A new study ties playing a musical instrument to better memory and executive function (the ability to perform complex tasks).

People who play musical instruments as they get older seem to have even more brain benefits, according to the study, published Sunday in the International Journal of Geriatric Psychiatry.

Researchers evaluated data from 1,107 people in the United Kingdom aged more than 40 who completed questionnaires about their musical abilities. The average age of participants was 67.82 years, and 83% were women. Of them, 89% of participants had played an instrument in the past, and 44% continued to play. The majority of the musical types played either a keyboard or woodwind instrument.

“Overall, we think that being musical could be a way of harnessing the brain’s agility and resilience, known as cognitive reserve,” Anne Corbett, PhD, a professor of dementia research at the University of Exeter in the UK, a co-author, said in a statement.

The piano isn’t the only instrument that can help in terms of brain health, as singing also was linked to brain benefits. But researchers aren’t sure whether the advantages of singing come from the social aspects, such as being part of a choir or a band.

“Although more research is needed to investigate this relationship, our findings indicate that promoting musical education would be a valuable part of public health initiatives to promote a protective lifestyle for brain health, as would encouraging older adults to return to music in later life,” Corbett said.

“There is considerable evidence for the benefit of music group activities for individuals with dementia, and this approach could be extended as part of a healthy aging package for older adults to enable them to proactively reduce their risk and to promote brain health,” she added.

“This study reports on the association of musicality and cognition in a large cohort of older adults, confirming clear, significant associations between key musical factors and cognitive performance,” the authors wrote. This study did not find a link between listening to music and cognitive ability, the team noted.