fixed dubel declaration of i