Added the NN (Nearest neighbor) creation method