This weekend’s episode of Saturday Night Live will likely be one for the history books. Not only did the highly accomplished Broadway star and playwright Lin-Manuel Miranda host the show but SNL also became the first late night comedy series to address Trump’s latest and arguably biggest controversy. The show’s head writers dropped by New York Comic Con to explain what went into creating this groundbreaking episode.

“It was very weird. We wrote — Sarah and I had written like a cold open for the table read, which was the vice presidential debate, and there wasn’t really — we were just like ‘Maybe this will stay,’” SNL head writer Chris Kelly said about this weekend’s episode during a panel at New York Comic Con. “You know, the vice presidential debate was so early in the week. We were like ‘Maybe this will stay as the cold open, but you never know. Something could happen.’”

And something certainly did happen. Late Friday afternoon, the Washington Post released a 2005 video of Donald Trump having an incredibly vulgar conversation about women, which included the phrase “grab them by the pussy.” SNL head writers Chris Kelly, Sarah Schneider, and Bryan Tucker sat down with Vulture’s Jesse David Fox at NYCC to discuss the complete overhaul the show went through after this scandal broke. “We kind of did a re-write on Friday morning to incorporate Donald Trump and Hillary Clinton, but [it was] still very on the vice presidential debates. We did a second run-through Friday morning,” Kelly said. “And then at 5 p.m., we were like ‘Huh …’ We all got the same breaking news alert.”

“We rewrote it again until like four in the morning on Saturday morning. And then the whole staff got involved,” the veteran writer explained. “It got turned into everybody’s sketch and everybody kind of was pitching jokes right up till the last second.”

“It’s so rare that something happens on Friday for us because normally we [write] at the start of the week,” Byran Tucker said. “All these other shows — you know, The Daily Show, Samantha Bee, all the talk shows — have already taken a crack at it. It’s so cool sometimes for us to be the first.”

Incorporating Trump’s latest scandal wasn’t as simple as inserting the news story into the pre-written cold open. Kelly explained that the writers took into account the flood of people who revoked their endorsements from Trump when they were writing. “So one person would be writing and another person would be like literally refreshing news,” he said. “It was a very horrible and disgusting situation, but it was fun to write.”

The cold open revealed a lot about Saturday Night Live, including how quickly the show’s writers can turn over a news issue and how big Alec Baldwin can make his lips, but one of the more surprising revelations had to do with the word “pussy.” As we have all now learned, that’s something you can say on Saturday Night Live. “Our standards person … basically ran to find us as fast as she could to say, ‘You can say pussy!’ She was ready and excited,” Schneider said. The word was said three times during the episode.

Another great sketch during the strong episode centered around Kate McKinnon playing Trump’s campaign manager, Kellyanne Conway. The pre-recorded segment was the solution to a problem SNL’s writers have been facing a lot this election season: How do you find a new angle for someone as universally covered as Trump? “We did a video last night that was like a day off with his campaign manager,” Kelly said. “So we’re like trying to get in a Donald Trump joke from the perspective of his campaign manager or like coming at it from the side, where we can still have Donald Trump jokes but we deliver them through a heavy music video or something.” He also pointed to the show’s “Melania Moments” as another creative way the show takes shots at the presidential candidate.

The trio also talked about what out was like working with the show’s latest Trump impersonator, Alec Baldwin. “I think so much so his stature and his voice and his body has done a lot of amazing things, which is a lot of fun because we get to like play with that a lot more,” Schneider said. “And he also follows politics as closely as we do, so he’s excited to be apart of this whole conversation.” Schneider also had nothing but praise for Hillary Clinton’s impersonator, Kate McKinnon, “who is just like a tornado,” she said.

“She’s made Hillary into a person and a character, and so now we’re just writing character sketches for her,” Schneider. Later, in response to an audience question, Tucker dissected the differences between Poehler’s impression of Clinton and McKinnon’s. According to Tucker, Amy Poehler’s Clinton was about her awkwardness, and Kate McKinnon is about her ambition.

Schneider pointed to McKinnon’s dance during the cold open as evidence for how powerful the Emmy winner’s impression is. “[McKinnon] hasn’t said a thing, but the audience is already on board. And it’s become she’s already done the work,” she said.

“Our job is not to promote one candidate over another,” Tucker said when asked if he thought Saturday Night Live helped normalize Trump’s behavior to the public. “Our job is to take whatever’s already happening and make fun of it. And I think that Donald Trump was already very close to the Republican nomination before he was on Saturday Night Live, so I don’t think that Saturday Night Live put him over the edge.”

Aside from the episode’s impressively topical cold open, the other much discussed moment was expectedly Lin-Manuel Miranda’s monologue. Backed by dancers, Miranda rapped about SNL’s history to the tune of Hamilton’s “My Shot,” and it was every bit as epic as it sounds. In case you were wondering, yes, Miranda did write the rap himself with the help of two Saturday Night Live writers. “Often our schedule works out where the host hangs out on Tuesday night, which is our writing night, until 10 p.m., 9 p.m. sometimes,” Schneider said. “I saw Lin in the hallway at 5 a.m. with his headphones just like this [bobs head up and down]. They actually rewrote that monologue a couple times too … but he was super involved in it.”

However, even Miranda’s monologue was given a last minute rewrite to incorporate Trump’s remarks. The panel’s sharp-eared moderator, Jesse David Fox, asked whose idea it was it add in the line “Never gonna be president now,” which landed as both a solid Hamilton reference and a scathing Trump takedown. The trio was unsure who decided to incorporate the line, but they did reveal what went into reconstructing the episode. “The cold open, the monologue, and Weekend Update were all written Friday night, early Saturday morning, right? A lot of those started from scratch. So I think that monologue was Friday night, probably,” Kelly said. With all of those last minute rewrites and late hours, it’s even more impressive that Tucker, Schneider, and Kelly were able to stop by for Comic Con.

RELATED: ‘SNL’ Recap: Alec Baldwin Recreates Trump’s Shocking “Pussy” Comments (Plus the Return of Fey and Fallon!!)

[Where to watch Saturday Night Live]