Implemented the inventory class.