Added convergance criteria