All Snakes are thought to descend from a reptile that lived roughly 160 million years ago and had four legs. Why those limbs disappeared remains an open question in evolutionary biology.

One hypothesis holds that losing their legs helped early snakes move through narrow underground tunnels, giving them an advantage in subterranean environments. Another suggests that their elongated, limbless bodies evolved as an adaptation for swimming.

Fossil evidence has supported both possibilities. In 2015, researchers studied X-ray models of the Inner Ear of an animal closely related to the ancestor of modern snakes. Its anatomy indicated that these ancestors may have lived underground. However, fossils of primitive snakes with well-developed hind legs have also been found in marine limestone, pointing to a possible aquatic origin.

“It’s hard to tell what exact conditions drove the evolution of this body plan,” said Tiago Simões, an evolutionary biologist at Princeton.

Sources: The New York Times Science.