updated some functions in AVL