“Caregivers at the school did their best to keep him happy, but the duckling was constantly in pain,” said New York Daily News reporter Carol Kuruvilla. Buttercup wound up being adopted by Feathered Angels, where the difficult decision to amputate the duckling’s foot was made.

Sanctuary owner Mike Garey explained that there was no alternative, telling Lexy Gross of The Tennessean that the leg would begin to bleed whenever the duckling walked outside. Had the foot not been amputated, it would have been too painful and prone to infections, and it was unlikely that Buttercup would have survived, Garey told Time’s Doug Aamoth.

However, in addition to being the sanctuary owner, Garey was a trained software engineer who began brainstorming ways to help Buttercup, Kuruvilla said. He contacted NovaCopy, a Nashville-based 3D printing company, and then used the left foot of Buttercup’s sister Minnie to design a plastic model of a replacement foot for the injured duckling — a process which reportedly took 13 hours to complete.

Knowing that the plastic would be too cumbersome, Garey and NovaCopy opted instead to create an appendage made from silicone that slips onto Buttercup’s stump using a stretchy silicone sheath, said Kuruvilla.

The materials needed to create the mold were reportedly received by Feathered Angels on Thursday, the mold was poured on Friday, and the final prosthetic should be completed by Sunday afternoon, Gross said — and it’s certainly worth noting that NovaCopy has agreed to cover the costs of the procedure.