added Devin's completed version of depth-first with a slight bit of prunning