Implementing AVL-tree