Going to bed late may do more than just leave you feeling groggy the next day: It can contribute to weight gain.

A new study in the October 2015 journal Sleep suggests that heading to bed late at night starting in adolescence and continuing through adulthood leads to an increased BMI (body mass index) over time. Previous research has shown that people who don’t get enough sleep during the week, which leads to a buildup of sleep debt, are 72 percent more likely to be overweight. The latter study researchers found that, after one year of accumulated sleep debt, for every 30 minutes of sleep lost during the week, the risk of obesity and diabetes increased by 17 and 39 percent, respectively.

“There’s a well-established link between reduced sleep time and the risk of obesity in both children and adults,” Timothy I. Morgenthaler, MD, the past president of the American Academy of Sleep Medicine (AASM), told YouBeauty.

Not getting enough sleep is particularly harmful to children and adolescents who need more sleep than adults. Dr. Morgenthaler pointed out that 70 percent of high schoolers get less than 8 hours of sleep each night, even though expert sleep panels recommend they get 9 hours to function properly.

“This study further strengthens the idea that our children are probably not getting enough sleep, and if they’re going to get enough sleep, we have to put them to bed earlier,” he said.

The same can be said for adults. Research shows that 30 percent of adults don’t get enough shut-eye—averaging 6 hours of sleep or less each night. That falls short of AASM’s taskforce recommendation that adults get at least 7 hours of sleep per night.

We’re also more likely to stay up later than we should because we’re binge watching “The Walking Dead,” texting our friends, or reading a book on a bright tablet—all of which signal our brains to stay awake, rather than drift off to sleep.

To help yourself fall asleep at an earlier hour, practice good sleep hygiene: Stop looking at any bright electronic screens (TV, smart phones, computers, and tablets) at least one hour before bed, recommended Morgenthaler, and dim the lights close to bedtime to tell your brain it’s time to wind down. Make sure the room is dark, cool, and quiet so you can slumber in peace. That means, turn clocks away so you’re not staring at a bright digital clock as you try to fall asleep, and use a white noise machine to drown out sounds from outside that may keep you up at night.

READ MORE: How To Sleep When Anxiety Keeps You Up At Night