adding a better solution to bst level traversal