A study reveals that people who live longer are usually the product of parents who lived similar healthier lifestyles.

What’s the secret of a long life? According to a new study by the Google spinoff company Calico and AncestryDNA, it’s not so much to do with genetics as to how you chose to live your life.

The study revealed that people who live longer are the product of parents who lived similar healthier lifestyles, meaning we pass on longevity through generations by choosing partners whose attitudes and lifestyle choices are similar to our own in what is known as assortative mating. According to the researchers behind the study, it means you pick partners who will live the same length of life as yourself. “What assortative mating means here is that the factors that are important for lifespan tend to be very similar between mates,” said lead author Graham Ruby. “Of course, you can’t easily guess the longevity of a potential mate. Generally, people get married before either one of them has died.”

The study was part of a former partnership between Calico and AncestryDNA that was first announced in 2015. AncestryDNA’s $99 genetic test has been used by over five million people who’ve sent off a saliva sample back to AncestryDNA’s labs, creating a vast database the company can now use to dig deeper into the building blocks of longevity.

According to a press release on the report’s used data that was scrubbed of all identifying factors to ensure the study didn’t cause a series breach of data protocol: “Before sharing the data with the Calico research team, AncestryDNA stripped away all identifiable information from the pedigrees, leaving only the year of birth, year of death, place of birth (to the resolution of state within the US and country outside the US), and familial connections that make up the tree structure itself.”