added inspect_order. small changes to the rest