During season 5 of The X-Files, literary horror master Stephen King wrote an episode entitled "Chinga," and here's how and why that happened. While responses to the episode were mixed, there's no denying that when fans first heard that King would be venturing into the X-Files world, there was much rejoicing. Surely King and The X-Files would be too great pop culture tastes that ended up tasting great together, or at least that's what most assumed at the time. Instead, the end result of their mixture was a good, but not great, episode.

True to form, "Chinga," is set in King's native Maine, although sadly not in the famous town of Castle Rock. Seeing Mulder and Scully head to Castle Rock would've been pretty great. Alas, fans didn't get to see Mulder much at all in "Chinga," as the story focused almost entirely on Scully. Not that a Scully-centered episode is a bad thing, but with King involved, fans wanted to see both leads interact with his scenarios.

Related: X-Files: Every Time The Cigarette-Smoking Man "Died" (& Was Resurrected)

What many fans might not be aware of though is that the final version of "Chinga" in many ways departs from King's original script, including having Mulder and Scully be separated for the duration. It turns out that not even Stephen King is immune to rewrites.

Stephen King's X-Files Episode Explained

Stephen King wrote an X Files episode about an evil doll named Chinga. Screenrant by Evan J. Pretzer.

In "Chinga," Scully is on vacation in Maine, and ends up getting drawn into a strange case involving a mother, her daughter, and the titular doll. The mom, Melissa, keeps getting visions of people's horrific self-inflicted deaths before they happen, with each death seemingly being caused by Chinga after the victim does something to anger Melissa's daughter Polly. Many in the town suspect Melissa of witchcraft, but it's the doll that's evil, and its reign of terror finally ends when Scully manages to cook it inside a microwave.

"Chinga," seems like a fairly standard King story, taking place in small town Maine, and focusing on a normally harmless object that's somehow become sentient. However, it's unclear just how much of King's script actually made it to the screen. King had met X-Files star David Duchovny while they were doing Celebrity Jeopardy together, and after expressing both his fandom and desire to write for the show, Duchovny got King in touch with Chris Carter. King ended up writing "Chinga" at his home, then sending it in. However, Carter wasn't happy with a lot of King's script, especially exchanges between Mulder and Scully that he didn't feel fit the characters. So Carter rewrote quite a bit of King's material, leading to them sharing writing credit on "Chinga." One element Carter brought into the story was its exclusion of Mulder.

While Carter would presumably know Mulder and Scully best, the fact that several of his scripts for other X-Files episodes weren't that great makes one wonder if he'd have been better off producing and guiding the ship, and leaving the actual week-to-week writing to others. It also begs the question of whether King's original version of "Chinga" would've been better than what fans ultimately got.

More: Every Movie & TV Show Actually Written by Stephen King