Why is it that you can’t go to a certain restaurant without remembering an ex-lover? Or why visiting childhood haunts bring back so many memories?

A team of neuroscientists at the University of Pennsylvania and Freiburg University has discovered that our brains work to “geotag” events. These mental reference tags are then activated immediately before recalling something.

“It’s an intuitive thing that when you think of a particular location, it brings up a particular memory,” says Jonathan F. Miller, one of the researchers who recently published a paper in the journal Science. Miller, along with others, set out to uncover just how the brain makes this possible.

In order to replicate realistic day-to-day life, the research team created a video game for test subjects to navigate — a kind of realistic city environment reminiscent of first person shooter games like Halo or Call of Duty. The subjects were instructed to get familiar with the city environment and were then told to go to certain locations, such as coffee shops. Once they arrived at different locations, they were told a certain item, like “pencil.” At the end of the test, they were asked to remember as many of the items as possible while electrodes measured the way their brains reacted.

“The word is a stand in for any kind of event,” Miller says. “If someone had delivered a pencil to a bookstore, we checked to see if the place cells were activated. We found that the same cells were reactivated when we said the word pencil.”

It appears to go both ways — certain memories will allow you to remember the location where an event occurred, which in turn can allow you to recall other memories associated with that particular geotag. “Where you are becomes linked to the actual memory itself,” Miller says.

He adds that researchers can now look at other kinds of memory retrieval. “We can look at visual features, semantic meaning, or particular cells that have been shown in rodents that keep track of time. It would be interesting to find those similar kinds of things in humans and if memories are activated by time.”