Added distance search exploration code