A daily trip to the gym can help dampen the daytime misery due to sleep apnea, new research shows. A study in the Journal of Clinical Sleep Medicine found that a 12-week exercise program helped improve daytime functioning in a small sample of adults with sleep apnea.

The study randomly assigned 43 sedentary and overweight adults with untreated sleep apnea to an aerobic and resistance training program or a low-intensity stretching routine. Subjects in the training group ran on a treadmill for about 40 minutes a day, four days a week. The group also lifted weights twice a week. The exercises were designed to work each major muscle group, and included shoulder and chest press, row, leg and bicep curls and abdominal crunches.

After 12 weeks, the group that participated in the exercise program reported improved daytime functioning. They were less sleepy, less depressed and in a better overall mood. The results are promising, but due to a relatively small sample size further research is needed on the benefits of exercise for patients with untreated sleep apnea.

Even if you don’t have sleep apnea, regular exercise can boost your energy, reduce your stress and improve your mood. Exercise can also help slow or prevent health conditions such as heart disease, stroke and diabetes. Some research has also suggested that it can help you sleep better.