function get_orders now returns orders instead of printing them to stdout