A method of processing a nucleic acid sample, comprising: (a) hybridizing a population of forward primers of the formula 5'-A-Y-Z to a population of template nucleic acid molecules, wherein: (i) region A provides a primer binding site when copied by a polymerase and is the same in every primer of the population of forward primers; (ii) region Y varies between the different primers of the primer population and provides a counter sequence; and (iii) region Z is complementary to a first site in a target polynucleotide in a population of template nucleic acid molecules and is the same in every primer of said population of primers; and said hybridizing is done in the presence of i) a second primer comprising the sequence of region A; ii) a third primer that has sequence B; and iii) a reverse primer of the formula 5'-B-W, wherein region B is a 5' tail of sequence B and sequence W is complementary to a site in said target polynucleotide; wherein the second and third primers are protected from degradation by a 3' to 5' exonuclease; (b) extending i) the forward primers that are hybridized to said target polynucleotide in step (a) and ii) the reverse primer, using a thermostable polymerase that has a 3' to 5' exonuclease activity that degrades free primers, using said target polynucleotide as a template to produce a population of first extension products that comprise a binding site for said reverse primer; (c) hybridizing said reverse primer to the binding site for said reverse primer in the population of first extension products produced by step (b); (d) extending said reverse primer to produce a population of second extension products that comprises the complement of region A and the complement of region Y, wherein the complement of region Y is different in each molecule in said population of second extension products; (e) selectively disabling, after step (d) any forward primers that are not extended; and (f) amplifying said population of second extension products by PCR using: i) said second primer-comprising region A and ii) said third primer that has sequence B, to produce a population of PCR products in which clonally-related products are tagged with the same counter sequence and products that are not clonally related are tagged with a different sequence relative to one another; wherein said steps (a) to (f) are done in a closed vessel and no additional reagents are added to the vessel during said method. (a) hybridizing a population of forward primers of the formula 5'-A-Y-Z to a population of template nucleic acid molecules, wherein: (i) region A provides a primer binding site when copied by a polymerase and is the same in every primer of the population of forward primers; (ii) region Y varies between the different primers of the primer population and provides a counter sequence; and (iii) region Z is complementary to a first site in a target polynucleotide in a population of template nucleic acid molecules and is the same in every primer of said population of primers; and said hybridizing is done in the presence of i) a second primer comprising the sequence of region A; ii) a third primer that has sequence B; and iii) a reverse primer of the formula 5'-B-W, wherein region B is a 5' tail of sequence B and sequence W is complementary to a site in said target polynucleotide; wherein the second and third primers are protected from degradation by a 3' to 5' exonuclease; (i) region A provides a primer binding site when copied by a polymerase and is the same in every primer of the population of forward primers; (ii) region Y varies between the different primers of the primer population and provides a counter sequence; and (iii) region Z is complementary to a first site in a target polynucleotide in a population of template nucleic acid molecules and is the same in every primer of said population of primers; and i) a second primer comprising the sequence of region A; ii) a third primer that has sequence B; and iii) a reverse primer of the formula 5'-B-W, wherein region B is a 5' tail of sequence B and sequence W is complementary to a site in said target polynucleotide; (b) extending i) the forward primers that are hybridized to said target polynucleotide in step (a) and ii) the reverse primer, using a thermostable polymerase that has a 3' to 5' exonuclease activity that degrades free primers, using said target polynucleotide as a template to produce a population of first extension products that comprise a binding site for said reverse primer; (c) hybridizing said reverse primer to the binding site for said reverse primer in the population of first extension products produced by step (b); (d) extending said reverse primer to produce a population of second extension products that comprises the complement of region A and the complement of region Y, wherein the complement of region Y is different in each molecule in said population of second extension products; (e) selectively disabling, after step (d) any forward primers that are not extended; and (f) amplifying said population of second extension products by PCR using: i) said second primer-comprising region A and ii) said third primer that has sequence B, to produce a population of PCR products in which clonally-related products are tagged with the same counter sequence and products that are not clonally related are tagged with a different sequence relative to one another;