breadth first traversal