The finale of USA's limited series The Sinner ended with the biggest twist of the season — a happy ending. After seven weeks of gloom and misery, the clouds parted and Cora Tannetti (Jessica Biel) got a reduced sentence and closure on what happened to her.

The questions left hanging in the penultimate episode were answered. Cora's mother came to visit her in jail for the first time, and she was just as awful as she'd been for Cora's entire life. She told Cora that she didn't report that her daughters were missing because she thought they'd run away. Cora told her that she didn't regret that night, because that night was the happiest Phoebe ever was because she fell in love with Frankie Belmont (Eric Todd). "I'm more free now than I ever was with you," Cora told her. She was sentenced to 30 years the next day.

The body in the woods was Phoebe's (Nadia Alexander). Maddie changed her name and was living a quiet, normal life as the mother of a young child, having finally left town that very night J.D. told her to get lost. J.D. (Jacob Pitts) was killed by some guys who worked for him in his opioid ring who got spooked that he was talking to police. He got access to those opioids by blackmailing Frankie's father, Dr. Patrick Belmont (Christopher Innvar), over his role in covering up Phoebe's death and imprisoning Cora.

Jessica Biel, <em>The Sinner</em>Jessica Biel, The Sinner

That's right; Det. Ambrose (Bill Pullman) put it together that Dr. Belmont was the one holding Cora. He pulled some strings again and took her to the Belmonts' house and she pulled away some peeling paint in a bedroom to reveal that distinctive wallpaper. And then she remembered: Frankie called his dad, who came to the Beverwyck to clean up the situation for his son. He and J.D. buried Phoebe in the woods, and then, unable to kill Cora, he took her home and cared for her until she was well enough to be released into the wilds of Poughkeepsie. He drugged her so much that she didn't remember what had happened to her, and he was so nervous when injecting her that he left the huge scars on her arms. He was the one in the ski mask.

But Cora didn't seem to have very hard feelings for him. "I know you did it for your son," she told him, perhaps thinking of her own son, who was doing pretty well, all things considered. He apologized.

In the car back to the prison, Ambrose finally articulated what made him help Cora. The first time he interviewed her, the way she blamed herself reminded him of how he blames himself. He saw in her a kid who was abused the same way he was. He doesn't know how to help himself, but he could help her.

Here's Why Jessica Biel Murdered That Guy on The Sinner

Cora was granted another hearing, and after learning about what Cora went through, the judge reduced the conviction from murder to manslaughter on the grounds that Cora acted under the influence of extreme mental disturbance. Cora's prison sentence was commuted to commitment to a psychiatric facility. She would be evaluated in two years, and if she was found to not be a danger to herself or others, she would be released and could resume her life with Mason (Christopher Abbott) and their son.

"You look happy, maybe," Ambrose told her, and since she was handcuffed and couldn't hug him, she put her head against his chest. He hugged her. Then he went out to his car and looked at his bloody, blistered, S&M-ed fingernails.

It was a farfetched, overly neat ending with a lot of "hmm, I don't buy that" moments — the Belmonts painted over the wallpaper? Who does that? And Phoebe was in love with Frankie after knowing him for like an hour? It was an ending that, like the rest of the show, was sort of good but not all the way there. The Sinner took itself more seriously than the audience did. But the finale contained some of Jessica Biel's best acting in the series and from what I've heard it stayed true to what happened in the book. And a happy ending was a genuinely surprising final twist in a show chockfull of them.