We all know working out is good for our bodies — but did you know it’s good for our emotions, too?

New research shows exercise may very well be an effective treatment for depression, especially among those with heart problems.

The study authors say that up to 40 percent of heart patients are clinically depressed and three-quarters score higher than average on tests for depressive symptoms, so they set out to discover if something as simple as exercise could help.

In the 30-month study, more than 2,000 heart-failure patients were tested for depression and then divided into two groups: one received normal care for their heart condition, and the other underwent that care plus a program of aerobic exercise like riding a stationary bike or using a treadmill.

When the study concluded, the exercise group had a modest reduction in depressive symptoms and was also found to have a lower risk of hospitalization and of death. Although the difference was small, the size of the pool of participants means it’s unlikely the results were just coincidence.

The findings are just the latest to tie exercise to an improved emotional state. In fact, one previous study found that for some people, physical activity can work just as well as standard antidepressant drugs.

[Time]