Madam Secretary type TV Show network CBS

Maybe President Conrad Dalton isn’t such a very stable genius, after all.

In Sunday’s episode of Madam Secretary, Dalton (Keith Carradine) will face removal from office after he exhibits uncharacteristically irrational behavior. Yes, the plot will center around invoking the 25th Amendment. No, the recent headlines about President Trump’s mental health didn’t inspire the episode, insists executive producer Barbara Hall.

The script was actually written in October, she says. Even the episode’s title, “Sound and Fury,” though awfully similar to Fire and Fury, Michael Wolff’s now bestseller about Trump’s first year in office, was created last year. (It was inspired by a famous Macbeth quote).

“It’s very easy to trace,” Hall says EW of the episode’s timing. “Look at the process for making a TV show. It takes a month to break a story and we shot it in mid-November.”

That said, Hall relishes the opportunity to dramatize the challenge of removing the president from office. “Anything that’s even remotely in the national discussion becomes something we like to explore,” Hall tells EW. “We felt like this would be a fun thing to game out. Let’s create a scenario where it would be valid, and show viewers how it works.”

Therein lied the challenge — coming up with a realistic situation under which Dalton should be booted from the Oval Office. “We don’t want to under-represent how serious the situation has to be,” says Hall. “There has to be some real extreme change in behavior. Because Conrad is rational and not given to extreme behavior, we discuss all the options. Once we came up with a real scenario that would make sense, we then show what the steps are.”

Whatever happens to Conrad, will this lead to Secretary of State Elizabeth McCord (Téa Leoni) declaring her candidacy for president? Hall isn’t spilling, but she did tease the possibility of a big change for the show’s central character last month. For more on the chances of ever seeing a President McCord, click here.

Madam Secretary isn’t the only CBS show to depict what it takes to remove a president. Last week, writers on The Good Fight said they will actually explore the possibility of Trump’s impeachment by having the show’s fictional law firm make a legal argument for removing Trump from office after being approached by the Democratic National Committee. For more on that plot point for the CBS All Access drama, click here.

Madam Secretary airs Sundays at 10 p.m. ET on CBS.