changed stop condition (using euclidian norm)