Fiber is already sort of a wonder nutrient: getting enough in your diet has been linked to protecting your heart and keeping you, um, regular. Now, as if that wasn't reason enough to eat your peas and legumes, a recent study suggests adding more beans, whole grains, and other fiber-rich foods to your plate may also improve your sleep. For the study, published last month in the Journal of Clinical Sleep Medicine, researchers recruited 26 adult men and women to stay in a sleep lab for five nights. During the first four days, the participants were put on a strict, controlled diet, but on the last two days, they were given an allowance of $25 per day and instructed to grocery shop and chow down on whatever they wanted. Their sleep was monitored all five nights. More specifically, researchers tracked how much time participants spent in various stages of the sleep and how long it took them to fall asleep. Unsurprisingly, without oversight from the researchers, participants ate very differently on the days they chose their own food. They ate significantly more saturated fat, carbohydrates, and less protein. When the researchers compared the diet changes to sleep amount and quality, they found some surprising correlations. "We saw that on the higher end of the fiber intake, there was more deep sleep and less time spent in stage 1 sleep or light sleep," explains lead study author Marie-Pierre St-Onge, PhD, of the Institute of Human Nutrition at Columbia University Medical Center. "On the lower end, we saw the opposite." The researchers also saw a correlation between eating more saturated fat and a decrease in deep and restorative sleep, as well as a link between eating sweets and how often people woke up throughout the night. Dr. St-Onge says this adds to previous studies that suggest eating more refined carbohydrates might keep you up by decreasing serotonin levels in the brain. Other research has found that eating a carb-rich meal before bed might even delay certain stages in your circadian rhythm: the release of the snooze-inducing hormone melatonin and an increase in body temperature. As opposed to refined carbohydrates, fiber may be helpful because it takes longer to digest, so the nutrients are released into your bloodstream more gradually and the effects on your body's wind-down process are less extreme, she adds. More research is needed to determine exactly how much more fiber you need to get the sleep benefits — due to the nature of this study, the researchers were only able to see a general trend — but a good starting point is to make sure you're eating lots of plant-based foods throughout the day by filling half your plate with some fruits and veggies and choosing more whole grains, like brown rice and whole wheat pasta. Sleep aside, it's a pretty smart health move in general.