add integ_mag function, please?