reverted and rewriten

todo remove storeinventory