Better termination criterion