Adding nearest neighbour calculations.
Adding nearest neighbour calculations.