You know that awkward moment when you join the group in laughing but you're not actually sure if they're laughing at you or laughing with you? While you may not know the answer – your brain does, and it knows the difference between the two types of laughter.

In an effort to understand the complexities of laughter and how it brings us together, a study published in PLOS One led by Dirk Wildgruber, professor of neuropsychiatry at Eberhard Karls University of Tübingen, decided to explore what these different expressions of hilarity looked like in the brain.

In the experiment, the researchers recruited 18 young men and monitored their brain activity while they listened to 3 different laugh tracks generated by professional actors — being tickled, feeling joy and taunting someone. When the men were asked to classify the appropriate laugh for each track (i.e. to categorize whether it was happy, mocking or a consequence of being tickled), they were largely able to correctly identify joyful and taunting laughs, though they were slightly less accurate to correctly label a laugh associated with tickling.

While all this focus on laughter might seem silly, it could actually lead to better diagnosis and treatment in those affected by mental illness:

Misperceiving neutral or positive information as threatening, for example, is a key problem in schizophrenia — and it may involve hearing happy laughter as mocking. In depression, smiles are often seen as smirks and interpreted as a sign of social rejection, so here, too, understanding how the brain recognizes the social information in laughter could be informative. Autism also involves problems with recognizing and decoding social information like the emotional tone of laughter. Wildgruber suggests that if differences in connectivity during laughter are seen in these conditions, it might lead to better diagnosis and treatment.

According to Jaak Panksepp, professor of integrative physiology and neuroscience at Washington State University and a leading researcher on laughter, who was not associated with the study, understanding laughter could also offer insight into human evolution. In his research, Panksepp has found that even rats laugh when tickled — but before you pick up the next ratitoule you see scurrying across the sidewalk, they laugh at a frequency too high to be perceived by human ears, so spare yourself please!

"[Panksepp] believes this stimulates joyful play, which helps animals bond and learn adult social behavior in a fun way that allows them to make mistakes that can be corrected in a safe and encouraging environment," writes Maia Szalavitz, a neuroscience journalist for TIME.com.

So go ahead, laugh it up — your brain will do the rest of the work!

For the full article, check out Healthland.time.com.