When director Desiree Akhavan introduced her adaptation of Emily Danforth’s novel The Miseducation of Cameron Post at its Sundance world premiere, she said there were no queer John Hughes films when she was growing up. While Hughes’ films are beloved by many (including myself) I think she’s selling her own work a little bit short by suggesting that comparison. Her film about a teen gay conversion retreat has humor, but isn’t jokey, and while its drama doesn’t speak down to young people, it won’t leave adults feeling out of the loop. This is a gripping and sad drama that puts a tremendous amount of faith in its performers and audience, and for all the emotion and tenderness in the rest of this year’s Sundance crop, this is the first film that left me a complete broken-down mess by the end.

We open in 1993 with Cameron (Chloë Grace Moretz), a teen in love with one of her female classmates. When the pair get caught in a moment of intimacy at a high-school dance (by Cameron’s date, no less!) she is quickly packed up and sent off to “pray away the gay.” What follows is a hybrid of an institution film and a summer camp film, with a remarkable set of characters, no real villains and an exquisite eye for detail.

The closest we’ll get to a Nurse Ratched is Jennifer Ehle’s Dr. Marsh. It’s her job to let the isolation and groupthink of the surroundings brainwash the kids into thinking that their natural impulses are temptations from Satan, and the power of prayer is the only path to salvation. She isn’t cruel, she’s just persistent. In any other context, she’d even be something of a hero.

Also working at the institution is Rick (John Gallagher Jr.), a warm, guitar-playing Reverend who once struggled with his own “SSA” (same-sex attraction). He’s held up as the model of what these kids can achieve if they put in the hard work, so naturally he’s the most tragic figure in the whole film. Cameron quickly falls in with the “bad kids”: Adam (Forrest Goodluck), and a girl who goes by the name ‘Jane Fonda’ (Sasha Lane). They’re the ones who sneak off to smoke pot and know how to BS the counselors well. Though not addressed, they are the only two kids of color at the whole place, with Jane having grown up in a commune and Adam describing himself as a Navajo Two-spirit. But Jane’s mother’s new boyfriend is born-again and Adam’s father is trying to get into politics, so that’s how they both ended up here. Jane lost her leg in an accident, so that’s how she’s able to hide the marijuana they grow out in the woods while Cameron couldn’t even smuggle in a Breeders cassette.

There’s also Cameron’s roommate Erin (Emily Skeggs), a football nut extremely devoted to finding Christian salvation. In any other movie she’d be an antagonist, but Akhavan treats everyone with equal compassion. Nobody asked for any of this. Everyone’s anguish is coming from outside sources. Erin has a surprising scene toward the end that made me gasp, smile and tear up all at the same time. It’s a perfect moment of filmmaking, and further proof that any time a character is all completely one thing in a movie that character is a lie.

An early image in The Miseducation of Cameron Post features young Cameron doing her makeup in one of those cheap plug-in vanity mirrors where you spin a knob for different light settings. This is a character looking for the right version of herself. It’s an outstanding turn by Chloe Grace Moretz, a performer who is frequently cast in snotty or heavily sexualized roles. She’s extremely reserved here, and for much of the film we aren’t quite sure what she’s thinking. Will she reject the attempt at conversion, or will the atmosphere win and she’ll want to “be saved”? We don’t know because she doesn’t know. Or maybe she does know, but doesn’t have the guts to tell herself that. The wheels are always turning, but the performance is subtle. It is far and away the best thing she’s done.

A lot of times when a movie is called “important” it’s hiding the fact that it is boring or dated or loaded with fake drama.Not here. The Miseducation of Cameron Post will be a panacea for gay kids for years to come, so for that our prayers have been answered.