Synthesis of functional water-soluble polymers