Added stop based on mxIterations