Rebels Jyn Erso and Cassian Andor were originally supposed to make it off Scarif alive with the Empire’s Death Star plans safely in hand, but the writers of Rogue One: A Star Wars Story got the surprising go-ahead from Disney to make the prequel so darkly satisfying.

Rogue One screenwriter Gary Whitta finally revealed the film’s alternative ending to Entertainment Weekly, and it’s a doozy. Whitta says Jyn and a would-be Cassian Andor made it off Scarif alive in one of the first iterations of the script, back when the Rogue One creative team was convinced Disney would never go for a dark ending.

“We were still scratching the itch that they all needed to die,” Whitta says. “Chris Weitz [who wrote another draft] thought we were right. They finally went off and fought for it. We told them, we feel they all need to die, and [Lucasfilm president Kathleen Kennedy] and everyone else said to go for it. We got the ending that we wanted.”

Obviously, the Rogue One ending the world got was a tearful one set against a backdrop of hope, A New Hope, to be precise. Bodhi Rook, K-2SO, Chirrut Îmwe, and Baze Malbus sacrifice themselves for the greater good. Jyn and Cassian don’t last much longer, but they do complete their all-important mission.

But in the earliest script, Bodhi, Baze, and Chirrut were nonexistent. The wonderfully blunt K-2SO was still there, as was a Cassian-esque character — “He was called something different back then,” Whitta says — but Jyn was a legitimate member of the Rebellion, a sergeant rather than an outsider.

The original ending supposedly went down like this:

The Death Star emerges from hyperspace to lay waste to Scarif and protect the Empire’s secrets by destroying the special weapons facility along with the Rebel incursion… But this time there was no last-second broadcast of the plans from a satellite tower. Jyn and Cassian were to escape the surface of the beach world carrying the data tapes… “A rebel ship came down and got them off the surface,” Whitta says. “The transfer of the plans happened later. They jumped away and later [Leia’s] ship came in from Alderaan to help them. The ship-to-ship data transfer happened off Scarif.” Darth Vader was still in pursuit and began attacking Jyn’s shuttle as the Rebels tried desperately to transfer the information from the data tapes to Leia’s vessel. Finally, Vader was successful in breaching their shields and destroying the craft. The audience would have been left fearing the heroes were dead. But as Vader’s Star Destroyer ventures off to chase Leia’s Tantive IV, we would have remained focused on the shuttle fragments floating in the vastness of space.

“They got away in an escape pod just in time,” Whitta says. “The pod looked like just another piece of debris.”

But the ending felt too perfect, too happy, to convey the struggles the Rebellion went through the defeat the Empire. So, Jyn and almost-Cassian were left to die on a beach in each other’s arms. At least they didn’t go alone.

Photos via Lucasfilm/The Walt Disney Company