Add new code for rotation