reorganization of functions
big reorganization of functions; added inventory command