Scientists may have discovered a key part of the brain that helps people sleep through noise, which could be lead to potential treatment of insomniacs.

The study published in Current Biology proved a concept that finds a brain structure that connects with high level thought areas with the sight and sounds of the outside world shuts out outside noise during sleep. The structure in the brain- thalamus generates brief, high-frequency brain waves called spindles.

Doctors at the Harvard University’s Massachusetts General Hospital put 12 people to sleep in their lab for three days. During the tests, they induced noise in the room where the volunteers slept. These were common noise such as toilets flushing, phones ringing and people talking.

The researchers discovered that “the more spindles one has, the more likely they are able to stay asleep when they are confronted with sounds,” Jeffrey Ellenbogen, chief of the division of sleep medicine at Harvard University’s Massachusetts General Hospital, said.

“The capacity of our brain to block out at least some sound is truly amazing, given that our ears are wide open all night long,” he said.