Changed to Depth-First search