The smashing success of Spider-Man: Brand New Day has Marvel feeling gleefully optimistic about Avengers: Doomsday as well as the X-Men movie coming down the line. But those projects mean the screenwriters of Brand New Day, Erik Sommers and Chris McKenna, had to approach the villain played by Sadie Sink with care. She may be a baddie for most of their movie, but she has a more heroic future awaiting her—so her introduction needed some calibration.

The word is mostly out by now, but just in case… Sink plays Jean Grey, best-known to movie fans as a key member of the X-Men. She’s complicated and has some dark (phoenix) tendencies, but generally she’s seen as one of the good guys. In an interview published last week, Brand New Day director Destin Daniel Cretton explained why Jean Grey was the right opponent for this chapter of Spider-Man’s story. She’s adrift in the world just like Peter Parker is—his friends don’t remember him thanks to the events of Spider-Man: No Way Home, and she’s been separated from her beloved sister. “We wanted a villain who reflected what he was going through,” Cretton explained and pointed to the specific comic-book arc that helped inform her journey. That makes sense for the narrative. But actually bringing her into not just Peter’s world, but the Marvel Cinematic Universe as a whole, required some finesse. She had to be believable as a sinister force who’s ultimately able to be redeemed.