Many of us have faced the daunting, often embarrassing, challenge that is trying out a new group workout class. But finding out what exactly it means to “pulse” or “tap it back” may be well worth it: a new study published in The Journal of the American Osteopathic Association found that people who worked out in a group were about 26 percent less stressed out after the study compared to people who worked out alone.

The study looked specifically at medical school students, a group known for being emotionally and physically fatigued, for 12 weeks. Lead researcher Dayna Yorks, DO, from the University of New England College of Osteopathic Medicine and her colleagues had 69 students self-select to either work out in a group, exercise with no more than two other people or alone, or do nothing.

The group workout was a 30-minute long “CXWORX” class that included core strengthening and free weights exercises once a week. The students who worked out alone or with no more than two people did activities like running or lifting weights twice per week, and the control group did nothing. They also completed surveys once every four weeks measuring their mental, physical and emotional well-being.

After 12 weeks, subjects in the group fitness class reported feeling about 26 percent less stressed than the other workout group, and experienced boosts in their physical, mental and emotional quality of life, according to the study. The people who worked out alone or with two people “worked out twice as long, and saw no significant changes in any measure, except in mental quality of life,” according to the study’s press release. The control group didn’t experience any significant changes.

It’s important to note the small size of the study and the self-selection process aren’t the gold-standard methods for research. (Ideally, it’d be a larger sample size with a randomized selection process.) But the findings are still interesting, not to mention the fact that the link between exercise and mental well-being is well established.

We’ve written before about the link between social relationships and exercise, and how things like running might even be socially contagious. But this study adds more emphasis to the idea that socializing while exercising can have important perks, especially for those experiencing stress.

What’s also worth mentioning is that the people who worked out alone worked out for longer and didn’t report the same well-being perks that the group exercisers did. This points to the idea that if you’re working out with other people, you might not need to do as much to get the mood-boosting benefits. (But keep in mind that if you want major health benefits, the U.S. Department of Health and Human Services suggest you get 150 minutes of moderate-intensity aerobic activity or 75 minutes of vigorous-intensity aerobic activity each week.)

Of course, these findings don’t mean you shouldn’t work out if you’re not interested in socializing while you do it. But they suggest that for people who are stressed out, like students in med school, a group fitness class per week could make a big difference.

“The communal benefits of coming together with friends and colleagues, and doing something difficult, while encouraging one another, pays dividends beyond exercising alone,” Yorks said in the press release.

Read more about the findings here