Deep first search