An Idaho judge gave an unconventional, and sure to be controversial, sentence to a convicted rapist this week, letting him avoid jail. Cody Herrera pleaded guilty to raping a 14-year-old girl when he was 17, and Judge Randy Stoker let him off with a one-year program where he’ll stay in a correctional facility and receive education, followed by probation. A condition of the probation is that Herrera not have sex outside of marriage, the Twin Falls Times News reported. He will also not have to register as a sex offender, as part of his plea agreement.

Herrera, now 19, would only be placed on probation if he completes the one-year program successfully, and the no-sex provision came about after he told Judge Stoker that he has had sex with 34 different people. “I have never seen that level of sexual activity by a 19-year-old,” Judge Stoker said at a hearing. “If you’re ever on probation with this court, a condition of that will be you will not have sexual relations with anyone except who you’re married to, if you’re married,” he ordered. This arrangement is a condition of the judge suspending a five to fifteen-year prison sentence.

The girl’s family was not happy with the light sentence. “Cody will never understand what he has done to our family,” her mother said in court. “Cody robbed her of her innocence. He destroyed the child left in her. This can never be returned.”

The condition of Herrera not having sex unless he’s married raises a legal issue. On the one hand, Idaho does have a law prohibiting “fornication,” which is defined in the law as an unmarried person having sex with with another unmarried person of the opposite sex, so there is legal grounds for it.

On the other hand, it could be unconstitutional. Shaakirrah R. Sanders, associate professor at the University of Idaho College of Law, told the Times News, “We seem to have an order infringing on (Herrera’s) right to procreate. A court can’t dictate how he decides to procreate.” There is also the question of how this would even be monitored. “[H]ow would you even enforce this?” Sanders asked. “It seems to be quite intrusive if they can just bust into his bedroom[.]”

If Herrera is found to violate his probation, he could get thrown in jail.

[Image via Twin Falls County Jail]

Have a tip we should know? [email protected]