Does living to an old age run in your family? Well, that’s great, but you can’t just sit around and assume the same will be true for you. New research, from the University of California, San Diego, found that your genetic make-up only gets you so far. There’s more that comes into play. Although nature is one card in the game of longevity, nurture seems to hold the winning hand — and exercise is the ace.

A new study published in the Journal of Aging and Physical Activity found that folks who were genetically predisposed to a long life couldn’t count on longevity if they weren’t moving. In fact, the more sedentary they were, the more health issues they had. Conversely, folks whose relatives were short-lived could counteract their genetics with regular exercise.

Even those participants who engaged in only moderate but regular physical activity added years to their lives.

“The goal of this research was to understand whether associations between physical activity and sedentary time with death varied based on different levels of genetic predisposition for longevity,” the study’s lead author, Alexander Posis, a fourth-year student in the San Diego State University/UC San Diego Joint Doctoral Program in Public Health, said in a university press release.

Here’s how the study worked: Beginning in 2012 as part of the Women’s Health Initiative Objective and Cardiovascular Health study (OPACH), UC researchers began to measure the rate of physical activity in nearly 5,500 women in the U.S. who were 63 years and older. They continued to track their physical activity and longevity over the decade. The participants wore a research-grade accelerometer above their hip for up to seven days. The portable meter measured the time they spent on the move, how intense their activity was, and how much time they rested or just sat still.

Even those participants who engaged in only moderate but regular physical activity added years to their lives. But those who were more sedentary were less likely to experience a longer life. And there’s more: This held true for all the women, even for those who came from families with impressive longevity.

“Our study showed that even if you aren’t likely to live long based on your genes, you can still extend your lifespan by engaging in positive lifestyle behaviors such as regular exercise and sitting less,” explains senior study author, Aladdin H. Shadyab, Ph.D., assistant professor at the Herbert Wertheim School of Public Health and Human Longevity Science at UC San Diego. “Conversely, even if your genes predispose you to a long life, remaining physically active is still important to achieve longevity.”

Previous studies have shown that regular exercise can improve brain health, boost mood, help with weight management, reduce your risk of developing Type 2 diabetes, heart disease and stroke, as well as several types of cancer. It also strengthens bones.

The more sedentary a person was, the more health issues they had. Conversely, folks whose relatives were short-lived could counteract their genetics with regular exercise.

What’s more, you don’t have to run a marathon or engage in heavy sweat-inducing gym workouts. Moderate exercise of at least 30 minutes daily will do the trick, including:

  • Walking or hiking at a moderate pace
  • Some forms of yoga
  • Yard work, such as raking or pushing a lawn mower
  • Bicycle riding (stationary or outdoors)
  • Water aerobics
  • Active kinds of housework such as mopping floors

If you’re pretty much a couch potato, but you want to try adding exercise to your life, be sure to speak with your healthcare provider first. Also, start slowly and increase the intensity of your exercise routine over time.

The study is published in the Journal of Aging and Physical Activity.