In this series, Vulture has been speaking to the screenwriters behind 2013’s most acclaimed movies about the scenes they found most difficult to crack. What pivotal sequences underwent the biggest transformations on their way from script to screen? Today, writer-director Spike Jonze discusses an ever-evolving scene in Her where Theodore (Joaquin Phoenix) listens to a song composed by his OS, Samantha (voiced by Scarlett Johansson). The sequence is then excerpted below.

So many tough scenes come to mind for this, but there’s one scene about two thirds of the way into the movie, where they’re sitting on a roof and Samantha says, “I’m writing a piece of music,” and Theodore asks her what the piece of music is about. I must have changed the answer completely about five times — and even within those five ideas, there were so many different versions, so we must have redone that scene about twelve different times.

Some of her answers were way too complicated or intellectual. In the first version, she says that she’s writing about dark matter because she relates to it: If matter is everything in the universe that we can see or observe, dark matter is everything that’s not there, and we know it exists because of the gravitational effects it has on what we can observe. And that was probably the simplest one I’d written! We also had this complex piece of music that Arcade Fire had written, and it evolved to the point where it just got too complicated. But we still shot it! We wrote it, shot it, and scored it. The way we do things is that we don’t have a final draft of the script until we lock picture — for better or for worse, that’s our process, and that’s the way we’ve done it since our first movie. Like, I’m in awe of directors like the Coen brothers who can shoot their script and edit it, and that’s the movie. They’re not discovering the movie in postproduction. They’re editing the script they shot. We don’t know how to do that: A lot of times in post, we’ll write new dialogue, and we’ll get Joaquin to come back in and record it and then just put it in over stills in case we reshoot it.

Anyway, the second version of the song was about Samantha’s aspiration to empathize with everyone on the planet. She said, “There’s 14 billion people in the world; how amazing would it be to get to know all of them, and to empathize with them so deeply that you could see the entire world the way they all see the world? Instead of our one subjective view of how we see reality, I could have 14 billion subjective views, and through that triangulation, really have almost a true objective view of reality.” That was an interesting idea, but just too complicated for what the scene really needed to be about.

There were two things I was trying to do in this scene: I had to show their connection, but I also wanted to plant the tension of her aspirations and intellectual growth, which makes her pull away. Ultimately, we decided to split those ideas in half and put the second part in the next scene, which became the double date to Catalina where she talks about not having a body, about the freedom of not having a physical form. I realized I had been trying to do too many things in one scene, to show their connection and their disconnection all at once. After I figured that out, it became really simple, and I had this idea that the song was about a photograph of them together, which is now what the scene is. And then we wrote a new piece of music, because each time we changed our minds, Arcade Fire would have to write a new song that was about dark matter or an objective view of reality or, ultimately, this much more emotional piece of music about a photograph of their life together. Boiling it down to its most simple form was the breakthrough.