Removed depthfirst implentation

Various misc changes