Denise, Dev’s confident, gay, cooler-than-thou childhood friend (and our favorite character) on Master of None, almost didn’t exist. Before she was played by actress Lena Waithe, the character of Denise was initially written as a straight white friend and possible future love interest for Aziz Ansari’s Dev. (After Ansari and his show’s cocreator, Alan Yang, first met with Waithe, the two decided to scrap that initial character entirely in favor of a character based on her.) In the second season of Master of None, which premiered last week, Waithe’s life once again helped shape the show. “Thanksgiving,” a standout episode directed by Melina Matsoukas (who is perhaps most famous for her Grammy-winning direction of music videos like Rihanna’s “We Found Love” and Beyoncé’s “Formation”), shows Denise’s origin story throughout a series of holiday dinners, as she matures from a young tomboy to a college student who comes out to her mother at a diner, and her subsequent string of girlfriends. Matsoukas felt it was about time that the subject matter was handled authentically. “We hadn’t seen that experience before,” the director said during a phone call late last week. “I have a lot of friends who have had this experience or a similar one, but I was disappointed that we hadn’t seen that represented on TV or even film.”

The episode was Waithe’s first time writing for the Netflix show, and was largely based on her own experience coming out to her family. “For my mom, when I came out, it was more about what the neighbors were going to think. So I really wanted to get that across, because the truth is, in my case, it was more about the embarrassment factor; more about ‘What did I do [as a parent]? And what are the neighbors going to think?’” said Waithe. “And then there’s that emotional thing, where life is already difficult for us as black people, the fact that you want to add another layer to that was very scary to her.” Below, a conversation with Waithe about the highly personal project.

How did this episode come about?It’s really a special baby that we all helped birth. It came about because I went to New York to visit the writers. We usually talk about what’s going on in our lives to see if there’s something we can pull from it. I had been taking diligent notes throughout the year about things going on with my girlfriend, things that were happening to me. So I walked into the room equipped, but then I think it was Alan [Yang] who asked: “Hey, how did you come out?” And so I started talking about that. When I left the room to go back to my hotel, I wasn’t even back there when Aziz called me and said we had to do an episode on that. That’s what we have to do. He thought that story was so interesting; he hadn’t seen or heard it before.

How true was the episode to your own coming-out experience?I grew up in a house full of black women; I only really came out to my mom. I wasn’t close to my dad; I never came out to my aunt or my grandmother, for reasons that you’ll see in the episode. Most people who come out have to come out to their whole family, and that just wasn’t my scenario. In real life, I have an older sister whom I came out to first. My sister was super-chill; the hardest conversation was my mom.