string rotation problem