Four months before animation work on Walt Disney Animation Studios’ latest film Moana was set to conclude, Disney Chief Creative Officer John Lasseter sat down to decide the fate of one of the movie’s characters. The character had been in the story since day one, and had survived the many iterations of the story, but the consensus was that he was not working and needed to be removed from the movie.

After slaving away on the film for the past five years, directors Ron Clements and John Musker were not ready to let go of their beloved rooster. Heihei (pronounced hay-hay) was on the chopping block, and by a stroke of luck, the Moana story team had 48 hours to “save the rooster.”

“This is a character that was in the movie from the very beginning and he was in many versions of the story,” explains story artist Sunmee Joh. “But as story changes, Heihei was on the chopping block. And even though the directors really wanted to keep him, they were having a hard time keeping him in the movie.”

The character Heihei was sort of this big macho character with attitude. He was kind of like the watchdog for Moana’s father, the chief, always keeping an eye on the young woman. He was also very judgmental, often being mean to Moana for no real reason. You can probably see why the character may not have worked in this context. You can see what the character was to look like in this image from the animation presentation at last year’s D23 Expo:

Story artist David Derrick says “he was 99.9 percent” sure that the character was going to be cut from the film, but that was before he became sick in March. So while one of the movie’s key story artists was out of commission for two days, one of the directors suggested the story team should use the time to figure out how to make Heihei work in order to save him from being cut out of the movie.

“Everyone was convinced that we don’t need him, but let’s just try,” admits screenwriter Jared Bush. With only 48 hours to save him, the Moana story team was tasked with a mission: “Save this chicken.”

The story team brainstormed and thought of different ways of incorporating the character. One of the ideas came from something they had pitched to John Lasseter, to make Heihei “stand up and spread his wings.” They imagined Heihei in all sorts of ridiculous situations, with the key bit being that he is not aware of his surroundings which lead to totally irrational responses. The character went from smart and ornery to what director Ron Clements says “might be the stupidest character in the history of Disney Animation.” But it wasn’t enough to just make the character dumber. Joh says they “had to think of a way to make him a complication for Moana and really tie it to the story.”

They re-storyboarded a climactic action sequence from the film, which John Musker lovingly refers to as “Disney meets [Mad Max:] Fury Road on the high seas.” Moana is in possession of an artifact called the Heart of Te Fiti, and her boat comes under attack by huge ships carrying hundreds of cute but deadly little creatures called the Kakamora (who wear coconuts with war paint as armor) who are also after the Heart. The story team found a way to have Heihei further complicate the situation by accidentally eating the artifact at the center of this battle. Joh storyboarded the scene, and the result is a funnier and more complex action sequence.

As the Sorcerer’s Hat building was being remodeled on the Disney Studios lot, Disney Animation has been relocated to a warehouse in Tujunga, California (part of Los Angeles) which used to be employed by Walt Disney Imagineering to test out future theme park ride concepts. The story room is known to be one of the coldest rooms in the building, and John Lasseter sat in a chair to the left of a screen ready to be the judge, jury, and executioner.

As they presented the pitch, Lasseter had a skeptical look about him. The Heart of Te Fiti rolls down to Heihei’s feet, and he unknowingly plucks it and swallows it. It was at this point that he stood up from his chair and screamed, declaring:

Yes, Heihei has been saved! He’s in the movie!

The studio celebrated with a fried chicken lunch for everyone involved. You can still find those large squeezable rubber chickens spread around the office from the party.

But a time for celebration meant there was suddenly a lot of work ahead for the modeling department, who at this late hour in production were tasked with completely redesigning Heihei to fit the new pitch. Derrick explains:

They had already gone down the road of building the other character. And the story structure of the film was going so that we didn’t need him. You know, but Ron and John really loved him, the story team really loved him and we wanted to kind of find a place for him. So when they did that change, the modeling department was like, oh no. They changed it?

A change of this magnitude meant that many people would have to spend weeks to incorporate the changes. But Derrick admits that “getting John Lasseter’s blessing to do so is our ticket.”

So we go, ‘John, do you like it?’ If John says ‘yes, okay.’ Sorry, modeling guys.

The change has not only saved a character from the editing room floor, but if the Moana writing team is to be believed, has made the film better. Bush said:

Once Heihei could really be a complication to Moana and make her journey more difficult, it’s great for our main character. So sometimes it’s not for entertainment sake, although it’s hugely entertaining. It actually really helped the Moana story quite a bit.

Bush says that when they test screened the film recently, “Heihei was one of the characters like a scene stealer, a standout character.” Bush adds, “And three months ago, he was not in the movie. So it’s pretty amazing. And it’s all story team saving him.”

Here is a look at Moana‘s dumb, clueless rooster Heihei — the village idiot, who accidentally stows away on Moana’s canoe and lands a front-row seat for her epic journey. Walt Disney Animation Studios’ lucky charm Alan Tudyk provides the voice of Heihei in the final film.