correct the right rotate code