It’s been millions of years since dinosaurs walked the Earth, but they left plenty of remains behind for us to find. Paleontologists can learn a lot about what dinosaurs looked like and even their respective places on the food chain based on their bones, but figuring out how the bodies of these ancient beasts functioned is a great deal more difficult.

A new research paper published in PLOS One explains how scientists studying one particular species of dinosaur discovered something incredible about its teeth. The carnivorous Majunasaurus loved meat and bones so much that it evolved the ability to replace its teeth at a staggering pace.

As the paper explains, the Majungasaurus was capable of rapidly regenerating its dagger-like teeth. In fact, based on fossil evidence discovered across its ancient stomping ground of Madagascar, researchers believe that it gradually replaced an entire mouth’s worth of teeth every two months.

“This meant they were wearing down on their teeth quickly, possibly because they were gnawing on bones,” Michael D. D’Emic, lead author of the work, said in a statement. “There is independent evidence for this in the form of scratches and gouges that match the spacing and size of their teeth on a variety of bones—bones from animals that would have been their prey.”

The researchers made the discovery with the help of scans that allowed them to see inside fossilized jaws. Deep within the bone, the scientists spotted teeth growing in behind teeth that appeared otherwise healthy. This offered insights into how often the dinosaurs replaced their teeth with new ones.

Rapid teeth regeneration is a specialized feature, and there are animals today that do the same thing. Many species of shark, for instance, regularly shed teeth and then grow new ones to replace those that are lost. Identifying similarities between modern animals and creatures that died out millions of years prior can help scientists better understand certain evolutionary triggers, and perhaps even paint a clearer picture of how certain species adapt to fit their own lifestyles.