By 2014, the hardware components of a DIY artificial pancreas—a small insulin pump that attaches via thin disposable tubing to the body and a continuous sensor for glucose, or sugar, that slips just under the skin—were available, but it was impossible to connect the two. That’s where the security flaw came in. The hackers realized they could use it to override old Medtronic pumps with their own algorithm that automatically calculates insulin doses based on real-time glucose data. It closed the feedback loop.

They shared this code online as OpenAPS, and “looping,” as it’s called, began to catch on. Instead of micromanaging their blood sugar, people with diabetes could offload that work to an algorithm. In addition to OpenAPS, another system called Loop is now available. Dozens, then hundreds, and now thousands of people are experimenting with DIY artificial-pancreas systems—none of which the Food and Drug Administration has officially approved. And they’ve had to track down discontinued Medtronic pumps. It can sometimes take months to find one.

Obviously, you can’t just call up Medtronic to order a discontinued pump with a security flaw. “It’s eBay, Craigslist, Facebook. It’s like this underground market for these pumps,” says Aaron Kowalski, a DIY looper and also CEO of JDRF, a nonprofit that funds type 1 diabetes research. This is not exactly how a market for lifesaving medical devices is supposed to work. And yet, this is the only way it can work—for now.

By the time Boss decided to try looping, he had not gotten a good night’s sleep in a decade. Every night, the alarm on his glucose monitor would go off when his blood sugar dipped too low or climbed too high. He’d wake up, do math with a sleep-fogged brain, and either eat a snack or give himself extra insulin. Like many patients with type 1 diabetes, he was sacrificing sleep to stay alive.

OpenAPS changed that. To start looping with OpenAPS, Boss did also need to buy a mini computer called an Edison. The Edison receives data wirelessly from his continuous glucose monitor, runs an algorithm to predict future blood sugar, and tells the insulin pump how much to dispense every five minutes to prevent highs and lows. Boss could choose to monitor everything through his phone. But at night, he simply slept. “The sheer idea that I have a chance to sleep through the night ... ” he marveled to me. So many other loopers I spoke with echoed the sentiment. Jeremy Pettus, another looper, used to keep apple juice by his bed to guard against perilously low blood sugar. “One day my wife was like, ‘We haven’t bought you apple juice in a long time,’” he says. “That burden of having a dangerous low in the middle of my night completely disappeared.”

The looping algorithm makes these corrections throughout the day too. Laura Nally, another looper, described to me how she had always planned out her life hours in advance: Would she be walking a lot at work that day? Eating a meal in a couple hours? Taking a hot shower that could affect insulin absorption? “You’re always thinking, ‘What is the next thing I’m going to be doing?’” she says. With Loop, she still uses an app on her phone to tell the algorithm when she’s eating. (Same with OpenAPS, which is why both systems are technically “hybrid” closed systems rather than fully closed.) But if she is off by a few grams of carbohydrates or walks a little bit more than she expects, Loop can easily make real-time corrections. “Every decision we make, we’re trying to hit a bull’s-eye. With Loop, all I’m trying to do is get the dart on the board,” explains Erik Douds, who also uses Loop to manage his type 1 diabetes.

Loop and OpenAPS users tend to be a pretty self-selecting bunch, as the systems require buying your own equipment out of pocket and following detailed setup instructions. They also come with a bit of a learning curve. But according to one small study and many, many anecdotes, looping is, when done properly, both safe and better than a human brain at managing blood sugar. As the good word about looping has spread, demand for the few compatible models of Medtronic pumps has swelled.