Even Tyrannosaurus rex grappled with growing pains, new research suggests. As the teenage dinosaurs transformed into adults, their bodies ballooned in fits and spurts, in lockstep with the amount of available food. The study, published this week in Science Advances, presents one of the most detailed analyses of this dinosaur’s development to date.

Maxing out around 40 feet in length and up to 9 tons in weight, adult T. rex were a force to be reckoned with. But the most well-studied T. rex fossils have also been the biggest—adults that had wrapped up most of the growing process in their early twenties, study author Holly Woodward, a paleontologist at Oklahoma State University, says in a statement. As such, exactly how these infamous behemoths—which likely entered the world as pigeon-sized hatchlings—attained these staggering sizes has long been mysterious.

So Woodward and her team decided to re-analyze two dinosaur specimens housed at Illinois’s Burpee Museum of Natural History. The pair, nicknamed Jane and Petey, are sleek, slender, and around 20 feet in length, bearing some resemblance to T. rex, but middling in size. As such, while most researchers believe Jane and Petey are probably T. rex teens, others have previously contended they were adult members of another species entirely—a diminutive dinosaur called Nanotyrannus.

But when the researchers analyzed microstructures in the specimens’ leg bones, they discovered that both Jane and Petey almost certainly juveniles at the time of their death. The fibers in their bones were haphazard, and teemed with ancient traces of blood vessels—signs that the dinosaurian duo were in the midst of rapid growth.

“This study is another nail in the coffin of Nanotyrannus,” Steve Brusatte, a paleontologist at the University of Edinburgh who reviewed the new study for publication, tells National Geographic’s Michael Greshko in an email.

Like trees, bones archive their growth in rings, typically laid down during lean winter months, Greshko reports. By counting these fossilized halos, the researchers determined that Jane, the more complete specimen, was probably around 13 years old when it died, and Petey was about 15 years old. That puts them around a decade shy of their full size—well within the bounds of adolescence, reports Leah Crane for New Scientist. (Other fossils have hinted that T. rex typically lived until age 30 or so.)

The bone rings, however, weren’t evenly spaced. “Some years [Jane and Petey] did a lot of growing, other years they didn’t,” Holly Woodward tells Business Insider's Aylin Woodward. What stalled the dinosaurs’ development isn’t entirely clear, but Holly Woodward thinks it was likely linked to how much prey was available in a given year. If that’s the case, hitting the pause button could have been a clever strategy, Holly Woodward tells Greshko. “Rather than starving and dying one year because you don’t have the resource abundance, you just don’t grow,” she says.

Over the course of many years, however, this stop-and-go process transformed limber, fleet-footed juveniles into bulky, lumbering giants that hunted mostly with their bone-crushing jaws, Mark Norell, a paleontologist at the American Museum of Natural History who wasn’t involved in the study, tells Business Insider. Jane and Petey may have been just on the cusp of this metamorphosis, the lion’s share of which occurred in the late T. rex teens, when the dinosaurs could gain almost five pounds per day.

The tyrant kings may have ruled the Cretaceous. But royalty isn’t everything. As Holly Woodward tells Greshko, “Even [for] a dinosaur as famous as Tyrannosaurus rex … there’s still a lot to learn.”