Warning! The following contains spoilers for Barbie.

StereotypicalBarbie(Margot Robbie) didn’t have a clue what the real world had in store for her. Nonetheless, she embarks on a journey for much-needed answers with her boyfriend Ken (Ryan Gosling) in tow — He’s actually sitting in the back seat of her pink convertible. Unfortunately, their excursion ends up turning Barbieland completely upside down, and it’s up toAmerica Ferrera’s character Gloria to help fix things. Gloria does this with quite the inspirational speech, courtesy of writer/director Greta Gerwig.

Ferrera talked about shooting the iconic monologue in an interview withVanity Fair:

Margot Robbie and the Barbies at the beach in Barbie

It felt like 500 [takes]. I’m sure it wasn’t. It was probably 30 to 50 full runs of it, top to bottom. By the end, Ariana [plays Gloria’s daughter in the film] recited the monologue to me because she had memorized it because that’s how many times I had said it. We shot it over two days. It’s one part of a much bigger scene with lots of characters in it. I had to do it many, many times for other people’s coverage and to get through the whole scene and over the course of two days. But she [Gerwig] gave me so much freedom with it.

Ferrera continued:

There were moments in shooting the movie where Greta really had written something in a very specific way that she heard a very specific way in her head with particular cadence in a particular speed or a particular inflection. I thought maybe this would be like that, but it was the opposite. She wanted me to completely make it my own and find it as we did it.

Stereotypical Barbie journeys to the real world because she needs to know why the heels of her feet are suddenly flat and to discover why she’s thinking about death. Unfortunately, letting Ken tag along ends up being a huge mistake because Barbie’s beau brings the ideas of a patriarchal society back to Barbieland.

Related:America Ferrera’s 8 Best Performances, Ranked

Ferrera’s Persistence Pays Off With an Applaud-Worthy Speech

By the time stereotypical Barbie (Robbie) returns to her home, Ken (Gosling) has already changed everything to fit his new Kendom ideology. In a society that once centered almost solely on the wants and needs of the Barbies, Ken flipped the script. Yes, he had the gall to make himself and the other Kens the top of the food chain. Distraught, Barbie doesn’t know what to do, and that’s when her new real-world friend Gloria whips out her unforgettable, “impossible-to-be-a-woman” speech.

Ferrera continued discussing the process of shooting her monologue with Vanity Fair:

I have my own prep and process as an actor on any day to drop in and be in an open place where I’m exploring and having fun. I think that part of it was — this was also based on Greta’s direction — neither one of us went into it feeling like it’s got to grow and crescendo to this big moment where you burst into tears, or you’re laughing so hard you cry. There were no targets to hit. It was much more a moment-to-moment drop in.

Gloria’s speech inspires Barbie and shakes her out of her funk, and it turns out to be the answer to breaking Ken’s ideological trance over all the other brainwashed Barbies. Order is eventually restored to Barbieland. But if it hadn’t been for Gloria’s speech, Barbie may never have been able to get through to a kind-hearted but misguided Ken.

Barbieis now playing in theaters.