residue determination