Dacher Keltner is a huge fan of Pixar’s Inside Out. The UC Berkeley psychologist and co-director of the Greater Good Science Center had already seen the quirky animated flick several times before its official release in theaters this weekend. “I think it’s amazing,” he says. “I really was astounded at how much truth they reveal about emotion.”

Of course, it helps that he was brought on as a consultant for the film by director Pete Docter (whose credits also include Up and Monsters, Inc.), after they met at a convention panel on how to portray emotion nonverbally. When the movie’s writers were developing the story, Keltner visited Pixar’s Emeryville campus several times to share his expertise on the neuroscience of emotion, and later contributed to the design of the characters. (He also fielded Docter’s more specific questions by email, including “What is oxytocin?”) But Keltner is modest about his involvement. “My role was to say, this is some interesting science and here’s what it says about emotion,” he says. “And then those guys, as artists, make the real tough choices about what to do.”’

Along with getting a remarkable amount of the science right, the movie (which would go on to win an Oscar for Best Animated Feature) endeavors to make a case for the importance of emotions and the benefits that come with heeding them—Keltner’s own particular branch of research. The movie’s central characters are the emotions in 11-year-old Riley’s brain: Joy, Sadness, Anger, Fear, and Disgust. But while we’d consider most of them negative emotions, the movie portrays them as sympathetic, wacky, adorable, useful characters. Each emotion, negative or not, has a job to do. Disgust’s is to prevent Riley from being poisoned (which means avoiding things like icky broccoli), Fear keeps her safe, and Anger alerts her when she’s being treated unfairly and galvanizes her to change things.

It’s a simple model that reflects how emotions operate in us, too. But when we feel angry or hurt or afraid, we tend to either lash out or quell these feelings, and shy away from dealing with them in more productive ways. “Thirty, forty years ago, the idea of crying in public was not acceptable, and men embracing each other wasn’t acceptable,” Keltner says. “There was more of a derisive, critical attitude towards emotions. The first thing this movie tells us is, ‘Hey, embrace!’”

That message feels radically new, though emotions have a long lineage. Evolutionarily, emotions developed to operate as little voices in our heads, telling us how to respond quickly to our environment and navigate complex social interactions. “[Emotions] are old, they’re a fascinating part of the mind, they’re shaped by evolution,” Keltner says. “Don’t react against them.”

Of course, in reality, there are more than just five emotions. “One of the things that I pitched Pete Docter on,” Keltner says, “was that you know, you have five emotions in the movie, but there are more emotions and some of them are really interesting, like compassion or awe.” And no wonder, because Keltner’s latest research finds that when we experience awe, we’re more likely to think of ourselves as members of society, act altruistically, and even live longer. (Ultimately, Docter opted for just five because more emotions would’ve made the storyline too complicated.)

Still, Keltner praises the way the movie portrays how emotions work in the brain. Their “headquarters” is a luminous, spacious room somewhere in Riley’s cranium, complete with couches and a control panel—the metaphorical ‘control center’ of consciousness manifested as a clever storytelling device. “As the character Riley moves through the day,” Keltner says, “the emotions will kind of wrestle for who has control of the control panel. And that’s just a funny, playful way of saying something pretty deep—that emotions vie for our consciousness.”

The emotions have a lot on their hands when Riley and her family move from their home in the Midwest to bustling San Francisco, where she struggles to adapt to city life and a new school. Her happy childhood memories, represented as luminous orbs, become quite literally colored by her feelings. “As the main character becomes more sad in the film,” Keltner says, “the balls that represent the past become colored with blue. It’s a portrayal of this very important truth about our minds, which is that what we think about the past is filtered through our current feelings.”

Unusual for a kids’ movie, Inside Out is also a meditation on the importance of sadness. The ebullient Joy (a sprite-like character voiced by Amy Poehler) acts as de facto leader of the other emotions, but doesn’t quite understand what Sadness is supposed to do. Before Riley’s first day at her new school, Joy directs Anger, Fear and Disgust to make sure Riley is prepared for class, looking her best, and entertained. Sadness, however, isn’t given a task. “This is the circle of sadness,” Joy tells Sadness, drawing a small chalk circle around the hapless blue character. “Your job is to make sure that all the sadness stays inside of it!”

It’s much easi­er to keep track of your emo­tions, or tem­per them, if you ima­gine them as the in­ter­ac­tions of these five brightly colored char­ac­ters, each with a dis­tinct, im­port­ant role. (And if your in­ner feel­ings are voiced by Amy Poehler and Mindy Kal­ing, so much the bet­ter.)

This scene is revealing, because it’s not unlike what we do when we deal with sadness—we compartmentalize or distract ourselves or try to banish it entirely. But the rest of the movie is dedicated to convincing Joy, and us, that sadness is, well, kind of deep. “Sadness is inevitable in life,” Keltner says. “We all lose people, and to not panic about it, to let it take its course, I think there’s a lot of wisdom in the film about that.” Pete Docter agrees. “[Keltner] was big on sadness as a community bonding,” Docter told NPR. “If you’re sad, it’s a way of connecting with other people and a lot of times, we sort of feel embarrassed about being sad and we go off by ourselves to hide and cry by ourselves, but really it’s a way of re-establishing relationship.” And sadness is the way we bear witness to the good things in life that have ended, whether it’s the last season of NBC’s Parks and Recreation or a dearly departed grandmother.

So maybe Inside Out can change the way we think about emotion by introducing a sort of logic to the welter of feelings that inform our actions. It’s much easier to keep track of your emotions, or temper them, if you imagine them as the interactions of these five brightly colored characters, each with a distinct, important role. (And if your inner feelings are voiced by Amy Poehler and Mindy Kaling, so much the better.) More concretely, it might also be a useful way to interpret the sometimes ridiculous actions of others, and foster empathy.

Given the plot, the film will especially resonate with parents decoding the sullenness of young teens. In fact, Pete Docter was inspired by his own daughter Elie’s shift into adolescence, and Keltner, who has daughters of his own, thinks Inside Out has plenty of sound parenting advice. “I think parents are going to see this and have this visceral set of insights about how they should approach their teenagers’ emotions, which are often dramatic and colorful,” he says. Taking a peek into someone else’s head to understand what makes them tick is illuminating, no matter how old you are.