bug fix and add rotation method