          *spaceUsed = bamSize;
 diff -rupN -x Xcode -x .git tmp/snap/SNAPLib/BaseAligner.cpp snap/SNAPLib/BaseAligner.cpp
 --- tmp/snap/SNAPLib/BaseAligner.cpp	2015-07-28 15:15:02.000000000 -0400
-+++ snap/SNAPLib/BaseAligner.cpp	2015-07-25 21:10:24.000000000 -0400
-@@ -764,6 +764,11 @@ Return Value:
++++ snap/SNAPLib/BaseAligner.cpp	2015-08-05 11:13:27.000000000 -0400
+@@ -289,7 +289,7 @@ Return Value:
+     primaryResult->score = UnusedScoreValue;
+     primaryResult->status = NotFound;
+ 
+-    unsigned lookupsThisRun = 0;
++    lookupsThisRun = hitsThisRun = 0;
+ 
+     popularSeedsSkipped = 0;
+ 
+@@ -471,6 +471,7 @@ Return Value:
+ 
+         nHashTableLookups++;
+         lookupsThisRun++;
++        hitsThisRun += (nHits[FORWARD] + nHits[RC]);
+ 
+ 
+ #ifdef  _DEBUG
+@@ -764,6 +765,17 @@ Return Value:
                  primaryResult->score = bestScore;
                  if (bestScore <= maxK) {
                      primaryResult->location = bestScoreGenomeLocation;
++					float hitsPerLookup = (float)hitsThisRun / lookupsThisRun;
 +					primaryResult->features.init(bestScore,
 +												 secondBestScore,
 +												 probabilityOfAllCandidates,
 +												 probabilityOfBestCandidate,
-+												 popularSeedsSkipped);
++												 popularSeedsSkipped,
++												 0,
++												 lookupsThisRun,
++												 0,
++												 hitsPerLookup,
++												 0);
                      primaryResult->mapq = computeMAPQ(probabilityOfAllCandidates, probabilityOfBestCandidate, bestScore, popularSeedsSkipped);
                      if (primaryResult->mapq >= MAPQ_LIMIT_FOR_SINGLE_HIT) {
                          primaryResult->status = SingleHit;
+diff -rupN -x Xcode -x .git tmp/snap/SNAPLib/BaseAligner.h snap/SNAPLib/BaseAligner.h
+--- tmp/snap/SNAPLib/BaseAligner.h	2015-07-28 15:15:02.000000000 -0400
++++ snap/SNAPLib/BaseAligner.h	2015-08-05 11:12:27.000000000 -0400
+@@ -136,6 +136,9 @@ private:
+     _int64 nReadsIgnoredBecauseOfTooManyNs;
+     _int64 nIndelsMerged;
+ 
++	unsigned lookupsThisRun;
++	_int64 hitsThisRun;
++
+     //
+     // A bitvector indexed by offset in the read indicating whether this seed is used.
+     // This is here to avoid doing a memory allocation in the aligner.
 diff -rupN -x Xcode -x .git tmp/snap/SNAPLib/ChimericPairedEndAligner.cpp snap/SNAPLib/ChimericPairedEndAligner.cpp
 --- tmp/snap/SNAPLib/ChimericPairedEndAligner.cpp	2015-07-28 15:15:02.000000000 -0400
 +++ snap/SNAPLib/ChimericPairedEndAligner.cpp	2015-08-05 09:03:57.000000000 -0400

+	secondBestScore(0),
+	probabilityOfAllCandidates(0.0),
+	probabilityOfBestCandidate(0.0),
+	popularSeedsSkipped(0) { }
+	
+	void init(unsigned _bestScore,
+			  unsigned _secondBestScore,
+			  double _probabilityOfAllCandidates,
+			  double _probabilityOfBestCandidate,
+			  unsigned _popularSeedsSkipped)
+	{
+		bestScore = _bestScore;
+		secondBestScore = _secondBestScore;
+		probabilityOfAllCandidates = _probabilityOfAllCandidates;
+		probabilityOfBestCandidate = _probabilityOfBestCandidate;
+		popularSeedsSkipped = _popularSeedsSkipped;
+	}
+	
+	unsigned bestScore;
+	unsigned secondBestScore;
+	double probabilityOfAllCandidates;
+	double probabilityOfBestCandidate;
+	unsigned popularSeedsSkipped;
+};
+
 struct SingleAlignmentResult {
 	AlignmentResult status;
 
@@ -54,6 +83,7 @@ struct SingleAlignmentResult {
     int             score;		// score of each end if matched
 
     int             mapq;		// mapping quality, encoded like a Phred score (but as an integer, not ASCII Phred + 33).

     GenomeLocation genomeLocation,
     Direction direction,
     bool secondaryAlignment,
@@ -1249,7 +1250,43 @@ SAMFormat::writeRead(
             readGroupString = read->getReadGroup();
         }
     }
