Rapid Eye Movement (REM) sleep gets the most hype, but it’s far from the only important part of our snooze cycle. A new study shows that slow-wave sleep (SWS), the deepest phase of non-REM sleep, may be the key to detoxing our brains.

The study identified a cycle that occurred during SWS in 11 participants, who were all healthy people between the ages of 20 and 33. Animal research in the 1970s found that “slow waves” of neuronal activity sweep across the brain during SWS. Then, blood volume decreases and cerebrospinal fluid sweeps in to fill the new space. Cerebrospinal fluid is known to play an important role in flushing out toxic waste that can cause neurodegeneration, and the researchers think that these waves of it are an important part of the brain’s “wash-rinse” cycle.

During this process, cerebrospinal fluid “started to flow upwards in these really large, slow waves… much larger than we’d ever seen when were scanning the awake brain,” says study senior author Laura Lewis of Boston University.

To do the research, the team had its study subjects come to the lab at midnight, after only sleeping for four hours the previous evening. (“We talk so much about how important sleep is,” Lewis said, “but you really tax your own sleep when you’re trying to do all of your experiments in the midnight to 3 a.m. zone.”) They outfitted them with electrode-covered caps to measure electrical activity, then used an accelerated MRI technique to snap images every 360 milliseconds.

The cycle those rapid snapshots revealed—first a “slow wave” of electrical activity in the subjects’ brain cells, then a dip in brain blood oxygenation, followed by an upward rush of cerebrospinal fluid—is something that hadn’t previously been identified in humans. But it seems to happen about every 20 seconds during SWS.

Because previous work has shown that sleep plays an important role in clearing the brain of waste proteins that are known to cause neurodegeneration if they hang around too long, and cerebrospinal fluid is known to cleanse these proteins, Lewis and her colleagues think the cerebrospinal fluid wave is helping to wash the brain of waste.

However, they didn’t directly measure the rate at which toxins were fleeing the scene—so this study doesn’t go so far as to prove that SWS removes the bulk of these dangerous proteins. Lewis’s team is working on that research now, along with expanding their study to include adults in their 60s and 70s, to understand how aging might affect this wash-rinse cycle.

In the longer term, better understanding the dynamics of slow-wave sleep may be able to help us treat neurodegenerative diseases associated with aging, such as Alzheimer’s. But Yo-El Ju, a neurologist who studies sleep at the Washington University School of Medicine and who was not involved in the current study, says this might only show part of the picture. “It’s important to keep in mind that this may be just one of the ways in which sleep interacts with brain metabolism and waste clearance,” she says. Other systems that the MRI was not designed to measure—such as the glymphatic system—may also play a crucial role. We have a lot left to learn about what sleep does for us. For now, one thing is certainly clear: Sleep is incredibly important, and most of us aren’t getting enough.