Getting a good night’s sleep is essential for a host of reasons. Now, researchers have added another one: staving off Alzheimer’s.

A study at Boston University found that during deep sleep, the brain goes through a sort of self-cleaning process that could remove toxins associated with the disease.

Researcher Laura Lewis said that during deep sleep, slow waves appear in the brain just before fluid washes through the brain, which helps clear toxins.

“It’s been known for a long time that sleep is really important for brain health,” Lewis said. “But why it is was more mysterious.”

People who have Alzheimer’s are known to have fewer of these slow waves, which means there are less chances for the brain to clear out the toxins associated with the disease.

These waves are associated with memory and other diseases.

Lewis said it’s important not only to get enough sleep, but the right kind of sleep. In order for the brain to produce the slow waves, you must first be in a deep sleep.

“Some disruption to the way sleep is working could potentially be contributing to the decline in brain health,” Lewis said.

And even then, sleep is not a cure-all, researcher William Jagust said.

“There are a bunch of things that are probably contributing to people’s likelihood of getting Alzheimer’s,” he said, “and I think sleep is going to turn out to be one of them.”