Modified for loop