“Speechless” creator Scott Silveri opened up about how they came up with this week’s musical episode of the ABC comedy.

In a guest column on The Hollywood Reporter, Silveri wrote that the musical concept of Season 2, episode 16 was conceived and executed at the last minute. “Three days before the table read, we had no script and three stories I was jamming down the staff’s throats that were all ready to go, except for the fact that they did not make any sense,” Silveri wrote. “[Then] late on a Friday afternoon, the decision was made to scrap the stories and start over.”

Silveri went on to reveal that they then decided to resuscitate an old story idea about Maya’s (Minnie Driver) secret joy in getting called for jury duty. “It was inspired by the mom of one of the writers, Carrie Rosen,” Silveri wrote. “A real-life selfless and dedicated mom of a child with a disability, Phyllis Rosen’s quiet place was in a dentist's chair. A rare hour of nothing, even under a drill, was an hour of bliss. Fantastic, woman, Phyllis. Great teeth, too.”

As to how they came up with the thought of including musical elements to the episode, Silveri wrote that it was borne out of the fact that they wanted the viewers to know that Maya relished the chance to serve on a jury, but the other characters couldn’t know. “We could have had Maya sharing this information with the family dog or talking to a wall,” the exec producer said. “[But] a song and dance number seemed a little more fun, if vastly more complicated.”

Because the episode was conceived at the 11th hour, Driver didn’t have much time to rehearse for her musical number. “I learned each section [of the performance] 10 minutes before we shot,” the actress told Yahoo! Entertainment, before admitting that although the sequence looks flawless from a layman’s point of view, it isn’t actually perfect. “I love to dance, and I see problems. I wish I’d had more rehearsal, because I could have executed my turns better!”

Despite the challenges she faced while filming the episode, Driver tweeted earlier this week that the installment is the “happiest thing” she’s ever filmed.

“Speechless” airs its Season 2 finale next week, Wednesday, March 21 at 8:30 p.m. EDT on ABC.