improved stopping criteria