refactored inventory code, one slight issue with finding texture though