fixed some bugs and made avl_tree support the iterator