Nothing ruins a good night's sleep like a dream about your teeth falling out or taking a calculus test while naked.
Thankfully, scientists are getting to the bottom of bad dreams, according to new research that tracks the neurological basis of nightmares.
The research, expected to be published Tuesday in the journal JNeurosci, tracks down which part of the brain is responsible for generating feelings of anger in sleeping people, according to Cosmos Magazine.
In the study, researchers woke people up when they were in the middle of what's called REM sleep — short for Rapid Eye Movement — which is linked with dreaming, according to Cosmos. Participants who reported feeling angry during their dreams had increased neural activity in the right half of their frontal cortex, suggesting that that part of the brain is responsible for dreaming up a bad time.
This one study, which hasn't yet been published, reportedly only studied 17 people over the course of two nights.
While this neural asymmetry is worth probing further, it represents just the first step in figuring out why dreams go sour and, hopefully, how to fix them.
READ MORE: One side of your brain might be giving you nightmares [Cosmos Magazine]
More on sleep: A New Class of Drugs Could Make Safer Sleeping Pills