My 2 cents: At 160 HR, you're likely riding at or above your "LT" or "aerobic" pace on every ride. Without a sufficient cardio-vascular network for cycling, you're working your leg muscles anaerobically on every ride which is a prescription for pain, not improvement.
Your obvious answer is to slow down! 16 mph avg for 20-25 miles is fast for a beginning cyclist, even on flat terrain. Suggest you limit your HR to 120 while allowing two full days for recovery until all signs of leg soreness are gone. Then you can slowly add in more riding or bump up the HR very gradually. Key is to build a consistent base of pain-free riding.
Compared the way you've been flogging yourself, this will feel too easy. But all the leg pain isn't necessary or even helpful. After a season of riding, your body will develop the cv network you need to train harder. Just relax and learn to enjoy cycling as a life-long sport, and let your body progress at it's own pace.