final version of computing most similar sample in a dataset