switched instructions and inventory for readability