Adding depth- and breadth-first search code