If you love (or hate) your nose, you can thank wherever your ancestors decided to settle.

Noses evolved into shapes that were conducive to local climates, according to a new study published in PLOS Genetics.

Researchers at Pennsylvania State University said the study supported a popular theory from the 1800s, called Thompson’s Nose Rule. Introduced by British anthropologist and anatomist Arthur Thompson, the theory suggested that wider nostrils developed in warmer climates, while narrower nostrils evolved to adapt to chillier conditions.

One of the nose’s most important functions is to “condition” air before it reaches the lungs. In cold regions, a narrow nose would warm the air more effectively.

In the past, scientists have only measured skull shapes to test the accuracy of the Nose Rule and not noses themselves. This is also the first study to examine dimensions in living people.

“We focused on nose traits that differ across populations and looked at geographical variation with respect to temperature and humidity.” Mark D. Shriver, one of the authors of the study, said in a statement.

Using 3D facial imaging, the research team studied nose height, nose length, and the width of nostrils and distance between them. The measurements were taken from 476 volunteers of South Asian, East Asian, West African and Northern European ancestry.

Learning how our noses evolved is important for accessing and understanding potential health risks. People with lighter skin, for example, have a higher risk of sunburn and skin cancer the closer they are to the equator. And people with darker skin who reside in higher latitudes, are more likely to have a vitamin-D deficiency.

The research team did note that other factors, like gender differences, also played a role in deciding nose sizes, but that “it all goes back” to Thompson’s Rule.