The Long Beach Unified School District and the union the represents teachers ratified an agreement for the coming school year that allows most instructors to choose where they teach—and avoids the prospect of a strike.

The memorandum of understanding came after hours-long negotiations on Monday that “puts us in a good place for collaboration,” Superintendent Jill Baker said at Wednesday’s Board of Education meeting. “Those were long days and nights, and weekends.”

The formal labor agreement between the two sides guarantees there won’t be a strike this school year.

In order for teachers to teach from home, they’ll have to sign an “alternate work location agreement” that requires them to meet a variety of requirements related to technological setup and professional dress.

But while the teachers won the argument on workplace flexibility, they didn’t get everything they were hoping for. Preschool educators and some special education teachers will still need to teach from campus, as some of their students are attending class in person.

TALB President Christine Kelly said at Wednesday’s board meeting that signing the MOU was “gut-wrenching” because not all teachers will be able to remain remote.

Another member of the TALB executive board, Susan Garcia, echoed Kelly’s sentiment.

“Last night I was faced with a difficult decision, to sign a flawed MOU,” she said. “Unfortunately some of our members felt that we threw them under the bus. As a union, we believe that an injury to one is an injury to all.”

Classes are set to start at most LBUSD schools on Sept. 1, and will be conducted virtually until at least Oct. 5.