Moderate aerobic exercise may be the key to helping you get a full night’s rest, according to a new Brazilian study.

Researchers at Federal University of Sao Paulo examined women and men with chronic insomnia. The participants were divided into three exercise groups—those doing moderate aerobic, heavy aerobic and moderate strength training—as well as one control group.

The researchers found that the men and women who participated in moderate aerobic exercise had an increase in their total sleep time and sleep efficiency, as well as a decrease in anxiety. The same benefits were not seen for those in the heavy aerobic or moderate strength training groups.

Examples of moderate aerobic exercise include taking a brisk walk, walking up a hill, or other exercises that gradually increase your heart rate at a moderate level over an extended period of time.