fix bugs and done with convergence