Take note of the scope of the variables, and the usage (or lackthereof) of brackets in your for loop.