Ten years ago, up-and-coming comedian Kumail Nanjiani and therapist Emily V. Gordon were falling in love. Then Emily fell into a coma.

Don’t worry: She came out of it, and many things have happened since then. Kumail landed a starring role in the hit HBO comedy Silicon Valley, Emily became a published author and screenwriter, and the couple have shared several projects, like a weekly stand-up showcase-turned TV show and a podcast. Now, they’ve turned their own love story into a feature film, The Big Sick—which, besides being a hilarious romantic comedy, packs insights about race, religion and family into its punch.

Nanjiani stars as a version of himself (a Pakistani-American aspiring comedian with traditional Muslim parents), opposite Zoe Kazan as Emily and a brilliant cast that includes Holly Hunter, Ray Romano and alt-comedy favorites like Bo Burnham, Aidy Bryant and Kurt Braunohler. They enlisted Michael Showalter (coming off his 2015 feature Hello, My Name is Doris) as director—and joined the ranks of Amy Schumer, Pete Holmes and Lena Dunham (to name a few) as writers whose idiosyncratic voices Judd Apatow has brought to the screen.

“It was a very open process,” says Apatow, who produced The Big Sick. “Kumail and Emily were very flexible and crazy hard-working. Without a lot of courage, you can’t really make a movie like this—going deep and thinking about your feelings, about how you relate to the story and to your significant other and to your parents.”

After rave reviews at Sundance this January, The Big Sick was picked up by Amazon Studios (after a competitive bidding session involving Paramount, Fox Searchlight and Universal) for approximately $12 million—one of the biggest deals in the festival’s history. Not bad for a first-time feature screenplay. Even sweeter, perhaps: the fact that the film’s release this summer marks the couple’s 10th anniversary.

Andy Young, MovieMaker Magazine (MM): In the film, Kumail has a Shaun of the Dead poster in his room. That movie seems like an influence, since The Big Sick is also an unconventional rom-com. What were some other influences?

Kumail Nanjiani (KN): Shaun of the Dead truly is one of our favorite movies, and because we are friends with Edgar Wright, we knew we could clear it easily. The movie I’ve seen more than any other is Four Weddings and a Funeral. We watched it the day we got married. I was a big rom-com fan at the height of rom-coms, in the ’90s, so I’ve seen way more that you’d think I’ve seen.

Emily Gordon (EG): Boomerang, weirdly, was a very big influence for me, because the males and females are treated with equal respect in that movie, Halle Berry’s character specifically. And 50/50, a movie that has medical stuff in it but can still treat it with kind of a light hand. I think that’s a tough needle to thread.

KN: We watched other movies that balanced comedy and drama really well: Tootise, Kramer vs. Kramer, Broadcast News, a lot of movies that are super funny but also feel real. And we listened to a lot of commentaries to all those movies. Tootise was really helpful because on the commentary Sydney Pollack keeps going, “This is a comedy, this is a comedy, so now look—something really emotional happens, then we do a joke, something really emotional happens, then we do a joke.” So we really followed that blueprint in our movie. Whenever something really heavy happens, we try and do a joke, because the jokes buy you the freedom to go more emotional.

Nanjiani, DP Brian Burgoyne and director Michael Showalter on set. Photograph by Nicole Rivelli

MM: This was the first time either of you had written a feature, let alone written one together. Were there any misconceptions you had about writing feature films?

KN: I feel that one lesson I learned was there’s really no right way to do it.

EG: In that there are 18,000 right ways to do it.

KN: Yeah, exactly. I always felt that everything had to be resolved and characters had to behave in certain ways, but what we learned from Judd was that it just had to feel real. So you don’t have to have anybody really figure anything out in this movie; you just have to have people—

EG: Ask questions.

KN: Yeah, and people’s reactions have to feel real. So in a way, writing this made me think that writing movies is not as hard as some people make it out to be! Not that it’s easy, but the barometer of “is this real or not?” is really more important than anything else.

EG: I think that’s more of a feature of modern movies, too. There might be a thousand steps [toward a complete resolution], but if you show that the first two steps have been taken, that’s enough for the viewer to be satisfied. It also feels more realistic and feels more like how life really is.

KN: We wanted our ending to feel like a beginning. We didn’t want everything to be done. A lot of people were like, “Why doesn’t it have you and your parents making up?” When we tested the movie, people commented, “I just wanted the final scene to go on longer.” But my favorite three endings of all time are: Monsters, Inc., when we see Sulley opening the door, and Boo goes, “Kitty!” and he smiles, and that’s it. Our movie ends on a smile, too.

EG: But our characters are not monsters. [laughs]

KN: My second favorite, Kramer vs. Kramer, is where they’ve had these vicious fights and at the end Joanna’s going up to see the kid and she’s like, “How do I look,” and Ted goes, “You look lovely.” That’s a great ending because that’s the start of them figuring out how to be friends together. And the third ending I really love is Before Sunset, where Celine is dancing and she goes, “I think you’re going to miss that plane,” and Jesse goes, “I know.” I’m getting emotional talking about it! We wanted our ending to feel sort of like that.

MM: Talk about writing together, because you’re both very busy people juggling other projects. What was your regular writing schedule like?

EG: Our schedules change all the time, but most of the writing we fit in on the weekends. That’s also where it’s helpful to be married because we would just pick a time on the weekend or whenever we had free time. We wouldn’t even write together in the same room initially; later on we did, but it was just, “You take this scene, I’ll take this scene,” and then we traded back. And then, toward the end, one would dictate and the other would write. That actually worked out quite well.

KN: It was like, these were the scenes I wanted to do the first draft of, these were the scenes she wanted to do the first draft of. Generally, the scenes of me and my family I did the first draft of.

EG: I usually took Emily’s family.

KN: We would sort of split it up like that and then swap. And then toward the end we wrote between seasons of Silicon Valley. When I’m doing Silicon Valley, that’s my whole life, 5 a.m. to 7 p.m. every day. There’s no room for anything else. But we had a month off around Christmas in 2015 when we did all the auditions and got the script ready to get money for it, and then when we got Ray and Holly in February—I finished shooting February…

EG: We also shot a season of [their Comedy Central series] Meltdown! We shot the movie, came home, had a week and a half off, and then we shot the TV show a week and a half later.

KN: During the last couple of writing sessions, it was me, Emily, Mike Showalter and producer Barry [Mendel] in a room with the script up on a screen, going through line by line, like, “Can we beat this joke?” We just went through, rewriting, rewriting, rewriting, every single day right up until shooting, and then rewriting as we shot, too.

In The Big Sick, actor-comedian Kumail Nanjiani plays, essentially, himself, falling in love with Emily, his eventual wife (played by Zoe Kazan). Photograph by Sarah Shatz

MM: Since this is based on your true story, did either of you have any difficulty adding fiction to the facts?

 EG: At first it maybe felt a little uncomfortable—like, “This is our story, but no, that didn’t happen.” But we let go of that quickly. Judd was really great about that. He was like, “It needs to go from your story to a story. And you have to heighten things, you have to turn things up.” Then it didn’t feel like our own thing that we needed to guard. And Judd’s really good about things like, “OK, you have this character, Kumail, and you have his girlfriend’s parents, and who would be the worst people he could possibly be paired with? Now crank it up more…”

KN: Judd said, “I want Holly Hunter to play Emily’s mother.” He was like, “The pairing of [Kumail] with Holly Hunter would be so great, because you’d be terrified of her!”

EG: She represents an even stronger version of Emily, who’s already this headstrong creature. We wanted Holly to feel a bit like Emily’s still around even when she’s in the coma.

MM: Your name in the film is Kumail Nanjiani, but Emily’s last name changes.

KN: I should have changed my name too! I really fucked up. We shot the hospital scenes first and they gave me my badge and I put it on and I was like, “Oh my god, it says ‘Kumail Nanjiani’ on it,” but it was too late to change it. So we were locked in, and I was like, “Fuck, I guess this is it.” It’s one of those things. There’s so much to do; I have to prepare these scenes, I have to learn these scenes, I have to act them, I have to rewrite, all this stuff. That’s a little detail that you forget until you’re there shooting.

EG: This is why ladies are better, because we are always thinking of those details.