By Alex Orlov for Life by DailyBurn

You know working out can give you strong muscles, greater endurance and a toned physique. But did you know that even moderate exercise can improve the way your brain functions, too? And we’re not just talking about results found in older people, either.

Even though twentysomethings are thought to have brains that are in their prime developmentally, new research published in Psychophysiology reveals that their cognitive function can actually improve — with just 30 minutes of exercise. While previous studies have established that physical activity is essential for protecting memory and cognitive processes in older folks, this new study is the first to suggest that regular exercise can also improve brain function in young adults.

After noticing that the university students around her appeared to be less fit these days than in her early years as a professor, study author Liana Machado, Ph.D., Department of Psychology Senior Lecturer at the University of Otago in New Zealand, decided to investigate whether their fitness levels might negatively influence cognitive abilities. Not anticipating she would see much of an effect, her findings were unexpected.

“Given that the development of the brain peaks in young adulthood, it is quite surprising that there would be room for improvement in brain function in healthy young adults,” says Machado.

Your Brain on Exercise

It turns out your sweat sessions are giving you more than just a feel-good endorphin boost — they’re giving you an oxygen high, too. Researchers at the University of Otago analyzed the self-reported activity levels of 52 young women (ages 18 to 30), the oxygen availability in participants’ brains and their performance on a series of reaction-time tasks on a computer. Theses reaction-time tasks were designed to test cognitive inhibitory control, which is the ability to exert self-control when faced with a changing environment. This is cognitive ability is crucial during daily activities like driving a car or when resisting cravings, says Machado.

Related: How Exhaustion Might Change the Way You Think

“Brain cells depend very heavily on oxygen,” she says. Breathing air with a smaller concentration of oxygen, such as at high altitudes, is associated with worse cognitive performance, and the inverse is also true: Increased oxygen is associated with optimal brain functioning.

Based on the study results, you may want to get active for a more oxygen-happy brain. Among study participants, those who worked out more often had more oxygen availability in their brains — and hence, better cognitive functioning. In fact, you’re doing your brain a long-term favor by exercising. Machado notes that effects observed in the study weren’t temporary. In other words, exercise could provide a lasting brain boost unlike the quick mental edge you’d get from downing a cup of coffee.

Related: The 10 Best Apps to Train Your Brain

Best of all: This research suggests you won’t have to spend hours at the gym to experience clearer thinking. “Moderate physical activity, including brisk walking, at least five days a week for at least 30 minutes may suffice to gain benefits with respect to brain function,” says Machado. Brisk walking counted as exercise in the study, though Machado says achieving an elevated heart rate is likely important. (So, strolling leisurely around the block just to hit your fitness tracker step goal doesn’t count!)

Bulletproof Coffee and the Case for Butter as a Health Food