Implemented bare DFS