inventory class mostly written