started for loop function