added index funcion