implementing rotation