added tree rotation functions