rotateHead implementation