Everyone gets them, and many people spend hundreds or even thousands to cover them up. Grey hair is one of the inevitable parts of getting older, but not everyone is happy to see them. Scientists have long known that greying is the result of a gradual disappearance of melanin in hair follicles — melanin is the protein responsible for giving hair its color. But until now, they didn’t know exactly what caused that color drain to take place.

Now, in a paper published in Nature Communications , an international team of researchers describe the first gene linked to greying hair. The finding came from a larger study on genes related to a number of hair traits, including balding, monobrow, curliness and beard growth (for more on these other findings see here ). Led by Kaustubh Adhikari, a post doctoral researchers at University College London, the group sequenced the genomes of more than 6000 people from Latin America and compared their genes against various hair features, including how much grey hair they had.

TIME Health Get the latest health and science news, plus: burning questions and expert tips. View Sample SIGN UP NOW

Adhikari says that for grey hair, only one gene stood out. It’s a gene that’s been connected to blonde hair in Europeans, which makes sense since it also affects how much melanin the hair follicle receives. But this is the first study to link the gene to greying.

MORE: Can Stress Make You Go Grey? (Even If You Are Not Barack Obama)

In the study, this gene accounted for about 30% of hair greying, with the remaining 70% due to other factors such as age, (probably the biggest contributor), stress and other environmental exposures. Having the gene will now help scientists to figure out the genetic pathway responsible for turning hair grey, and that could lead to new products that help people avoid getting grey hair in the first place, if these products can replace the melanin and keep a hair follicle’s original color. “We might have drugs that boost or stop the protein from acting and change the amount of melanin in hair follicles and change the hair internally,” says Adhikari. “So once the hair comes out like the way you want, you don’t have go out and buy dyes.” That may be a while away yet, but now that there’s a gene that researchers can target, eventually you may not have to visit the hair colorist any more.