Spending time outdoors has lots of benefits — it’s good for the body and good for the mind. Some research has found that people who spend time outdoors have better vision. And now, a new study finds that sun exposure during adolescence is linked to a reduced risk of near-sightedness many years down the road.

People in the study, all in their 60s, answered a number of lifestyle questions posed by researchers, including how much time they’d spent outdoors as teenagers, and in their 20s and 30s. They were also given eye exams and blood tests to measure levels of vitamin D, lutein and other markers of better vision.

In addition to sun exposure, lutein, a compound found in leafy vegetables, was linked to a much reduced risk of near-sightedness — over 40%, for those who had the highest levels.

Out of all the participants in the London School of Hygiene and Tropical Medicine study, 370 had myopia (near-sightedness) and 2,800 did not. The team found that UVB exposure during one’s teen years and during one’s 20s and 30s was linked to a reduced risk of near-sightedness in one’s 60s. In fact, those with the greatest sunlight exposure in youth had about a 30% reduced risk of near-sightedness later on, compared to those with the lowest. Vitamin D levels did not seem to be linked to the risk of near-sightedness.

It’s not totally clear why sunlight would correlate with better vision, but it may be that spending time outside forces the eye to focus in a different way, or that the increased brightness compared to artificial light may somehow benefit eyes.

There were a couple of other interesting findings. One was that people who were more educated had a higher risk of near-sightedness, which studies have found before. But this didn’t correlate to sun exposure, so it’s not exactly clear why the link exists.

Another odd, and somewhat unexpected, finding was that lutein, a compound found in leafy vegetables, was linked to a much reduced risk of near-sightedness — over 40%, for those who had the highest levels. Lutein consumption had previously been linked to a reduced risk of age-related macular degeneration (AMD). “Lutein is a retinal carotenoid…and has antioxidative, anti-inflammatory, and structural effects in neural tissue,” the authors write. They don’t know exactly how the connection might work, but they say it’s certainly worth exploring in the future.

In the meantime, spend as much time outside as you can (wearing sunscreen, of course). It will help your health, and your kids’ health, in more ways than you know.

The study is published in the journal JAMA Ophthalmology.