  
      static int compareByContigAndScore(const void *first, const void *second);      // qsort()-style compare routine
      static int compareByScore(const void *first, const void *second);               // qsort()-style compare routine
-@@ -81,6 +140,8 @@ struct PairedAlignmentResult {
+@@ -81,6 +144,8 @@ struct PairedAlignmentResult {
  	int score[NUM_READS_PER_PAIR];              // score of each end if matched
  
  	int mapq[NUM_READS_PER_PAIR];               // mapping quality of each end, encoded like a Phred score (but as an integer, not ASCII Phred + 33).

+			diffbufPair[2] = '\0';
+		}
+		ztzSeparator = "\tZT:Z:";
+		snprintf(ztzbuf, 1024, "%d,%s,%s,%d,%d,%d,%d,%d,%lld,%d,%d",
+				 -features.bestScore,
+				 diffbuf,
+				 diffbufPair,
+				 (int)(9999.0 * features.probabilityOfBestCandidate),
+				 (int)(9999.0 * features.probabilityOfBestCandidate - features.probabilityOfSecondBestCandidate),
+				 (int)(9999.0 * features.probabilityOfBestCandidate /
+				       ((features.probabilityOfAllCandidates > 0) ? features.probabilityOfAllCandidates : 1)),
+				 features.popularSeedsSkipped,
+				 features.popularSeedsSkippedPair,
+				 features.countOfHashTableLookups,
+				 (int)(features.hitsPerLookup+0.5),
+				 (int)(features.hitsPerLookupPair+0.5));
+		ztzString = ztzbuf;

+			  double _probabilityOfSecondBestCandidate,
+			  unsigned _popularSeedsSkipped,
+			  unsigned _popularSeedsSkippedPair,
+			  _int64 _minHits,
+			  _int64 _minHitsInDirection,
+			  float _hitsPerLookup,
+			  float _hitsPerLookupPair)
+	{
