add dynamic distance search