print_in_order method added