Teenagers may often infuriate older people because they seem to seek immediate gratification. However, a new study published in the journal Neuron on Oct. 5 shows that this behavior is actually part of an evolutionary adaptation to learn from the teenagers’ environment.

“The adolescent brain is adapted, not broken,” says the study’s first author Juliet Davidow, a psychology postdoc at Harvard University. “The imbalances in the maturing teenage brain that make it more sensitive to reward have a purpose–they enable adolescents to be better at learning from their experiences.”

The researchers studied 41 adolescents ages 13 to 17 and 31 adults ages 20 to 30. They asked the participants to play a picture-based learning game while they analyzed their brain activities using an fMRI.

The participants were shown a photo of a butterfly and then a couple of flower pictures. The researchers asked them which flower the insect would land on. The participants then had to guess the right flower through trial and error and if they discern the correct pattern of the right answers, the word correct would appear and incorrect if they guessed wrong.

The adults and teenagers were also presented with unrelated images when they were told if their answer was right or wrong. These unrelated images, which include a pencil or watermelon, were then used for a memory test later on.

Overall, when the teens saw the pattern, they would choose the right flower more often than the adults. When they were tested with how good they recalled the unrelated images, the teens also remembered them better than the adults.

The results indicate that teens are better at remembering details about unexpected results. The brain scan reveals that the teens used both their striatum and hippocampus while the adults mostly used their striatum. The additional system in the teens’ brains helped their learning more than in the adolescents.

Previously, hippocampus was not associated with reinforcement or reward learning during adolescence but the researchers are now working to find out what changes occur in the brain between adolescence and adulthood.

Other researchers include experts from the Columbia University’s Zuckerman Institute and the University of California, Los Angeles.