Watching “Glee” on a weekly basis is like playing a high-stakes poker game in a Vegas casino. The show is the house, and the house almost always wins. “Winning” in this case means that the show takes not only your chips, but also your heart and soul as well. But every once in a while, the player beats the house, and their efforts are rewarded. After one of the worst episodes in the show’s history, “Glee” bounced back something fierce with “The First Time,” an episode that should have gone completely off the rails but managed to stay on the tracks and build confidence throughout the hour.

Look: it wasn’t perfect. No episode of “Glee” ever was nor ever will be. You could pick nits in nearly every scene. But the episodes of the show make you stop looking at the flaws and appreciate the emotional responses it can elicit when everything aligns correctly. No more ginger supremacists, leprechauns, or student/teacher trysts. (Unless you count that awful number inside Dalton Academy which, like the second season of “Friday Night Lights,” we’ll all agree never happened.) Instead, we got two things that generally make for a stellar episode of “Glee”: thematic resonance between various storylines, and musical performances that actually comment upon those resonances. This sounds like an easy thing to do. The sum total of “Glee” to date suggests the opposite. So let’s celebrate when it gets things right.

When “Glee” fails to work, it’s generally because characters are not acting like actual human beings would act. Either they are detached from the human race itself, or from any semblance of how that character once behaved. Look at Finn: we’ve seen about a dozen variations on his character over the show’s three seasons. Those dozen variations don’t add up to a complex whole so much as twelve separate entities. Like so many other denizens of Lima, he’s whatever the show needs him to be that week in order to get from Point A to Point B. When the show DOES work, however, its characters are frustrating in ways that are relatable. Their flaws are our flaws. And tonight’s thematic flaw: a lack of belief in oneself.

Through that prism, a lot of characters tonight do a lot of stupid things. But the show recognizes them as stupid, and that makes all the difference. In guiding the major players through their preconceived/misconceived notions, “The First Time” is less about two couples having sex for the first time and more about self-acceptance. That’s a totally cheesy thing to structure an episode of television around, but as I’ve said many times in these reviews: I like cheesy “Glee” when it’s earned. It makes me gloss over questions like, “Wait, they are doing ‘West Side Story’ already? And even the girls that left New Directions are in it, and also counseling Rachel on the side? Also, that Irish dude is in it?” I simply give up asking, because the answers to those questions aren’t terribly important if I’m welling up watching the show. Having Rory as a Shark is something I won’t lose sleep over. Puck banging Shelby? That might require some warm milk.

I put a lot of the success of tonight’s episode on director Bradley Beucker, who not only lucked out with a script featuring no Sue and almost no Will, but also brought some extremely interesting camerawork, editorial choices, and character direction that heightened connections that another episode might have failed to make. Without Beucker’s input, I might not have seen how Artie and Beiste’s storylines directly connect to Rachel/Finn and Kurt/Blaine. The temptation to put “SEX” on the front burners and make Artie and Beiste fill-ins might have been too tempting for another director. Instead, losing one’s virginity gets subsumed into larger issues of identity, inadequacy, and the universal desire to simply achieve comfort within one’s own skin. If that leads to sharing that skin with someone else, great. If not, that’s OK too.

Cross-cutting these storylines with performances from “West Side Story” only drove these thematic connections further. Every one of the major players had a connection to the musical, and “The First Time”. Playing “A Boy Like That” over Blaine’s coffee date with Dalton Academy lothario Sebastian Smyth should not have worked. And yet, the melodrama of the song mirrored the melodrama in coffee shop, giving both elements added power than they would have had as stand-alone scenes. Performances like this week’s “Uptown Girl” and last week’s “Last Friday Night (T.G.I.F)” stop the show dead in its tracks. But Buecker and credited writer Roberto Aguirre-Sacasa found a way to incorporate the musical into the episode, rather than stopping the episode for periodic numbers. Successful episodes of “Glee” usually find a way to do this. It’s difficult work, but it’s work that the show created for itself by the very nature of its dramatic conceit. I will celebrate it when it works, but never excuse it when it doesn’t.

Music aside, the dramatic aspects of the show held up their end of the bargain this week. Each of the four main arcs were thematically related, but all had their unique flavors to them. Artie proudly declares that he’s found his calling as a director, but his bold proclamations are a bluff for being scared out of his wits. Beiste wants to date Ohio State recruiter Cooter Menkins, but has issues dating back to “Never Been Kissed” about her own ability to be loved. Rachel/Finn are dealing with the ticking time bomb that is graduation, but also the rest of their lives. Blaine/Kurt are trying to spice up their relationship, but afraid of both their partner’s limitations and their own. Even if these arcs don’t reflect every aspect of what we’ve seen from these characters, they represented the truest aspects of these people.

Note I didn’t say “best” aspects. Beiste uses food and odd medical quirks to keep Cooter at bay. Artie’s direction to Rachel and Blaine consists of telling them to lose their viriginity. Those two characters then clumsily attempt to fulfill this advice: Rachel manipulates Finn’s loins, Blaine manipulates Kurt through Sebastian and manipulates himself through alcohol. Against every fact in the world, Finn thinks he’s got a shot at being the next quarterback for the Ohio State Buckeyes! These are flawed people doing occasional horrible things…but they all come out realizing how horrible they have been, and in those moments of emotional nudity, find someone there willing to love them all the same. Artie gets flowers from a cast/crew that admired his leadership. Beiste gets a date to Opening Night. And two sets of couples become lovers by recognizing kinship in spirit, intercut with Tony and Maria’s marriage. That marriage is itself symbolic: they are married in the eyes of no one but each other. But that’s more than enough for them. And it’s more than enough for these characters, for now.

Probably the clearest lesson of the episode comes from Dave Karofsky, who has a short but meaningful scene with Kurt inside “Scandals,” a nearby gay bar. The bar itself is much less wild than either Blaine or Kurt imagine it to be, and Karofsky’s low-key presence in there represents a refutation of expected drama. Everyone in tonight’s episode fears the unknown, and then are pleasantly surprised by what actually unfolds. Karofsky talks of baby steps: he’s at a new school now in order to dodge any rumors about his sexuality, but he’s also going to Scandals because he feels welcome there. He isn’t whole by any means, and his life’s problems haven’t been solved, but he’s made progress. And as momentous as the end of the episode might be for Kurt/Blaine and Rachel/Finn, they will all wake up the following morning realizing that life goes on. What they did didn’t solve anything. But if they are lucky, it prepared them to be better equipped to confront whatever life throws their way next.

And if we the viewers are lucky, “The First Time” helped “Glee” figure out how to save the show from itself.

What did you think of “The First Time”? A return to form, or just another misfire? How do you think the show handled the two couples contemplating their first sexual encounter? Are you upset the musical is already over, or was that enough time spent on it? Sound off below!