finished creating the order function