changed a bit of the timing code in the for loop