Three years after Puerto Rico nearly defaulted on a $2 billion payment to creditors, the island’s federal overseers have reached the final stages of a plan to restructure the territory’s $124 billion in debt. 

The plan is required under the Puerto Rico Oversight, Management and Economic Stability Act (PROMESA), which the United States Congress passed in June 2016. It provided the commonwealth with relief from its then-$72 billion in debt and created a seven-member control board to oversee creditor and court negotiations with the goal of reducing the debt.

Three years later, there is a workable plan created against the backdrop of recovering from 2017’s Hurricane Maria. According to The New York Times:

At the center of it all are two intertwined issues. The oversight board wants to cut back the amount paid to some of those who hold the territory’s debt while also giving an unexpectedly good deal to more than 300,000 workers and retirees, some of whom do not even have Social Security. The good deal for the pension holders means a worse one for the holders of Puerto Rico’s debt.

“You can make social and political decisions,” said James E. Spiotto, a longtime municipal bankruptcy lawyer who is not involved in Puerto Rico’s legal proceedings. “But it’s best to have them wrapped up in a settlement that everybody agrees to.”

The plan reportedly includes Puerto Rico declaring $9 billion of its debt unconstitutional. It would also pay full pensions to 61 percent of retirees, with the remaining ones being paid on a sliding scale (though most would receive 91.5 percent of payments). Current employees would be shifted into individual retirement accounts, reports The Times. Bondholders, however, would receive a maximum of 64 cents on the dollar, with some getting as low as 9 cents on the dollar.

Financial experts say that fiscally-challenged states (including Illinois, New Jersey and Kentucky) could see the island as a test case for their own financial future. “If this works—if PROMESA works and the restructuring works—it may make bankruptcy for states seem like something that lawmakers should be considering a little more seriously,” David A. Skeel Jr., a University of Pennsylvania law professor, told The Times. “But if it doesn’t work, it would have the opposite effect.”

The plan will soon be formally presented in the United States District Court for the District of Puerto Rico. The New York Times reports that the terms of the deal will likely lead some of the island’s creditors to challenge the plan for violating Puerto Rico’s 1952 Constitution, which gives general-obligation bondholders “first claim” on “all available resources” of the government to ensure repayment.

Even as the island moves toward financial stability, it is experiencing political upheaval. This past weekend, residents demanded the resignation of Governor Ricardo A. Rosselló after Puerto Rico’s Center for Investigative Journalism published 889 pages of damaging messages between him and cabinet members.