Thousands of Americans are still without power in part because of the botched hurricane recovery.

Alana Rivera, age 10, does her homework on her apartment balcony, lit by a cell phone, in San Juan, Puerto Rico, in November 2017.

It’s now been seven months since Hurricane Maria shredded Puerto Rico. Thousands Americans on the island still don’t have power, and this year’s hurricane season, expected to be busy, begins in less than a month.

Last year’s Category 4 storm that toppled 80 percent of the island’s power lines and flooded its generators left the island in the longest and largest blackout in US history and the second-largest blackout in the world on record.

While regulators report that more than 98 percent of utility customers have their power back, the remaining 2 percent of customers represents more than 22,000 people that can’t turn on the lights, refrigerate food, or run water pumps. That so many Americans have languished so long without electricity is a national embarrassment.

Yet the federal government is now winding down its role in the recovery and preparing to hand over the reins to Puerto Rico’s power officials. The Federal Emergency Management Agency has set an end date for the US Army Corps of Engineers’ power restoration mission on midnight May 18.

“It’s going to be a challenge,” Walter Higgins, CEO of the Puerto Rico Electric Power Authority, told the Senate Energy and Natural Resources Committee on Tuesday. “I don’t doubt that we will have some growing pains. This is a massive effort, but we are ready to take this task.”

But lawmakers said they were deeply concerned that the mission will end with thousands of Americans still left in darkness.

“I’m having a hard time wrapping my head around this,” said Sen. Martin Heinrich (D-NM). “I cannot imagine a scenario where 20-plus thousand Texans, or 20-plus thousand Floridians, were without power and FEMA would make that decision. I think that’s reprehensible.”

Even with federal supervision, the recovery has been marred by huge setbacks, including an acute blackout in April that affected the entire island and a cyber attack in March.

The botched recovery effort that’s dragged on and on is ultimately a disaster caused by humans, leading to environmental and health crises. The Army Corps has compared the situation to Iraq after the US invasion in 2003.

Even though power outages are common after large storms, several key factors have made the situation in Puerto Rico uniquely dangerous and deadly. And as the blackout drags on, health and sanitation problems linger, giving residents more reasons to abandon the island.

“The longer a recovery lasts the longer it takes to get to pre-storm levels,” said Peter Marsters, a research analyst at the Rhodium Group.

A blackout is a simple problem in a complicated system

When an electrical circuit is open or broken, the power doesn’t flow, whether that’s a flashlight or a phone.

It’s a simple concept, but when it happens in the electricity grid — what engineers say is the largest, most complex machine ever built — it quickly becomes a byzantine problem.

With thousands of miles of transmission lines, gigawatts of generation, computers that route power, frequency regulators, and transformers that all serve the constantly fluctuating needs of millions of people, lots of things can go wrong. Generators can shut down. Transformers can explode. Power demand and supply can fall out of balance.

By far the most common cause of blackouts is damage to power lines, which are the most vulnerable part of the electrical grid to storms.

“In a disruption like this, it’s transmission and distribution,” Marsters said. “Damage does occur to generation assets, but those are point specific and you can get those back online in a reasonable time.”

A car battery connected to an inverter and a generator provide power for a makeshift street party, on a block without grid electricity, on Christmas Eve on December 24, 2017 in Rio Grande, Puerto Rico.

Mario Tama/Getty Images

Debris can fall on the wires, wind can knock down poles, and there’s not much utilities can do to prevent this during a massive storm. Some areas bury electrical infrastructure underground, but it gets expensive over long distances. It costs $174,000 per mile to run transmission lines above ground on average and $1.4 million per mile to bury them, according to a study from the Edison Electric Institute. And buried electrical hardware remains vulnerable to storm surges and flooding.

That’s why most utilities don’t try to make the power system invulnerable but instead focus on getting power back up quickly after a storm. Florida, for example, lined up 20,000 utility workers from across the country well before Hurricane Irma made landfall.

But Puerto Rico’s power grid has been creaky for years. The local government’s crippling debt of more than $73 billion and PREPA’s own obligations of $9 billion made it hard to keep up with critical maintenance like trimming tree branches away from power lines, let alone make upgrades to make the energy network. PREPA has also faced accusations of corruption and nepotism in its management, leading the island’s utility to neglect its responsibilities.

Puerto Ricans are now desperately trying to connect the main power arteries to individual homes, and some have resorted to their own makeshift repairs, mounting their own utility poles and stringing up low-voltage transmission lines.

The local and federal governments botched Puerto Rico’s recovery

José Román, chairman of Puerto Rico Energy Commission, the independent body that regulates Puerto Rico’s energy, said officials should have seen this coming.

He noted that many of the island’s power plants are decrepit, with some more than 40 years old. Almost half of its generators run on imported diesel, making Puerto Rico dependent on fuel shipments. And these power plants are mostly on Puerto Rico’s southern coast, but the main load centers like the capital, San Juan, are in the north. So electricity has to be routed more than 40 miles across the island’s central mountain range, creating a narrow, remote choke point for its energy grid.

As Maria charged in, PREPA decided not to invoke mutual aid agreements with other public utilities the way Florida did for Irma. Instead, Puerto Rico’s government signed agreements with private contractors, with almost half awarded without any bidding.

The $300 million grid repair contract PREPA signed with Whitefish Energy, a tiny company that had only two full-time employees at the time, is a case in point. The company ended up billing the utility above-market rates for expenses, charged nearly double the standard wages for line crews, and used expensive charter flights to bring in supplies.

The contract led to investigations from Congress and the FBI. The head of PREPA, Ricardo Ramos, resigned in the wake of the debacle in November, and the utility is now being privatized.

FEMA also suffered its own contractor troubles in the recovery effort, and the agency waffled on whether or not it would withdraw from Puerto Rico at the end of January.

A sub-contractor rebuilds a power line in northeast Puerto Rico

Congress appropriated a $4.9 billion recovery loan rather than a grant for Puerto Rico in October, but FEMA and the Treasury Department said in January that the territory may not even get that money because the local government still has cash in its coffers.

FEMA has so far approved more than $1.9 billion in public assistance grants and more than $1.1 billion through its Individuals and Households Program.

Puerto Rico Gov. Ricardo Rossello announced in February that he reached a deal with Congress to get $2 billion to repair the island’s energy infrastructure. And a federal judge approved an emergency $300 million loan to PREPA to keep the utility running at the end of March.

But the White House only gave Puerto Rico a 10-day waiver for the Jones Act, a shipping regulation that requires that only US-built ships transport goods between US ports. This law ends up limiting the number of ships that can transport much-needed grid repair supplies to Puerto Rico and drastically raises their costs.

All these factors added up to an agonizingly slow restoration of power, and the tedious process of getting electricity to remote individual homes will still take more time.

“We’re talking about pretty much the last mile, getting to areas that are not easily accessible,” Román said.

Regulators are now looking for alternatives to the conventional power grid, like microgrids, and are hoping that backing them up with renewable solar and wind power would reduce the bottlenecks in the power system and get the lights back on more quickly after a future disaster.

Román said that more than 200,000 Puerto Ricans have left the island since Maria and many will not come back, leaving the power utility with fewer customers with which to pay back their investments. Coupled with Puerto Rico’s ongoing financial crisis, that means “difficult decisions” lie ahead in what kind of grid is rebuilt and how much they’ll have to pay for it. And the next big storm may soon come over the horizon.