Add computation of residue to file