working on depth first search