undo inventory function

fixes #89