an utility function to easily generate a stop function that stops when the convergence is stalling
Useful links