implemented upto rotations.