very simple DFS implementation