using for loop