credited AVL implementaion