and it seems pretty straight forward to me. When it runs, however, I'm caught in an infinite loop of "is". The weirdest part to me is that the i-increment should clearly start at 0, yet I never get into the "This" statement. Is my problem in the for loop setup or the entry to the if loops?
if(i=0) should be if(i==0), same thing for the else if part. What you're doing now isn't comparing a value to i, you're assigning a value to i. Huge difference.