Replace 10000 by 1000 iterations