In findNearestNeighbor initialize neighbor to -1, not 0