We all know that running is good for your heart and can help you maintain a healthy weight, but in case you needed one more reason to break out the gym shoes, a new study has shown exercise significantly improves memory retention and could help you ace that final exam.

In the study, participants who went for a run after learning performed better in an exam than those who went for a casual walk or who played video games after learning. The researchers believe these results may be due to the physical stress caused by running. Stressful situations can cause our body to release the “stress” hormone cortisol, which may also help with memory retention.

According to the study, when we do strenuous exercise such as running, our bodies create more cortisol to help keep the body in balance. The scientists theorize this increase in cortisol may also cause the brain to switch into memory storage mode, Elsevier reported.

These results were revealed by having 60 men between the ages of 16 and 29 complete a basic memory and learning test which involved tasks such as memorizing a map, learning words in a foreign language, and recalling facts. After the learning experiences, the men were split into three groups where they were asked to either go for a run, go for a walk, or play the video game Counter Strike. Upon completing their task, they were asked to take a test based on what they had previously learned; results showed that the runners did better than both the walkers and the gamers.

In addition to the cortisol levels, there may be another explanation for the profound affect running has on our cognitive performance. Vigorous activity such as running is one of the few behaviors that can actually cause organisms to grow new brain cells, New York Magazine reported.

If you are exercising so that you sweat — about 30 to 40 minutes — new brain cells are being born,” Karen Postal, president of the American Academy of Clinical Neuropsychology, told NY Mag. “And it just happens to be in that memory area.”

Source: Kindermann H, Javor A, Reuter M. Playing counter-strike versus running: The impact of leisure time activities and cortisol on intermediate-term memory in male students. Cognitive Systems Research . 2016

Read More:

Mental And Physical Exercises May Boost Cognitive Ability, Memory, Problem Solving Skills In Just 12 Weeks: Read Here

Physical Activity Keeps The Brain Young; The Brain Regions That Benefit From Exercise: Read Here