fixed incorrect pseudocode convergence algorithm