Aging is an inevitable part of life. But a new study shows how you can stave off potential age-related memory issues by walking.

Researchers at Colorado State University have found that people who regularly went for brisk walks for six months had better cardiovascular fitness than people who only did stretching and balance exercises for that period. They also noticed improvements in memory from walking compared to those practicing stretching and balance, Everyday Health reported.

Findings were published in the journal NeuroImage.

This research focused on white matter, which is a less-studied part of the brain. White matter is what makes up the majority of the brain, Medical News Today reported. This matter continues to develop into our 20s and potentially into our 50s in a more subtle way. Gray matter, meanwhile, peaks in development at around 11 or 12. Gray matter processes information in the brain. White matter facilitates the transfer of information. Both are required for the brain to function normally.

The study involved 247 participants over age 60. They were 68% female with inactive lifestyles but otherwise healthy. They had no history of neurological problems. At the beginning of the study, researchers took baseline measurements of memory, processing skills and cardiorespiratory fitness. They also took a special MRI brain scan to gauge the health and function of white matter.

Participants were put into groups and met three times weekly for six months. One group took brisk 40-minute walks, while the another practiced supervised stretching and balance training. A third group learned and performed choreographed dances. Brain tests and imaging were measured at the end of the study.

Results showed that after six months of regular physical activity, walkers and dancers had better overall cardiovascular health. Positive changes in white matter occurred in both groups, but the changes were more widespread among the walkers. A decline in white matter health occurred in the control group.

“We think these findings are important because the regions we observed are sometimes vulnerable to aging or dementia,” lead author Andrea Mendez Colmenares, cognitive neuroscience Ph.D. student at Colorado State University, said according to Everyday Health. “This tells us that the white matter is malleable, and even in regions that are susceptible to aging or disease you can still see a response to an exercise intervention.”