Code to process orders