Neuroscientists are using testimonies of Holocaust survivors to help map the way the brain experiences gratitude, the U.K’s Daily Mail reported on Tuesday.

Researchers took multiple recordings of testimony from archives at the USC Shoah Foundation in California and designed a brain-scan study to test and track gratitude in 23 subjects. Most of the subjects were in their 20s and had no personal connection to the Holocaust.

In order to stimulate feelings of gratitude similar to those experienced by Holocaust survivors, subjects were shown brief documentaries explaining the chronology of the Holocaust; the rise of Nazism and Jewish persecution; and the final months and liberation of the concentration camps, the Daily Mail reported.

“In the midst of this awful tragedy, there were many acts of bravery and life-saving aid,” said Glenn Fox, a post-doctoral researcher at the Brain and Creativity Institute at the University of Southern California, who led the study. “With the Holocaust, we only typically associate the awful things. But when you listen to the survivors, you also hear stories of incredible virtue, and gratitude for the help they received.”

Researchers also developed 50 scenarios based on stories from survivors who had been given something, whether it be a place to hide or a pair of shoes. In one scenario, subjects are asked to imagine being sick for weeks and then receiving life-saving medicine from a doctor located by a fellow prisoner.

The participants rated the depth of their gratitude based on the scenarios, and researchers mapped the gratitude’s circuitry in the brain using an MRI scanner, according to the Daily Mail.

Experts found that when the brain experiences gratitude, it activates areas responsible for other feelings, as well, including reward, moral cognition, subjective value judgments, fairness, economic decision-making and self-reference. They also discovered that the emotion of gratitude stimulated a number of brain regions, such as the ventral- and dorsal-medial prefrontal cortexes.

Scientists explained that gratitude is an important emotion, because it rewards generosity and maintains the cycle of healthy social behavior. USC Shoah Foundation Executive Director Stephen Smith said the emotion of gratitude helped Holocaust survivors stay alive.

“When they gave testimony to USC Shoah Foundation, many Holocaust survivors told us that they found reasons to be grateful, whether it was because of a stranger offering a bit of food or a neighbor providing a place to hide,” Smith explained. “These small acts of generosity helped them hold on to their humanity. That Glenn has been able to use testimonies in his incredible research on gratitude shows why it is so important to preserve the voices of people who lived through these dark times.”