Completed rightRotate() and leftRotate()