Added the Nearest Neighbour Computation function.