handles depth search now. example call on top of distance.py