help me to merge the rotate method and then i can write the method in the utils