changed for loop to 0.. 1000 instead of 10