Adding index func