streamlining inventory management (making everything global); adding onExit validator