wrote a good convergence criteria