Added DFS order and unit tests