The story of the black peppered moth, which changed colors from Oreo milkshake to dark chocolate during the Industrial Revolution in Britain, is the iconic tale of adaptive evolution taught in science classes. And today its plot thickens: In a study published in Nature, researchers have pinpointed the precise genetic mutation that led to the darker moth and determined just when this mutation occurred. The same gene, called cortex, was also found to control color patterns on the wings of tropical butterflies in a separate study.

The once rare black peppered moth became commonplace in the United Kingdom during the Industrial Revolution, when its original light speckled wings became a clear target for predators against tree trunks darkened by coal soot. A black version of the same species appeared around 1819, according to the new study. By blending in with the coal-darkened trees, it avoided becoming lunch for birds, passed down its genes and outnumbered the original moth in urban areas for a time.

After searching through a large area of this moth’s genome, Ilik Saccheri, an evolutionary ecologist, and his colleagues at the University of Liverpool found that a single mutation on a gene called cortex was responsible for the wings’ black coloring. The mutation is on a “jumping gene,” or a transposable element, which can hop between locations on the genome. Dr. Saccheri was surprised because cortex usually controls cell division in many organisms, not traits like wing color.