Movies like Jurassic Park may give the impression that we know everything about dinosaurs, including how they used to walk or run. But it’s actually incredibly difficult to figure out how extinct creatures moved their bodies. 

Now, a fruitful combination of computational biomechanics and so-called “predictive simulation” are helping fill in these locomotive knowledge gaps.  

To replicate the movements of a Triassic dino that lived around 200 million years ago, Coelophysis bauri, a team of researchers with diverse expertise developed a novel 3D simulation program. According to their results, small, two-legged dinosaurs like C. bauri likely swung their tails as they walked or ran—similar to how humans swing their arms. They reproduced how different muscles would interact, and looked at how C. bauri’s gait and momentum would have been impacted by tail movements. 

The tail, it turned out, regulated angular momentum and efficiency, reducing the muscular strain on the dinosaur’s body. The team believes this mechanism likely applied to other dinosaurs as well. The research was published in Science Advances.

Previously, paleontologists mostly believed that the tail was just a passive counterbalance that offset the weight of dinosaurs’ heads and necks, evolutionary biomechanist and co-author Peter Bishop told Live Science. “We didn’t really have expectations or hypotheses leading into this,” he added. “We assumed that [the tail] would just be there hanging.”

[Related: What would a dinosaur taste like?]

To make sure their model was consistent with real-life biomechanics, the team first used it to simulate birds called tinamous, elegant Central and South American avians with anatomy similar to bipedal dinosaurs. When they were sure that their simulation could faithfully replicate the bird’s bodily movements in real life, they turned their model to the C. bauri dinosaur. 

To really get at the tail’s importance, the team repeated the simulation, but removed the dino’s tail from the model. The simulated C. bauri had to move its pelvis differently. “When we chopped the tail off, the dinosaur was effectively having to wag its hips to compensate for the loss of the tail,” Bishop told The Guardian.

The tailless dino also had to increase its muscle effort by 18 percent, which suggests that the tail also helped keep energy expenditure low. When the team repeated the model and forced the tail out of sync, C. bauri again had to really up its energy use to travel at the same speed. 

“It’s always good to see robust computational biomechanics approaches applied to dinosaur locomotion,” said Nizar Ibrahim, a vertebrate paleontologist at the University of Portsmouth who is unaffiliated with the recent research, to Gizmodo. Ibrahim was the lead author of a study published in Nature last year that showed how one giant dinosaur, Spinosaurus aegyptiacus, may have used its tail to help it swim. He added that new work like this 3D simulation is adding to a growing body of research supporting the idea that “dinosaur tails were more dynamic and complex than previously assumed.”

Now that they have this simulation at the ready, Bishop hopes to apply it to all kinds of creatures of yore. “We are now primed to explore locomotion and other behaviors in a whole host of other extinct critters, and not just dinosaurs,” Bishop told Gizmodo. “Pretty much anything is fair game.”