If Greg Daniels had gotten his ending, there would have been a literal dead horse highlighting the romantic episode.

Depending on who you ask, the later seasons of “The Office” — even before Steve Carell left the series — were somewhat akin to beating the proverbial dead horse (as the horror movie known as “Scott’s Tots” illustrates). That could be especially painful when it came to how Dwight Schrute connected to Jim and Pam’s relationship. Well, as it turns out, if showrunner and creator Greg Daniels had his way, there would have been a literal dead horse added to the mix.

Seriously.

Entertainment Weekly’s recent oral history of Jim and Pam’s wedding — which took place in the two-part episode “Niagara” and aired 10 years ago this week — revealed that the six-season earnest culmination of the series’ famed will-they-won’t-they relationship almost ended with a twisted bit of darkness. In the oral history, episode director Paul Feig brought up the “big controversy” about the original wedding ending:

“All throughout the episode, Roy’s [David Denman] been kind of haunting around and unhappy that they’re getting married, so when they ask if anybody has reason why this couple can’t get married, he rides into the church on a horse to sweep Pam off her feet like a knight in shining armor and declares, ‘I have an objection.’ And she’s like, ‘What are you doing? No, I want to get married,'” Feig said. “She sends him away, so he has to ride his horse back out of the church. But then, in an absolute insane thing, they had this crazy ending where Dwight [Rainn Wilson] gets the horse and rides it into the falls.”

The “crazy ending” was episode co-writer (alongside Mindy Kaling) Greg Daniels’s idea. Daniels was admittedly “really committed to the horse for the longest time” and went on to explain even further how “The Office” would have gone from Point A to Point Literal Dead Horse:

“It was like Dwight got fascinated with this historical display at the hotel that talked about various animals,” Daniels said. “It started with a cow had been swept over the falls and survived, and then a couple of people tried to go over the falls in a barrel and were killed, and then some sheep went over the falls and survived. And he came up with this theory that you could survive going over the falls if you were riding a horse, because a horse would have the instinct of how to swim properly. And so he was trying to get people to listen to this theory, and then Roy interrupts the wedding trying to do a big, grand romantic gesture that nobody wants and just abandons the horse and drives home.”

“So Dwight gets on and goes into the river above the falls, but panics and jumps off the horse at the last second, while the horse goes over in the background of the wedding. I remember scouting this tank on the Universal lot and talking about how we’re going to shoot this horse being swept over the waterfall. Then we got to the table read and I was the last defender of the horse. The entire staff and actors were yelling at me: ‘Don’t ruin Jim and Pam’s wedding with a horse!’” Daniels remembered.

Instead, after a long debate between Daniels and the writers’ room, the wedding ended with a very 2009-appropriate viral dance down the aisle. While that choice certainly makes the episode a bit dated today, it’s at least more tonally appropriate and memorable for the right reasons — compared to a dead horse.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.