So, you’re headed back to school–it’s time to wave goodbye to the warm days of summer and trade in the beach for the library.

As you settle in for another (or your first) year on campus, you’re sure to be looking for any advantage you can get when it comes to studying.

What if there was a way to hack your studying? A recipe to fuel your brain for the difficulties of a long school year? A way to boost energy and reduce stress while improving your mood and sleep?

A regular routine of physical activity can do all of these things for you. A consistent schedule of exercise has the potential to significantly enhance your grades in numerous ways, both direct and indirect.

Indirectly, physical activity will help raise your energy levels so you can skip the energy drinks and coffee. It will also remove common causes of cognitive impairment by reducing anxiety and stress and improving mood and sleep.

More directly, exercise helps improve cognition in a couple of different ways.

For one, aerobic exercise (cardio) increases your heart rate and, in turn, blood flow to your brain. As your workout intensifies, so does your breathing, which sends more oxygen into your bloodstream. When this heightened level of oxygen reaches the brain, the parts of your brain that control memory and thinking (the prefrontal cortex and medial temporal cortex) begin to produce new neurons–this is called neurogenesis. The result of neurogenesis is increased brain volume–you’re literally growing your brain.

Another way exercise helps improve cognition is through the activity of neurotrophins, proteins that act as a fertilizer for neurons. Brain Derived Neurotrophic Factor (BDNF) is a substance that helps protect and enhance existing neurons while aiding in the production of new ones. High levels of BDNF protein are linked to increased brain plasticity, or the ability to learn and create new memories. Meanwhile, low levels of the same substance are associated with depression, anxiety and poor memory.

Your brain will benefit from any form of exercise, but the best kind of activity is one that is both physically and mentally demanding. Try a fitness class, where you’re learning new moves and trying to replicate them, or a team sport, where you have to think strategically while moving quickly to maximize the activation of BDNF.

The most important thing is that you’re consistently stimulating your brain through exercise. Establish a routine of physical activity this school year and watch your grades climb.