Polymer hydrogels and methods of preparation thereof