If you're trying to learn something new, you might want to hit the gym a few hours after studying. According to new research, exercising 4 hours after learning a task can improve memory.

In a recent study published in the journal Current Biology, researchers discovered exercising four hours after a memory task helped people better retain the information and increased brain patterns associated with memory.

The experiment involved a picture location memory task that 72 people participated in for about 40 minutes. Then the participants were randomly instructed to either exercise right away, exercise 4 hours later, or not exercise at all.

Two days later, the researcher scanned the participants' brains and tested them to see how well they remembered what they had learned.

The people who exercised hours after studying remembered more information. The areas of their brains associated with memory retrieval were also more clearly activated.

Evidence from animal experiments suggests that the neurotransmitters released by exercise lead to a production of proteins that "help stabilise new memory traces", study author Guillén Fernández, director of the Donders Institute for Brain, Cognition, and Behaviour at Radboud University Medical Center, wrote in an email to TIME.

Plenty of reports claim that regular exercise can improve brain health, but Fernández says the new study increases the evidence by demonstrating how an isolated session of exercise can aid in memory retention.

However, the theory was tested on a small number of people, so more research is needed to determine exactly when we should time our workouts after learning something important.

Regardless, the study authors believe their findings are proof that exercise should be used as a strategy for long-term memory retention.

This article was originally published by Business Insider.

More from Business Insider: