The most poignant moment of Running with Beto, the new documentary about Texas Democrat Beto O’Rourke and his energetic, grassroots campaign for Senate against Ted Cruz, comes at its end. It’s late, the polls have closed, and O’Rourke has officially lost his race by nearly three percentage points—a failure that can also be seen as a significant accomplishment in a state that hasn’t voted Democrat in close to a quarter-century. O’Rourke has delivered his concession speech, consoled loyal staffers and constituents, and returned to his El Paso home with his wife, Amy, and their three children.

He’s making quesadillas.

There is no bitterness, no regret. As O’Rourke sits and ponders the past 18 months—traversing all 254 counties in Texas, raising over $80 million primarily from individual donors giving on average $44 apiece, while vowing to refuse money from political action committees—the former congressman is hopeful that the campaign could yield a movement bigger than himself. “We got to be a part of that, and it was fucking amazing. The most amazing thing in the world,” he says in the film, sitting next to his wife at their kitchen counter. “Maybe we did what we were supposed to do. Maybe that’s all.”

It’s a moment that captures the O’Rourke optimism at its purest. And it almost didn’t happen. Three months before Election Night, Running with Beto director David Modigliani was having trouble maintaining access to his increasingly famous subject. The glare of the spotlight had intensified to an almost unbearable level; the national news media all wanted a piece of the upstart, who was offering a challenge to incumbent Cruz. Modigliani, who had been following O’Rourke since the days when his rallies featured roughly 20 people in foldable lawn chairs, was seeing his direct access turn into a bird’s-eye view.

And so, as Modigliani said during an interview in Austin following his movie’s debut at the SXSW Film Festival, he had to level with O’Rourke: “We have the chance to make something special here, unless this behind-the-scenes film goes to a film that’s outside looking in.” Happily for Modigliani, O’Rourke’s team was receptive to his request. “They allowed me to shoot the debate [opposite Cruz]. They took me into the greenroom. And on Election Night, he invited us in. He had just spoken to 6,000 people, and now he’s making sure the quesadilla is not sticking to the frying pan. He got it in some way that he needed, to allow us to get this last piece of the puzzle. You really see him and Amy processing it together. I will never forget that moment, because we were so worried we weren’t going to get it.”

Modigliani met O’Rourke soon after the Texas representative announced his candidacy for Senate in March 2017, on first base at a sandlot baseball game where Modigliani’s team, the Texas Playboys, was playing O’Rourke’s Los Diablitos de El Paso. During the seventh-inning stretch, the lanky center fielder with a funny name jumped onto a hay bale and began delivering his campaign spiel. “He just brushed his sweaty locks aside and started talking,” said the director. “I thought, ‘Oh, this guy’s amazing.’”

Modigliani, whose filmography includes the 2008 film Crawford—about the small Texas town that became George W. Bush’s home base—soon pitched the candidate on letting him follow O’Rourke with a camera. After meeting O’Rourke’s mother and traveling with the candidate on a brief get-to-know-you tour, Modigliani officially began filming in November 2017, a year before the election.

“It felt, to me, that this wasn’t just going to be a political thing. Beto was part of the zeitgeist,” he said.