Setting the number of ITERATIONS in the right place