autogains now writes to cal file