for loops and scope