This fuzzy caterpillar is sporting some gruesome headgear—a tower of its own discarded heads! This bug is the larva, or immature form, of the gum-leaf skeletoniser (Uraba lugens), a moth found in Australia and New Zealand. Given its odd choice of accessories, it more commonly goes by the nickname “the mad hatterpillar,” after the character of the Mad Hatter from Lewis Carroll’s book Alice’s Adventures in Wonderland.

Like all insects, the hatterpillar’s body is covered by an exoskeleton. As the caterpillar grows, it molts, or sheds, this tough outer layer. Each time this happens, the old exoskeleton that covered its head gets pushed up, creating a pile of heads, each one bigger than the last. The stack can reach up to 1.2 centimeters (0.5 inches) tall—almost half the caterpillar’s body length. “The most we’ve seen were five or six heads on the top,” says Alan Henderson, an insect expert and photographer with the company Minibeast Wildlife in Australia.

Henderson says U. lugens’s stack of heads may provide a defense against animals looking to snack on the caterpillars. Besides having venomous spines to ward off predators, a hatterpillar can also swat away attackers with its headpiece. This tactic might buy the insect just enough time to escape. The caterpillar grows until it undergoes metamorphosis, transforming into an adult moth. The moth’s inconspicuous brown coloring allows it to camouflage itself against the bark of trees to avoid being eaten. Adult moths don’t molt like caterpillars do, which unfortunately means no more outlandish top hats made out of body parts.