We’ve all been there—wandering the aisles of 7-eleven trying to pick out the perfect late night snack. Do you want something sweet or salty? Are you hungry enough to risk a hot dog?

You might assume that your likes and dislikes guide such choices (I’m a fan of savory snacks, so I’ll always go for chips over chocolate), and they do—to a point. But that system of decision making breaks down in the face of two equally appealing options, like pretzel sticks or pretzel nuggets. In these cases, your mental machinery actually modifies how you feel about one item, making sporadic changes to your preferences that can linger over time, according to research recently published in the Journal of Neuroscience. The work reveals a previously unknown step in the decision-making process that challenges conventional wisdom.

“Of course our preferences drive choices,” says Katharina Voigt, a neuroscientist at the University of Melbourne, Australia, and paper author, “but it’s also the other way around.”

Voigt’s inspiration came from a 14th-century paradox known as Buridan’s ass, which posits that a perfectly rational donkey picking between two identical bales of hay would die of starvation due to indecision. Few of us in the real world suffer such paralyzing indecisiveness, suggesting that our brains have some way of breaking a tie between similarly compelling options.

Previous research has clearly shown that people come to feel satisfied with most decisions after the fact, but this study focused on what goes on in our heads at the moment of choice.

One of the trickiest parts, Voigt says, was accurately measuring how much the 22 participants wanted certain foods. People have a hard time honestly reporting their preferences in studies, so the researchers set up as realistic a scenario as possible. After selecting nearly three hundred snacks they knew the Australian public would recognize, such as Mars bars, Snickers, and fruit, they starved the participants for four hours to make sure they were hungry and gave them each 4 Australian dollars (about 3 USD). Then, through an auction system, they let the peckish snackers bid on each food item, using those bids to measure their preferences.

Once the researchers knew how much each person liked each item, they confronted each participant with a series of hard choices between equally valued snacks, recording eye movements and tracking blood flow in the brain using an fMRI. After making their selections, the participants made bids in a second auction and did some control trials before finally enjoying their snacks.

By comparing the two rounds of bidding, Voigt and her team could watch people’s preferences change, and measure exactly how much. Consider a person who initially bid exactly $3.00 on both popcorn and Pringles, but ended up choosing the popcorn in the head-to-head matchup. On average, the snacker came to value the popcorn at $3.10 later on, while devaluing Pringles to $2.50. The very act of choosing converted this participant into a popcorn fan in real time.

Related: Your brain and body remember trauma differently than other events

Voight says that based on features such as activity in parts of the prefrontal cortex—an area of the brain associated with planning, reason, and working memory—and eye movement, she could sometimes predict which item the person would come to like. Participants spent an average of 60 milliseconds longer gazing at the item they would end up choosing (and liking), for instance. They also tended to look at the soon-to-be-preferred snack first, and last.

While this is the first work to show that preferences can change during the crunch time of a hard call, Voigt emphasizes that this experiment can’t address whether preferences might continue to evolve after the fact, as other research has found. Rather, she says, her work has uncovered an additional step to be better understood. Keise Izuma, a psychologist at the University of Southampton who has studied such post-decision changes, called the new work “methodologically very sound,” and praised its multi-stage structure.

Next, Voigt hopes to dive deeper into the factors that might push a person to choose popcorn over Pringles—the brightness of the packaging, for example—but in the meantime says these results have helped relieve anxiety about hard decisions in her own life.

“At first difficult decisions were scary for me,” she says, “but now I know it doesn’t matter what I choose because I will like it in the end.”