Spoilers for Avengers: Endgame follow below.

One of the most devastating moments in Avengers: Endgame comes before the big battle, when Scarlett Johansson’s Black Widow sacrifices herself in an act of pure bravery to acquire the Soul Stone, which in turn gives the Avengers the chance to revive half the universe’s population. It’s a tremendously emotional moment, and one that plays out with serious tension as Black Widow and Hawkeye (Jeremy Renner) essentially fight each other to prevent the other from dying. A decade of character work and terrific performances layers the whole scene with a serious degree of emotional investment, all culminating in Black Widow’s shattering sacrifice.

As the scene plays out, audiences are left to wonder which of these heroes will “win” out, and indeed Avengers: Endgame screenwriters Christopher Markus and Stephen McFeely revealed in a spoiler-filled interview with the New York Times that there was a version of the film in script form where it was Hawkeye who died instead:

McFEELY There was, for sure. Jen Underdahl, our visual effects producer, read an outline or draft where Hawkeye goes over. And she goes, “Don’t you take this away from her.” I actually get emotional thinking about it. MARKUS And it was true, it was him taking the hit for her. It was melodramatic to have him die and not get his family back. And it is only right and proper that she’s done.

Indeed, McFeely went on to elaborate on why it was time for Natasha’s story to end here, and why it made them nervous:

“Her journey, in our minds, had come to an end if she could get the Avengers back. She comes from such an abusive, terrible, mind-control background, so when she gets to Vormir and she has a chance to get the family back, that’s a thing she would trade for. The toughest thing for us was we were always worried that people weren’t going to have time to be sad enough. The stakes are still out there and they haven’t solved the problem. But we lost a big character — a female character — how do we honor it? We have this male lens and it’s a lot of guys being sad that a woman died.”

The duo went on to explain why Natasha doesn’t get a funeral, and why her death had to be final:

MARKUS Tony gets a funeral. Natasha doesn’t. That’s partly because Tony’s this massive public figure and she’s been a cipher the whole time. It wasn’t necessarily honest to the character to give her a funeral. The biggest question about it is what Thor raises there on the dock. “We have the Infinity Stones. Why don’t we just bring her back?” McFEELY But that’s the everlasting exchange. You bring her back, you lose the stone.

While most were bracing themselves for a lot of bloodshed in Avengers: Endgame, I think Markus, McFeely, and directors Joe and Anthony Russo actually found the perfect way to give each exit weight. Black Widow’s death is shocking and early; Tony Stark’s death is inevitable yet crushing; and Captain America’s exit is perfectly in tune with who he is as a character. Talk about nailing it.

For more on Avengers: Endgame, click on the links below.