improvements to haplotype-counting due to Matt Holt