The variable i is already define in the parent for loop, it would be less confusing to name your iterator 'it' or whatever name that are not already defined here.