You probably think diet and exercise matter most when it comes to reshaping your body. And while they certainly are important, there’s another lifestyle habit that can make all the difference in your journey: sleep.

“Sleep affects absolutely everything — from heart rhythms to hair and everything in between,” says Ellen Wermter, board-certified family nurse practitioner in Charlottesville, Virginia, and spokesperson for the Better Sleep Council. “It is the ultimate multipurpose tool for optimizing systems and improving overall health, metabolism included.” In fact, it can potentially cause you to gain weight and make it even tougher to lose weight and body fat.

How Sleep Is Connected to Body Composition

Poor sleep is connected with numerous health issues, weight gain being one of them. “Weight gain is a well-documented consequence of sleep restriction,” says Eve Van Cauter, Ph.D., professor of medicine and director of the Sleep, Metabolism and Health Center at the University of Chicago and chair of the Sleep Number scientific advisory board. That link is stronger if you’re not getting the proper amount of sleep versus if you’re frequently waking throughout the night and not getting the quality of rest you need. “The increase in hunger and appetite leads to excess food intake, particularly snacks,” she explains.