rotate function

Rotate a tree object