Heart attack patients who participate in cardiac rehabilitation have a higher self-reported quality of life than those who don’t. And when they add on more physical activity they feel even better, according to a new study.

Investigators recruited more than 4,500 patients admitted to British hospitals with a suspected heart attack between 2011 and 2013. Questionnaires completed at one, six and 12 months after discharge asked about rehabilitation class attendance, perceived quality of life, and physical activity levels.

Cardiac rehabilitation attendees reported a higher quality of life at all times compared to non-participants. And patients who exercised an additional 150 minutes per week had even higher quality of life scores compared to those who did neither.

The differences can be attributed in part to the comprehensive exercise and lifestyle support found in cardiac rehabilitation. And there are also the therapeutic benefits that come from engaging with others who share the same problems, the researchers said.

“Exercise improves fitness, which has both physical and mental health benefits,” said researcher Ben Hurdus, M.D., from the University of Leeds, United Kingdom. “If you’re more able to participate in activities that bring you happiness, then you’re more likely to have a better quality of life.”

The findings were presented Friday on ACVC Essentials 4 You, a scientific platform of the European Society of Cardiology.