Added distance analysis option to allow slow clustering to be avoided.