The Los Angeles school district will pay $88 million to settle sexual abuse cases at two elementary schools where complaints about the teachers behavior had surfaced long before their arrest.

The Los Angeles Times reports that the settlement with 30 children and their families is the second largest in district history.

The cases at De La Torre Elementary and Telfair Avenue Elementary emerged after sexual misconduct was uncovered at Miramonte Elementary. Altogether, a spate of prosecutions and lawsuits led to large settlements and reforms in the school system.

The cases prompted the district to better document and retain allegations against employees. The district also improved training on recognizing and reporting abuse and set up a special investigations unit.

The De La Torre litigation encompassed 18 children. The Telfair settlement involved 12 minors. The agreement provides an average payout of about $3 million per family.