But here’s the caveat: Baking in the sun for longer doesn’t yield higher amounts of vitamin D—our skin molecules can only produce a certain level of the vitamin at a time. Once it reaches your body’s quota (which looks different for everyone), any extra rays will cause sun damage. Sun damage, in turn, can trigger oxidative stress, premature aging, and a slew of other issues. This is why dermatologists are so adamant we stay smart about sun care. Enter this new study, published in Nature Communications, which measured the genomes of more than 502,000 individuals in the U.K. They found that variations of a specific gene called 4HAL 4(histidine ammonia-lyase)4 can influence how much of this internal SPF molecule we make. In other words, if you have variations of the HAL gene, the more SPF molecules you could have in your skin, and the more vitamin D your body can create. Meaning, more optimal vitamin D levels with fewer burns—sounds like a win-win. Currently, we know that high amounts of melanin in the skin can affect how much vitamin D our bodies make, which is why some experts say those with darker skin tones may need a higher amount of sun exposure to meet adequate levels of vitamin D. But this study takes skin tone out of the equation, finding that HAL can influence how much of the vitamin we make—no matter the color of our skin. So our advice is that in the meantime, slather on your SPF (here are our favorite mineral options), and think about supplementing with vitamin D if you might be at risk of deficiency.*