Once upon a time, when he was but a mere solicitor general for the state of Texas, Ted Cruz helped write a 76-page legal brief defending the Lone Star State’s ban on the sale of sex toys. While his argument was ultimately shot down by an appellate court, the brief resurfaced Wednesday, confronting Americans with an unfortunate juxtaposition of mental images.

Mother Jones got its hands on the 2007 brief for the case, in which Cruz was tasked with defending a state law banning the sale and advertisement of sex toys—or “obscene devices,” as he called them—an offense then punishable by up to two years in jail.

In its brief to the U.S. Fifth Circuit Court of Appeals, Cruz and his team argued that the plaintiffs challenging the law, a group of online retailers and Austin stores that sold sex toys, were not protected under the 14th Amendment’s right to privacy. In fact, he continued, banning obscene devices was in the public interest, and the government should be granted “police powers” for the purposes of “discouraging prurient interests in sexual gratification, combating the commercial sale of sex, and protecting minors.” Furthermore, using “obscene devices,” the state argued, was akin to “hiring a willing prostitute or engaging in consensual bigamy.”

Video: Ted Cruz’s Ten Most Infamous Moments

Cruz observed that the law itself did not prevent people from using dildos or artificial vaginas in the privacy of their own homes, but unlike Lawrence v. Texas, the landmark Supreme Court case striking down laws prohibiting certain types of consensual sex, “there is no substantive-due-process right to stimulate one’s genitals for non-medical purposes unrelated to procreation or outside of an interpersonal relationship.” (It is unclear who penned that exact turn of phrase, but one could easily imagine Ted Cruz saying those words to a black-robed judge.)

Sadly for Cruz, and thankfully for the world, his argument was struck down and the law overturned. “The case is not about public sex. It is not about controlling commerce in sex. It is about controlling what people do in the privacy of their own homes because the State is morally opposed to a certain type of consensual private intimate conduct,” the court ruled in a 2-1 decision.

Another state attorney might have given up at this point—but not Cruz, who attempted to have the case heard by the full circuit court, Mother Jones reports. When the appeal was rejected, his legal team briefly considered taking the matter to the Supreme Court. He never submitted the case, however, and thus deprived—or saved—the world from the existence of audio wherein Ted Cruz respectfully explains the vices of autoeroticism to Ruth Bader Ginsburg.

Cruz’s former roommate at Princeton, Craig Mazin, who is no fan of the Texas senator, was as surprised as anyone that Cruz had once fought the right to masturbate. “I was his college roommate. This would be a new belief of his,” he tweeted Wednesday.