Answer to for loop question