From the moment he burst onto the blockade runner in 1977’s Star Wars: New Hope, Darth Vader has reigned as one of the biggest, baddest, most iconic antagonists in cinema. But let’s face facts: The Sith lord has largely been coasting on reputation these past 40 years. After all, most of his big-screen career has seen the erstwhile Anakin Skywalker being alternately redeemed in third-act Return of the Jedi heroics or humanized via the prequels’ backstory, which saw him develop from whiny kid to angsty adolescent to disaffected young adult, all too easily manipulated by Palpatine along the way.

But, thanks to Rogue One, Darth Vader is back at his malevolent best, annihilating rebels with a mere flick of his wrist and flash of his lightsaber in the film’s waning moments. However, that climactic scene, which reestablishes Vader’s dark side bona fides and has quickly become a fan favorite, almost didn’t exist. According to editor John Gilroy, the badass action scene was one of the key late tweaks arising from the film’s infamous reshoots. “What was added — and it was a fantastic add — was the Vader action scene, with him boarding the ship and dispatching all those rebel soldiers,” he tells Yahoo Movies. “That was something conceptualized a little later.”

With the Star Wars standalone providing the connective tissue between Revenge of the Sith (which ends with our first glimpse of Anakin-as-Vader) and A New Hope, director Gareth Edwards always intended to bring back the dark lord. As initially conceived, though, Vader was more threat than death agent in his brief appearances — an ominous warning here, a nonlethal Force choke there.

Related: Watch Lego and 8-Bit Recreations of Darth Vader’s Climactic ‘Rogue One’ Scene

Gilroy, who came aboard the production late in the game to help incorporate the reshoots overseen by his brother, Tony, alongside Edwards, explains how that final scene changed over the course of the summer. Reverse-engineering the opening of A New Hope, Edwards and the Rogue One screenwriters had plotted out the ending almost precisely as it was rendered onscreen: Jyn and Cassian steal the Death Star plans from the Imperial archives on the tropical planet Scarif, and, with the help of their crew, manage to beam the data to the Alliance fleet orbiting above. From there, a hard copy is passed along until it winds up in the hands of Princess Leia, with Vader in hot pursuit. “As far as I know that was always the plan… the main structure was there,” explains Gilroy.

But then the Rogue brain trust decided to up the dark-side-of-the-Force factor and allow Vader to reclaim his Sith cred, storming the Alliance flagship, wiping out the crew, and nearly preventing the plans from getting to Leia. “It was a really great punch in the arm and something I think fans wanted to see,” the editor continues, again using “fantastic” to describe the inspired addition.

Related: ‘I Rebel’ and Other Scenes That Weren’t in ‘Rogue One’

As the Rogue One story was reshaped during reshoots, Vader’s earlier scenes were likewise retooled. Most notably, a segment featured in the first full trailer (below), was cut from the film.

View photos Vader as seen in the ‘Rogue One’ trailer (Lucasfilm) More

Because of the timing of the reshoots, a different actor was needed to don the ebony armor. Daniel Naprous wielded the lightsaber for the climactic scene, while Spencer Wilding did the chores for initial meeting between Vader and Ben Mendelsohn’s Orson Krennic. (James Earl Jones, of course, provided the Sith lord’s pipes throughout.)

Related: Exclusive Look at ‘Rogue One’ Concept Art

As Gilroy notes, fan service was important for the filmmakers. Aside from showcasing Vader at the height of his villainous powers, the film also revealed his home base, a lair on Mustafar. The castle was based in part on unused designs legendary concept artist Ralph McQuarrie dreamed up for The Empire Strikes Back.

View photos Early versions of Vader’s lair by Ralph McQuarrie (Lucasfilm/from the book ‘Star Wars Art: Ralph McQuarrie’) More