Added for loop in the beginning