started work on avl tree for cycle checking. commented out those because they are bad right now.