When you say mucus, most people automatically think of the stuff that comes out of a person’s nose when they're sick. That is true, however — as disgusting as mucus may seem — it is actually keeping us healthy. In a recent TED Talk, speaker Katharina Ribbeck explains the various ways our mucus is actually looking out for us.

Our body produces more than a liter of mucus per day. No, it’s not constantly dripping out of your nose without you knowing it. Instead, mucus can be found in our eyes, helping us blink; in our mouth, keeping it hydrated; and in our stomach, keeping acids at bay.

Mucus contains a number of different compounds, including proteins, fats, and salts. But what makes mucus so versatile is a set of proteins called mucins. Mucins are the molecules that give mucus its slippery feel and belong to proteins called glyco-proteins, which are built out of amino acids and sugars.

Mucus is the first line of defense in the body’s fight against foreign objects like dust and bacteria. It clears these foreign bodies from the respiratory system, because if mucus didn’t, bacteria would build up and make us sick.

When microbes become harmful, the body produces more mucus than usual to try and flush those microbes out. The immune system does its part by adding extra white blood cells to the mucus. The greenish mucus sometimes associated with infection actually comes from an enzyme produced by white blood cells.

So, the next time you see someone on the train or subway with a runny nose, know that as gross as they may look, that mucus pouring out of their nose is actually trying to make them feel better.