added depth first search roughly