1D distances

Implementation of distances for 1D