Good lung health may help you maintain your brain’s processing speed and problem-solving abilities as you age, according to a new study.

While reduced lung function had a negative effect on these two types of “fluid” cognitive [thinking] abilities, it was not linked with poorer memory or any significant loss of stored knowledge, the researchers said. Changes in thinking function did not affect lung health.

For the study, the research team analyzed data from 832 people, aged 50 to 85, in Sweden who were followed for up to 19 years. The findings were published recently of the journal Psychological Science.