created inventory and quantity sold function