There are countless studies and copious amounts of research delving into how the internet can negatively impact your mind. But, new data indicates that there’s one way online time could actually benefit the brain. According to findings recently published in the Journal of the American Geriatrics Society from a team at NYU, it appears that regular internet usage may significantly reduce the risk of dementia in older populations.

As also highlighted by Gizmodo on Thursday, the study examined online habits of over 18,000 adults over the age of 50 for as long as 17 years (with a median of nearly 8 years) via data from the government’s biannual Health and Retirement Study. The dataset was subsequently broken down into two groups—those who were regular internet users, and those who were not. A second survey assessed their cognition at the study’s outset to use for reference over time. According to researchers, regular visitors to the internet “experienced approximately half the risk of dementia than non-regular users,” even when taking issues like pre-existing conditions into consideration. As Gizmodo also noted, those who reported using the internet in subsequent analysis displayed even lower risks of impairment.

[Related: How your daily screen time affects your wellbeing.]

But don’t take this as carte blanche to surf the web to your heart’s content just yet. When utilizing a smaller dataset of users that provided hourly usage rates per week, researchers discovered a potential U-curve situation between time and risk for dementia. Those who spend over six hours a day on the internet appear to possess a slightly increased chance to develop cognitive issues, much like those who rarely go online at all. This led researchers to hypothesize that “excessive online engagement may have adverse cognitive effects on older adults.” Despite the study’s caveats, however, the findings present an interesting look into the potential positives of online use, especially when people are often told to use the internet less.

The Goldilocks “not too much, but not too little” linkage between internet use and dementia falls in line with experts’ recent suggestions on how to best maintain cognitive health: lead an overall, decently healthy lifestyle, i.e. one with regular physical activity, a primarily plant-based diet, an aversion to bogus supplements, managing existing diseases, and reduced alcohol consumption. So, on top of all that, you can now possibly add a healthy hour or so of daily internet scrolling to the list. Just don’t fall too far down the rabbit hole.