make distance and cd functions
all functions needed to make bootstrap cutpoint