Added rotate command to flip function.