fixing depth search. working now