Cutting calories is nobody’s idea of a fun time. But the perks of fasting go far beyond a leaner body, finds a new study published in JAMA Internal Medicine. People who ate a lot less for two years found they had brighter days and more satisfying nights.

The findings come from a new analysis based on the CALERIE 2 trial, in which scientists told a group of 218 generally healthy weight people to either cut 25% of their overall calories for two years or stick to their usual eating patterns. The diet worked; people who fasted lost an average of 10% of their body weight, or about 16.5 pounds. But the scientists also looked at other measures throughout the study, including quality of life, depression, sleep and sexual function, using standardized scales.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

According to the new results, people who lost weight also gained a lot, too: brighter moods, improved quality of life, better sleep after a year on the diet and better sexual function after two years of fasting.

Weight loss doesn’t have to be drastic, and you don’t have to be obese, to reap the ancillary perks of shedding pounds, the findings suggest.

“What people report is that after they ‘get over the hump’ and start to lose weight, their hunger levels subside a bit and they start to feel the benefits of the weight loss,” says Corby Martin of the Pennington Biomedical Research Center in Louisiana, the study’s first author. “They find it easier to move around, their joints hurt less, they feel better.”

But he cautions that cutting calories for a full two years is not easy. “Even though they achieve those benefits, it is just really hard to adhere to these diets over the long term, at least in today’s society,” Martin says. “They’re minnows trying to swim upstream, in a world where it’s very easy to overconsume calories.”

Martin and his colleagues conducted a follow-up study to see if people stuck to the diet after the experiment ended. While some gained the weight back, others continued to do well, Martin hints. A formal analysis is coming soon.

Write to Mandy Oaklander at mandy.oaklander@time.com.