 +		kputw(p->pair_score, str);
 +		kputc(',', str);
 +		if(p->pair_sub >= 0) {
-+			//assert(p->pair_score >= p->pair_sub);
 +			kputw(p->pair_score - p->pair_sub, str);
 +		} else {
 +			kputsn("NA", 2, str);
 +		}
++		kputc(',', str);
++		kputw(p->n_comp, str);
++		kputc(',', str);
++		kputw(p->seedlen0, str);
 +		kputc(',', str);
 +		kputw(p->sub_n, str);
 +		kputc(',', str);

 	kputc('\n', str);
 }
 
@@ -1131,6 +1164,11 @@ mem_aln_t mem_reg2aln(const mem_opt_t *o
 	a.pos = pos - bns->anns[a.rid].offset;
 	a.score = ar->score; a.sub = ar->sub > ar->csub? ar->sub : ar->csub;
 	a.is_alt = ar->is_alt; a.alt_sc = ar->alt_sc;
+	a.seedcov = ((float)ar->seedcov) / l_query;
+	a.frac_rep = ar->frac_rep;
+	a.sub_n = ar->sub_n;

diff -rupN -x Xcode -x .git bwa/bwamem.c bwa-mod/bwamem.c
--- bwa/bwamem.c	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem.c	2016-07-29 21:32:26.000000000 -0400
@@ -942,6 +942,40 @@ void mem_aln2sam(const mem_opt_t *opt, c
 		for (i = tmp; i < str->l; ++i) // replace TAB in the comment to SPACE
 			if (str->s[i] == '\t') str->s[i] = ' ';
 	}
+	if ((p->flag & 4) == 0) {
+		kputsn("\tZT:Z:", 6, str);
+		kputw(p->score, str); // same as AS:i
+		kputc(',', str);
+		if(p->sub >= 0) {
