add distance metric functions