Next to the Death Star run, Star Wars: Rogue One almost had the best ending of any Star Wars story. After a tragic-but-beautiful ending for Jyn Erso and friends, we finally got to see Darth Vader go beast mode on a bunch of tiny, non-force-using dudes.

But, in one odd moment, Rogue One ends with a Leia Organa cameo that feels a little off. The filmmakers CGI-pasted ’80s-era Carrie Fisher on a double’s face, and the results are what you’d expect: A weird, glossy sheen on Leia’s face, and buggy eyes that look taken from a poorly-rendered video game cutscene.

Thankfully, among Star Wars: The Rise of Skywalker’s imperfections, trying some CGI buffoonery to recreate the departed Carrie Fisher was not one of them. Director J.J. Abrams faced a very difficult challenge in concluding Leia Organa's story after the tragic death of Carrie Fisher in December of 2016. Thankfully, the last film in the Skywalker Saga gives Leia Organa a solid ending, revealing that she was a lightsaber-wielding Jedi, and ended up giving her life to save her son, Ben Solo. We already know that the footage of older Leia was taken from unused footage from The Force Awakens—which is something that director J.J. Abrams recently spoke to Vanity Fair about:

“We weren't going to recast, we couldn't do a CG character,” Abrams said. “We looked at the footage we had not used in The Force Awakens, and we realized we had a number of shots that we could actually use. It was a bit like having a dozen pieces of a jigsaw puzzle and then having to make other pieces around it and paint a cohesive image from these separate pieces.”

Later in the Vanity Fair story, Abrams and The Rise of Skywalker’s visual effects team explain that they actually did the opposite of what Rogue One went for—they created a digital body for Leia, and kept her facial expressions the same. As the leader of the visual effects team, Roger Guyett, explained: “I always thought, when we were doing these shots, that everyone's looking at her face. That was the thing that we held onto, and then we fixed everything else.”

But what about The Rise of Skywalker’s flashback scene, where we see Luke train Leia in lightsaber combat after the events of The Return of the Jedi? In an interview with The Hollywood Reporter, The Rise of Skywalker’s co-writer, Chris Terrio, explained that the Episode IX crew raided the Lucasfilm archives—taking audio and images from The Return of the Jedi:

“We had all the audio that Leia says at our disposal, and of course, every word that she says on camera is really Carrie, Terrio said. “We also had access to the dailies from the original trilogy, and in the flashback of Luke and Leia, that image of Carrie comes from Return of the Jedi. So, we had access to everything in the archive, which turned out to be super helpful.”

Not to mention, the body stand-in for the flashback is none other than Billie Lourd, Carrie Fisher's daughter. Lourd already had a small part in the new trilogy as Lieutenant Connix, but The Rise of Skywalker's filmmakers thought it would be especially fitting to have her stand in for her mother. Visual effects supervisor Patrick Tubach told Yahoo Entertainment:

“Billie was playing her mother,” Tubach said. “It was a poignant thing, and something that nobody took lightly — that she was willing to stand in for her mom.”

Leia's story in The Rise of Skywalker is one of the real triumphs of Episode IX. And if the movie was to get anything right, it was giving our princess, our general a proper ending.