ORLANDO (AP) — Female workers who say they were sexually harassed by prisoners at a massive federal prison complex in central Florida have reached a settlement with the Federal Bureau of Prisons that could amount to $20 million.

An administrative judge on Friday signed off on the agreement involving workers at the Coleman Federal Correctional Complex, located northwest of Orlando.

The female workers had alleged in a complaint filed in 2013 that male inmates had groped them, threatened them with sexual violence and masturbated in front of them. The complaint said the prisons bureau was aware of the harassment yet had done little to prevent or minimize it.

Under the terms of the settlement, prison staff will be required to identify inmates who are harassing female workers and those inmates could lose privileges, such as access to television.

Signs will be placed on inmate televisions saying sexual harassment won’t be tolerated, and inmates who repeatedly harass female staffers will be referred to psychology services. Inmate uniforms will be replaced so that they don’t have pockets to minimize sexual behavior and the wardens will hold “town hall” meetings to discuss the prohibition on sexual harassment, according to the settlement’s terms.

The proposed changes are “impressive by any standard, and the parties are to be commended for their willingness to work on such an elaborate plan to make improvements to the Coleman prison system,” wrote Joy Brockman, an administrative judge for the Equal Employment Opportunity Commission, in an order approving the agreement.

The proposals show “intent to make real changes for the better at the Agency,” she wrote.

The female workers who brought the class-action case will be entitled to $20 million, provided there are at least 350 workers who make claims, and the settlement fund will be reduced by $40,000 for each worker that falls short of that number, according to the agreement.

Each worker’s payout will be based on the amount of time worked in Coleman, the harm suffered, the amount and type of harassment suffered and the efforts she made to raise the problems with management, Brockman said in her order.

The payments are intended to compensate the workers for “emotional distress and physical harm as well as reimbursement of out-of-pocket expenses resulting from harassment from male inmates,” the agreement said.