Hollywood producer Harvey Weinstein was sentenced to 23 years in prison on Wednesday for rape and sexual aggression.

Weinstein, who has been accused of sexual crimes by some women, was found guilty last year of raping a woman in a New York hotel in 2013 and forcing another woman to perform oral sex in his apartment in 2006. On these charges, he faced imprisonment for up to 29 years.

Both women, whose testimony contributed to the conviction, appeared in court on Wednesday.

Weinstein himself, who insists that all sexual contacts were consensual, also made a speech in court, noting that he had fond memories of the accusers. “I will not say that these are not beautiful people. I had a great time with these people. I’m genuinely confused. Men are confused by this topic.”