Depth first search working.