reduced number of iterations from 5000 to 500