You do not declare i=0, here.