Edited Inventory to avoid out of bounds Exceptions