redeclaration of variable i removed