Added slight optimization for checking identical inventories