use fixed rotate function