Please add a not that function throws an exception if algorithm does not converges.