refactored ReverseRotate and made attempt at error semantics