Add generate_order func to main