debug for distance search