  } mem_aln_t;
  
  #ifdef __cplusplus
+Binary files bwa/bwamem.o and bwa-mod/bwamem.o differ
+Binary files bwa/bwamem_extra.o and bwa-mod/bwamem_extra.o differ
 diff -rupN -x Xcode -x .git bwa/bwamem_pair.c bwa-mod/bwamem_pair.c
 --- bwa/bwamem_pair.c	2015-07-08 13:14:28.000000000 -0400
 +++ bwa-mod/bwamem_pair.c	2015-08-06 16:18:28.000000000 -0400

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	2015-08-16 20:10:52.000000000 -0400
@@ -942,6 +942,32 @@ 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) {
+			kputw(p->sub, str);
+		} else {
+			kputsn("NA", 2, str);
+		}
+		kputc(',', str);
+		kputw(p->pair_score, str);
+		kputc(',', str);
+		kputw(p->pair_sub, 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;
