Evolution drives relentlessly forward, leaving behind a messy wake. One of the best places to survey its sloppy creativity is inside your nose.

When you smell a lily or a cigar or a jug of spoiled milk, you are grabbing their molecules out of an ocean of air. You have exposed nerve endings dangling deep inside your nostrils, each of which is studded with proteins called olfactory receptors. Each neuron is covered in one type of receptor, the shape of which allows it to grab tightly onto certain odor molecules and weakly to others, while letting many others drift by.

Snagging a molecule causes the receptor to squirm, leading to a falling-domino-like series of reactions that ends with the neuron firing an electric signal into your brain. The brain gets signals from thousands of neurons in our noses, creating a distinctive signature for each kind of smell we perceive.

We can distinguish between a vast number of different odors, thanks in part to the vast number of olfactory receptor genes our neurons can choose from. So far scientists have identified 390 different genes in the human genome that encode olfactory receptors.

But they’ve also found something else that’s rather stunning. The human genome contains another 468 olfactory receptor genes that neurons cannot use to make a receptor. They’re known as pseudogenes (“false” genes). While their sequence is overwhelmingly similar to working olfactory receptor genes, these pseudogenes carry mutations that make it impossible for a neuron to translate their sequence into a protein.

To figure out how the human genome could end up with more pseudogenes genes for olfactory receptors than working ones, scientists have looked back at their evolutionary history. They can get in a time machine by comparing the olfactory receptor genes in humans with those in other species. We share a lot of these genes in common with chimpanzees–both working and broken. Scientists can track this kinship back further in time by looking at more distant relatives–other mammals, reptiles, amphibians, and even fish. Eventually, they can rebuild the rough outlines of half a billion years of sniffing.

The most distantly related animals that share our olfactory receptors are known as lancelets. They look a bit like sardines with their heads cut off. They split off from our own ancestors about 700 million years ago, not long before the evolution of the brain and eyes. As a result, lancelets can give us a glimpse at what our invertebrate ancestors were like. Lancelets don’t have anything like a nose, but they do have about 40 olfactory receptor genes. It’s possible that they turn their whole body into a nose, using receptors scattered across their flanks to pick up odor molecules from the water surrounding them.

Over the next 200 million years, full-blown fish evolved. They evolved something more like our nose, although these were just dead-end holes in their heads. As fish swim, water rushes into these holes, and the animals can sample the molecules in the water with about 100 different olfactory receptors.

Our kinship is even clearer when scientists look up the noses of amphibians. There are even more olfactory receptor genes that match closely to our own. What’s more, some of the genes have changed structure, so that instead of capturing water-soluble molecules, they can capture airborne ones. (Amphibians still make receptors for grabbing water-soluble ones, since they spend time in water.) Mammals, to which we’re even more closely related, have many more olfactory receptor genes, which show even closer kinship to our own.

As scientists trace olfactory receptor genes along this tree of life, they can see two forces at work in their evolution: an evolutionary version of birth, and one of death.

Olfactory receptor genes are located in regions of our chromosomes that are especially prone to copying mistakes. From time to time, an olfactory receptor gene’s DNA gets copied out twice, creating a duplicate of the original.

After the duplication, one of the two identical genes may mutate. Sometimes the mutation disables the gene, turning it into a pseudogene. Losing the gene isn’t a catastrophe, however, since the other copy of the gene still survives. Sometimes a copying error may delete the pseudogene altogether.

In other cases, the new copy mutates, but not fatally. It may continue making the same olfactory receptor, despite the slight change its DNA. Or the receptor’s structure changes. Its different shape alters its grip on odor molecules. That change may trigger a subtle shift in the smells an animal can sense.

Run this operation over and over again for millions of years, and you end up with the diversity of smelling genes found today in living creatures. Like humans, other mammals have have hundreds of working genes and hundreds more pseudogenes. Functional or not, the genes in different species belong to different “families” that originated in duplications millions of years ago. The fact that pseudogenes are “cousins” to functional genes is evidence that they once functioned.

Animals that depend heavily on smell often have huge numbers of olfactory genes, and relatively few pseudogenes. Rats, for example, have 1207 working olfactory receptor genes, for example, and only 508 pseudogenes–roughly a quarter knocked out. Humans have far fewer olfactory receptor genes, and about 55% of them no longer make receptors. Some other species have suffered even greater losses. Chickens have just 554 genes, of which 476 (86 percent) are pseudogenes. Sperm whales, whose ancestors returned to the sea, lost all their working olfactory receptor genes. They only have pseudogenes left.

The churning evolution of smell has not stopped, however. In a new study just published in Nature Neuroscience, for example, a team of scientists took a close look at the genes we living humans use to build olfactory receptors. Our olfactory receptors vary tremendously from one person to the next. Some people have extra copies of olfactory receptor genes, for example. Many have mutations in some of their genes.

To see if these differences have an effect on how people smell, the scientists developed a way to analyze olfactory receptors on an industrial scale. They created hundreds of lines of cells, each of which produced one type of receptor on its surface. They could then expose the cells to a collection of odor molecules and see if any stuck.

Once they found these molecules, the scientists then tested out the different variants of olfactory receptors that are found in human populations. In almost two-thirds of the cases, the scientists found that olfactory receptor genes had variations that changed how they grabbed onto odor molecules. On average, any two people in the study had functional differences in over 30% of their odorant receptor genes.

To see if these chemical differences translated into a different experience of smells, the scientists zeroed in on one gene, called OR10G4. The OR10G4 receptor can bind to a few different molecules, including vanillin and a molecule called guaiacol that has a flowery smell. The scientists found that one common mutation to OR10G4 influences how strongly the receptor binds to guaiacol, but not to vanillin. It turns out that people with the mutation perceive the pleasantness and strength of guaiacol differently too. But there’s no difference in their perception of vanillin.