createOrder function created