Puerto Rico is at the edge of a cliff — and it’s up to the U.S. Senate to stop it from toppling over.

The legislation under consideration isn’t perfect, and it won’t solve all of Puerto Rico’s problems, but it is a necessary starting point.

There isn’t much time. On Friday, Puerto Rico will have $2 billion in debt payments due. The island territory can’t pay. If the federal government does nothing, Puerto Rico will default and then its creditors are likely to sue. Repayment of many of the island’s bonds are constitutionally guaranteed; creditors may need to be paid first, leaving public services unfunded. That would be devastating to the island.

Puerto Rico’s financial troubles have been building ever since key tax breaks expired in 2006, and companies and jobs began to leave. The island never recovered from the 2008 recession and, as people left, and tax revenue fell, reckless leaders borrowed and spent. The island’s debt has surpassed a stunning $70 billion.

The Senate should approve proposed legislation — already passed by the House of Representatives — that would allow Puerto Rico to restructure its debt, while providing a financial control board and strict oversight provisions. The proposal also would exempt Puerto Rico from the nation’s new overtime rules and allow officials there to temporarily reduce the minimum wage for some workers. Those pieces have angered some Senate Democrats, and even Treasury Secretary Jack Lew, who supports the overall bill, has criticized those provisions. But this is an immediate crisis. A scenario without legislation could have a far more horrifying impact on Puerto Ricans. Hospitals and schools could shutter, police could disappear from the streets, public transit could grind to a halt. Waiting is not an option.

The legislation avoids a taxpayer-funded bailout and allows Puerto Rico to negotiate with creditors, maintain services and rebuild its financial house. Only then will Puerto Rico be able to do the tough job of governing itself, to try to find a way out of the hole it is in.