Iron Man 3 is one of the most successful Marvel Studios movies ever made, but it’s also one of the most divisive. The film scored over $1.2 billion at the worldwide box office, and thus far it’s only been bested by Avengers movies and Black Panther. It was one of the most highly anticipated movies of 2013, effectively serving as a sequel to the 2012 smash-hit Marvel’s The Avengers. Fans were eager to see how Marvel Studios would continue the MCU storyline now that the heroes had finally met up. Could they create a standalone film where fans weren’t constantly asking where Thor/Captain America/Hulk were? How do you possibly follow up something as monumental as The Avengers? Well, if you’re Marvel and Robert Downey Jr. (who at this point had earned a tremendous amount of clout in Marvel Studios), you hire Shane Black to bring the Iron Man franchise back to basics while also forging an ambitious path forward—but not without a couple of twists and turns.

At the behest of Downey, whose career resurgence really began with Black’s directorial debut Kiss Kiss, Bang Bang, Shane Black was hired to co-write and direct Iron Man 3 in February 2011, still over a year away from the release of The Avengers. As the one who started it all, Iron Man was the easy pick for who should follow-up the MCU’s first culmination event, and it was no easy task. Black and co-writer Drew Pearce got to work writing the screenplay, but they knew they had to deliver something different to appease audiences after the mega-feast that was The Avengers. So they decided to go a bit smaller, more intimate, but to also raise the emotional stakes by acknowledging the traumatic experience Tony went through at the end of The Avengers, when he flew through a wormhole in the sky on a suicide mission.

Indeed, thematically the crux of Iron Man 3 is a sort of PTSD story about Tony feeling powerless without his suit. After Iron Man, Tony felt he was king of the mountain. But in The Avengers, he met a super soldier, a monster, an assassin, and a pair of literal gods. Cap says to him directly, “Take away the suit and what are you?” Well Iron Man 3 takes away the suit, strips Tony bare, and forces him to regain his confidence by working through his internal pain and struggles.

You get the feeling that Tony Stark is a guy who’s spent his whole life running away from his problems, and while his decision to out himself as Iron Man at the end of the first movie is a step in the right direction, he doesn’t really shred his narcissism (and deep-seeded self-doubt) until the end of Iron Man 3, when he throws the arc reactor into the ocean. Of course, this being a 20-film-and-counting interconnected franchise and all, Tony’s issues return in subsequent films. But for the purposes of Iron Man 3, Black aims to complete a character arc that began with the first Iron Man, and it’s refreshingly internal.

The film opening in 1999 is no accident. We see Tony being an absolute jackass, not content to just rebuff a pitch from disabled scientist Aldrich Killian (Guy Pearce), but instead going one further by embarrassing the man and inviting him to a secret rooftop meeting that Tony never plans to attend. Tony’s lack of regard for other human beings comes back to haunt him, as Killian eventually destroys Tony’s house, severely injures his best friend, and takes his girlfriend hostage. Everyone Tony loves is in danger, and it’s largely his fault—a point made clear when Tony’s midnight panic attack results in one of his suits threatening Pepper (Gwyneth Paltrow).

It’s only when Tony is stripped of everything and forced to take a hard look at his own internal problems that he’s able to step up and right the situation, and that this is a result of a delightfully sincere friendship with a young boy (Ty Simpkins) is so very Shane Black.

Indeed, one of the strengths of Iron Man 3 is that it is, for the most part, unabashedly a Shane Black film. There’s the signature humor, the Christmas setting, the delightful wordplay, the narration, and even something of a detective story in the middle. Marvel Studios purposely hired directors who could be considered journeymen before this time—even Joss Whedon’s take on The Avengers was to just make it incredibly comic book-y. With Iron Man 3, even though ever-watchful Marvel Studios CEO Ike Perlmutter was still making bone-headed decisions, you can see the seeds of authorial personality that would grow in later films like James Gunn’s Guardians of the Galaxy, Taika Waititi’s Thor: Ragnarok, and Ryan Coogler’s Black Panther. And while Iron Man 3 is nowhere near as Shane Black-y as Black Panther is Ryan Coogler-y, it was a refreshing start.

Black isn’t content to play things straightforward or conventional. There’s an added playfulness in nearly every scene that’s even more accentuated when you get Downey involved, and when you come to a scene where the story necessitates delivering some exposition, Black and Pearce always find a unique and often humorous way to make the material feel alive (see: Trevor watching soccer while explaining Killian’s plan).

And so here, finally, is where we talk about The Mandarin. This is Iron Man’s most iconic villain from the comics, and some fans were adamant that he had to be included in the MCU. So Black and Pearce got to work crafting a version of this character that could work, but kept running up against a major issue: The Mandarin is kind of racist and pretty silly, and ran counter to their science-centric take on Iron Man 3. One day, Pearce floated the idea that The Mandarin was just a façade—a theatrical frontman for a true and more grounded villain working behind the scenes. Black and Pearce pitched this to Marvel, got the greenlight, and Trevor Slattery was born.

Some fans felt betrayed by this twist, others loved it. I’m firmly in the latter camp. For those who felt betrayed, it speaks to how well Black crafted a genuinely scary version of The Mandarin for the first hour or so of the film. But ultimately, is that really satisfying? Tony Stark goes through a deeply personal existential crisis to… defeat a terrorist who wears flamboyant rings and blows stuff up? Villains have never been the MCU’s strong suit, but even still, that would’ve been a bummer. Instead, we get Killian as the true villain—a spurned scientist with greedy aspirations—and Trevor Slattery makes his grand entrance in what remains one of the funniest performances in the MCU.

The whole idea of a façade also connects thematically to Tony’s journey. He’s terrified to show the world himself, Tony Stark, without his powerful suit of armor. As Iron Man he’s a hero. As Tony Stark he’s a man, fallible and mortal. The Mandarin, likewise, isn’t some insane terrorist running networks all across the globe. It’s a bad actor in a suit, so Killian can use these “bombings” as excuses for his own screw-ups. He’s just an entrepreneur. A murderous entrepreneur, but an entrepreneur regardless.

Iron Man 3 isn’t without its problems. Killian’s (mostly) grounded nature and science-focused goals at the very least make him stand out as a palate cleanser of sorts from the extreme sci-fi of The Avengers, but when we learned that Black originally intended for Maya Hansen (Rebecca Hall) to be the main villain only to have bone-headed Ike Perlmutter nix the idea because girl toys don’t sell, the film’s baddie became even more disappointing. And Killian’s plan only kinda-sorta makes sense in the first place.

The Iron Patriot subplot is also a bit of an unnecessary detour, and the film’s devolution into high-flying explosions in the third act doesn’t come close to reaching the excitement gained from the more intimate set pieces, like Tony fighting with one glove and one boot. Then you have Pearce’s “I am the Mandarin!” declaration, which felt like Marvel getting nervous about the twist during post-production and opting to pull its punch.

But even with all that—and keeping in mind that at this point, Feige was still reporting to the meddlesome Perlmutter—Iron Man 3 is a joy. Black is even able to stick the landing during the suit-filled set piece, driving home the thematic arc as Tony self-destructs all of his suits in a show of personal growth. That Iron Man 3 feels so much like a Shane Black movie, especially at that juncture, is a testament to Feige’s willingness to push the boundaries of what a Marvel Studios movie could be.

In hindsight, it’s hard not to imagine that this film had a significant influence on the increasingly idiosyncratic nature of future MCU films like Guardians of the Galaxy and Black Panther. Shane Black was somewhat allowed to make a Shane Black movie, albeit within certain constraints. And Iron Man 3 is all the better for it.