added initial implementation of nearestNeighbor