Added distance calculation, and closestNeighbour