You know that getting your sweat on in the gym is good for your physique, and for better overall health. But new research from the University of Geneva suggests that exercise could also benefit your memory.

To find out how exercise — especially endurance sports like running or cycling — affects the brain, researchers had 15 young, male, non-athletes take a memory test under different conditions. They were given the test after 30 minutes of moderate cycling, 15 minutes of intensive cycling at 80 percent of their max heart rates, or after a period of rest. And as it turns out, upping the intensity may be best.

“The exercise was as follows: a screen showed four points placed next to each other. Each time one of the dots briefly changed into a star, the participant had to press the corresponding button as quickly as possible,” Blanca Marin Bosch, a researcher involved in the study, explained in a release. “It followed a predefined and repeated sequence in order to precisely evaluate how movements were learnt. This is very similar to what we do when, for example, we learn to type on a keyboard as quickly as possible. After an intensive sports session, the performance was much better.”

The brain’s ability to permanently adapt when we learn these types of repetitive skills is called motor learning. It’s the same process that takes place when you learn new exercises and start to use proper form without even thinking about it.

That improvement in memory that researchers saw post-exercise has to do with the same process that causes athletes to feel euphoric after exertion (aka a runner’s high). When an athlete exerts themselves, the body produces molecules called endocannabinoids, which can get past the blood-brain barrier (basically the bouncer who decides what gets into the brain). Then, they attach to receptors in the brain that make you feel good.

“These same molecules bind to receptors in the hippocampus, the main brain structure for memory processing,” Kinga Igloi, lead study author, explained.

And while intensive exercise seemed to boost memory and motor learning in this study, the same team found that moderate-intensity exercise boosted memory in a past study. But in that case, the effect was on associative memory, which is the brain’s ability to remember how unrelated terms are connected. This shows that while memory functions aren’t all improved by the same type of exercise, being active is still better than doing nothing.

This study was small, but in light of the growing amount of evidence supporting exercise for brain health, researchers want to find ways to implement it into daily routines. Igloi poses the question: “Sports activity can be an easy to implement, minimally invasive and inexpensive intervention. For example, would it be useful to schedule a sports activity at the end of a school morning to consolidate memory and improve learning?”

It goes without saying that we at M&F are always up for using exercise as medicine.