Moved count and startTime just above the for loop