A new study has found that foods high in flavonoids may help lower risk of cognitive decline.

"There is mounting evidence suggesting flavonoids are powerhouses when it comes to preventing your thinking skills from declining as you get older," said study author Walter Willett, MD, DrPH, of Harvard University in Boston, MA, in a press release. "Our results are exciting because they show that making simple changes to your diet could help prevent cognitive decline."

The study,published in Neurology, looked at 49,493 women with an average age of 48 and 27,842 men with an average age of 51 at the start of the study. Over 20 years of follow-up, participants completed questionnaires about how often they ate various foods. Their intake of different types of flavonoids was calculated by multiplying the flavonoid content of each food by its frequency.

Participants evaluated their own cognitive abilities twice during the study, using questions such as: “Do you have more trouble than usual remembering recent events?” and: “Do you have more trouble than usual remembering a short list of items?” This method of assessment was intended to capture early memory problems when people have noticed them, but when they aren’t necessarily bad enough to be detected on a screening test.

The group in the highest 20% of flavonoid consumers had an average of around 600mg daily, whereas those in the group with the lowest 20% of flavonoid consumption had an average of 150mg daily. For reference, 100g of strawberries have around 180mg of flavonoids per 100g serving, while apples have around 113.

Related: Mental Health: The Next Crisis Low Flavonoid Intake Correlates with Alzheimer’s, Long-Term Study Finds

After adjusting for factors including age and caloric intake, people who consumed more flavonoids reported lower risk of cognitive decline. The group of highest flavonoid consumers had 20% less risk of self-reported cognitive decline than the people in the lowest group.

Looking at specific flavonoids, flavones (found in some spices and yellow or orange fruits and vegetables) had the strongest protective qualities, and were associated with a 38% reduction in risk of cognitive decline, the equivalent of being three to four years younger in age. Anthocyanins (found in blueberries, blackberries, and cherries) were associated with a 24% reduced risk of cognitive decline. While peppers have around 5mg of flavones per 100g serving, blueberries have about 164mg per 100g serving.

"The people in our study who did the best over time ate an average of at least half a serving per day of foods like orange juice, oranges, peppers, celery, grapefruits, grapefruit juice, apples and pears," Dr. Willett added. "While it is possible other phytochemicals are at work here, a colorful diet rich in flavonoids—and specifically flavones and anthocyanins—seems to be a good bet for promoting long-term brain health. And it's never too late to start, because we saw those protective relationships whether people were consuming the flavonoids in their diet 20 years ago, or if they started incorporating them more recently."

The researchers noted that the study is limited by the fact that participants self-reported on their diets, and may not recall perfectly what they ate or how much.