for loops with if conditions