added depth first search