<i>T. rex</i> was one of the smarter dinosaurs in existence