implements an AVL Tree and Grapgh