It may be time to invest in some spandex and buy that class pass. According to a study released Monday, one of the best ways to lower stress levels and improve the overall quality of your life is to exercise in a group.

When it comes to improving mental, physical, and emotional health, the researchers report, group exercise far outweighs exercising solo. It’s a good enough reason to dip out of those one-on-one personal trainer sessions and get your butt over to Zumba.

“The communal benefits of coming together with friends and colleagues, and doing something difficult, while encouraging one another, pays dividends beyond exercising below,” explains the study’s lead researcher, Dayna Yorks, D.O., in a statement.

Exercising alone was less beneficial than group exercise.

In the Journal of the American Osteopathic Association, Yorks and her fellow researchers from the University of New England College of Osteopathic Medicine explain that, to their knowledge, this is also the first study that looks specifically at how exercise can lower the stress levels of medical students. Overall, they found that group exercise lowered the stress levels of students by 26 percent, while those who exercised alone or with just up to two other people experienced no significant changes to their stress levels.

In the study, 69 medical students (nice) — a group the authors say is “known for high levels of stress and self-reported low quality of life” —were split into three groups: one that spent 30 minutes at least once a week participating in a group core strengthening fitness program called CXWORX, another that was allowed to do whatever sort of fitness they wanted as long as it was done alone or with only up to two other people, and a control group whose exercise was limited to walking or biking to class. Each group stuck to their program for twelve weeks and were asked every four weeks to fill out a survey rating their levels of mental, physical, and emotional health.

Exercise: better with friends.

At the end of the 12 weeks, survey scores revealed that the people who worked out in groups improved in all quality of life measures: mental health improved on average by 12.6 percent, physical health improved by 24.8 percent, emotional health improved by 26 percent, and stress levels were lowered by 26.2 percent. Meanwhile, the solitary exercisers only improved their mental health, averaging an 11 percent increase in perceived quality of life. The control group didn’t experience any changes.

This study is in line with previous research that’s found that the combination of social interactions and physical activity can be immensely beneficial to those experiencing anxiety and stress. Exercise overall is believed to be an effective way to improve mood and a 2010 study published in Psychosomatic Medicine even found that exercise is not only a powerful way to treat depression but an efficient way to prevent its relapse. Yes, it’s much comfier to stay inside and binge Netflix, but to shake off the blues it may be best to grab your crew and head to the gym.