For centuries, great thinkers have instinctively stepped out the door and begun walking, or at the very least pacing, when they needed to boost creativity. Charles Dickens routinely walked for 30 miles a day, while the philosopher Friedrich Nietzsche declared, “All truly great thoughts are conceived while walking.”

But in recent years, as lives have become increasingly sedentary, the idea has been put to the test. The precise physiology is unknown, but professors and therapists are turning what was once an unquestioned instinct into a certainty: Walking influences our thinking, and somehow improves creativity.

Last year, researchers at Stanford found that people perform better on creative divergent thinking tests during and immediately after walking. The effect was similar regardless of whether participants took a stroll inside or stayed inside, walking on a treadmill and staring at a wall. The act of walking itself, rather than the sights encountered on a saunter, was key to improving creativity, they found.

Dan Schwartz, who conducted the study and is Dean of Stanford Graduate School of Education, says in an interview that there are “very complicated” physiological changes associated with walking. It’s not exactly clear why walking is helpful to so many thinkers, but “it could be that the brain is focusing on doing a task it’s quite good at,” he adds, which then allows it to free up and relax.

Exercise is known to improve mood, and so it’s likely that the aerobic activity has an effect. But it’s not clear whether more intense forms of exercise has exactly the same effect as walking.

“When I’m in good shape, my imagination can go, but when I’m in bad shape, all I can think about is how much it hurts,” says Schwartz, suggesting that perhaps the activity would have to be undemanding to have a creative boost.

Barbara Oakley, engineering professor at Oakland University who wrote a book about learning effectively which includes the benefit of walking, says in an interview that we make a mistake of thinking that we’re only learning when we’re focused. In fact, walking allows us subconsciously process and think in a different way.

“Part of why walking, I think, is important is it can be boring. It’s that very aspect that causes your mind to go back and revisit, even subconsciously, on what you’ve been analyzing and learning,” she says.

This “important part of the creative process” has helped her work many times, adds Oakley:

““I can’t tell you how many times I’ve been working away and I’m completely stuck. Sometimes I’m so stuck I don’t even know I’m stuck. I finally get so frustrated I just get up. And as soon as I get out and have walked for ten or 15 minutes, these ideas start coming to me. It’s the best thing I could’ve done and I should’ve done it earlier.”

Meanwhile, several therapists have embraced the benefits of walking, by only conducting sessions outside. Clay Cockrell, who runs a walking therapy practice in New York, says he believes the motion, as opposed to sitting on a couch, allows for more free form thinking.

Cockrell has 35 to 40 clients a week, and says they appreciate the rare chance without any agenda.

“New Yorkers walk out of their apartment building and jump in the taxi or subway, get to their destination, walk the two feet to their office. They’re never just outside out and about,” he says in an interview.