MONTGOMERY, Ala. (AP) — A federal judge who ruled mental health care in Alabama prisons was “horrendously inadequate” has ordered the state to make multiple changes and gave the state a 2025 deadline to boost the number of correctional officers.

U.S. District Judge Myron Thompson on Monday issued a sometimes scathing 600-page opinion that often focused on the prison system’s lack of progress in meeting an earlier directive to boost staffing.

Thompson set a 2025 deadline for the state to fill all mandatory and essential posts. He also ordered the state to make numerous other changes.

Thompson said at least 27 more prisoners have died by suicide since his initial ruling in 2017.