remove redundant code
return head when not necessary to rotate