IN A room beneath the smokestacks of the Aguirre steam plant in south-eastern Puerto Rico, an engineer points to a colourful poster entitled “How Electricity Arrives at Your Home”. In normal circumstances, explains Alexis Torres, burning oil turns water to steam, which spins mechanical turbines and sends energy out through power lines that criss-cross the island territory. Hurricane Maria made landfall 30 miles from the Aguirre steam plant. The south-east, where coal and oil plants generate much of the island’s electricity, suffered the worst damage.

A month later, 82% of Puerto Ricans still lack power. The island operates a centralised electricity grid: the plants in the south-east provide power to beach resorts in the north-west and metropolitan San Juan; 80% of the power lines were destroyed by the storm. Restoring them is a finicky process. By October 10th 16% of the island’s power had been restored. Later that day it dropped back down to 8% when a plant partially shut down, leaving the airport, police headquarters and several hospitals in the dark. “I was in the middle of open-heart surgery,” one surgeon said. A back-up generator saved his patient. Thousands of the diesel-fuelled contraptions are powering food refrigeration, water purification and other vital needs. But closed schools and shuttered businesses are the new norm. Tens of thousands of Puerto Ricans have left the island.

Maria’s fury would have battered any grid, but the scope of the damage, the sluggish pace of repairs and the suffering from weeks without power have almost as much to do with mismanagement as they do with wind and rain. Last year Synapse Energy, a consultancy based in Massachusetts, carried out the first-ever audit of the Puerto Rico Electric Power Authority (PREPA) and found that the power lines were “cracking, corroding and collapsing”. The utility had been operating for decades without regulation or oversight. Imprudent spending was accelerating a decade-old debt crisis. “The results are grim,” the authors wrote. “PREPA’s system appears to be running on fumes.”

The story of PREPA is the story of Puerto Rico. The utility, created by a New Deal governor in 1941, powered rapid industrialisation in the 1970s as American pharmaceutical and other firms flocked to the island to take advantage of federal tax benefits. By offering stable, well-paid jobs to electrical workers, PREPA helped create a Puerto Rican middle class, says José Caraballo Cueto, an economist at the University of Puerto Rico. The boom was short-lived. When the federal government peeled back the tax perks in 1996, factories started leaving and PREPA began losing customers.

Declining revenues were exacerbated by political patronage, corruption and inefficiency. Municipalities and government agencies do not pay for electricity in Puerto Rico. Successive governments spent tens of millions of dollars evaluating solar and natural-gas projects in order to wean PREPA off its dependence on oil, but did next to nothing. Less than 3% of the island’s energy came from renewables.

PREPA is responsible for $9bn of Puerto Rico’s $73bn of debt. As PREPA and other agencies borrowed billions of dollars from international creditors (and from each other, a practice some have compared to a Ponzi scheme), the utility started skimping on maintenance. In 2014 an austerity law prompted hundreds of experienced employees to retire and claim their pensions before cuts took effect. They were never replaced. The result, according to Synapse’s report, was generator failures, blackout rates four times higher than other American utilities, rising consumer costs, environmental violations and an increasing numbers of worker injuries and fatalities. A three-day blackout in 2016 caused by a fire at the Aguirre plant foreshadowed the darkness and economic standstill Hurricane Maria would bring. “We took the risk and we are paying the price,” says Mr Torres, peering at his poster. In the aftermath of the hurricane, debate is swirling about how to fix the electrical system and who should pay. “We must rebuild better,” Governor Ricardo Rosselló has said, voicing enthusiasm for a proposal from Elon Musk, founder of Tesla, to deploy solar panels and batteries throughout the island to decrease dependence on the weak grid. This is a fine idea, but also an expensive one. Besides, federal emergency aid—the House of Representatives approved a $36.5bn package on October 12th, though only a fraction will go to Puerto Rico—can typically be used only to reconstruct what existed before the disaster. The reconstruction has begun in an unusual fashion. Puerto Rico has hired a tiny Montana-based contracting company called Whitefish Energy to oversee grid restoration. Normally, states and municipalities contact a “mutual aid network” that can quickly mobilise thousands of repairmen. “But Puerto Rico never said ‘Hey, we need crews’,” says Mike Hyland of the American Public Power Association (APPA), which represents 1,100 utilities. Mr Rosselló originally claimed he could not get in touch with the APPA, and then later explained that he began negotiating with Whitefish before Hurricane Maria. The company had responded to a request for repair work after Hurricane Irma, and it appeared to be Puerto Rico’s cheapest option. José Roman of the Puerto Rican Energy Commission, an independent body created in 2014 to regulate and monitor PREPA, confirmed that no official bidding process took place. “The government was in emergency mode,” he said. “It wasn’t like all the big guys were jumping up and down to go to a bankrupt island,” said Ken Luce, a spokesman hired by Whitefish a week ago. The company, which has two full-time employees, began as a joint-venture in 2015 with a Brazilian company called Comtrafo to build a transformer plant in Montana, a project that has since sputtered out. The Puerto Rican government declined to provide details on the contract, but Mr Luce said that Whitefish demanded only a $2m deposit for supplies and crews. It has 220 men on the island, though it plans to increase these to around 1,000 in order to meet the government’s goal of 95% power restoration by Christmas. Until several days ago, Whitefish’s website consisted of a single page with a photo of a helicopter and the contact information for a spokesman.

Puerto Rico’s ability to get the lights back on—and get them to stay on—may determine the island’s future. People will not wait indefinitely for schools without electricity to reopen if they can afford flights to mainland America. Yarimar Bonilla, a Puerto Rican anthropologist at Rutgers University, asked thousands of residents how they felt about Puerto Rico’s territorial status. They told her that, historically, reliable government services like electricity, water and communications made them feel superior to their non-American neighbours like Dominicans and Cubans. The blackouts made people wonder.