Depth-first searching added