The universe has five states of matter: solid, liquid, gas, plasma, and soft-serve ice cream. The latter, of course, is between a solid and a liquid: It neither spreads to fill its container nor completely retains its shape. Scientists continue to study this fascinating, mysterious state of matter—particularly when they can duck out early on hot Friday afternoons.

OK, soft-serve isn’t really a state of matter. It’s a suspension: tiny solid bits floating in a sea of liquid. Really good soft-serve is also interlaced with minute pockets of gas that add to its delightful texture. (Thankfully, there’s no plasma.) And while fluid dynamicists do have laboratories devoted to suspensions, researching the perfect ice cream is open to anyone—including you, if you follow along with our friends from ChefSteps in the video above.

Freezing something usually takes time, so you typically have to plan in advance if you want soft-serve. Inside a zero-degree freezer, it takes a while for the ambient temperature to work its way through the mixture. But there’s a better alternative, and it’s not the liquid nitrogen variety that you might’ve made in science class. True, it’s much faster to freeze ice cream with liquid nitrogen than the conventional way, but it tends not to be very malleable. The liquid nitrogen is just too cold, and the ice cream is just too hard.

Generations of soft-serve fans have lamented being limited to these two options, but no longer. Enter: dry ice.

Dry ice is frozen carbon dioxide, and it’s far colder than regular water ice (its temperature tops out at -109 degrees Fahrenheit, so it needs to be handled with care). When mixed with the soft-serve ingredients, dry ice is cold enough to freeze everything that needs to be frozen almost immediately, but it’s not so cold that it freezes everything else, too. It’s right in the sweet spot. Score one for dry ice.

Its second advantage is that dry ice sublimates, going straight from a solid to a gas. (The bad guys on Scooby Doo once used dry ice blocks to make smoke.) Students are usually taught that the state of matter depends on temperature—heated solids melt, heated liquids boil—but that’s only part of the story. Something’s state also depends on the pressure it’s under, which is why water boils at a degree or so cooler in Denver than in Death Valley: There’s less air pressure in Denver than below sea level.

The pressure on Earth’s surface is never high enough to keep carbon dioxide a liquid, no matter what temperature it is. It can only be a solid or a gas. So while you could keep the ice cream cold by mixing ice in there instead of putting it in the freezer, that ice will melt and wreck your dessert. Instead, dry ice chills the ice cream once it’s mixed in, then turns right into a gas. This creates lots of tiny air holes, producing a wonderfully fluffy treat for you and your friends.

It’s the best of both worlds. Enjoy!