Updating the rotation matrix