Added a rotation flip function