Manage order

modified update function to keep track of new order