It was all a dream... er, a hallucination, that is.

For its penultimate episode Wednesday, Royal Pains went the musical route — and after a few song-and-dance numbers up to and during his father's wedding, Hank (Mark Feuerstein) came to the realization that maybe he doesn't need to find love in order to be truly happy. Of course, we also learned that all the musical numbers were just hallucinations suffered by Broadway legend/wedding guest Annette (guest star Cloris Leachman), thanks to some malformed blood vessels in her brain.

Here's a rundown of the musical numbers in the episode, ranked best to worst:

Royal PainsMega Buzz: Hank makes a surprising decision

"The Good News Is" (Annette and Hank)

Good luck getting that catchy chorus out of your head. It's those words — "the good news is, you're going to be OK" — sticking in Hank's mind that make him realize he's got a pretty good life after all, even if it doesn't include the picture-perfect romance he's been dreaming of. But probably the most impressive thing about this number is that it manages to incorporate a ton of medical jargon (you trying building a rhyme scheme around "encephalopathy!"), as a bunch of Hank's former patients return to thank him for improving their lives so drastically. Kind of a bummer that Annette has to go and suffer a seizure at the end of it.

"Kickin' It In" (Mrs. Newberg, Divya, Paige, Hank, Evan)

Here's where we first meet Annette, who's the longtime BFF of Eddie's (Henry Winkler) fiancée Mrs. Newberg (Christine Ebersole). The "It" refers to a hypothetical door in this feminist number, in which Mrs. Newberg, Paige (Brooke D'Orsay) and Divya (Reshma Shetty) all lament their personal and professional woes as women. (Paige: "Screw you, low motility / Eff you, infertility.") They harmonize pretty well together, and have obviously taken some inspiration from the Schuyler sisters of Hamilton:

The only thing that brings down the song is a cheesy cameo by the men, Hank and Evan (Paulo Costanzo). Symbolic?

"The Good News Is" Reprise (all)

Annette's going to be OK! Get it? And Hank realizes he is, too. "What if I don't need to meet someone?" he ponders. "What if I end up alone, and it's OK?" The Hamptons community loves him and maybe that's enough. But then he catches that bouquet...

"Done and Done" (Evan and Hank)

Evan, sick of Eddie's shenanigans and unreliability, wants to cut his dad out of his life once and for all — and out of his and Paige's (at this point hypothetical) child's life as well. Hank tries to talk him out of it, and they serenade each other on the beach. Costanzo, it must be said, is a better singer than Feuerstein. Hank eventually convinces his brother that family is important, and at the end of the song Annette appears out of nowhere — our first sign that maybe these musical numbers aren't actually happening.

"Plus None" (Hank)

Alone at his father's wedding, Hank gets jostled around as he tries to navigate his way through all the couples who are dancing around him. Metaphor. But he's also on the verge of having his big epiphany, and notes "My life is as it should be." Still, it feels like kind of a halfhearted attempt to convince himself more than anyone else that he's single and loving it. (Consider his confession about five minutes prior that he'd love to attend a wedding with someone he's in love with, just once.)

"Lullaby" (Divya)

Hank walks in on Divya singing to her daughter about what a good sister she's going to be. This song ranks last because it's kind of a snoozer (which makes sense, it being a lullaby and all), but Shetty has a decent voice. And, twist! This is the only song in the episode that wasn't a hallucination. Annette wasn't present for this scene, but since Divya was actually singing to her daughter, she doesn't need to be - it wasn't happening in her mind.

What did you think of Royal Pains' musical episode?

The Royal Pains series finale airs Wednesday, July 6 at 10/9c on USA.