added inputs for discount rate and tolerance