If you’re a Harry Potter fan, you’ve no doubt received a box of Bertie Bott’s Every Flavour Beans in your Easter basket at least once. As its name suggests, there are beans of many flavors in the boxes—and not just nice ones. In addition to beans that taste like banana, lemon, and blueberry, there are also black pepper, earwax, booger, earthworm, and vomit jelly beans. Ditto for the company’s BeanBoozled line, which features lookalike jelly beans in flavors like buttered popcorn and rotten egg, licorice and skunk spray, peach and barf, and chocolate pudding and canned dog food. (Part of the fun of taking the BeanBoozled Challenge is finding out which one you’ve gotten!)

Having tasted the vomit jelly bean myself, I can tell you it does, in fact, taste like puke. (I had to spit it out.) “We’re nothing if not committed to making flavors as true to life as possible,” Jelly Belly spokesperson Jana Sanders Perry tells mental_floss, “and that includes the wacky flavors, too.” Still, no one at Jelly Belly is eating canned dog food or vomit to make these beans, or putting that stuff in the beans themselves—and yet, they taste just like what they’re named after. So how is it done?

Smells play a huge part in how we taste, so Jelly Belly’s first step in creating a jelly bean involves analyzing the real thing in a gas chromatograph. The machine converts the target object into vapors in an oven (either after dissolving it in a solvent and then boiling it or simply by heating it), and then analyzes the chemical makeup of those vapors and converts them to flavor markers, which is what Jelly Belly’s team uses as a starting point for its beans. “This is how many of our flavors are analyzed and created, particularly those found in the BeanBoozled and Bertie Bott’s Every Flavour Beans lines,” Perry says.

For example, when the company decided to add a new bean called Stinky Socks to its BeanBoozled line, “our flavor scientist aged his own socks in a sealed plastic bag for a couple of weeks,” Perry says. The scientist then took the socks and put them in the gas chromatograph, which generated a report of the socks’ flavor makeup; the bean’s flavor was created using that data. “In the early tests of what became Stinky Socks flavor, the scent permeated everything the scientist wore, even though she was making a very small batch,” Perry says. “Usually you can do some laundry and take a shower and all is well, but [her] leather boots took on the scent and would not let it go. It’s the only time I’ve heard of one of the flavors causing such extreme ruin.” The company’s flavor scientists refined the flavor so it’s less potent.

Once a new jelly bean flavor is created, it goes through taste testing trials to get the flavor just right, and adjustments are made based on that feedback. Occasionally, that input comes from the company’s owners. “A few of them grew up on farms with chickens and have had run-ins with rotten eggs,” Perry says. “When we created the Rotten Egg flavor, it passed through the usual channels for taste testing, and when it got to our Chairman of the Board, Herm Rowland, and his daughter, now-President & CEO Lisa Rowland Brasher, they both had the same feedback: Needs even more rotten egg flavor. Both have strong memories of the smell of a rotten egg [after it] exploded in their hands.”

But sometimes flavors are created in a more roundabout way; it’s not always about putting something like puke in the gas chromatograph. “The Vomit in the Bertie Bott’s and Barf in BeanBoozled lines were born from the humble attempt to make a pizza-flavored jelly bean,” Perry says. “Attempt after attempt was rejected by our taste testers because the cheese flavor of the pizza was not palatable.”

The company shelved the flavor, but when it was time to make a vomit jelly bean, one team member brought up the failed pizza flavor. “We made a few adjustments,” Perry says, “and the rest is history.”

This article originally appeared in 2015.