New research shows that lack of sleep affects what we choose for a midnight snack.

Lack of sleep not only makes our brains foggy, but it could also explain our expanding waistlines. New research from the University of California, Berkeley shows that the less sleep we get, the more we crave high-calorie foods.

Berkeley researchers hooked up 23 healthy young adults to a functional magnetic resonance imaging (fMRI) machine, which allows scientists to see our minds working in real time. They scanned the subjects’ brains after a good night’s rest and then again after a restless night, all while showing them images of healthy and unhealthy food.

Without quality sleep, the brain’s frontal lobe, which manages complex decision-making, was impaired. Meanwhile, deeper activity in the brain suggested that test subjects desired greater rewards. In this case, the “rewards” were high-calorie junk foods like pizza and doughnuts, which were selected by subjects more often than healthy foods such as fruits and vegetables.

“What we have discovered is that high-level brain regions required for complex judgments and decisions become blunted by a lack of sleep, while more primal brain structures that control motivation and desire are amplified,” senior author Matthew P. Walker, a UC Berkeley assistant professor in psychology, said in a press release. “This combination of altered brain activity and decision-making may help explain why people who sleep less also tend to be overweight or obese.”

Getting adequate sleep each night can play an important role for those looking to shed a few pounds because it makes eating healthier that much easier, Walker said.

The study was published this week in the journal Nature Communications.

Even when you have had the right amount of rest, don’t skimp on breakfast. New research published in the journal Steroids shows that meal timing is just as important for long-term weight loss as exercise and eating well.

Researchers studied 193 obese people over a 32 week period and found that those who ate breakfasts high in carbohydrates and protein exhibited better craving control and were more likely to lose weight and keep it off.

The U.S. Centers for Disease Control and Prevention issued a report earlier this week stating that obesity rates among American preschool children have dropped for the first time in decades.

Obesity rates for children ages four to eight showed a slight decrease in 19 of the 43 states studied. Other U.S. states and territories—including Texas, which is notorious for high obesity rates—were excluded because of the way that the data was collected.

Florida, Georgia, Missouri, New Jersey, and South Dakota had the most significant change in rates with at least a one percentage point drop in each.

While the numbers show promise, one in eight children are still considered obese, which means that there’s still plenty of work to do. And making sure that kids get enough sleep is a good first step.