Evidence shows that MDMA, initially popular as a club drug, has the potential to significantly alleviate anxiety and post-traumatic stress disorder. That’s because it affects the social brain in profound yet little-understood ways which bolster it as a therapeutic tool. In a study published Monday, a team of researchers became the first to determine exactly why MDMA impacts cooperative behavior — a cornerstone understanding that explains why it has the potential to help thousands.

Brain imaging studies on MDMA, technically known as 3,4-methylenedioxy-methamphetamine, have shown that it changes activity in brain regions that are linked to social processing. In the new paper, published in the Journal of Neuroscience, researchers explain when one takes a dose of MDMA, it elicits the release of dopamine, noradrenaline, and euphoric serotonin. Here, the scientists determined that this release of serotonin doesn’t cause one to implicitly trust others more — as some had suspected — but it does prompt one to rebuild relationships in which a sense of trust has been ruptured.

“This research is important to build our understanding of how drugs might alter social cognition,” first author Anthony Gabay, Ph.D. tells Inverse. “This has applications in testing novel drug therapies for mood and anxiety disorders. It also tells us which parts of the task a drug may alter, so we can target therapy towards parts of behavior people are having difficulty with.”

Parts of the brain activated while one is on MDMA. Gabay et. al.

Gabay, who conducted this work as a scientist at King’s College London and is now at Oxford University, and his colleagues examined MDMA’s effect on social cognition through a series of tests. Twenty adult men with no history of psychiatric illness or other neurological disorders where either administered 100 milligrams of MDMA or a placebo. Then, while their brains were scanned in an MRI machine, they took part in tests designed to examine how well they could recognize emotions and empathize, as well as the Prisoner’s Dilemma.

The Prisoner’s Dilemma, a decision-making game in which two players simultaneously choose to cooperate with or compete against each other, was really the heart of this study. In this game, if both players choose not to compete with each other, they both get points. If one player betrays and decides to compete, then they get all the points and the other player gets nothing. If both players compete, nobody wins.

Here, the participants thought they were playing real people through a computer, but the “people” were pre-programmed computer responses designed to come off as “trustworthy” or “untrustworthy.” Trustworthy meant that the program cooperated 80 percent of the time and untrustworthy meant that the program competed 80 percent of the time.

“We hoped that by having participants play the game with different types of opponents, we could test whether the effect of MDMA was different depending on the behavior of the opponent,” Gabay explains. “That’s exactly what we found — when playing a trustworthy opponent, participants cooperated even more when on MDMA than they did on placebo. This effect was not seen when playing the untrustworthy opponents.”

This means that MDMA didn’t cause the people to naively cooperate with “people” who were not themselves cooperative. On the rare occasion that the programmed trustworthy opponent changed course and competed, the MDMA participants indicated in a subsequent evaluation that they were willing to rebuild their relationship after that breach in trust. The same wasn’t true with untrustworthy opponents — indicating that MDMA itself isn’t an agent for gullibility.

Meanwhile, brain scans demonstrably proved that MDMA was altering the participants’ social processing. Each individual demonstrated increased activity in the superior temporal cortex and mid-cingulate cortex, which activate when we attempt to understand the thoughts, beliefs, and intentions of other people. When the participants specifically processed the behavior of the trustworthy players — both when the program competed and cooperated — MDMA increased activity in the right anterior insula. When they processed the behavior of untrustworthy players, the opposite happened — the activity in that region actually decreased. This area is where the brain appraises risk and uncertainty.

“What was surprising was that these changes were seen when participants were receiving feedback of other players’ behavior, not when they were deciding what to do themselves,” Gabay says. “This suggests that MDMA’s impact on these social interactions, as indicated by the drug’s impact on brain activity, was to alter the appraisal of other people’s choices.”

As MDMA moves forward as an essential competent of U.S. Food and Drug Administration-regulated Phase III clinical trials, these results will play an important role in understanding why it has great potential as a therapeutic agent. It’s known that MDMA can make psychotherapy more effective and better tolerated — and now scientists are beginning to understand that’s this is in part because of how MDMA affects how one thinks about other people.

“Considering the profound effect of MDMA on one’s conscious experience, it is essential to fully understand all of the drug’s effects, not only how it treats the core symptoms of specific conditions,” Gabay concludes. “Also, by gaining greater clarity on these effects, it helps us to understand the mechanisms by which this drug is having its therapeutic effect.”