adding nearest neighbour and k-nearest neighbour search