Here’s another reason not to heed low-fat brigades: A diet rich in fatty, oily fish, nuts, vegetables, and olive oil can improve your cognitive function way better than low-fat diets.

The beneficial attributes of the famous “Mediterranean diet” have been outlined in plenty of studies and health articles; the nutrient- and antioxidant-rich diet has been shown to fight obesity, heart disease, stroke, and even dementia. Now, a new study published in JAMA Internal Medicine shows that the Mediterranean diet can assist in improving cognitive function.

“Oxidative stress and vascular impairment are believed to partly mediate age-related cognitive decline, a strong risk factor for development of dementia,” the authors wrote. “Epidemiologic studies suggest that a Mediterranean diet, an antioxidant-rich cardioprotective dietary pattern, delays cognitive decline.”

The Spanish researchers examined 447 healthy participants (223 of whom were women) with an average age of 67 years. The participants were cognitively healthy, but they had high risk of cardiovascular disease and were receiving a Mediterranean diet intervention. The researchers divided them into three groups: 155 individuals supplemented their Mediterranean diet with 1 liter of extra virgin olive oil per week; 147 supplemented it with 30 grams of a combination of walnut, hazelnuts, and almonds; and 145 were asked to follow a low-fat control diet (meaning they ate typical low-fat foods instead of Mediterranean diet foods). The participants ate their assigned diets for about four years.

The researchers measured their cognitive changes over time, focusing on memory, frontal (attention and executive function), and global cognition. The people who had the Mediterranean diet were more likely to see improved cognitive function compared to those on the low-fat diet. In fact, people on the low-fat diet actually experienced decreased cognitive function across the board, while those on the Mediterranean diet with nuts in particular saw a significant memory increase. The frontal and global cognition for those on the Mediterranean diet plus olive oil, meanwhile, improved significantly.

“Our results suggest that in an older population a Mediterranean diet supplemented with olive oil or nuts may counter-act age-related cognitive decline,” the authors wrote. “The lack of effective treatments for cognitive decline and dementia points to the need of preventive strategies to delay the onset and/or minimize the effects of these devastating conditions. The present results with the Mediterranean diet are encouraging, but further investigation is warranted.”

Since the Mediterranean diet comes with a large package of benefits, including increased longevity, you really can’t go wrong with it. Eat abundant amounts of fruit, vegetables, whole grains, olive oils, and legumes (beans, lentils, etc) — in addition to lean sources of protein like fish and poultry, and occasional glasses of red wine — and you’ll be well on your way to healthy aging. Replace red meat with omega-3-packed slabs of salmon, or butter with extra virgin olive oil, and base every meal on vegetables, whole grains, olive oils, and legumes.

“It’s never too late to change your dietary patterns to improve your health,” Dr. Emilio Ros of the Hospital Clinic in Barcelona, a lead author of the study, said, according to Time. “This surprised even myself.”

Source: Valls-Pedret C, Sala-Vila A, Serra-Mir M, Corella D, de la Torre R, Martínez-González M. Mediterranean Diet and Age-Related Cognitive Decline. JAMA Internal Medicine. 2015.