Life wasn’t going too swimmingly for Philip the duck, who lost both of his feet to frostbite. However, thanks to a 3D printer and a thoughtful teacher in Wisconsin, Philip has a brand-new set of webbed prosthetics—and a second chance at life, the Associated Press reports.

Vicki Rabe-Harrison, an animal lover from Wisconsin, adopted Philip after seeing a picture of the bird “with his feet all curled up and dried because they had frozen,” she told WBAY News in Wisconsin. However, she wasn’t sure if he could survive on his own.

Rabe-Harrison considered putting Philip down. But when she heard that Jason Jischke, a teacher at Oshkosh’s South Park Middle School, owned a brand-new 3D printer, she reached out to see if he could use the technology to make Philip a set of new feet.

“We literally were an hour away from putting him down, when I got the call from Jason,” Rabe-Harrison says. Jischke had received her email; his class was working on a prototype for a set of webbed prosthetics.

It took six weeks to create the perfect pair of feet for Philip. They’re fashioned from a flexible material called Ninja Flex, and they took about 36 hours to print. Phillip was reportedly a tad wobbly when he tried them on, but the lucky duck is now able to live with other birds and animals in an animal sanctuary north of Milwaukee.

Check out above video of Philip and his new 3D-printed feet, courtesy of ABC News.

[h/t Associated Press]