fixed some stuff relating to order