modify breadth traverse.