added closest data point index