updating nearest neighbour search