converged() function (still to be tested)