Update rotate code