def add(self, r):
        '''Takes an id and a Residue r and adds them to the Sequence.'''
        id = r.get_residue_id()
        if self.order:
            last_id = self.order[-1]

            # KAB - allow for multiresidue noncanonicals
            if id in self.order:
                raise colortext.Exception('Warning: using code to "allow for multiresidue noncanonicals" - check this case manually.')
                id = '%s.%d'%(str(id),self.special_insertion_count)
                self.special_insertion_count += 1

            assert(r.Chain == self.sequence[last_id].Chain)
            assert(r.residue_type == self.sequence[last_id].residue_type)
        self.order.append(id)
        self.sequence[id] = r
Takes an id and a Residue r and adds them to the Sequence.