add rotation optimization