What slithers like a snake, swims like a fish and lives in the Sahara? The sandfish lizard, of course. This small reptile, which measures just 10 centimeters long, can swim through the sand dunes at up to 15 centimeters per second. But how does it do it?

Researchers at the Georgia Institute of Technology used a high-speed x-ray camera to peer through the sand and see. The little lizards, it turns out, use a far different mode of locomotion under the sand than they do at the surface.

“Once below the surface they no longer use their limbs for propulsion," study leader Daniel Goldman said in a statement. “Instead they move forward by propagating a traveling wave down their bodies like a snake.”

The lizard’s swimming style also helped Goldman and his team understand the physics behind movement in different types of grainy substances—findings that could provide lessons for engineers looking to build robots that can make their way through a variety of materials.