When you spot that first silvery strand in your hair, it’s hard not to have a brief moment of panic, followed by quickly combing through your locks to see if there are any others. And if it hasn’t happened to you yet, it eventually will. So what exactly makes hair turn gray? And does stress play a role?

Related: How Stress Can Seriously Mess With Your Skin

First, some background on hair color: Hair gets its hue from melanin, the same pigment (or lack thereof) that determines your skin and eye color. With hair, you start to lose melanin as you get older, according to the American Academy of Dermatology, which eventually turns hair gray, silver, or white. “A typical hair on the head can grow for up to about three years,” Angela Lamb, M.D., dermatologist at The Mount Sinai Hospital, tells SELF. “When that hair is shed, the germ cells that produce the pigment need to get going again. As we age, the ability to do that robustly decreases.” Although it’s not fully understood why hair’s melanin production is affected, research shows that naturally-occurring hydrogen peroxide can build up in the hair follicle as we age, which may affect the melanin—essentially, bleaching hair from the inside out.

Related:  8 Hip Stretches Your Body Really Needs

But can stress speed up this process? While stress has been known to trigger hair loss, there’s little research showing that it can actually turn your hair gray. And it certainly can’t turn it white overnight. The leeching of color is a gradual process. That said, it’s possible stress has some influence. “We do not have any good research that stress directly causes gray hair,” says Lamb, “but we think there is some connection.”

Related: 8 Signs You’re Eating Too Much Sugar

As Jennifer Lin, a dermatologist who conducts molecular biology research at the Dana-Farber/Harvard Cancer Center, in Boston, explained to Scientific American: “There is evidence that local expression of stress hormones mediate the signals instructing melanocytes to deliver melanin to keratinocytes. Conceivably, if that signal is disrupted, melanin will not deliver pigment to your hair.”

For the most part, you can blame your parents for your gray hairs, rather than stress. “Genetics play the largest role in when you will start going gray,” says Lamb. In fact, scientists have identified the first gene responsible for gray hair, IRF4, which may one day hold the key to preventing gray hair in people who aren’t fans of the pigment-free strands.

Related: How To Tell If You’re Legit Addicted To Food (Or Just Really, Ridiculously Into Eating It)

One habit that can cause gray hairs to prematurely sprout on your head: cigarette smoking. A 2013 study found a significant link between lighting up and turning gray before age 30. “Smoking and stress can certainly impact hair, but the extent with which it causes graying is not exactly linear,” says Lamb. Your best bet? Kick the bad habit if you smoke and keep stress in check. It may not keep the silver out of your hair, but it certainly doesn’t hurt.