add function to trace haplotype