Updated Code to return index of the particular point of interest