fixed rotation bug from last commit. found some new bugs when opening/saving files (not fixed yet)