Cramming for a test and need the things you’re reading to stick in your mind? A bit of post-learning exercise could be the answer.

According to a new study published in Cell Press, exercising four hours after learning something new could help boost your memory and help you remember it. There’s a bit of a catch though, the exercise can’t happen directly after learning to have the positive brain-boosting effects.

Seventy-two participants took part in the study and each of them was asked to learn 90 picture-location associations for approximately 40 minutes. The participants were then divided into three groups. The first group performed exercise immediately, the second did a sesh four hours later and the third did no exercise at all.

Group one and two did the same kind of exercise- 35 minutes of interval training on an exercise bike at an intensity of up to 80 percent of the participants’ maximum heart rates.

Forty-eight hours later, all of the participants returned to take a test on what they had learnt two days before.

The result? Group two (the delayed exercisers) did much better on the test than both group one and three.

Researchers aren’t entirely sure why delayed exercise has this effect on memory but they presume it has something to do with the chemical compounds in our body that improve memory consolidation. Earlier studies have shown that chemical compounds like catecholamines (which include dopamine) are boosted by physical exercise but the need for the four hour wait is yet to be explained.

The verdict? Hit up a workout after a big day of learning, studying or cramming and you could be better off come test time.