Have you ever had the experience after a very late night or a very early morning (or, for those of us with children, it’s likely to be a combination of both) where you find yourself reaching for food constantly? Where alongside feeling seedy and foggy headed you have an insatiable appetite? In my experience the foods we crave at this time are likely to be energy dense and rich in fat. Why is that?

I always had my own theory about this phenomenon. I figured that since I wasn’t replenishing my energy with adequate sleep my body was trying to obtain energy from alternative sources, namely food or calories.

It turns out there is a bit more going on in the body than my simple equation suggests. Research shows that how much we sleep and possibility the quality of our sleep is the trigger for a slew of hormonal activity tied to our appetite.

There are two hormones that control appetite. Ghrelin, which is produced in the gastrointestinal tract, stimulates appetite, while leptin, produced in fat cells, sends a signal to the brain when you are full. It is during sleep that the body releases and regulates these appetite hormones as well as other growth hormones. “When you don’t get enough sleep, it drives leptin levels down, which means you don’t feel as satisfied after you eat. Lack of sleep also causes ghrelin levels to rise, which means your appetite is stimulated, so you want more food,” Breus tells WebMD.

This hormonal imbalance causes us to crave simple carbohydrates and high-fat foods. It also weakens our satiety level. These two factors combined interfere with our eating cues and can set the stage for overeating. We eat but don’t feel satisfied so we eat more. This ultimately causes weight gain.

Sleep contributes to our wellbeing in many ways and these findings are yet another reason to ensure you are getting adequate sleep each night. Everyone’s sleep needs do vary though, so whilst some people function fine on 6 hours a night others will need 9+ to wake feeling refreshed and well rested. We must also factor in sleep quality. If you experience constant interruptions during the night you are unlikely to fully experience the recovery benefits of sleep. So while it varies from person to person it is recommended that adults get between 7.5 to 9 hours of sleep per night to reap all of the rewards.

So if you are tired during the day, or need caffeine to help you get through, or you don’t feel refreshed upon waking it is likely that you are not getting adequate amounts of sleep and this may very well be undermining your weight loss efforts.