Made inventory an object.