+ lastRight = scoresRight[i];
+ }
+
+ //if (mergedResults.size() > numWanted) { lasti = i; break; } //you have enough results
+ }
+
+ //add in sequences with same distance as last sequence added
+ /*lasti++;
+ int i = lasti;
+ while (i < tempIndexesLeft.size()) {
+ if (scoresLeft[i] == lastLeft) {
+ it = seen.find(tempIndexesLeft[i]);
+
+ if (it == seen.end()) {
+ mergedResults.push_back(tempIndexesLeft[i]);
+ seen[tempIndexesLeft[i]] = tempIndexesLeft[i];
+ }
+ }
+ else { break; }
+ i++;
+ }
+
+ // cout << "lastRight\t" << lastRight << endl;
+ //add in sequences with same distance as last sequence added
+ i = lasti;
+ while (i < tempIndexesRight.size()) {
+ if (scoresRight[i] == lastRight) {
+ it = seen.find(tempIndexesRight[i]);
+
+ if (it == seen.end()) {
+ mergedResults.push_back(tempIndexesRight[i]);
+ seen[tempIndexesRight[i]] = tempIndexesRight[i];
+ }