Added convergence analysis and fixed bugs