Sigh. The code that iMalc posted was an equivalent of your (BROKEN!) for loop, to show you what was wrong with it. It was not a copy/paste source for a fix. Of *course* the program is still broke. Because you still haven't worked out what's broke in order to fix it despite iMalc given you a HUGE clue.