Our actions are motivated by the goals we want to achieve. However, little is known about the mechanism in our brains that allow us to make the right decisions to reach our goals. Researchers at the Friedrich Miescher Institute for Biomedical Research (FMI) and the University of Basel now identified the sequence of events taking place in a mouse brain when the mouse behaves in a certain way to obtain a reward, and how it can adapt its behavior when the reward is not the one expected.