Good news for millennials: if you prioritize your heart health today, you could keep your brain from shrinking a few decades from now, according to a new study published in Neurology.

Researchers analyzed data on 518 people (averaging 51 years old) who’d been monitored by the research team for 30 years.

The participants had their blood pressure, cholesterol and blood sugar measured at the beginning of the study, and were interviewed about lifestyle habits like diet and exercise. They were followed up with every two to five years, and at the 25-year mark had their brains scanned.

The goal was to see if people who scored higher on the American Heart Association’s guideline “Life’s Simple 7”—seven factors known to improve heart health including reducing blood sugar, staying physically active, eating healthier, losing weight, quitting smoking, controlling cholesterol and maintaining a healthy blood pressure—had healthier brains down the road. Researchers gave each participant a score at the beginning of the study and at the 25-year mark based on the Life’s Simple 7 assessment to determine how heart health impacted brain function over time.

“We know that when people take certain steps like exercising and eating well, they have healthier hearts,” study author Michael Bancks, PhD, from Northwestern University’s Feinberg School of Medicine in Chicago, said in the press release.

The researchers found that people who initially scored higher on the heart-health assessment at the beginning of the study had “a higher average brain volume as a percentage of their total head size in middle age,” according to the press release. This was also true for people who had a better average of their beginning heart-health score and their score at year 25, according to the press release. There was also a stronger association between smaller brain volume and current smoking at the time of the scans as compared to other factors.

“These findings are exciting because these are all changes that anyone can make at a young age to help themselves live a long and healthy life,” Bancks said, adding “this may mean that heart health may have an impact on brain function in early life.” (He added that more research needs to be done to support this.)

While the study is especially encouraging for young people, it’s a good reminder for everyone that improving your heart health can really be as simple as 7 relatively easy steps.

Read the full press release here