Added calculation of discount