changes in quantity calculation