Since Black Panther is, of course, a superhero movie in the Marvel Cinematic Universe, it’s gotta have a couple post-credits scenes to tie it into the rest of the franchise. And they do a pretty great job: The first (SPOILERS) involves a speech given by T’Challa to the U.N., explaining that Wakanda has decided to come out of the shadows and share their knowledge with the world, and the second one reminds us that, oh yeah, Bucky Barnes AKA the Winter Soldier has been here convalescing in Wakanda since Captain America: Civil War. According to Ryan Coogler, the first post-credits scene was almost how the movie ended.

Coogler spoke to the Empire Film Podcast (via Collider) and explained that, originally, the final scene was not the scene where T’Challa introduces himself to those kids playing basketball in a neighborhood in Oakland (a callback to the first time we meet Killmonger as a child) — it was the U.N. speech.

It was [almost the ending]. We played with a lot of different ways to end it. We went back and forth about the U.N., and we had a version where it was the U.N. before the scenes in Oakland at the end. But we really kind of settled on how do we want the movie to end? And it came back to that symmetry, and it came back to the most moving version of it. That’s what we were asking ourselves, ‘Who’s more moved emotionally, that kid or the people sitting in the U.N.?’ Who is that a bigger deal to for T’Challa to walk in, who’s more connected to him?

As a kid, growing up, when you see somebody who looks like an older version of you doing something awesome, it’s like, ‘What’s going on?’ That’s kind of what that moment… We kind of went with the less distilled emotion, and the U.N. makes sense afterwards for where Wakanda could be going in the future of this universe.

The U.N. scene is a good scene in its own right, but the scene on the basketball court is a much better and more emotional and hopeful way to end the movie. The second post-credits scene, the one where Bucky walks out of a hut and trades a few lines with Shuri, who’s been helping him fight his Hydra conditioning.

[A Bucky scene] was something that was always—it was a Shuri thing, because in our world we kind of figured that Bucky Barnes would be her assignment. We kind of drop the hint at that when they bring Ross in and she’s like, ‘Oh another one.’ So we dropped hints in there, but what we kind of decided was that her cracking his mental code, if Shuri’s as smart as she is, that wouldn’t really be a big problem.

Coogler also explained why Bucky doesn’t appear in the movie itself — basically, he’d have horrible PTSD and it wouldn’t be fair to his character to have him deus ex machina himself into that big final battle, and Coogler also mentioned that “it could be potentially problematic if it’s a bunch of Africans fighting and you bring in a white dude, he comes in shootin’ people.” Plus, one of the strengths of Black Panther is that it isn’t hobbled by a compulsion to connect itself too deeply to the rest of the MCU. The Bucky scene is a reminder and a foreshadowing of things to come, but only that. Black Panther is strong enough to stand on its own.

More From MIX 108