Remove double declaration of i variable