Changed to a lookup table for distances
Changed initialisation to nearest neighbour
Ported lookup table from b