new quit condition added to algorithm: are