Finding loops in the metric of metric spaces