depth first search working