Though most experts agree sleep is just as important to weight loss as dieting and that a lack of it can lead to weight gain, the Centers for Disease Control and Prevention reports people in the U.S. still struggle with getting enough sleep every night. Research has shown a way to help people get more shuteye: losing weight through dieting.

Though many people may feel they’re at a healthy weight, and that they’re unable to get sleep for a different reason, researchers from the University of Pennsylvania’s Perelman School of Medicine found no matter what your body weight is, actively losing weight can be help you sleep better. "Our findings suggest body weight is a less important factor than changes in weight for regulating sleepiness," the study's lead author, Isaac Perron, a PhD student in Neuroscience at the University of Pennsylvania, said in a press release.

To prove their hypothesis, the researchers turned to obese mice, which they separated into two groups for eight weeks. One group of mice was given a regular amount of food to eat, while the second group ate a diet consisting of three times more fat content. After eight weeks, the researchers switched some of the mice’s diets for one more week — regular eaters moved to high-fat diets and vice versa, thus gaining and losing weight respectively — while the remaining mice stayed on the same diet as they had been for the previous eight weeks.

After the ninth week, the researchers found mice that remained on the high-fat diet during the entire experiment weighed 30 percent more than the other mice, and slept more than an hour longer than the others as well. However, this sleep was fragmented, and these mice experienced less frequent deep sleep. Meanwhile, the groups of mice that switched their diets had the same body weight as each other, but completely different sleep schedules.

The researchers found mice that had initially been on a regular diet, then switched to a high-fat diet, experienced a decrease in time asleep; an increase in non-REM (rapid eye movement) sleep; and similar sleep fragmentation to the mice that had spent the whole nine weeks on a high-fat diet. The mice that switched from a high-fat diet to a regular one, meanwhile, saw the opposite effect — they not only slept better but lost weight as well.

"The diet consumed during the final week was key to driving the sleep effects, independent of the starting body weight," Perron said. "If you're overweight and often feel tired, you may not need to lose all the weight to improve sleep, but rather just beginning to lose that excess weight may improve your sleep abnormalities and wake impairments."

Source: Perron I, Pack A, Veasey S. Diet/Energy Balance Affect Sleep and Wakefulness Independent of Body Weight. SLEEP. 2015.