On July 23, Arizona took 117 minutes to execute a convicted murderer named Joseph Rudolph Wood III. It was not the nation’s first execution to last that long. In September 2009, Romell Broom entered the Ohio death chamber and exited two hours later still breathing—the only inmate in U.S. history to survive a lethal injection. The executioners had scoured his arms, legs, hands, and ankles for veins in which to stick their needles. But they repeatedly missed the vessels with the IVs. After at least 18 failures, Ohio had no choice but to cancel the execution.

In Wood’s execution, the trouble began when the drugs began to flow. Arizona’s executioners first injected Wood with a combination of midazolam and hydromorphone, two drugs they had never used before in an execution. When the first dose failed to stop his heart, the executioners administered a second. And then a third. The execution team injected 15 doses in total before a doctor finally pronounced death. An Arizona Republic reporter witnessing the execution said Wood gasped more than 640 times and that he “gulped like a fish on land.”

Despite their different problems, the attempted execution of Broom and the execution of Wood are connected by more than just their lengths. Had executioners in Ohio been able to insert IVs into Broom’s veins, Wood’s execution might have gone much more smoothly. That’s because the Broom debacle led Ohio to write a “Plan B” for lethal injections, introducing into the death chamber for the first time the untested drugs Arizona would use years later to kill Wood. And emails I obtained from Ohio reveal some of the state's internal debates and concerns about these drugs—including fears that an inmate could “gasp” and “hyperventilate” as he died.

Doctors warned from the beginning that midazolam and hydromorphone could create “a distasteful and disgusting spectacle.” And yet the drugs spread from Ohio across the country, revealing the lengths states will go to in order to carry out death sentences despite constant IV trouble, drug shortages, and problematic executions.

Broom’s survival left Ohio in a panic. While states had been botching executions since they first began to use lethal injection in the 1980s, none had ever failed to kill a prisoner. Ohio’s first step after Broom was actually a concession to lethal-injection critics, who had long argued against the standard three-drug cocktail that chemically paralyzes the prisoners. In future executions, Ohio announced in November 2009, it would use as its main method of execution only a large dose of a single barbiturate—similar to the way veterinarians euthanize family pets.