Doctors are basically wizards at this point.

Welcome to the Glad You Asked series, a shame-free zone where we tackle topics you’re too embarrassed to ask even your BFF about. Don’t worry, we gotchu.

The sky had given way to dusk when Jessie Arbogast had his arm ripped off.

Unbeknownst to the eight-year-old boy’s family, the knee-deep water he waded into at Gulf Islands National Seashore contained a 200-pound bull shark. In a flash, the beast attacked Jessie, taking a chunk out of his thigh and severing his right arm between the shoulder and elbow. Thankfully, Jessie’s uncle bravely dragged the shark ashore and retrieved his nephew’s arm with the help of a park ranger and a volunteer firefighter.

According to the LA Times, Dr. Juliet M. De Campos was the one to get the call. She worked with two other surgeons and a large support staff for 11 hours to reattach the arm.

This medical procedure is a modern marvel that seems nothing short of magic. But in reality, it’s a relatively straightforward process that people have been perfecting for decades.

Officially called replantation, reattaching a limb starts with cutting away any damaged tissue that can’t be saved. This is why cases like Jessie’s are so difficult. A shark bite is hardly a clean cut, which means surgeons must spend precious time trimming away bits of flesh before they can even start to think about saving the limb.

After that, bones are shaved back while wires and pins are attached. Like a house’s frame, the human bones are the structure the rest of the body forms around. Therefore, it’s important to ensure the surgeon has something solid to build off of.

Finally, doctors painstakingly reattach every single vein, artery, muscle and tendon that they’re able to. Of course, this is no small task. According to a report from the Federal University of São Paulo, the basilic vein ranges in width from 2.6 mm to 3.6 mm. Considering that this tiny vein is still the largest blood vessel in the arm, it’s easy to see why this surgery requires so much precision. One small mistake here can result in poor blood flow, thereby dooming the reattached limb.

Boston Globe

The American Society for Surgery of the Hand points out that this is just the beginning. Patients often need grafts to fill in the blanks for tissue that’s too damaged to be repaired. These grafts sometimes come from the victim but often need to come from a tissue bank.

After that, patients begin their long journey to recovery. These people can’t smoke because it restricts blood flow, and they also must recognize that cold weather is going to make the process painful. Rehab consists of bracing the limb and moving it around to ensure it doesn’t tighten up.

After all of that, there are some pretty significant risks involved. The US National Library of Medicine states that patients might experience decreased nerve function and stiffness of the limb. The entire appendage also has the chance of completely dying.

Despite the fact that this procedure sounds like something straight out of a sci-fi movie, replantation has been around for more than 50 years. Dr. Ronald Malt was the first person to perform the surgery in 1962. He saved the arm of a boy who had lost it during a train accident. Surgeons have been building off of his work and the work of visionaries like him ever since.

While advances in technology are getting us closer to the day where amputees can rely on robotic arms, replantation is still the preferred treatment for most patients. We can look forward to miracle stories like Jessie’s for years to come.