Many people believe video games are bad for you—they suck up your time, keep you indoors and inactive, and some would argue “rot your brain.” However, a new study by researchers at the University of California, San Francisco shows that video games can sharpen the mental skills which sometimes fade as your brain ages.

One such skill is multitasking. People in their 20s typically see a 28% performance drop when they do two things at once. People in their 30s see a 39% drop. To combat this trend, scientists created a game called NeuroRacer where players drive over a winding mountain road that gets more and more difficult as the game goes on. At the same time, signs pop up and the player has to respond by quickly hitting a button.

The game was tested on a group of adults aged 60 to 85. After a month of playing the game for an hour three times a week, the drop in performance which occurs when multitasking went from 65% down to 16% and the seniors were doing even better at the game than 20 year-olds.

Of course, after playing a video game for a month you’re going to be better at it. But not only did these seniors get better at the game, they also reported an improvement in memory and their ability to sustain focus on daily tasks. The improvements lasted for a full six months after they stopped playing the game.

According to Dr. Adam Gazzaley, director of the Neuroscience Imaging Center at UCSF, NeuroRacer could be “a medical diagnostic and therapeutic, potentially even going the route of FDA approval.” Currently, NeuroRacer is being tested to see if it helps those with ADHD and depression, both of which decrease one’s ability to stay focused. The scientists are also working on new games to help improve the brain’s abilities.