A lot of factors go into maintaining attention: genetics, whether your environment is distracting or peaceful, past experiences, and of course, your own will. A new study out of Princeton University suggests even more so that if there’s a will, there’s a way: Students who constantly checked on their own levels of attention performed better at focusing tasks.

Wandering thoughts — while at times a good way for the brain to rest, or for the mind to stumble upon a new creative idea — can also lead to lost productivity and even accidents, especially if they happen all the time. The authors of the study believed that these “lapses” occur because we simply don’t pay enough attention to our attention.

“We hypothesized that lapses in these tasks — and in life — occur because humans do not adequately monitor how well they are attending from moment to moment,” the authors write. “Lapses emerge gradually and may be detected too late, after the chain of events that produces behavioral errors has been initiated. Accordingly, one way to train sustained attention might be to provide a more sensitive feedback signal, such that participants can learn to sense upcoming lapses earlier and prevent them from manifesting in behavior.”

In the study, the researchers monitored the brain activity of several student participants who performed a repetitive task that required focus. They lay inside a functional magnetic resonance imaging (fMRI) machine while flipping through photos of human faces superimposed over scenery, and were asked to press a button when they saw either a female or male face — or when they saw either inside or outdoor scenery. Each time the researchers detected activity in a student’s brain showing reduced attention, the next task was even harder than the one before, forcing them to concentrate even harder if they had slipped up. This actually led to improved performance, as the students learned to check their attention to make sure they maintained it.

In other words, real-time feedback from our own brains can help us reduce attention laps and focus much better. “If you’re supposed to be focusing on the face and get distracted, we detect that in your brain before it causes an error on the task,” Turk-Browne said in the press release. “We alert the participant that they’re in the wrong state by making the task harder so they really have to buckle down. If we see they’re starting to focus on the right kind of things again, we make the task easier. By giving them access to their own brain states, we’re giving them information they wouldn’t otherwise have until they made a mistake.”

This proved that our brains possess attentional plasticity — or the ability to improve focus when checked on. After the training period, the participants seemed to be able to differentiate between the two states: attention lapse and concentration, which helped them stay in the focus zone.

“The basic science is really why we did the study, and we learned a lot about behavior and the brain,” Turk-Browne said in the press release. “I think some of the most interesting applications may actually be in the everyday mundane experiences we all have of not being able to stay focused on what we’re trying to do.” This could include driving for long periods of time, but the authors also hope that further research on the subject could in the future assist in treating attention disorders like ADD or ADHD.

But we definitely aren’t robots. Every once in a while, it’s normal to slip and find yourself staring out the window at the sky. And sometimes, these lapses of attention can be good for your brain by giving them some air to breathe.

Source: DeBettencourt M, Cohen J, Lee R, Norman K, Turk-Browne N. Closed-loop training of attention with real-time brain imaging. Nature Neuroscience. 2015.