added index variable access