Updated

No one likes a super foamy beer. But according to science, it turns out all these extra bubbles actually have a pretty important purpose when it comes to preserving your brew.

Fluid physicists from Princeton and École Normale Superieure de Cachan in France determined that beer “sloshes around” less than water and other liquids because of its foamy head, reports Fusion.

The team of researchers conducted experiments using high-speed cameraa, water, and glycerol to determine that beer foam acts as a “stopper,” helping to prevent beer spillage when in a glass is in motion. When a drink moves—like when a bartender hands you a cocktail—the movement creates tiny waves in the glass. Foam that tops beer clings to the edges of the container, which lessens the micro-waves’ intensity-- and likelihood that some alcohol will spill over the side.

The scientists concluded that the foam actually cuts down on wave motion by as much as 90 percent.

The theory also holds true for non-alcoholic foamy drinks like lattes and macchiatos, which spill less than plain back coffee.

Yet, the foam won’t prevent drink spillage if you’d had so many cocktails you can’t stand up straight. But at the beginning of the night, take comfort in knowing that your foamy beer is less likely to end up all over the bar.