The old saying “you are what you eat” extends to your brain. According to a new study published in the Journal of the American Geriatrics Society, following the Mediterranean or MIND diets could help protect your cognitive abilities as you age.

Researchers surveyed 5,907 adults from the United States with an average age of 68 years old. They asked participants to share information about their diets and measured their performance on memory and attention-focused cognitive tests. The researchers found that those who followed the Mediterranean diet were 35 percent less likely to score poorly on the cognitive tests than those who didn’t follow the diet. They also found that people who only moderately followed the diet were 15 percent less likely to perform poorly on the test, according to the study’s press release. The results were similar for participants who followed MIND-style programs.

Heavy on fruits, vegetables, whole grains, fish and olive oil, the Mediterranean diet suggests you steer clear of red meat, butter, cheeses and the majority of sweets, but does allow for wine. The MIND diet, a variation on the Mediterranean diet, focuses on ten foods considered to be “brain healthy,” according to the press release, including leafy greens, nuts, berries, beans, seafood, olive oil and yes, wine.

There are many reasons to prioritize a healthy diet, but this study adds to the already significant pile of evidence showing that when it comes to your brain, what you eat really does make a difference.

Read more about the findings here.