According to a new study, published in the Journal of Applied Social Psychology, young people who’ve read the Harry Potter series — and identify with the main character or protagonist — are less likely to be biased or prejudiced against minority groups.

Researchers examined 34 Italian fifth graders in the very first study, who filled out a questionnaire about their attitude toward immigrants. They then read excerpts from Harry Potter books over the course of six weeks, focusing mostly on parts that had to do with prejudice or bigotry. After reading the books, they then answered the questionnaire about immigrants again, and showed increased empathy toward immigrants — especially if they also identified strongly with the main character, Harry.

In the second half, researchers examined a group of older college students in England, and their attitudes toward refugee groups. They found that reading the books had a similar effect on college students. “Harry Potter book reading was positively associated with perspective toward refugees only among those less identified with Voldemort,” the authors wrote. “Perspective taking, in turn, was associated with improved attitudes toward refugees.”

The young Italian children who read the series were affected by “the positive attitudes and behaviors of Harry Potter toward stigmatized fantastic groups,” which impacted their attitudes in real life. For example, Harry’s acceptance of the stigmatized group known as “mudbloods” influenced kids to better understand the intolerance and unfairness against minority groups like gays or immigrants and improve their attitudes toward them. As a result, the researchers believe that “reading the novels can potentially tackle actual prejudice reduction.”

The researchers examined various subplots in the novel, finding parallels between evil Voldemort and Hitler; the fantastical “bad guy” in Harry Potter believes that all power should be given to “pure-blooded” witches and wizards, not the mudbloods. Meanwhile, other groups of species like goblins are often forced into servant roles, which Harry “tries to understand … and appreciate their difficulties,” the authors wrote. So perhaps fantasy books can have more of an impact on real-life ideas than you might have expected.