Moved tree rotation to it's own function, now to find how to call it without function being called during every element added or removed