Use callbacks to ensure we print everything in the right order.