fixed error in discount formula