added function index-by