It’s a hard fact of life: The most delicious foods are terrible for you. Cakes and pies, fried chicken and mac ‘n cheese; foods high and sugar and fat sure can be tasty, but too much of a good thing can lead to weight gains. But putting on a couple pounds isn’t exactly a death sentence. If anything, it’s a good motivator to eat better and get active. But if you continue to eat poorly, and weight continues to pack on, your body could end up paying the price. And this could translate into your body being unable to achieve an erection.

Yes, while weight gain and erectile ability seem like they wouldn’t share a connection, the truth is that your weight can dictate your ability to achieve an erection. As your waist expands, your odds of developing ED go up. A recent study published in the Journal of the American Medical Association found that four out of five men with ED have body mass indexes (BMIs) greater than 25. As your BMI rises, the chances of developing ED go up with it. The same study found that men with BMIs of 28.7 have a 30% greater risk of developing erectile dysfunction than average-weight men.

This is because weight gain puts stress on the heart, which in turn impedes blood flow. When blood flow impeded, the body struggles to provide blood to the various parts of the body. In these situations, it is typically the smallest arteries that end up paying the price, as they cannot get the amount of blood they require. And one of the smallest arteries on the body leads directly to the penis, which translates into no blood being supplied to the penis, which means erectile dysfunction.

Thankfully, weight-related ED is easy to beat: Lose the weight, and the erectile woes should follow. Dropping as little as 30 pounds can help to greatly increase sexual function. So if your waistline has affected your erection, get up, get active, eat better, and you’ll see your little guy spring back to life in no time.