Research published today helps us better understand why we need sleep and the important work our brains do behind closed eyes.

It’s no secret that sleep is good for us, but we’ve never really known why. Research published today in the journal Science shows that the brain takes out the garbage while we get shuteye, at least in mice, flushing out toxins through a remarkable plumbing system.

Lead author Dr. Maiken Nedergaard explains that during sleep the glymphatic system washes away harmful proteins, including amyloid beta, which may cause Alzheimer’s disease. Brain cells actually shrink by 60 percent during sleep, providing more room for fluids to rinse out the toxins.

Nedergaard, co-director of the University of Rochester Medical Center’s Center for Translational Neuromedicine, told Healthline she hopes this research will lead to the development of medications to improve clearance of amyloid beta and other toxic substances from the brain. “Nerve cells are very sensitive cells,” she said. “Similar to fish in a dirty tank, they will get sick and die if the brain is not cleared.”

Explore the Brain in 3D »

Toxins accumulate while our brain works during waking hours. Brain activity doesn’t slow down much during sleep, and now we know why. The flushing process increases tenfold during sleep, meaning the brain is cleaning house when it isn’t as busy processing information.

Dr. Stephen Rasmus, director of the Sleep Disorders Center at Genesis Health System in Davenport, Iowa, told Healthline that we badly need to unravel the mystery of why humans sleep.

“This is something that is a tiptoe into the mystery of why we need sleep and how this correlates with diseases such as Alzheimer’s disease,” Rasmus said. “What would really be amazing is to wonder where we will be 100 years from now. Maybe there will be a way to flush out these chemicals. You can say, ‘I’m really tired, maybe I’ll hook up to this little thing here, and I’ll be fine in 15 minutes.'”

Nedergaard explained that two relatively recent breakthroughs made her research possible. First, the scientists used 2-photon imaging to examine the brain at microscopic levels, which was not possible 10 years ago. Second, the researchers trained mice to tolerate the microscopic examinations. “They are comfortable, can move, and they get sugar water after the experiments,” she said.

Her team has already done research that shows this imaging technique can be applied to humans and lead to a better understanding of someone’s risk for Alzheimer’s. Developing medications to help the glymphatic system clear toxins from the brain more efficiently could take many years, however.

Nedergaard and others first described the glymphatic system only about a year ago. The name comes from glial cells, which are abundant in the brain, and the lymphatic system, which is how the rest of the body’s organs dispel waste.

Rasmus said that while this research is very preliminary, he hopes it will someday lead to new medications for insomniacs as well. He noted that many of his patients suffer from decreased performance at work, irritability, and depression.

Although there have been recent improvements in sleep medications, they’re still not perfect, with side effects such as “sleep wandering,” Rasmus said. He only prescribes them as a last resort after trying other treatments, such as cognitive-behavioral therapy and improved sleep hygiene.

“I had one patient who ended up in a parking lot in his underwear,” Rasmus said. “He had driven four or five blocks and didn’t know how he got there.”

Read More: Understanding Alzheimer’s Disease »