Extended to K nearest neighbour search