find nearest centroid