Added visual for depth-first traversal and fixed ordering issue