“A conservative anchor just died. A … brilliant thinker who brought the right out of the closet and championed a whole conservative revival. You cannot replace [him] with a [liberal] … I hated his positions, but he was a visionary. Blew the whole thing open. Changed the whole argument.”

Sure, you’re saying. I’ve heard those kinds of tributes nonstop over the past few days. But this quote wasn’t said in the past few days. It had nothing to do with Scalia. It was said on The West Wing 12 years ago.

Even though Aaron Sorkin had left the show the season before, “The Supremes,” Episode 17 of Season 5 of The West Wing, is quintessentially his style: smart, sassy, and sentient, not to mention prophetic. The premise of “The Supremes” will sound familiar: A Democratic president (Jed Bartlet) is in his second term. The Senate majority is Republican. The Senate Judiciary Committee is determined not to allow a liberal Bartlet nominee to fill what they view as a “conservative” seat on the court.

And then the figurehead of the conservative movement, a brilliant scholar beloved by the right, dies suddenly (just how we’re never told, but it happens overnight, and the news has spread worldwide by morning–Josh Lyman needs his coffee). And now the Bartlet White House has an opportunity that every president dreams of: the chance to replace a Supreme Court Justice appointed by the other party with a nominee who shares his ideology. The problem: When the Senate is controlled by Republicans, a Democratic president can’t easily get a liberal lion through the confirmation process. Sound familiar?

The West Wing staffers are stuck. See, they know that the way through the Senate is to appoint a moderate. And at first they’re OK with that (Josh and Toby fight about the pros and cons: “If we had a bench of moderates in ’54, ‘separate but equal’ would still exist.” “Moderate means temperate, it means responsible, thoughtful.” “It means cautious, it means unimaginative.” “It means being more concerned about making decisions than making history.”) But then they fall in love. With a true liberal, Evelyn Baker Lang, played with subtlety and poise and just a dash of whimsy by Glenn Close. They love her mind. They love her shoes. What they don’t love? That she had a legal abortion in law school.

She’s a non-starter. They’re going to have to go with the moderate whose son has just burned the president in effigy. A problem, it’s true, but in the grand scheme of things, it doesn’t come close to exercising the right to choose, and the scandal the right will try to turn that legal act into. He’ll make it through. He’ll be confirmed. And, while he won’t move the court left, he won’t disastrously move it right, either. Brad Shelton is the obvious pick. But then Donna, Josh’s assistant, pulls out the cookies that her parents sent her. Nothing could be more Sorkin-esque: dry peanut butter cookies in a circular tin change the whole game.

On the lid of the tin, Donna’s parents have taped photos of their two cats. And Donna explains that her parents were too old to compromise, so they each picked out a cat instead of trying to agree on just one. Josh nearly chokes in excitement as he runs from the room. He has the answer: The administration will put up Lang for chief justice, and they’ll let the Republicans pick their next conservative poster child to fill the vacant associate justice seat.

There are only a few problems: The chief justice, old but hearty, is still alive and well and sitting in the center seat on the Supreme Court bench. The chairman of the Senate Judiciary Committee isn’t going to be wild about Glenn Close. And neither Lang nor her conservative counterpart—Christopher Mulready, played by William Fichtner—has any idea what is going on.

But this is The West Wing. Josh and Toby and Leo and CJ— they’re our Sorkin-created superheroes. They might not be able to keep the president from getting MS, or his daughter from getting kidnapped, but this Supreme Court maneuver? All in a day’s work. Even if, as Josh worries, he’s promised the Senate Judiciary Chair “a pork barrel roads project on a bill that doesn’t exist.” He’s got this. And so Josh and Toby convince the current chief justice to step down. And CJ helps get the Senate Judiciary chairman drunk. And Leo announces a West Wing mini-Powerball: “First one to get me a Supreme Court Justice gets a free corned beef sandwich.” As if these West Wing warriors needed more motivation that truth, justice, and the American way.

But the best scenes in the episode focus on the dynamic between Lang, the liberal goddess, and Mulready, the conservative movement’s young, brilliant poster child (“The man wrote a book that flushes the entire doctrine of enumerated rights down the toilet … the garbage disposal. No right to use a condom. No right to get an abortion, certainly. No protection from electronic searches. No substantive due process.”) You’d think—and the West Wing staffers start off thinking—that they’d hate each other. But instead, they challenge each other, make each other’s thinking crisper and smarter and deeper (much like, I should note, Ruth Bader Ginsburg’s friendship with Antonin Scalia). As Fichtner’s character puts it, “The court was at its best when [the justices] were fighting.”

As for the president, he’s won over by, of all people, the conservative upstart that is Mulready. Bartlet is acutely aware that, “Filling another seat on the court may be the only lasting thing [he does] in this office.” And, when Fichtner waxes melodic about “the extraordinary dissent. …The one-man minority opinion whose time hasn’t come, but 20 years later some circuit-court clerk digs it up at 3 in the morning … Brennan railing against censorship … Harlan’s jeremiad on Jim Crow,” Bartlet falls in love. With the court. With the rule of law. With the role of debate in achieving justice. And with his presidential legacy. At the end of the episode, the president introduces his nominees, saying to the press, “I look forward to taking your questions.”

Our questions, in 2016: How can the president and the Senate play ball? Perhaps they should look to The West Wing for inspiration.