Under California Penal Code Section 286(e), sex between prisoners in state prisons is illegal. Yet as with many laws, reality strays far from original intent.

Enter the “Prisoner Protections for Family and Community Health Act.” Signed into law by Governor Jerry Brown earlier this year, the law makes condoms available for free in all of California’s prisons. The intent of the law is to help prevent sexually transmitted diseases.

San Francisco served as the model for the legislation, as the City by the Bay first started providing condoms to inmates in the 1980s. According to representatives from the county’s Public Health Department, dozens of condom machines now serve the inmates of the jails.

Given the statistic that one in seven people living with HIV finds themselves in prison facilities each year, the law hopes to curb the number of diseases spread among inmates.

Read the full story at KQED.