added i variable