update gauge and variables