Fixed searchForDepth, some refactoring depth methods