Finally finished coding the avl-tree stuff.. must test it a bit.