There are many reasons to live a happy life. Among them, according to a new study, is a longer-lasting, more functional body. The study found that older people who enjoy life maintain a better physical function later into life.

“The study shows that older people who are happier and enjoy life more show slower declines in physical function as they age,” said Dr. Andrew Steptoe, of University College London, in a press release. “They are less likely to develop impairments in activities of daily living such as dressing or getting in or out of bed, and their walking speed declines at a slower rate than those who enjoy life less.”

The findings fall in line with many previous studies that have found that an active, outgoing, and optimistic person is more likely to be happy and healthy into old age. The catch though, may be that happiness has to come from young age first. A July 2013 study, for example, found that people who were more outgoing and emotionally stable during young adulthood were more likely to carry those traits as they aged. This in turn could affect physical well-being, as evidenced by the current study.

The current study looked followed 3,199 men and women over eight years. The participants were split into three age groups (60-69, 70-79, and 80 and over), and asked to assess their enjoyment of life on a four-point scale. Specifically, they were asked to rate their happiness based on the following statements: “I enjoy the things that I do,” “I enjoy being in the company of others,” “On balance, I look back on my life with a sense of happiness,” and “I feel full of energy these days.”

Their answers were compared to interviews in which the participants reported on how well they carried out daily tasks, such as getting dressed, getting in and out of bed, and bathing. Their walking speed was also determined with a gait test. Overall, the researchers found that happiness correlated to better physical function. Unsurprisingly, they also found that participants in the youngest age group were most likely to report and exhibit well-being. Besides them, participants with higher socioeconomic status, an education, and who were married were also better able to function.

Conversely, the participants who suffered from chronic illness — heart diseases, diabetes, and depression, for example — were more likely to be unhappy with life. People with low well-being were more than three times as likely to develop problems that affected their physical function. “This is not because happier people are in better health, or younger, or richer, or have more healthy lifestyles at the outset, since even when we take these factors into account, the relationship persists,” Steptoe said in the release.

There are many factors that contribute to happiness, well-being, and physical and mental health, and they’re all interrelated. A study from last June found that volunteering, which meant remaining active and social, reduced the risk of hypertension — a factor leading to unhappiness — by 40 percent. For retired people, the risk of unhappiness could even rise, as social interaction and physical activity lessens. A study from May found that well-being gradually decreased as a person spent more time retired. “It is possible that health will initially improve when somebody retires and then, after a while, start to deteriorate due to reduced physical activity and social interaction,” one of the study’s authors, Gabriel Sahlgren, said at the time.

Looking into ways to prolong well-being in older adults “may have benefits to society and health care systems,” Steptoe said in the press release. “Our results provide further evidence that enjoyment of life is relevant to the future disability and mobility of older people.”