[med-svn] [baitfisher] 01/03: Import Upstream version 1.0+dfsg

Olivier Sallou osallou at debian.org
Sat Jan 14 07:48:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

osallou pushed a commit to branch master
in repository baitfisher.

commit e9fbfb7b2b36b33f101e4456cdf5e9a6e20714d5
Author: Olivier Sallou <osallou at debian.org>
Date:   Sat Jan 14 07:29:19 2017 +0000

    Import Upstream version 1.0+dfsg
---
 .DS_Store                                          |   Bin 0 -> 24580 bytes
 CAligner/.DS_Store                                 |   Bin 0 -> 6148 bytes
 CAligner/CAligner.h                                |  1009 ++
 CBaitRecord.h                                      |  1376 +++
 CBlastParser.h                                     |  1774 ++++
 CDistance_matrix.h                                 |   811 ++
 CDnaString2.h                                      |   445 +
 CFile/.DS_Store                                    |   Bin 0 -> 6148 bytes
 CFile/CFile2_1.h                                   |   364 +
 CHistogram.h                                       |   660 ++
 CRequiredTaxon.h                                   |   315 +
 CSeqNameList.h                                     |  1083 ++
 CSequence_Mol2_1.h                                 |  2837 ++++++
 CSequences2.h                                      |  3153 ++++++
 CSplit2.h                                          |   271 +
 CTaxonNamesDictionary.h                            |   178 +
 Csequence_cluster_and_center_sequence.cpp          |  1083 ++
 Csequence_cluster_and_center_sequence.h            |   570 ++
 Ctriple.h                                          |    85 +
 DEBUG_STUFF.h                                      |    54 +
 .../BaitFilter-analysis/run-BaitFilter             |     6 +
 .../alignments/EOG505R03.fas                       |    48 +
 .../alignments/EOG57H4P2.fas                       |    48 +
 .../alignments/EOG5DV4JW.fas                       |    50 +
 .../parameter.txt                                  |    43 +
 .../Example-without-alignment-cutting/run-command  |     1 +
 GFF-class.h                                        |   633 ++
 GFF-collection.h                                   |  1307 +++
 LICENSE.GPLv3.txt                                  |   674 ++
 LICENSE.md                                         |   674 ++
 LICENSE_AND_COPYRIGHT_as_found_in_each_source_file |    26 +
 README.md                                          |    64 +
 bait-filter.cpp                                    |   633 ++
 bait-fisher-helper.cpp                             |   193 +
 bait-fisher-helper.h                               |    51 +
 bait-fisher.cpp                                    |  2199 ++++
 basic-DNA-RNA-AA-routines.h                        |   451 +
 easystring.h                                       |   511 +
 fast-dynamic-bitset/.DS_Store                      |   Bin 0 -> 6148 bytes
 fast-dynamic-bitset/fast-dynamic-bitset.h          |   518 +
 fast-realloc-vector.h                              |   355 +
 faststring2.h                                      |  3438 +++++++
 global-types-and-parameters.cpp                    |   563 ++
 global-types-and-parameters.h                      |    87 +
 makefile                                           |    21 +
 makefile_win                                       |    24 +
 mydir-unix.cpp                                     |   386 +
 mydir-unix.h                                       |    57 +
 primefactors.h                                     | 10034 +++++++++++++++++++
 print_container.h                                  |    70 +
 range_functions.h                                  |  1625 +++
 scoring-matrices/.DS_Store                         |   Bin 0 -> 6148 bytes
 scoring-matrices/CScoreMatrix.h                    |   319 +
 simpledna_N0.mat                                   |    23 +
 statistic_functions.h                              |   466 +
 tclap/Arg.h                                        |   692 ++
 tclap/ArgException.h                               |   200 +
 tclap/ArgTraits.h                                  |    87 +
 tclap/CmdLine.h                                    |   633 ++
 tclap/CmdLineInterface.h                           |   150 +
 tclap/CmdLineOutput.h                              |    74 +
 tclap/Constraint.h                                 |    68 +
 tclap/DocBookOutput.h                              |   299 +
 tclap/HelpVisitor.h                                |    76 +
 tclap/IgnoreRestVisitor.h                          |    52 +
 tclap/Makefile.am                                  |    28 +
 tclap/Makefile.in                                  |   403 +
 tclap/MultiArg.h                                   |   433 +
 tclap/MultiSwitchArg.h                             |   216 +
 tclap/OptionalUnlabeledTracker.h                   |    62 +
 tclap/StandardTraits.h                             |   208 +
 tclap/StdOutput.h                                  |   298 +
 tclap/SwitchArg.h                                  |   266 +
 tclap/UnlabeledMultiArg.h                          |   301 +
 tclap/UnlabeledValueArg.h                          |   340 +
 tclap/ValueArg.h                                   |   425 +
 tclap/ValuesConstraint.h                           |   148 +
 tclap/Version                                      |     2 +
 tclap/VersionVisitor.h                             |    81 +
 tclap/Visitor.h                                    |    53 +
 tclap/XorHandler.h                                 |   166 +
 tclap/ZshCompletionOutput.h                        |   323 +
 typedefs.h                                         |    29 +
 83 files changed, 47779 insertions(+)

diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..2410036
Binary files /dev/null and b/.DS_Store differ
diff --git a/CAligner/.DS_Store b/CAligner/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/CAligner/.DS_Store differ
diff --git a/CAligner/CAligner.h b/CAligner/CAligner.h
new file mode 100644
index 0000000..41519ad
--- /dev/null
+++ b/CAligner/CAligner.h
@@ -0,0 +1,1009 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+
+#define  NODEBUG
+#ifndef CALIGNER_H
+
+#define CALIGNER_H
+
+// Changes:
+// 8.2.2012:   Trailing gaps are never free in the matrix. First I thought this
+//             could be handled without much effort in the traceback routine, but
+//             things seem to be ambiguous then.
+//             One solution would be to look for the maximum along the original
+//             back boundary of the dynamic programming matrix.
+
+// 18.9.2014:  TODO: Import coords_of_s1_in_al_string
+//                    al_perfection
+//             from *_experimental.h
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <string>
+
+#include "../faststring2.h"
+#include "../scoring-matrices/CScoreMatrix.h"
+
+#include <limits.h>
+
+//const int DEBUG_LEVEL=5;
+
+#define NDEBUG
+
+#define DEBUG_i_min 15700 
+#define DEBUG_i_max 15800
+
+
+
+#ifdef  DEBUG
+#define DEBUGOUT1(x)           std::cerr << x                << std::endl;
+#define DEBUGOUT2(x,y)         std::cerr << x << y           << std::endl;
+#define DEBUGOUT3(x,y,z)       std::cerr << x << y << z      << std::endl;
+#define DEBUGOUT4(x,y,z,w)     std::cerr << x << y << z << w << std::endl;
+ 
+#define DEBUGOUT4Del_OS(os,x,y,z,w)   os << x << "," << y << "," << z << "," << w << std::endl;
+
+#define DEBUGOUT4Del(x,y,z,w)  std::cerr << x << "," << y << "," << z << "," << w << std::endl;
+#define DEBUGCODE(x) {x}
+
+#define IF_IN_DEB_RANGE if(i>=DEBUG_i_min && i<=DEBUG_i_max)
+#else
+#define DEBUGOUT1(x)
+#define DEBUGOUT2(x,y)
+#define DEBUGOUT3(x,y,z)
+#define DEBUGOUT4(x,y,z,w)
+#define DEBUGOUT4Del(x,y,z,w)
+
+#define DEBUGOUT4Del_OS(os,x,y,z,w)
+
+#define DEBUGCODE(x)
+
+#define IF_IN_DEB_RANGE
+#endif
+
+ 
+#define RECENTER_AFTER 3
+#define U_ENTRY  INT_MIN + 1000000
+#define U_ENTRY2 INT_MIN + 3000000
+
+#define macromax2(a,b)     ((a<b)?b:a)
+#define macromin2(a,b)     ((a>b)?b:a)
+#define macromax3(a,b,c)   (macromax2(c, macromax2(a,b)))
+
+#define next_odd(x) ((x%2==0)?x+1:x)
+
+// #define MATCHSCORE 1
+#define N_SCORE    0
+#define NOCOMPILE_NO_OFFSET 1
+
+#define DIRECTION -
+
+
+#define move_forward_in_seq(pos, b, e, s, l)   {pos += s; while (pos >= e) pos -=l;}
+#define move_backward_in_seq(pos, b, e, s, l)  {pos += s; while (pos <= b) pos +=l;}
+
+// #define move_forward_in_seq_pp(pos, b, e, l)   ((++pos >= e)?pos: pos -=l)
+// #define move_backward_in_seq_mm(pos, b, e, l)  ((--pos <= b)?pos: pos +=l)
+
+
+
+inline void move_forward_in_seq_pp(const char *&pos, const char *b, const char *e, int l)
+{
+  ++pos;
+  if (pos >= e)
+    pos -= l;
+}
+
+inline void debug_cyclic_checker(const char *pos, const char *s, int l, const char *error_msg)
+{
+  if (pos < s)
+  {
+    std::cerr << "CYCLIC Lower bound exceeded: " << error_msg << std::endl;
+  }
+
+  if (pos >= s+l)
+  {
+    std::cerr << "CYCLIC Upper bound exceeded: " << error_msg << std::endl;
+  }
+}
+
+
+
+
+
+
+
+
+// typedef int scoretype;
+
+using namespace std;
+
+class align_coord
+{
+ public:
+  int col; 
+  int row;
+
+  align_coord(int c=0, int r=0):col(c), row(r)
+  {}
+
+  void print(ostream &os)
+  {
+    os << "(" << col << "," << row << ") ";
+  }
+
+  bool valid(int mcol, int mrow)
+  {
+    return (col >= 0 && col < mcol && row >= 0 && row < mrow);
+  }
+};
+
+
+inline int max3(int a, int b, int c)
+{
+  int tmp = macromax2(a,b);
+  return macromax2(tmp,c);
+}
+
+inline void print_index(ostream &os, int x, int y)
+{
+  os << "(" << x << "," << y << ") ";
+}
+
+class CAligner
+{
+  // Convention:
+  // s1 has to be envisaged above the first row. s1 index corresponds to first index in the matrices.
+  // s2 has to be envisaged before the first column. s2 index corresponds to second index in the matrices.
+
+  // The size of the matrix is l1 x l2.
+  //
+
+  ostream &log_file;
+  int    **ar_s;                // array of scores, first index will be the column (x), the second index the row (y)
+  char   **ar_bto;              // array of bytes indicating the backtrace route. 0: Only initialized, bit1: match , bit2: mismatch, bit3: gap in s2 (score2 und p2), bit4: gap in s1 (score3 und p3)
+  // Valid coordinates in these two fields:
+  // 0..l1, 0..l2,
+
+  //  int          stopscore;
+  //  int          last_col_computed;
+
+  CScoreMatrix &score_mat;
+
+  const char*  s1;  // pointer to sequence 1
+  int          l1;  // length of sequence  1
+
+  const char*  s2;  // pointer to sequence 2
+  int          l2;  // length of sequence  2
+
+  //  int          l_max;
+
+  int          gap_open; 
+  int          gap_ext;
+  //  int          mis_pen;
+  int          alignment_score;
+
+  short        alignment_mode;  // 0: global_alignment, 1: non-global alignment, 2: cyclic alignment
+
+  //  bool         global_alignment;
+  bool free_front_gaps;
+  bool free_back_gaps;
+
+ void init_border()
+ {
+   // init the border
+   int i;
+
+   if (free_front_gaps)
+   {
+     for (i=0; i<=l1; ++i)
+     {
+       // Fill first row, corresponding to gaps in s2
+       ar_s[i][0]   = 0;
+       ar_bto[i][0] = 4;
+     }
+     for (i=0; i<=l2; ++i)
+     {
+       // Fill first columnn, corresponding to gaps in s1
+       ar_s[0][i]   = 0;
+       ar_bto[0][i] = 8;
+     }
+     ar_bto[0][0] = 0; // Has no predesessor
+   }
+   else
+   {
+     for (i=0; i<=l1; ++i)
+     {
+       // Fill first column, corresponding to gaps in s2
+       ar_s[i][0]   = -(i*gap_ext + gap_open);
+       ar_bto[i][0] = 4;
+     }
+     for (i=0; i<=l2; ++i)
+     {
+       // Fill first row, corresponding to gaps in s1
+       ar_s[0][i]   = -(i*gap_ext + gap_open);
+       ar_bto[0][i] = 8;
+     }
+     ar_bto[0][0] = 0; // Has no predesessor
+   }
+ }
+
+ public:
+ void print_ar_s(ostream &os)
+ {
+   int i, j;
+
+   os << "Score matrix:" << endl;
+   for (j=0; j <= l2; ++j)
+   {
+     for (i=0; i <= l1; ++i)
+     {
+       os.width(3);
+       if (ar_s[i][j] < U_ENTRY2)
+	 os << "-";
+       else
+	 os << ar_s[i][j];
+     }
+     os << endl;
+   }
+ }
+
+ void print_ar_bto(ostream &os)
+ {
+   int i, j;
+
+   os << "Traceback matrix:" << endl;
+   for (j=0; j <= l2; ++j)
+   {
+     for (i=0; i <= l1; ++i)
+     {
+       os.width(3);
+       if (ar_s[i][j] < U_ENTRY2)
+	 os << "-";
+       else
+	 os << (int) ar_bto[i][j];
+     }
+     os << endl;
+   }
+ }
+ 
+
+CAligner(const char* param_s1, int pl1, const char* param_s2, int pl2,
+	 CScoreMatrix &param_score_mat, short param_alignmentmode,
+	 ostream &plog_file=cerr, int pstopscore=INT_MIN):
+   log_file(plog_file),
+   score_mat(param_score_mat),
+   s1(param_s1), l1(pl1), s2(param_s2), l2(pl2),
+
+   gap_open( -param_score_mat.get_Gap_open_score()  ),
+   gap_ext(  -param_score_mat.get_Gap_ext_score()   ),
+   alignment_mode(param_alignmentmode)
+ {
+   int i,j;
+   ar_s   = new int*[l1+1];         // col pointer vector
+   ar_bto = new char*[l1+1];
+
+   for (i=0; i <= l1; ++i)         // for all columns
+   {
+     ar_s[i]   = new int [l2+1];
+     ar_bto[i] = new char[l2+1];
+   }
+
+   DEBUGCODE(
+	     cerr << "Alignment parameters: " << endl;
+	     cerr << "gap opening:   " << -gap_open << endl;
+	     cerr << "gap extension: " << -gap_ext << endl << endl;
+	     )
+
+   // Init alignment array
+   for (i=0; i <= l1; ++i)
+   {
+     for (j=0; j <= l2; ++j)
+     { 
+       ar_s[i][j]   = U_ENTRY;
+       ar_bto[i][j] = 0;
+     }
+   }
+
+
+   DEBUGCODE(cerr << "Mode: (intern) " << alignment_mode << endl;)
+
+   if (alignment_mode == 0)      // global
+   { 
+     free_front_gaps = false;
+     free_back_gaps  = false;
+     DEBUGCODE(cerr << "Mode: global mode" << endl;)
+   }
+   else if (alignment_mode==1) // local
+   {
+     free_front_gaps = true;
+     free_back_gaps  = true;
+     DEBUGCODE(cerr << "Mode: local mode" << endl;)
+   }
+   else // cyclic
+   {
+     free_front_gaps = false;
+     free_back_gaps  = true;
+     DEBUGCODE(cerr << "Mode: cyclic mode" << endl;)
+   }
+ }
+
+
+ ~CAligner()
+ {
+   int i;
+
+   for (i=0; i<= l1; ++i)
+   {
+     delete [] ar_s[i];
+     delete [] ar_bto[i];
+   }
+   delete [] ar_s;
+   delete [] ar_bto;
+ }
+
+ void print_time_stamp_to_log_file(const char * s)
+ {
+   log_file << "Time: " << s << " " << time(NULL) << endl;
+ }
+
+void align()
+ {
+   int i,j;
+
+   init_border();
+
+   // print_ar_s(std::cerr);
+   // print_ar_bto(std::cerr);
+
+   //   std::cerr << "GAP*******" << gap_open << std::endl;
+
+
+   int score1;
+   int score2;
+   int score3;
+   char match_mismatch;
+   int align_score;
+
+   // TODO: Further improve efficienty: Loop over < l2, <l1.
+   //       This removes the if that check for the last row and column.
+ 
+   for (j=1; j <= l2; ++j)        // loop over all rows
+   {
+     for (i = 1; i <= l1; ++i ) // loop over all cols
+     {
+       // Caution: Both loops start at 1 since row and column 1 have already been filled.
+       // However, row and col 1 correspond to entry 0 of the sequence. So sequence indices
+       // are shifted by -1:
+ 
+       DEBUGCODE(
+		 cerr << "al: i " << i << " j " << j
+		    << " s1[i-1]=" << "s1[" << i-1 << "]=" << s1[i-1] << " s2[j-1]=" <<  "s2[" << j-1 << "]= " << s2[j-1]
+		    << " ar_s[i-1][j] "<< ar_s[i-1][j] << " ar_s[i-1][j-1] "<< ar_s[i-1][j-1] << " ar_s[i][j-1] "<< ar_s[i][j-1]
+		    << endl;
+		 )
+
+       // Do we have a match - what is the match/mismatch score
+       align_score = score_mat.score_compare_symbols(s1[i-1], s2[j-1]);
+       if (s1[i-1] == s2[j-1])
+	 match_mismatch = 1;  // set bit 1
+       else
+	 match_mismatch = 2;  // set bit 2
+
+       {
+	 //                       match                    gap                     gap
+	 //	   ar_s[i][j] = macromax3( ar_s[i-1][j-1]+match_score, ar_s[i][j-1]-gap_ext, ar_s[i-1][]-gap_ext);
+
+	 // Compute:
+	 // score1, score2, score3:
+	 // score1: match or mismatch
+	 // score2: gap in s2, horizontal move in matrix
+	 // score3: gap in s1, vertical move in matrix
+
+	 score1 = ar_s[i-1][j-1]+align_score;
+
+	 if (!free_back_gaps || (i < l1 && j < l2 ) )
+	 {
+	   score2 = ar_s[i-1][j] - gap_ext;    // gap in s2
+	   score3 = ar_s[i][j-1] - gap_ext;    // gap in s1
+
+	   if ( !(ar_bto[i-1][j]&4) )
+	   {
+	     score2 -= gap_open;
+	   }
+	   if ( !(ar_bto[i][j-1]&8) )
+	   {
+	     score3 -= gap_open;
+	   }
+	 }
+	 else // free_back_gaps and either i or j on the back boundary:
+	 {
+	   if (i==l1 && j==l2)
+	   {
+	     score2 = ar_s[i-1][j];    // gap in s2
+	     score3 = ar_s[i][j-1];    // gap in s1
+	   }
+	   else if (i==l1)
+	   {
+	     score2 = ar_s[i-1][j] - gap_ext;    // gap in s2
+	     if ( !(ar_bto[i-1][j]&4) )
+	     {
+	       score2 -= gap_open;
+	     }
+	     score3 = ar_s[i][j-1] - 0;          // gap in s1
+	   }
+	   else // if (j==l2) 
+	   {
+	     score2 = ar_s[i-1][j] - 0;          // gap in s2
+	     score3 = ar_s[i][j-1] - gap_ext;    // gap in s1
+	     if ( !(ar_bto[i][j-1]&8) )
+	     {
+	       score3 -= gap_open;
+	     }
+	   }
+	 }
+
+	 DEBUGOUT4Del("al score1 ",  i-1,  j-1, score1);
+	 DEBUGOUT4Del("al score2 ",  i-1,  j,   score2);
+	 DEBUGOUT4Del("al score3 ",  i,    j-1, score3);
+
+	 DEBUGOUT4Del("2: al ar_bto[i-1][j]",       i-1,  j,   (int)ar_bto[i-1][j]);
+	 DEBUGOUT4Del("3: al ar_bto[i][j-1]",       i,    j-1, (int)ar_bto[i][j-1]);
+
+	 if (score1 >= score2 && score1 >= score3)
+	 {
+	   ar_s[i][j] = score1;
+	   ar_bto[i][j] = match_mismatch;  // set bit 1 or 2
+	   if (score1 == score2)
+	     ar_bto[i][j] += 4;      // set bit 3 in addition to other bit
+	   if (score1 == score3)
+	     ar_bto[i][j] += 8;     // set bit 4 in addition to what has been set before
+	 }
+	 else if (score2 >= score3) // gap in s2
+	 {
+	   ar_s[i][j]   = score2;
+	   ar_bto[i][j] = 4;        // set bit 3
+	   if (score2 == score3)
+	     ar_bto[i][j] = 12;     // set bit 4 in addition to bit 3
+	 }
+	 else // score3 > score2 and score1 // gap in s1
+	 {
+	   ar_s[i][j]   = score3;
+	   ar_bto[i][j] = 8;   // set bit 4
+	 }
+
+	 DEBUGCODE(
+		   log_file << "al: scores: ";
+		   print_index(log_file, i, j);
+		   log_file << score1 << " " << score2 << " " << score3
+		   << " " << ar_s[i][j] << " bto: " << (int)ar_bto[i][j]
+		   << endl;
+		   );
+       } // END Block
+     } // END loop over all cols
+   } // END loop over all rows
+
+
+/*    int col_maximum = ar_s[i][find_max_index_of_col(i)]; */
+
+/*      if (col_maximum < stopscore) */
+/*        //       break; // This means we leave the for (i=1; i < length; ++i) loop */
+/*     { */
+/*        DEBUGOUT1("Breaking out of for i loop in align_raw():"); */
+/*        // In this case we revert to the previous column to start the traceback */
+/*        last_col_computed = i-1; */
+
+/*        DEBUGOUT2("raw: last_col_computed reverted to :", last_col_computed); */
+
+/*        break; // This means we leave the for (i=1; i < length; ++i) loop */
+/*      } */
+
+
+//   print_ar_s(std::cerr);
+//   print_ar_bto(std::cerr);
+
+ }  // End align()
+
+
+
+
+ int traceback(faststring &alignment, align_coord &ac_start, align_coord &ac_end)
+ { 
+   int col, row;
+
+   // Let us determine the starting cooridnates for the backtracking procedure. Later this will be stored in ac_end
+   col = l1;
+   row = l2;
+
+/*    if (!free_back_gaps) // global alignment */
+/*    { */
+/*      row = l2; */
+/*      if (row <= 0 || row >= width) */
+/*      { */
+/*        cerr << "Critical out of bounds error: first row index in traceback out of bounds" << endl; */
+/*        exit(1); */
+/*      } */
+/*    } */
+/*    else */
+/*      row = find_max_index_of_col(col); */
+
+   DEBUGOUT2("Starting in col: ", col);
+   DEBUGOUT2("Starting in row: ", row);
+
+   ac_end.col = col;
+   ac_end.row = row;
+
+   alignment_score = ar_s[col][row];
+
+   align_coord curr_ac(col, row);
+
+   // Initialise last_ac. Otherwise it might be used uninitialized.
+   align_coord p1, p2, p3, last_ac = ac_end;
+   bool end_fixed_free_end_gaps     = false;
+   bool start_fixed_free_front_gaps = false;
+
+   while (curr_ac.col > 0 || curr_ac.row > 0)
+   {
+/*      if (curr_ac.col == 1) */
+/*      { */
+/*        cout << "COORD: "; */
+/*        curr_ac.print(cout); */
+/*        cout << endl; */
+/*      } */
+
+     DEBUGCODE(bool match;) 
+
+
+     DEBUGCODE(
+	       cerr << "curr_ac: ";
+	       curr_ac.print(cerr);
+	       cerr << "Matrix value: " << ar_s[curr_ac.col][curr_ac.row];
+	       cerr << endl;
+	       )
+
+     p1.col = curr_ac.col - 1;
+     p1.row = curr_ac.row - 1;
+
+     p2.col = curr_ac.col-1;
+     p2.row = curr_ac.row;     // horizontal (p2, 3rd bit, gap in s2)
+
+     p3.col = curr_ac.col;     // vertical   (p3, 4th bit, gap in s1)
+     p3.row = curr_ac.row-1;
+
+     DEBUGCODE(
+	       match = (ar_bto[curr_ac.col][curr_ac.row]&1);
+
+	       cerr << "Potential preds: ";
+	       cerr << "p1 ";
+	       p1.print(cerr);
+
+	       cerr << "p2 ";
+	       p2.print(cerr);
+
+	       cerr << " p3 ";
+	       p3.print(cerr);
+
+	       cerr << endl;
+ 
+	       if (ar_bto[curr_ac.col][curr_ac.row]&1)
+		 cerr << "Match" << endl;
+	       if (ar_bto[curr_ac.col][curr_ac.row]&2)
+		 cerr << "Mismatch" << endl;
+	       if (ar_bto[curr_ac.col][curr_ac.row]&4)
+		 cerr << "gap s2" << endl;
+	       if (ar_bto[curr_ac.col][curr_ac.row]&8)
+		 cerr << "gap s1" << endl;
+
+
+	       cerr << "Compare:" << endl;
+	       cerr << "Answer: " << ar_s[curr_ac.col][curr_ac.row] << endl;
+	       if (p1.valid(l1,l2) )
+	       {
+		 //		 cerr << "   match? " << ar_s[p1.col][p1.row] << "+" << match_score << endl;
+		 //		 cerr << "mismatch? " << ar_s[p1.col][p1.row] << "-" << mis_pen << endl;
+	       }
+	       else
+		 cerr << "   p1 is out of bounds. That is OK if we are in the first row or column." << endl;
+
+	       if (p2.valid(l1,l2) )
+		 cerr << "      p2? " << ar_s[p2.col][p2.row] << "-" << gap_ext << endl;
+	       else
+		 cerr << "   p2 is out of bounds. That is OK if we are in the first row or column." << endl;
+	       if (p3.valid(l1,l2) )
+		 cerr << "      p3? " << ar_s[p3.col][p3.row] << "-" << gap_ext << endl;
+	       else
+		 cerr << "   p3 is out of bounds. That is OK if we are in the first row or column." << endl; 
+	       );
+
+
+     // New version for finding the traceback
+
+     DEBUGCODE(if (ar_bto[curr_ac.col][curr_ac.row]==0)
+	       {
+		 cerr << "Error. Tracebackvalue == 0"<< endl;
+		 exit(1);
+	       }
+	       );
+
+     DEBUGOUT2("ar_bto[curr_ac.col][curr_ac.row] = ",char(ar_bto[curr_ac.col][curr_ac.row]+'0'));
+
+     if (ar_bto[curr_ac.col][curr_ac.row]&1) // If this is true, this was a match
+     {
+       DEBUGOUT1("Choosing match (p1)");
+       alignment.push_back('M');
+       curr_ac = p1;
+     }
+     else if (ar_bto[curr_ac.col][curr_ac.row]&2) 
+     {
+       DEBUGOUT1("Choosing mismatch (p1)");
+       alignment.push_back('m');
+       curr_ac = p1;
+     }
+     else if (ar_bto[curr_ac.col][curr_ac.row]&4)
+     {
+       DEBUGOUT1("Choosing gap s2 (p2)");     // left <- | gap in s2 | 'i' means: relative insertion in s1.
+       alignment.push_back('i');
+       curr_ac = p2;
+     }
+     else if (ar_bto[curr_ac.col][curr_ac.row]&8)
+     {
+       DEBUGOUT1("Choosing gap s1 (p3)");   //  up ^ | gap in s1 | 'd' means: relative deletion in s1.
+       alignment.push_back('d');
+       curr_ac = p3;
+     }
+     else
+     {
+       cerr << "Critical error in traceback_raw_alignment: No succ found at: ";
+       curr_ac.print(cerr);
+       cerr << endl;
+       exit(0);
+     }
+     // End: New version for finding the traceback
+
+     // In the case of free end gaps we have to find the end of the
+     // alignment dynamically. We enter as long as !end_fixed_free_end_gaps
+
+     if (free_back_gaps && !end_fixed_free_end_gaps)
+     {
+       if (alignment_score != ar_s[curr_ac.col][curr_ac.row] )
+       {
+	 ac_end = last_ac;
+	 end_fixed_free_end_gaps = true;
+       } 
+     }
+     //     else ac_end is l1, l2
+
+     if (free_front_gaps && !start_fixed_free_front_gaps)
+     {
+       if (curr_ac.col == 0 || curr_ac.row == 0)
+       {
+	 ac_start = curr_ac;
+	 start_fixed_free_front_gaps = true;
+       }
+     }
+     else if (!free_front_gaps)
+     {
+       ac_start = curr_ac; // Always the last enty has to be stored.
+     }
+     last_ac  = curr_ac;
+  } 
+   return alignment_score;
+ }
+
+
+ // Requires alignment mode 1 (local) for expected results.
+ void get_respective_start_end_coordinates(int          &s2_in_s1_start,
+					   int          &s2_in_s1_end,
+					   int          &s1_in_s2_start,
+					   int          &s1_in_s2_end,
+					   align_coord  a,
+					   align_coord  e,
+					   int          l1,
+					   int          l2,
+					   faststring   &alignment)
+ {
+   if (a.col > a.row)
+   {
+     s2_in_s1_start =  a.col;
+     s1_in_s2_start = -a.col;
+   }
+   else
+   {
+     s2_in_s1_start = -a.row;
+     s1_in_s2_start =  a.row;
+   }
+
+   if (*(alignment.begin()) == 'i')
+   {
+     s1_in_s2_end = -(l1 - e.col);
+     s2_in_s1_end = e.col;
+   }
+   else if (*(alignment.begin()) == 'd')
+   {
+     s1_in_s2_end = e.row;
+     s2_in_s1_end = -(l2 - e.row);
+   }
+   else
+   {
+     s1_in_s2_end = l2;
+     s2_in_s1_end = l1;
+   }
+ }
+
+
+
+ void alignment_strings(faststring &line1, faststring &line2, faststring &line3, faststring alignment)
+ {
+   line1.clear(); 
+   line2.clear();
+   line3.clear();
+
+   const char *i_al, *i_al_end;
+
+   const char *ps1 = s1;
+   const char *ps2 = s2;
+
+   i_al     = alignment.rbegin();
+   i_al_end = alignment.rend();
+
+   // Delete:
+   //   int num_m_M = 0;
+   //   int s1;
+
+   while (i_al != i_al_end)
+   {
+     if (*i_al == 'M') // Match
+     {
+       line1.push_back(*ps1);
+       ++ps1;
+       line3.push_back('|');
+       line2.push_back(*ps2);
+       ++ps2;
+       //       ++num_m_M;
+     }
+     else if (*i_al == 'm') // mismatch
+     {
+       line1.push_back(*ps1);
+       ++ps1;
+       line3.push_back(' ');
+       line2.push_back(*ps2);
+       ++ps2;
+       //       ++num_m_M;
+     }
+     else if (*i_al == 'i') // gap in s2, or insertion in s1
+     {
+       line1.push_back(*ps1);
+       ++ps1;
+       line3.push_back(' ');
+       line2.push_back('-');
+     }
+     else if (*i_al == 'd') // gap in s1, or insertion in s2
+     {
+       line1.push_back('-');
+       line3.push_back(' ');
+       line2.push_back(*ps2);
+       ++ps2;
+     }
+     --i_al;
+   }
+ }
+
+ int get_alignment_score()
+ {
+   return alignment_score;
+ }
+
+  // NEW
+ // Result only verified for mode==1
+ void coords_of_s1_in_al_string(faststring &alignment,
+				align_coord ac_start,
+				align_coord ac_end,
+				int len1,
+				int len2,
+				unsigned &s,
+				unsigned &e)
+ {
+   int          s2_in_s1_start;
+   int          s2_in_s1_end;
+   int          s1_in_s2_start;
+   int          s1_in_s2_end;
+
+   get_respective_start_end_coordinates(s2_in_s1_start,
+					s2_in_s1_end,
+					s1_in_s2_start,
+					s1_in_s2_end,
+					ac_start,ac_end,
+					len1, len2,
+					alignment);
+
+   if (s2_in_s1_start < 0)
+     s = 0;
+   else
+     s = s2_in_s1_start;
+
+   if (s1_in_s2_end < 0) // s1 extends beyond s2 in alignment at its end.
+     e = alignment.length() + s1_in_s2_end;
+   // If s1 does not extend beyond s2 at its end, s2 goes till the end:
+   else // s2_in_s1_end < 0 || s2_in_s1_end > 0 && s1_in_s2_end > 0
+     // s2_in_s1_end < 0: s2 extends beyond s1 in alignment at its end.
+     // s2_in_s1_end > 0 && s1_in_s2_end > 0: end simultanious.
+     e = alignment.length();
+ }
+
+ // NEW
+ // Usually used for mode==1 only! 
+ void al_perfection(faststring &alignment,
+		    align_coord ac_start,
+		    align_coord ac_end,
+		    int len1,
+		    int len2,
+		    unsigned &len,        // alignment covering s1
+		    unsigned &matches,    //
+		    unsigned &mismatches, //
+		    unsigned &gaps)       //
+ {
+   unsigned s,e; // Start and end in alignment string
+
+   unsigned al_len = alignment.length();
+
+   coords_of_s1_in_al_string(alignment,
+			     ac_start,
+			     ac_end,
+			     len1,
+			     len2,
+			     s,
+			     e);
+ 
+   if (s > e)
+   {
+     cerr << "Internal error: s>e in method al_perfection is not possible." << endl;
+     exit(-33);
+   }
+
+   if (e > al_len)
+   {
+     cerr << "Internal error: e>alignment.length() in method al_perfection is not possible." << endl;
+     exit(-33);
+   }
+
+
+   len        = e - s;
+   matches    = 0;
+   mismatches = 0;
+   gaps       = 0;
+
+   unsigned i, N;
+   char c;
+
+   i = al_len-e;
+   N = al_len-s;
+
+   for (; i<N; ++i)
+   {
+     c = alignment[i];
+     if (c == 'M')
+       ++matches;
+     else if (c == 'm')
+       ++mismatches;
+     else
+       ++gaps;
+   }
+ }
+
+};
+
+///////
+
+
+inline void pretty_print_alignment(FILE *of, faststring &line1, faststring &line2, faststring &line3, int char_per_line=50)
+{ 
+  //        0     .    :    .    :    .    :    .    :    .    :
+  faststring top_str = "    .    :    .    :    .    :    .    :    .    :";
+
+  int i=50;
+  while (i<char_per_line)
+  {
+    i += char_per_line;
+    top_str += "    .    :    .    :    .    :    .    :    .    :";
+  }
+
+  unsigned len = line1.size();
+  unsigned pos = 0;
+  unsigned back_pos = pos + char_per_line;
+
+  const char* l1 = line1.c_str();
+  const char* l2 = line2.c_str();
+  const char* l3 = line3.c_str();
+
+  unsigned n_print_now;
+  while (pos < len)
+  {
+    back_pos = pos + char_per_line;
+
+    if (back_pos > len)
+    {
+      back_pos    = len;
+    }
+    n_print_now = (unsigned)(back_pos - pos);
+
+    //    fprintf(of, "debug: %d\n", n_print_now);
+
+    fprintf(of, "%7d %.*s\n",     pos+1, n_print_now, top_str.data());
+    fprintf(of, "        %.*s\n", n_print_now, l1+pos);
+    fprintf(of, "        %.*s\n", n_print_now, l3+pos);
+    fprintf(of, "        %.*s\n\n", n_print_now, l2+pos);
+
+    pos += char_per_line;
+
+  }
+}
+
+inline void pretty_print_alignment_base0(FILE *of, faststring &line1, faststring &line2, faststring &line3, int char_per_line=50)
+{
+  //        0     .    :    .    :    .    :    .    :    .    :
+  faststring top_str = "     .    :    .    :    .    :    .    :    .    :";
+
+  int i=50;
+  while (i<char_per_line)
+  {
+    i += char_per_line;
+    top_str += "    .    :    .    :    .    :    .    :    .    :";
+  }
+
+  unsigned len = line1.size();
+  unsigned pos = 0;
+  unsigned back_pos = pos + char_per_line;
+
+  const char* l1 = line1.c_str();
+  const char* l2 = line2.c_str();
+  const char* l3 = line3.c_str();
+
+  unsigned n_print_now;
+  while (pos < len)
+  { 
+    back_pos = pos + char_per_line;
+
+    if (back_pos > len)
+    {
+      back_pos    = len;
+    }
+    n_print_now = (unsigned)(back_pos - pos);
+
+    //    fprintf(of, "debug: %d\n", n_print_now);
+
+    fprintf(of, "%7d %.*s\n",     pos, n_print_now, top_str.data());
+    fprintf(of, "        %.*s\n", n_print_now, l1+pos);
+    fprintf(of, "        %.*s\n", n_print_now, l3+pos);
+    fprintf(of, "        %.*s\n\n", n_print_now, l2+pos);
+
+    pos += char_per_line;
+
+  }
+}
+
+#endif
diff --git a/CBaitRecord.h b/CBaitRecord.h
new file mode 100644
index 0000000..31a7105
--- /dev/null
+++ b/CBaitRecord.h
@@ -0,0 +1,1376 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include <iostream>
+#include <fstream>
+#include "faststring2.h"
+#include <vector>
+#include <set>
+#include "Ctriple.h"
+#include "print_container.h"
+#include "CBlastParser.h"
+
+
+
+class CBaitRegionSelectorSets
+{
+  std::set<faststring>                               set_of_alignment_names;
+  std::set<std::pair<faststring, unsigned> >         set_of_alignment_names_feature_num;
+  std::set<Ctriple<faststring, unsigned, unsigned> > set_of_alignment_name_feature_num_start__ie_locus;
+
+ public:
+  void add(const faststring &str, unsigned i, unsigned j)
+  {
+    set_of_alignment_names.insert(str);
+    set_of_alignment_names_feature_num.insert(std::make_pair(str, i));
+    set_of_alignment_name_feature_num_start__ie_locus.insert(Ctriple<faststring, unsigned, unsigned>(str,i, j));
+  }
+
+
+  bool exists(const faststring &str) const
+  {
+    if (set_of_alignment_names.find(str) != set_of_alignment_names.end() )
+      return true;
+    else
+      return false;
+  }
+
+  bool exists(const faststring &str, unsigned i) const
+  {
+    if (set_of_alignment_names_feature_num.find(std::make_pair(str, i)) != set_of_alignment_names_feature_num.end() )
+      return true;
+    else
+      return false;
+  }
+
+  bool exists(const faststring &str, unsigned i, unsigned j) const
+  {
+    if (set_of_alignment_name_feature_num_start__ie_locus.find(Ctriple<faststring, unsigned, unsigned>(str,i,j)) != set_of_alignment_name_feature_num_start__ie_locus.end() )
+      return true;
+    else
+      return false;
+  }
+
+  void print_all(std::ostream &os) const
+  {
+    os << "Selector string (alignment) argument:" << std::endl;
+    print_container(os, set_of_alignment_names, "", "\n" , "\n");
+    os << "Selector string (alignment) arument, unsigned (feature number): " << std::endl;
+    print_container(os, set_of_alignment_names_feature_num, "", "\n" , "\n");
+    os << "Selector string (alignment) arument, unsigned (feature number), unsigned (start): " << std::endl;
+    print_container(os, set_of_alignment_name_feature_num_start__ie_locus, "", "\n" , "\n");
+  }
+
+  void print_num_genes_num_features(std::ostream &os, const char *s) const
+  {
+    os << s << "Bait regions have been determined for this number of different:" << std::endl;
+    os << s << "Alignment files                                             " << set_of_alignment_names.size() << std::endl;
+    os << s << "Feature (is identical to number of files if not applicable: " << set_of_alignment_names_feature_num.size() << std::endl;
+    os << s << "Bait regions:                                               " << set_of_alignment_name_feature_num_start__ie_locus.size() << std::endl;
+  }
+};
+
+class CBait
+{
+  faststring bait;
+  double     CG;
+  double     max_dist;
+  unsigned   tiling_index;  // 1 based index in tiling array. 1: first tile; 2: second tile, etc.
+
+ public:
+
+  CBait(faststring &str)
+  {
+    faststring pre, post1, post2;
+
+    str.divide_at(' ', pre, post2);
+    if (!pre.isAnUnsigned())
+    {
+      std::cerr << "Baits are preceeded by a number indicating the index of the tiling design column. This number could not be found for the following bait:"
+		<< std::endl;
+      std::cerr << str << std::endl;
+      std::cerr << "Exiting." << std::endl;
+      exit(-4);
+    }
+    tiling_index = pre.ToUnsigned();
+    post2.divide_at(' ', pre, post1);
+    bait = pre;
+    post1.divide_at(' ', pre, post2);
+    if (!pre.isADouble())
+    {
+      std::cerr << "Baits are proceeded by two double numbers containing the CG content and the maximum distance in its cluster.\n"
+		<< "Expecting a double number for the CG content but found: " << pre 
+		<< std::endl;
+      std::cerr << "Exiting." << std::endl;
+      exit(-4);
+    }
+    if (!post2.isADouble())
+    {
+      std::cerr << "Baits are proceeded by two double numbers containing the CG content and the maximum distance in its cluster.\n"
+		<< "Expecting a double number for the distance value but found: " << post2 
+		<< std::endl;
+      std::cerr << "Exiting." << std::endl;
+      exit(-4);
+    }
+
+    CG       = pre.ToDouble();
+    max_dist = post2.ToDouble();
+  }
+  
+  faststring& get_bait()
+  {
+    return bait;
+  }
+
+  unsigned get_tiling_index()
+  {
+    return tiling_index;
+  }
+
+  void print(std::ostream &os)
+  {
+    os << tiling_index  << " " << bait << " " << CG << " " << max_dist;
+  }
+
+  double get_max_distance()
+  {
+    return max_dist;
+  }
+
+  double get_CG_content()
+  {
+    return CG;
+  }
+
+}; // END CBait
+
+// Forward declaration of friend functions of the CBaitLocus class. Avoids friend injection problems:
+class CBaitLocus;
+bool num_baits_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+bool num_sequences_in_region_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+bool gene_name__feature_num_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+
+bool num_baits_greaterThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+bool num_sequences_in_region_greaterThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+bool gene_name__feature_num_greaterThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+
+bool gene_name__feature_num_lessThanOrEqualCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+
+bool seq_name__feature_num_start_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+
+bool locus_start_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b);
+
+
+
+class CBaitLocus
+{
+  faststring seq_name;
+  faststring gene_name;
+  unsigned   feature_num;
+  unsigned   num_features;
+  unsigned   start;
+  unsigned   num_sequences_in_region;
+  unsigned   num_baits;
+  unsigned   bait_length;
+  unsigned   number_of_tiles;
+
+  std::vector<CBait*> bait_vec;
+
+ public:
+
+  CBaitLocus(faststring &str)
+  {
+    std::vector<faststring> container;
+    container.reserve(7);
+    split(container, str, "\t|#");
+    //split(container, str, "\t");
+
+    if (container.size() != 8)
+    {
+      std::cerr << std::endl;
+      std::cerr << "An error occurred while parsing the bait file. The line of input that causes the problem is:\n";
+      std::cerr << str << std::endl;
+      std::cerr << "The line does not contain 8 tab delimited fields as required." << std::endl;
+      exit(-1);
+    }
+
+    container[0].removeSpacesFront();
+    container[0].removeSpacesBack();
+    container[1].removeSpacesFront();
+    container[1].removeSpacesBack();
+    container[2].removeSpacesFront();
+    container[2].removeSpacesBack();
+    container[3].removeSpacesFront();
+    container[3].removeSpacesBack();
+    container[4].removeSpacesFront();
+    container[4].removeSpacesBack();
+    container[5].removeSpacesFront();
+    container[5].removeSpacesBack();
+    container[6].removeSpacesFront();
+    container[6].removeSpacesBack();
+    container[7].removeSpacesFront();
+    container[7].removeSpacesBack();
+
+    seq_name                = container[0];
+    gene_name               = container[1];
+    feature_num             = container[2].ToUnsigned();
+    num_features            = container[3].ToUnsigned();
+    start                   = container[4].ToUnsigned();
+    num_sequences_in_region = container[5].ToUnsigned();
+    num_baits               = container[6].ToUnsigned();
+
+    std::list<faststring> b;
+    split(b, container[7], ",");
+
+    std::list<faststring>::iterator it, it_end;
+
+    CBait *p_tmp;
+
+    it     = b.begin();
+    it_end = b.end();
+
+    number_of_tiles = 0;
+    // For all baits in this bait region:
+    while(it != it_end)
+    {
+      p_tmp = new CBait(*it);
+      bait_vec.push_back(p_tmp);
+      if (p_tmp->get_tiling_index() > number_of_tiles)
+	number_of_tiles = p_tmp->get_tiling_index();
+
+/*       if (0) */
+/*       { */
+/* 	std::cerr << "Adding bait:" << std::endl; */
+/* 	bait_vec.back()->print(std::cerr); */
+/* 	std::cerr << std::endl; */
+/*       } */
+
+      ++it;
+    }
+    if (bait_vec.size() != 0)
+    {
+      bait_length = bait_vec[0]->get_bait().size();
+    }
+    else
+    {
+      bait_length = 0;
+    }
+  }
+
+  ~CBaitLocus()
+  {
+    std::vector<CBait *>::iterator it, it_end;
+    it     = bait_vec.begin();
+    it_end = bait_vec.end();
+
+    while (it != it_end)
+    {
+      delete *it;
+      ++it;
+    }
+  }
+
+  faststring &get_seq_name()
+  {
+    return seq_name;
+  }
+
+  const faststring &get_gene_name() const
+  {
+    return gene_name;
+  }
+
+  void get_vector_of_baits(unsigned tiling_index, std::vector<CBait*> &v)
+  {
+    std::vector<CBait*>::iterator it, it_end;
+    it     = bait_vec.begin();
+    it_end = bait_vec.end();
+
+    v.clear();
+    v.reserve(bait_vec.size());
+
+    if (tiling_index == 0) // all
+    {
+      while (it != it_end)
+      {
+	v.push_back(*it);
+	++it;
+      }
+    }
+    else
+    {
+      while (it != it_end)
+      {
+	if ((**it).get_tiling_index() == tiling_index)
+	{
+	  v.push_back(*it);
+	}
+	++it;
+      }
+    }
+  }
+
+  unsigned get_feature_num() const
+  {
+    return feature_num;
+  }
+
+  unsigned get_start() const
+  {
+    return start;
+  }
+  
+  unsigned get_number_of_tiles() const
+  {
+    return number_of_tiles;
+  }
+
+  unsigned get_bait_length() const
+  {
+    return bait_length;
+  }
+
+  faststring get_bait_region_name_string()
+  {
+    return seq_name + "|" + gene_name + "|" + faststring(feature_num) + "|" + faststring(start);
+  }
+
+  // TODO: Change this to FILE * instead of using ostream.
+  // Known formats are 'f', 's' for the 2 paramter version of this function.
+  void print(std::ostream &os, char format)
+  {
+    std::vector<CBait *>::iterator i1, i2, i3;
+    //    faststring name;
+    unsigned count = 1;
+
+    i1 = bait_vec.begin();
+    i2 = bait_vec.end();
+
+    if (format == 'f') // fasta
+    {
+      //      name = ">" + seq_name + "|" + gene_name + "|" + faststring(feature_num) + "|" + faststring(start);
+
+      while (i1 != i2)
+      {
+	os << ">" << get_bait_region_name_string()  << "|" << (**i1).get_tiling_index(); 
+	os         << "|" << count    << std::endl;
+	os << (**i1).get_bait()       << std::endl;
+	++i1;
+	++count;
+      }
+      
+    } // END if (format == 'f') // fasta
+    else if (format == 's') // standard - same as input
+    {
+      i3 = i2;
+      --i3;
+      os << seq_name << "\t"
+	 << gene_name << "\t"
+	 << feature_num << "\t"
+	 << num_features  << "\t"
+	 << start  << "\t"
+	 << num_sequences_in_region  << "\t"
+	 << num_baits << "\t";
+
+      // Works for 0, 1, or more elements in vector:
+      if (i1 != i2) // Should always be the case, but be cautious
+      {
+	while (true)
+	{
+	  
+	  (**i1).print(os);
+	  if (i1 == i3)
+	    break;
+	  os << ",";
+	  ++i1;
+	  ++count;
+	}
+      }
+      os << std::endl;
+    }
+  }
+
+  // TODO: Change this to FILE * instead of using ostream.
+  // Known formats are 'A' for the 3 paramter version of this function.
+  void print(std::ostream &os, char format, const char *probeIDprefix)
+  {
+    std::vector<CBait *>::iterator i1, i2, i3;
+    //    faststring name;
+
+    i1 = bait_vec.begin();
+    i2 = bait_vec.end();
+
+    if (format == 'A') // Agilent-Germany format:
+    {
+      unsigned t_index, t_index_old = 0;
+      unsigned count = 1;
+
+      while (i1 != i2)
+      {
+	t_index = (**i1).get_tiling_index();
+	
+	if (t_index != t_index_old)
+	{
+	  t_index_old = t_index;
+	  count = 1;
+	}
+
+	os << gene_name     << "_" << feature_num << '\t'
+	   << probeIDprefix
+	   << gene_name     << "_" 
+	   << feature_num   << "_" 
+	   << num_features  << "_"
+	   << start         << "_"
+	   << t_index       << "_"
+	   << count                              << '\t' 
+	   << (**i1).get_bait()
+	   << "\t1"        << std::endl;
+	++i1;
+	++count;
+      }
+    }
+  }
+
+
+
+  void print_stats(std::ostream &os)
+  {
+    os << "Locus: " << gene_name << " " << feature_num << " " << start << " Num baits: " << bait_vec.size() << " bait-length :" << bait_length << std::endl;
+  }
+
+  unsigned get_num_baits()
+  {
+    return num_baits;
+  }
+
+  unsigned get_num_sequences()
+  {
+    return num_sequences_in_region;
+  }
+
+  // Can be used to compute mean values together with get_num_baits()
+  double get_sum_max_distances()
+  {
+    int     i, N=num_baits;
+    double  sum=0;
+
+    for (i=0; i<N; ++i)
+    {
+      sum += bait_vec[i]->get_max_distance();
+    }
+    return sum;
+  }
+
+  double get_overall_max_dist()
+  {
+    int     i, N = num_baits;
+    double  overall_max  = -1000;  // True values must be in the range 0..1
+    double  dist;
+
+    for (i=0; i<N; ++i)
+    {
+      dist = bait_vec[i]->get_max_distance();
+      if (dist > overall_max)
+	overall_max = dist;
+    }
+    return overall_max;
+  }
+
+  // Can be used to compute mean values together with get_num_baits()
+  double get_sum_CG()
+  {
+    int     i, N=num_baits;
+    double  sum=0;
+
+    for (i=0; i<N; ++i)
+    {
+      sum += bait_vec[i]->get_CG_content();
+    }
+    return sum;
+  }
+
+
+  friend bool num_baits_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    // For an equal number of baits, prefer a locus based on more sequences.
+    if (a->num_baits == b->num_baits)
+      return a->num_sequences_in_region > b->num_sequences_in_region;
+
+    return a->num_baits < b->num_baits;
+  }
+
+  friend bool num_sequences_in_region_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    // For loci based on an equal number of sequences, prefer the one with less needed baits.
+    // Note: This comparator sorts in reversed order.
+    if (a->num_sequences_in_region == b->num_sequences_in_region)
+      return a->num_baits > b->num_baits;
+      
+    return a->num_sequences_in_region < b->num_sequences_in_region;
+  }
+
+  // First criterion:  gene_name
+  // Second criterion: feature num
+  // Third  criterion: locus start coordinate
+  friend bool gene_name__feature_num_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    if (a->gene_name != b->gene_name)
+      return a->gene_name < b->gene_name;
+
+    if (a->feature_num != b->feature_num)
+      return a->feature_num < b->feature_num;
+    
+    return a->start < b->start;
+  }
+
+  friend bool num_baits_greaterThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    if (a->num_baits == b->num_baits)
+      return  a->num_sequences_in_region < b->num_sequences_in_region;
+
+    return a->num_baits > b->num_baits;
+  }
+
+  friend bool num_sequences_in_region_greaterThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    if (a->num_sequences_in_region == b->num_sequences_in_region)
+      return a->num_baits < b->num_baits;
+
+    return a->num_sequences_in_region > b->num_sequences_in_region;
+  }
+
+  friend bool gene_name__feature_num_greaterThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    if (a->gene_name != b->gene_name)
+      return a->gene_name > b->gene_name;
+
+    if (a->feature_num != b->feature_num)
+      return a->feature_num > b->feature_num;
+    
+    return a->start > b->start;
+  }
+
+
+  friend bool locus_start_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    if (a->gene_name == b->gene_name)
+      return a->start < b->start;
+    return a->gene_name < b->gene_name;
+  }
+
+  friend bool seq_name__feature_num_start_lessThanCBaitLocus(CBaitLocus *a, CBaitLocus *b)
+  {
+    if (a->seq_name != b->seq_name)
+      return a->seq_name < b->seq_name;
+
+    if (a->feature_num != b->feature_num)
+      return a->feature_num < b->feature_num;
+    
+    return a->start < b->start;
+  }
+
+}; // END CBaitLocus
+
+
+
+
+class CBaitLoci_collection
+{
+  std::vector<CBaitLocus*>                                       baitLoci_vec;
+  std::map<Ctriple<faststring, unsigned, unsigned>, CBaitLocus*> baitLoci_map;
+  bool                                                           delete_in_destructor;
+  //  unsigned                                                       bait_length; // Will be set to 0 in constructor and will be adjusted to its true value in the add method.
+  //                                                                              // The fact that we have one value for a collection of baits implies, that we assume that all baits in all loci have the same length.
+
+  // Internal add 
+  void add_locus(CBaitLocus *p)
+  {
+    baitLoci_vec.push_back(p);
+    baitLoci_map.insert(std::pair<Ctriple<faststring, unsigned, unsigned>, CBaitLocus*>(Ctriple<faststring, unsigned, unsigned>(p->get_seq_name(), p->get_feature_num(), p->get_start()), p) );
+
+    //    unsigned new_bait_length = p->get_bait_length();
+
+/*     if (bait_length == 0) */
+/*       bait_length = new_bait_length; */
+/*     else */
+/*     { */
+/*       if (bait_length != new_bait_length) */
+/*       { */
+/* 	std::cerr << "ERROR: It is assumed that all baits in all bait loci have identical lenghts." << std::endl;  */
+/* 	exit(-4); */
+/*       } */
+/*     } */
+  }
+
+
+ public:
+ CBaitLoci_collection(std::ifstream &is):delete_in_destructor(true) //, bait_length(0)
+  {
+    faststring line;
+
+    getline(is, line);
+    while (!is.eof())
+    {
+      line.removeSpacesBack();
+      line.removeSpacesFront();
+      if (line[0] != '#' && !line.empty() )
+	add_locus(new CBaitLocus(line) );
+      getline(is, line);
+    }
+    if (!is_partially_ordered() )
+    {
+      std::cerr << "Note: Bait loci in input file are not ordered or genes appear twice." << std::endl;
+      std::cerr << "Note: Lets try to order them." << std::endl;
+      sort_by_gene_name__feature_num(baitLoci_vec.begin(), baitLoci_vec.end());
+    }
+  }
+
+
+ CBaitLoci_collection(CBaitLoci_collection &source, char genes_or_features, char num_baits_or_sequences):delete_in_destructor(false) //, bait_length(0)
+  {
+/*     { */
+/*       std::cout << "++++++++++++++" << std::endl; */
+/*       std::cout << "Full set: DEBUG OUT" << std::endl; */
+/*       source.print_all(std::cout, 's'); */
+/*       std::cout << "++++++++++++++" << std::endl; */
+/*     } */
+
+
+    if (!source.is_partially_ordered() )
+    {
+      //      std::cout << "Source loci have to be sorted partially:" << std::endl;
+      source.sort_within_genes(gene_name__feature_num_lessThanCBaitLocus);
+      if (!source.is_partially_ordered() )
+	if (global_verbosity >= 1)
+	{
+	  std::cout << "WARNING: Sorting NOT successful." << std::endl;
+	}
+/*       else */
+/* 	std::cout << "Sorting was successful." << std::endl; */
+    }
+
+/*     { */
+/*       std::cout << "**************" << std::endl; */
+/*       std::cout << "Full set: DEBUG OUT" << std::endl; */
+/*       source.print_all(std::cout, 's'); */
+/*       std::cout << "**************" << std::endl; */
+/*     } */
+
+    // Sort such the the best loci is first in each "group" of loci.
+    if (genes_or_features == 'g')
+    {
+      //      std::cout << "Sorting within genes" << std::endl;
+      if (num_baits_or_sequences == 'b')
+	source.sort_within_genes(num_baits_lessThanCBaitLocus);
+      else if (num_baits_or_sequences == 's')
+	source.sort_within_genes(num_sequences_in_region_greaterThanCBaitLocus);
+    }
+    else if (genes_or_features == 'f')
+    {
+      //      std::cout << "Sorting within features" << std::endl;
+      if (num_baits_or_sequences == 'b')
+	source.sort_within_featues(num_baits_lessThanCBaitLocus);
+      else if (num_baits_or_sequences == 's')
+	source.sort_within_featues(num_sequences_in_region_greaterThanCBaitLocus);
+    }
+
+/*     { */
+/*       std::cout << "##############" << std::endl; */
+/*       std::cout << "Full set: DEBUG OUT" << std::endl; */
+/*       source.print_all(std::cout, 's'); */
+/*       std::cout << "##############" << std::endl; */
+/*     } */
+
+    // Add best to this:
+    std::vector<CBaitLocus*>::iterator it, it_end, it_tmp;
+    it     = source.baitLoci_vec.begin();
+    it_end = source.baitLoci_vec.end();
+
+    if (genes_or_features == 'g')
+    {
+      while (it != it_end)
+      {
+	add_locus(*it);
+	//	baitLoci_vec.push_back(*it);
+	it = source.find_end_this_gene(it);
+      }
+    }
+    else if (genes_or_features == 'f')
+    {
+      while (it != it_end)
+      {
+	//	std::cout << "Next it:" << std::endl;
+	//	(**it).print(std::cout, 's');
+	//	std::cout << "==" << std::endl;
+	add_locus(*it);
+	//	baitLoci_vec.push_back(*it);
+	it = source.find_end_this_feature(it);
+      }
+    }
+    sort_within_genes(gene_name__feature_num_lessThanCBaitLocus);
+  } // END CBaitLoci_collection(CBaitLoci_collection &source, char genes_or_features, char num_baits_or_sequences)
+
+
+ CBaitLoci_collection(const CBaitLoci_collection &source, const CBaitRegionSelectorSets &lss, char mode):delete_in_destructor(false) // , bait_length(0)
+ {
+   unsigned i, N;
+   N=source.baitLoci_vec.size();
+
+   if (mode == 'b')      // Remove all loci from ALIGNMENT if a double hit occurs in this set
+   {
+     for (i=0; i<N; ++i)
+     {
+       CBaitLocus *p = source.baitLoci_vec[i];
+
+       if (!lss.exists(p->get_seq_name()) )
+       {
+	 add_locus(p);
+	 //	 baitLoci_vec.push_back(p);
+       }
+     }
+   }
+   else if (mode == 'B') // Remove all loci from FEATURE if a double hit occurs in this set
+   {
+     for (i=0; i<N; ++i)
+     {
+       CBaitLocus *p = source.baitLoci_vec[i];
+
+       if (!lss.exists(p->get_seq_name(), p->get_feature_num()) )
+       {
+	 add_locus(p);
+	 //	 baitLoci_vec.push_back(p);
+       }
+     }
+   }
+   if (mode == 'x')      // Remove Locus is if a double hit occurs in it
+   {
+     for (i=0; i<N; ++i)
+     {
+       CBaitLocus *p = source.baitLoci_vec[i];
+
+       if (!lss.exists(p->get_seq_name(), p->get_feature_num(), p->get_start()) )
+       {
+	 add_locus(p);
+	 //	 baitLoci_vec.push_back(p);
+       }
+     }
+   }
+ }
+
+
+ CBaitLoci_collection(const CBaitLoci_collection &source, CBlast_parser &bp, double minimum_coverage):delete_in_destructor(false) //, bait_length(source.bait_length)
+  {
+    unsigned    tile_index, number_of_tiles;
+    faststring  recognition_string;
+    double      best_coverage_this_tiling_stack;
+    bool        bait_region_has_tiling_stack_with_insufficient_coverage;
+    int         max_hit_length, bait_length_this_bait_region;
+    unsigned    count, N;
+
+    std::vector<CBaitLocus*>::const_iterator it, it_end;
+
+    it     = source.baitLoci_vec.begin();
+    it_end = source.baitLoci_vec.end();
+
+    N = source.baitLoci_vec.size();
+    count = 0;
+
+    // for each bait region
+    while (it != it_end)
+    {
+      ++count;
+      number_of_tiles                 = (**it).get_number_of_tiles();
+      bait_length_this_bait_region    = (**it).get_bait_length();;
+/*             std::cout << "Number of tiles for: " << (**it).get_bait_region_name_string() */
+/* 		<< " " << number_of_tiles << std::endl; */
+
+      if (bait_length_this_bait_region == 0)
+      {
+	// We have a problem. Something seems to have gone wrong. This should not happen.
+	std::cerr << "The bait length has been determined to be 0 for the bait region: " << std::endl;  
+	(**it).print(std::cerr, 's');
+	std::cerr << "This bug should be reported. It should not occur. It might be caused by mal formated input files,"
+	             " but the error should be caught earlier than here." << std::endl;
+	exit(-5);
+      }
+
+      if (global_verbosity > 2)
+      {
+	std::cout << "Region: " << count << " of " << N << std::endl;
+      }
+
+      // Within each bait region determine the maximum hit coverage of all baits
+      // For each tiling stack of baits:
+
+      // Each tiling stack has to be checked individually.
+      // A single tiling stack with insufficient query coverage should result in the exclusion of this bait region.
+      bait_region_has_tiling_stack_with_insufficient_coverage = false;
+      for (tile_index=1; tile_index <= number_of_tiles; ++tile_index)
+      {
+	// Do something with (**it):
+	// Determine string to identify blast hits of baits of this bait region and tiling_index against the genome. 
+	recognition_string = (**it).get_bait_region_name_string() + "|" + tile_index + "|";  
+
+	//	std::cout << "T1: " << time(NULL) << std::endl;
+	max_hit_length = bp.get_max_hit_query_span__matching_beginning2(recognition_string, global_verbosity);
+	//	std::cout << "T2: " << time(NULL) << std::endl;
+
+	best_coverage_this_tiling_stack = (double) max_hit_length/bait_length_this_bait_region;
+
+	if (global_verbosity > 50)
+	{
+	  std::cout << "Tile: " << tile_index << " " << recognition_string << " " << max_hit_length << "/" << bait_length_this_bait_region << "=" << best_coverage_this_tiling_stack << std::endl;
+	}
+
+	if (best_coverage_this_tiling_stack < 0)
+	{
+	  if (global_verbosity > 50)
+	  {
+	    std::cout << "No hit for recognition string: " << recognition_string << " --> "
+		      << 0.00 << std::endl;
+	  }
+	}
+	else
+	{
+	  if (global_verbosity > 50)
+	  {
+	    std::cout << "Determined best coverage of this tiling stack: " << recognition_string << " --> "
+		      << best_coverage_this_tiling_stack << std::endl;
+	  }
+	}
+
+	if (best_coverage_this_tiling_stack < minimum_coverage)
+	  bait_region_has_tiling_stack_with_insufficient_coverage = true;
+      }
+
+      if (!bait_region_has_tiling_stack_with_insufficient_coverage)
+      {
+	add_locus(*it);
+      }
+      ++it;
+    }
+  }
+
+  ~CBaitLoci_collection()
+  {
+    if (delete_in_destructor)
+    {
+      std::vector<CBaitLocus*>::iterator it, it_end;
+      it     = baitLoci_vec.begin();
+      it_end = baitLoci_vec.end();
+
+      while (it != it_end)
+      {
+	delete *it;
+	++it;
+      }
+    }
+  }
+
+
+  void get_map_of_baits_to_locus_info(faststring seq_name_match, unsigned tiling_index, std::map<faststring, CBaitLocus *> &bait_map)
+  {
+    //    sort_by_seq_name__feature_num_start();
+
+    std::vector<CBaitLocus*>::iterator it_Locus, it_Locus_end;
+    it_Locus     = baitLoci_vec.begin();
+    it_Locus_end = baitLoci_vec.end();
+
+    std::vector<CBait *> tmp_bait_vec;
+
+    unsigned i, N;
+
+    std::map<faststring, CBaitLocus *>::iterator find_it;
+
+    while (it_Locus != it_Locus_end)
+    {
+      if ( (**it_Locus).get_seq_name().find(seq_name_match) != faststring::npos)
+      {
+	(**it_Locus).get_vector_of_baits(tiling_index, tmp_bait_vec);
+
+	N=tmp_bait_vec.size();
+	for (i=0; i<N; ++i)
+	{
+	  faststring &thebait = tmp_bait_vec[i]->get_bait();
+	  find_it = bait_map.find(thebait);
+	  if (find_it == bait_map.end())  // Insert, if not present yet.
+	    bait_map[thebait] = *it_Locus;
+	}
+      }
+      ++it_Locus;
+    }
+  }
+
+/*   void clean_NULL_elements_form_baitLoci_vec() */
+/*   { */
+/*     std::vector<CBaitLocus*>::iterator it_end, it1, it2; */
+/*     unsigned count = 0; */
+    
+/*     it1 = it2 = baitLoci_vec.begin(); */
+/*     it_end    = baitLoci_vec.end(); */
+
+/*     // Advance it2 until we have the first NUll element: */
+/*     while (*it2 != NULL && it2 != it_end) */
+/*     { */
+/*       ++it1; */
+/*       ++it2; */
+/*       ++count; */
+/*     } */
+
+/*     // if it2 is not at the end, it will point to a NULL element */
+/*     while (it2 != it_end) */
+/*     { */
+/*       // Find next non-NULL element: */
+/*       while (*it2 == NULL && it2 != it_end) */
+/*       { */
+/* 	++it2; */
+/*       } */
+/*       if (it2 == it_end) */
+/* 	break; */
+/*       //Copy: */
+/*       *it1 = *it2; */
+/*       ++count; */
+      
+/*       ++it1; */
+/*       ++it2; */
+/*     } */
+
+/*     // Resize vector: */
+/*     baitLoci_vec.resize(count, 0); */
+
+/*   } */
+
+
+  void sort_by_num_baits(std::vector<CBaitLocus*>::iterator it, std::vector<CBaitLocus*>::iterator it_end)
+  {
+    sort (it, it_end, num_baits_lessThanCBaitLocus);
+  }
+
+  void sort_by_num_sequences(std::vector<CBaitLocus*>::iterator it, std::vector<CBaitLocus*>::iterator it_end)
+  {
+    sort (it, it_end, num_sequences_in_region_greaterThanCBaitLocus);
+  }
+
+  void sort_by_gene_name__feature_num(std::vector<CBaitLocus*>::iterator it, std::vector<CBaitLocus*>::iterator it_end)
+  {
+    sort (it, it_end, gene_name__feature_num_lessThanCBaitLocus);
+  }
+
+
+  unsigned get_number_of_loci()
+  {
+    return baitLoci_vec.size();
+  }
+
+
+  void print_stats(std::ostream &os)
+  {
+    unsigned numBaits = 0;
+    
+    os << "Number of loci: " << baitLoci_vec.size() << std::endl;
+
+    std::vector<CBaitLocus*>::iterator it, it_end;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    while (it != it_end)
+    {
+      (**it).print_stats(os);
+      numBaits += (**it).get_num_baits();
+      ++it;
+    }
+    os << "Total number of baits: " << numBaits << std::endl;
+    //    os << "Bait length:           " << bait_length  << std::endl;
+  }
+
+
+  //////////////////
+  // We nowimpelmented this in a constructor to be consistent with other filtering steps.
+  //////////////////
+/*   void filter_hit_coverage(double minimum_coverage, CBlast_parser &bp) */
+/*   { */
+/*     unsigned    tile_index, number_of_tiles; */
+/*     faststring  recognition_string; */
+/*     double      best_coverage_this_tiling_stack; */
+/*     bool        bait_region_has_tiling_stack_with_insufficient_coverage; */
+
+/*     std::vector<CBaitLocus*>::iterator it, it_end; */
+
+/*     it     = baitLoci_vec.begin(); */
+/*     it_end = baitLoci_vec.end(); */
+
+/*     // for each bait region */
+/*     while (it != it_end) */
+/*     { */
+/*       number_of_tiles = (**it).get_number_of_tiles(); */
+/* /\*             std::cout << "Number of tiles for: " << (**it).get_bait_region_name_string() *\/ */
+/* /\* 		<< " " << number_of_tiles << std::endl; *\/ */
+
+/*       // Within each bait region determine the maximum hit coverage of all baits */
+/*       // For each tiling stack of baits: */
+
+/*       // Each tiling stack has to be checked individually. */
+/*       // A single tiling stack with insufficient query coverage should result in the exclusion of this bait region. */
+/*       bait_region_has_tiling_stack_with_insufficient_coverage = false; */
+/*       for (tile_index=1; tile_index <= number_of_tiles; ++tile_index) */
+/*       { */
+/* 	// Do something with (**it): */
+/* 	// Determine string to identify blast hits of baits of this bait region and tiling_index against the genome.  */
+/* 	recognition_string = (**it).get_bait_region_name_string() + "|" + tile_index + "|";   */
+	
+/* 	best_coverage_this_tiling_stack = (double) bp.get_max_hit_query_span__matching_beginning1(recognition_string)/bait_length; */
+
+/* 	if (best_coverage_this_tiling_stack < 0) */
+/* 	{ */
+/* 	  std::cout << "No hit for recognition string: " << recognition_string << " --> " */
+/* 		    << 0.00 << std::endl; */
+/* 	} */
+/* 	else */
+/* 	{ */
+/* 	  std::cout << "Determined best coverage of this tiling stack: " << recognition_string << " --> " */
+/* 		    << best_coverage_this_tiling_stack << std::endl; */
+/* 	} */
+
+/* 	if (best_coverage_this_tiling_stack < minimum_coverage) */
+/* 	  bait_region_has_tiling_stack_with_insufficient_coverage = true; */
+/*       } */
+
+/*       if (bait_region_has_tiling_stack_with_insufficient_coverage) */
+/*       { */
+/* 	if (delete_in_destructor) */
+/* 	  delete *it; */
+/* 	*it = NULL; */
+/*       } */
+/*     } */
+
+/*     clean_NULL_elements_form_baitLoci_vec(); */
+/*   } */
+
+
+  void print_all(std::ostream &os, char format)
+  {
+    std::vector<CBaitLocus*>::iterator it, it_end;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    if (format == 's')
+    {
+      os <<  "# Corresponding sequence name\tGene-name\tfeature-number\tnumber-of-features-of-specified-type-for-this-gene-in-gff-file\tstart-coordinate-of-bait-region-in-alignment\tnumber-of-sequences-in-region-the-baits-are-based-on\tnumber-of-baits-constructed-for-this-bait-region\tList of baits - each bait is proceed by the tiling stack number and followed by CG content and the maximum distance to the sequences in the alignment." << std::endl;
+    }
+
+    if ( !(format == 's' || format == 'f' ) )
+    {
+      std::cerr << "ERROR: Unkown internal format " << format << " found in call to CBaitLoci_collection::print_all(2 paramters)" << std::endl;
+      exit(-24);
+    }
+
+    while (it != it_end)
+    {
+      (**it).print(os, format);
+      ++it;
+    }
+  }
+
+
+  void print_all(std::ostream &os, char format, const char *probeIDprefix)
+  {
+    std::vector<CBaitLocus*>::iterator it, it_end;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    if (format == 'A')
+    {
+      os << "TargetID\tProbeID\tSequence\tReplication" << std::endl;
+    }
+    else
+    {
+      std::cerr << "ERROR: Unkown internal format " << format << " found in call to CBaitLoci_collection::print_all(3 parameters)" << std::endl;
+      exit(-25);
+    }
+
+    while (it != it_end)
+    {
+      (**it).print(os, format, probeIDprefix);
+      ++it;
+    }
+  }
+
+
+  void fill_locus_selector(CBaitRegionSelectorSets &ls) const
+  {
+    std::vector<CBaitLocus*>::const_iterator it, it_end;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    while (it != it_end)
+    {
+      ls.add( (**it).get_gene_name(),
+	      (**it).get_feature_num(),
+	      (**it).get_start() );
+      ++it;
+    }
+  }
+
+
+  void print_with_start_stepwidth(std::ostream &os, char format, unsigned start, unsigned step)
+  {
+    if (format == 's')
+    {
+      os <<  "# Corresponding sequence name\tGene-name\tfeature-number\tnumber-of-features-of-specified-type-for-this-gene-in-gff-file\tstart-coordinate-of-bait-region-in-alignment\tnumber-of-sequences-in-region-the-baits-are-based-on\tnumber-of-baits-constructed-for-this-bait-region\tList of baits - each bait is proceed by the tiling stack number and followed by CG content and the maximum distance to the sequences in the alignment." << std::endl;
+    }
+
+    unsigned i,N = baitLoci_vec.size();
+
+    i = start-1;  // start is 1 based, i is 0 based. Therefore we have to subtract 1.
+    while (i < N)
+    {
+      baitLoci_vec[i]->print(os, format);
+      i += step;
+    }
+  }
+
+  std::vector<CBaitLocus*>::iterator find_end_this_feature(std::vector<CBaitLocus*>::iterator it)
+  {
+    unsigned   the_feature_num = (**it).get_feature_num();
+    faststring the_gene_name    = (**it).get_gene_name();
+
+    while (it != baitLoci_vec.end() )
+    {
+      if (the_feature_num != (**it).get_feature_num() || the_gene_name != (**it).get_gene_name())
+      {
+	break;
+      }
+      ++it;
+    }
+    return it;
+  }
+
+  std::vector<CBaitLocus*>::iterator find_end_this_gene(std::vector<CBaitLocus*>::iterator it)
+  {
+    faststring the_gene_name    = (**it).get_gene_name();
+
+    while (it != baitLoci_vec.end() )
+    {
+      if (the_gene_name != (**it).get_gene_name())
+      {
+	break;
+      }
+      ++it;
+    }
+    return it;
+  }
+
+  void sort_within_featues(bool (*f)(CBaitLocus*,CBaitLocus*))
+  {
+    std::vector<CBaitLocus*>::iterator it, it_end, it_tmp;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    while (it != it_end)
+    {
+      // Find end of this gene:
+      it_tmp = find_end_this_feature(it);
+      //      std::cout << "Sort range: " << distance(baitLoci_vec.begin(), it) << " " << distance(baitLoci_vec.begin(), it_tmp) << std::endl;
+      sort(it,it_tmp, f);
+      it = it_tmp;
+    }
+  }
+
+  void sort_within_genes(bool (*f)(CBaitLocus*,CBaitLocus*))
+  {
+    std::vector<CBaitLocus*>::iterator it, it_end, it_tmp;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    while (it != it_end)
+    {
+      // Find end of this gene:
+      it_tmp = find_end_this_gene(it);
+      sort(it,it_tmp, f);
+      it = it_tmp;
+    }
+  }
+
+  void sort_by_seq_name__feature_num_start()
+  {
+    sort(baitLoci_vec.begin(), baitLoci_vec.end(), seq_name__feature_num_start_lessThanCBaitLocus);
+  }
+
+
+  bool is_ordered_within_genes()
+  {
+    std::vector<CBaitLocus*>::iterator it, it_end, it_tmp;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    if (it == it_end)
+      return true;
+
+    it_tmp = it;
+    ++it_tmp;
+
+    while (it_tmp != it_end)
+    {
+      if (!gene_name__feature_num_lessThanCBaitLocus(*it, *it_tmp) )
+	return false;
+      it = it_tmp;
+      ++it_tmp;
+    }
+    return true;
+  }
+
+
+  // Determines whether feature numbers reappear in successive loci
+  // if a different feature number was found in between.
+  // This ordering is assumed when filtering for the best loci in a feature.
+  bool is_partially_ordered()
+  {
+    std::set<faststring> set_genes_features;
+
+    std::vector<CBaitLocus*>::iterator it, it_end;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+
+    unsigned   the_feature_num;
+    faststring the_gene_name;
+
+    if (it == it_end)
+      return true;
+
+    the_feature_num  = (**it).get_feature_num();
+    the_gene_name    = (**it).get_gene_name();
+
+    faststring gene_feature_name;
+    gene_feature_name = the_gene_name + "_" + the_feature_num;
+    set_genes_features.insert(gene_feature_name);
+
+    while (it != it_end)
+    {
+      if (the_feature_num != (**it).get_feature_num() || the_gene_name != (**it).get_gene_name() )
+      {
+	// new gene or exon:
+	the_feature_num   = (**it).get_feature_num();
+	the_gene_name     = (**it).get_gene_name();
+	gene_feature_name = the_gene_name + "_" + the_feature_num;
+
+	if ( set_genes_features.find(gene_feature_name) != set_genes_features.end() )
+	{
+	  return false;  // We have seen this gene/exon combination before. So we return false;
+	}
+	set_genes_features.insert(gene_feature_name);
+      }
+      ++it;
+    }
+    return true;
+  }
+
+  void get_seqs_baits_count(unsigned &NumSeqs, unsigned &NumBaits) const
+  {
+    std::vector<CBaitLocus*>::const_iterator it, it_end;
+    it     = baitLoci_vec.begin();
+    it_end = baitLoci_vec.end();
+    
+    unsigned local_NumSeqs  = 0;
+    unsigned local_NumBaits = 0;
+
+    while (it != it_end)
+    {
+      local_NumSeqs  += (**it).get_num_sequences();
+      local_NumBaits += (**it).get_num_baits();
+      ++it;
+    }
+
+    NumSeqs  = local_NumSeqs;
+    NumBaits = local_NumBaits; 
+  }
+
+
+  void count_seqs_baits_for_start_and_offset(unsigned start_count, unsigned offset_count,
+					     unsigned &sum_seq,    unsigned &sum_baits)
+  {
+    unsigned i,N;
+    N = baitLoci_vec.size();
+
+    sum_seq = sum_baits = 0;
+
+    for (i=start_count; i<N; i += offset_count)
+    {
+      sum_baits += baitLoci_vec[i]->get_num_baits();
+      sum_seq   += baitLoci_vec[i]->get_num_sequences();
+    }
+  }
+
+  double get_max_dist_mean() const
+  {
+    double   sum=0;
+    double   num=0;
+    int     i, N = baitLoci_vec.size();
+    
+    for (i=0; i<N; ++i)
+    {
+      sum += baitLoci_vec[i]->get_sum_max_distances();
+      num += baitLoci_vec[i]->get_num_baits();
+    }
+
+    //    std::cerr << "sum max distances: " << sum << std::endl;
+    //    std::cerr << "num baits:         " << num << std::endl;
+
+    return sum/num;
+  }
+  
+  double get_overall_max_dist() const
+  {
+    double overall_max_dist = -1000;  // True values must be in the range 0..1.
+    double om_dist;
+    int    i, N             = baitLoci_vec.size();
+    
+    for (i=0; i<N; ++i)
+    {
+      om_dist = baitLoci_vec[i]->get_overall_max_dist();
+      if (om_dist > overall_max_dist)
+      {
+	overall_max_dist = om_dist;
+      }
+    }
+    return overall_max_dist;
+  }
+
+
+  double get_CG_mean() const
+  {
+    double   sum=0;
+    double   num=0;
+    int     i, N = baitLoci_vec.size();
+    
+    for (i=0; i<N; ++i)
+    {
+      sum += baitLoci_vec[i]->get_sum_CG();
+      num += baitLoci_vec[i]->get_num_baits();
+    }
+    return sum/num;
+  }
+
+}; // END CBaitLoci_collection
diff --git a/CBlastParser.h b/CBlastParser.h
new file mode 100644
index 0000000..28eaa6f
--- /dev/null
+++ b/CBlastParser.h
@@ -0,0 +1,1774 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+// Some parts of this header file could be made more efficient.
+// Much of the functionalilty relys on a sorted list of Blast hits.
+// The question arises whether a list is the best data structure for such 
+// a purpose. It could be more efficient to use a data sturcture such as
+// a set, which is sorted automatically and which should in principle be
+// more efficient.
+
+
+#ifndef CBLASTPARSER_H
+#define CBLASTPARSER_H
+
+
+#include <iostream>
+#include "CFile/CFile2_1.h"
+#include "faststring2.h"
+#include <vector>
+#include <set>
+#include <list>
+#include "CSeqNameList.h"
+
+#include "range_functions.h"
+#include "CHistogram.h"
+
+#include "typedefs.h"
+
+class CTaxonomy;
+class CBlastHit;
+
+// Forward declaration of friend functions in order to make them globally visible (friend injection problem):
+bool less_than_CBlastHit_query(const CBlastHit &a, const CBlastHit &b);
+bool less_than_CBlastHit_query_quality(const CBlastHit &a, const CBlastHit &b);
+bool less_than_CBlastHit_target(const CBlastHit &a, const CBlastHit &b);
+bool operator<(const CBlastHit &a, const CBlastHit &b);
+bool less_than_CBlastHit_pointer_query(const CBlastHit *a, const CBlastHit *b);
+bool less_than_CBlastHit_pointer_query_quality(const CBlastHit *a, const CBlastHit *b);
+bool less_than_CBlastHit_pointer_target(const CBlastHit *a, const CBlastHit *b);
+
+
+signed char CB_is_gi_of_type(CTaxonomy *tax, unsigned gi, unsigned type);
+//signed char 
+
+struct struct_less_than_CBlastHit_pointer_query_quality
+{
+  bool operator()(const CBlastHit *a, const CBlastHit *b)
+  {
+    return less_than_CBlastHit_pointer_query_quality(a,b);
+  }
+};
+
+
+static void __add_or_count(std::map<unsigned, unsigned> &m, unsigned x)
+{
+  std::map<unsigned, unsigned>::iterator it;
+
+  it = m.find(x);
+  if (it == m.end() )
+  {
+    m[x] = 1;
+  }
+  else
+  {
+    ++it->second;
+  }
+}
+
+/* //Not used in most applications. Not tested yet. Needs to be tested before it is used.
+static void majority_rule(std::vector<unsigned> v, int &val, double &prop)
+{
+  CHistogram h(v, -10);
+
+  double value;
+
+  h.dominant_category(value, prop);
+
+  val = (int)(value+0.5); // Adding 0.5 ensures we are not returning a wrong int due to
+                          // rounding errors.
+}
+*/
+
+class CBlastHit
+{
+ private:
+  unsigned internal_number;
+
+  faststring target_seq_name;
+  faststring query_seq_name;
+
+  double perfection;
+  unsigned length;
+  unsigned mismatches;
+  unsigned gaps;
+
+  bool reverse_query;
+  bool reverse_target;
+  
+  unsigned start_query;
+  unsigned end_query;
+  unsigned start_target;
+  unsigned end_target;
+
+  double   e_value;
+  double   score;
+
+ public:
+
+ CBlastHit(const faststring& line, unsigned in):internal_number(in)
+  {
+    std::vector<faststring> v;
+
+    split(v, line);
+
+    //    std::cout << v.size() << std::endl;
+
+    if (v.size() == 12)
+    {
+      
+      query_seq_name  = v[0];
+      target_seq_name = v[1];
+
+      perfection      = v[2].ToDouble();
+      length          = v[3].ToUnsigned();
+      mismatches      = v[4].ToUnsigned();
+      gaps            = v[5].ToUnsigned();
+  
+      start_query     = v[6].ToUnsigned();
+      end_query       = v[7].ToUnsigned();
+
+      //      std::cerr << "Identfied start_query: " <<  start_query << std::endl;
+      //      std::cerr << "Identfied end_query:   " <<  end_query << std::endl;
+
+      start_target    = v[8].ToUnsigned();
+      end_target      = v[9].ToUnsigned();
+      
+      e_value         = v[10].ToDouble();
+      score           = v[11].ToDouble();
+
+      if (start_query > end_query)
+      {
+	reverse_query= true;
+	unsigned tmp;
+	tmp         = start_query;
+	start_query = end_query;
+	end_query   = tmp;
+      }
+      else
+	reverse_query= false;
+
+      if (start_target > end_target)
+      {
+	reverse_target = true;
+	unsigned tmp;
+	tmp          = start_target;
+	start_target = end_target;
+	end_target   = tmp;
+      }
+      else
+	reverse_target= false; 
+    }
+    else
+    {
+      std::cerr << "Unrecognized line of input passed to CBlastHit constructor: " << line << std::endl;
+    }
+  }
+
+  double get_perfection()
+  {
+    return perfection;
+  }
+
+  unsigned get_length()
+  {
+    return length;
+  }
+
+  unsigned get_query_span()
+  {
+    if (end_query >= start_query)
+      return end_query - start_query+1;
+    else
+      return start_query - end_query+1;
+  }
+
+  // Searches for gi|xxxxxxxx| in the query sequence and returns the xxx string. 
+  void extract_GI_number_query(faststring &gi)
+  {
+    faststring::size_t pos1 = query_seq_name.find("gi|");
+    faststring::size_t pos2;
+    if (pos1 != faststring::npos)
+    {
+      pos2 = query_seq_name.find("|", pos1+3);
+      if (pos2 == faststring::npos) // No proper gi number found so we return empty string; 
+      {
+	gi.clear();
+	return;
+      }
+      gi   = query_seq_name.substr(pos1+3, pos2-pos1-3);
+      return;
+    }
+    else // No proper gi number found so we return empty string;
+    {
+      gi.clear();
+      return;
+    }
+  }
+
+  void extract_GI_number_target(faststring &gi)
+  {
+    faststring::size_t pos1 = target_seq_name.find("gi|");
+    faststring::size_t pos2;
+    if (pos1 != faststring::npos)
+    {
+      pos2 = target_seq_name.find("|", pos1+3);
+      if (pos2 == faststring::npos) // No proper gi number found so we return empty string; 
+      {
+	gi.clear();
+	return;
+      }
+      gi   = target_seq_name.substr(pos1+3, pos2-pos1-3);
+      return;
+    }
+    else // No proper gi number found so we return empty string;
+    {
+      gi.clear();
+      return;
+    }
+  }
+
+
+  double get_evalue()
+  {
+    return e_value;
+  }
+
+  unsigned get_start_query()
+  {
+    return start_query;
+  }
+
+  unsigned get_end_query()
+  {
+    return end_query;
+  }
+
+  unsigned get_start_target()
+  {
+    return start_target;
+  }
+
+  unsigned get_end_target()
+  {
+    return end_target;
+  }
+
+  const faststring &get_query_seq_name()
+  {
+    return query_seq_name;
+  }
+
+  const faststring &get_target_seq_name()
+  {
+    return target_seq_name;
+  }
+
+
+  friend bool less_than_CBlastHit_query(const CBlastHit &a, const CBlastHit &b)
+  {
+    // sort first by -query name, -query start, -query end, - target name, target start, target end, -length, -perfection
+
+    //    a.print(std::cerr);
+    //    b.print(cerr);
+
+    // Primary criterion: Query seq name:
+    if (a.query_seq_name != b.query_seq_name)
+      return a.query_seq_name < b.query_seq_name;
+
+    if (a.start_query != b.start_query)
+      return a.start_query < b.start_query;
+    if (a.end_query != b.end_query)
+      return a.end_query < b.end_query;
+
+    if (a.target_seq_name != b.target_seq_name)
+      return a.target_seq_name < b.target_seq_name;
+
+    if (a.start_target != b.start_target)
+      return a.start_target < b.start_target;
+
+    if (a.end_target != b.end_target)
+      return a.end_target < b.end_target;
+
+    // They should be irrelvant since we would have multiple identical hits
+    // if we come here.
+    if (a.length != b.length)
+      return a.length < b.length;
+
+    //    if (a.perfection != b.perfection)   // Including this line is a bug. This was a bug.
+      return a.perfection < b.perfection;
+  }
+
+  friend bool less_than_CBlastHit_query_quality(const CBlastHit &a, const CBlastHit &b)
+  {
+    // First criterion: name of query sequence: accending (smaller is "better")
+    // Second criterion: e_value accending (smaller is better)
+    // Third criterion: score descending (higher is better)
+    // Fourth criterion: perfection descending (higher is better)
+    // Fifth criterion: sequence positions
+    // Sixth criterion: target sequence name and positions
+
+    // sort first by -query name, -query start, -query end, - target name, target start, target end, -length, -perfection
+
+    //    a.print(std::cerr);
+    //    b.print(cerr);
+
+    // Primary criterion: Query seq name:
+    if (a.query_seq_name != b.query_seq_name)
+      return a.query_seq_name < b.query_seq_name;
+
+    // Secondary criterion: e_value
+    if (a.e_value != b.e_value)
+      return a.e_value < b.e_value;
+
+    if (a.score != b.score)
+      return a.score > b.score;
+
+    if (a.perfection != b.perfection)
+      return a.perfection > b.perfection;
+
+    if (a.start_query != b.start_query)
+      return a.start_query < b.start_query;
+
+    if (a.end_query != b.end_query)
+      return a.end_query < b.end_query;
+
+    if (a.target_seq_name != b.target_seq_name)
+      return a.target_seq_name < b.target_seq_name;
+
+    if (a.start_target != b.start_target)
+      return a.start_target < b.start_target;
+
+    if (a.end_target != b.end_target)
+      return a.end_target < b.end_target;
+
+    // They should be irrelvant since we would have multiple identical hits
+    // if we come here.
+    //    if (a.length != b.length)   // Including this line is a bug. This was a bug.
+      return a.length < b.length;
+  }
+
+
+
+
+  friend bool less_than_CBlastHit_target(const CBlastHit &a, const CBlastHit &b)
+  {
+    // sort first by -query name, -query start, -query end, - target name, target start, target end, -length, -perfection
+
+    //    a.print(std::cerr);
+    //    b.print(cerr);
+
+    // Primary criterion: Target seq name:
+
+
+    if (a.target_seq_name != b.target_seq_name)
+      return a.target_seq_name < b.target_seq_name;
+
+    if (a.start_target != b.start_target)
+      return a.start_target < b.start_target;
+
+    if (a.end_target != b.end_target)
+      return a.end_target < b.end_target;
+
+    if (a.query_seq_name != b.query_seq_name)
+      return a.query_seq_name < b.query_seq_name;
+
+    if (a.start_query != b.start_query)
+      return a.start_query < b.start_query;
+
+    if (a.end_query != b.end_query)
+      return a.end_query < b.end_query;
+
+    // They should be irrelvant since we would have multiple identical hits
+    // if we come here.
+    if (a.length != b.length)
+      return a.length < b.length;
+
+    //    if (a.perfection != b.perfection)  // Including this line is a bug. This was a bug.
+      return a.perfection < b.perfection;
+  }
+
+  friend bool operator<(const CBlastHit &a, const CBlastHit &b)
+  {
+    //    std::cout << "---------------" << std::endl;
+    return less_than_CBlastHit_query(a,b);
+  }
+
+  friend bool less_than_CBlastHit_pointer_query(const CBlastHit *a, const CBlastHit *b)
+  {
+    return (*a < *b);
+  }
+
+  friend bool less_than_CBlastHit_pointer_query_quality(const CBlastHit *a, const CBlastHit *b)
+  {
+    return (less_than_CBlastHit_query_quality(*a, *b));
+  }
+
+  friend bool less_than_CBlastHit_pointer_target(const CBlastHit *a, const CBlastHit *b)
+  {
+    return (less_than_CBlastHit_target(*a, *b));
+  }
+
+  void print(std::ostream &os, char delim = '\t') const
+  {
+    os << internal_number << delim;
+    os << query_seq_name << delim;
+    os << target_seq_name << delim;
+
+    os << perfection << delim;
+    os << length << delim;
+    os << mismatches << delim;
+    os << gaps << delim;
+  
+    os << start_query << delim;
+    os << end_query << delim;
+    os << start_target << delim;
+    os << end_target << delim;
+    
+    os << e_value << delim;
+    os << score;
+    os << std::endl;
+  }
+
+  void print(std::ostream &os,
+	     bool pinternal_number,
+	     bool pqueryname,
+	     bool ptargetname,
+	     bool pperfection,
+	     bool plength,
+	     bool pmismatches,
+	     bool pgaps,
+	     bool pstart_query,
+	     bool pend_query,
+	     bool pstart_target, 
+	     bool pend_target,
+	     bool pe_value, 
+	     bool pscore,
+	     char delim = '\t') const
+  {
+    if (pinternal_number)
+      os << internal_number << delim;
+
+    if (pqueryname)
+      os << query_seq_name << delim;
+
+    if (ptargetname)
+      os << target_seq_name << delim;
+
+    if (pperfection)
+      os << perfection << delim;
+
+    if (plength)
+      os << length << delim;
+    
+    if (pmismatches)
+      os << mismatches << delim;
+
+    if (pgaps)
+      os << gaps << delim;
+  
+    if (pstart_query)
+      os << start_query << delim;
+    
+    if (pend_query)
+      os << end_query << delim;
+
+    if (pstart_target)
+      os << start_target << delim;
+
+    if (pend_target)
+      os << end_target << delim;
+    
+    if (pe_value)
+      os << e_value << delim;
+
+    if (pscore)
+      os << score;
+
+    os << std::endl;
+  }
+
+  void print_essential_1(std::ostream &os, char delim = '\t') const
+  {
+    os << query_seq_name << delim;
+    os << "E: "   << e_value << delim;
+    os << "len: " << length << delim;
+    os << "%: "   << perfection << delim;
+    os << std::endl;
+  }
+
+
+
+};
+
+
+class CBlast_parser
+{
+  std::list<CBlastHit*> lbh;
+  std::map<faststring, CBlastHit*>  bh_map;
+
+  // Stores coverage in bp. If query seq. length is known it can be used to determine the relative sequence length.
+  std::map<faststring, unsigned> total_coverage_map; 
+
+  bool query_name_quality_sorted;
+  //TODO: add delete in destructor concept to improve performance in some constructors by avoiding to copy the data.
+
+  void add(CBlastHit* p)
+  {
+    lbh.push_back(p);
+    bh_map.insert(bh_map.end(), std::make_pair<faststring, CBlastHit*>(p->get_query_seq_name(), p));
+  }
+
+ public:
+ CBlast_parser(const char *filename):query_name_quality_sorted(false)
+  {
+    CFile f;
+    faststring line;
+    unsigned counter=0;
+
+    f.ffopen(filename);
+
+#ifdef FINANA
+    std::cerr << "We are in the FINANA mode." << std::endl;
+#endif
+
+    f.getline(line);
+    while (!f.fail() )
+    {
+      line.removeSpacesFront();
+      line.removeSpacesBack();
+      
+      if (!line.empty() && line[0] != '#') // if not a comment - allows to read the -m 9 in addition to the -m 8 output format
+      {
+	CBlastHit* p = new CBlastHit(line, counter);
+
+	// Debugging code:
+	//	if (counter > 1)
+	//	  break;
+
+	++counter;
+	add(p);
+      }
+      f.getline(line);
+    }
+  }
+
+  // Default constructor - rarely used.
+ CBlast_parser():query_name_quality_sorted(false)
+  {}
+
+
+  ~CBlast_parser()
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    while (it != it_end)
+    {
+      //      (**it).print(std::cout);
+      delete *it;
+      ++it;
+    }
+  }
+
+  // See also keep_only_n_top_hits
+  // Copy constructor that can be used to filter the n first blast hits for a query.
+  // Will be sorted by query name, since the source will be sorted.
+ CBlast_parser(CBlast_parser &b, unsigned n=-1u):query_name_quality_sorted(true)
+  {
+    b.sort_by_query_name_quality();
+
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = b.lbh.begin();
+    it_end = b.lbh.end();
+
+    faststring last_qname;
+    unsigned count = 0;
+
+    while (it != it_end)
+    {
+      if ((**it).get_query_seq_name() == last_qname)
+      {
+	++count;
+      }
+      else
+      {
+	count = 1;
+	last_qname = (**it).get_query_seq_name();
+      }
+
+      CBlastHit* tmp_copy;
+      if (count <= n)
+      {
+	tmp_copy = new CBlastHit(**it);
+	add(tmp_copy);
+      }
+
+      ++it;
+    }
+  }
+
+  // Copy constructor which filters hits that have a specific taxonomy
+  // of the target.
+  CBlast_parser(CBlast_parser &b, CTaxonomy *tax, unsigned type,
+		signed char (*func)(CTaxonomy *, unsigned, unsigned)):query_name_quality_sorted(b.query_name_quality_sorted)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = b.lbh.begin();
+    it_end = b.lbh.end();
+
+    unsigned    target_gi;
+    faststring  tmp;
+    CBlastHit   *tmp_copy;
+    signed char res;
+
+    while (it != it_end)
+    {
+      (**it).extract_GI_number_target(tmp);
+      target_gi = tmp.ToUnsigned();
+
+      res = func(tax,target_gi, type);
+      if (res < 0)
+      {
+	std::cerr << "Warning: In CBlast_parser. res < 0.\n\n" << std::endl;
+	std::cerr << "GI number seems to be unknown: String: " << tmp << " unsigned: " << target_gi << std::endl;
+	//	exit(0);
+      }
+      
+      if (res > 0)
+      {
+	tmp_copy = new CBlastHit(**it);
+	add(tmp_copy);
+      }
+      ++it;
+    }
+  }
+
+  // Copy constructor which filters hits that have a match in the title field
+  CBlast_parser(CBlast_parser &b, CTaxonomy *tax, std::vector<faststring> &query_strings,
+		signed char (*func)(CTaxonomy *, unsigned, std::vector<faststring> &query_strings)):query_name_quality_sorted(b.query_name_quality_sorted)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = b.lbh.begin();
+    it_end = b.lbh.end();
+
+    unsigned     target_gi;
+    faststring   tmp;
+    CBlastHit    *tmp_copy;
+    signed char  res;
+
+    while (it != it_end)
+    {
+      (**it).extract_GI_number_target(tmp);
+      target_gi = tmp.ToUnsigned();
+
+      res = func(tax,target_gi, query_strings);
+      if (res < 0)
+      {
+	std::cerr << "Error in CBlast_parser. res < 0.\n\n" << std::endl;
+	exit(0);
+      }
+      
+      if (res > 0)
+      {
+	tmp_copy = new CBlastHit(**it);
+	add(tmp_copy);
+      }
+      ++it;
+    }
+  }
+
+  void clear()
+  {
+    lbh.clear();
+    query_name_quality_sorted = false;
+  }
+
+
+  unsigned get_hit_count()
+  {
+    return lbh.size();
+  }
+
+
+  void keep_only_n_top_hits(unsigned n=1)
+  {
+    sort_by_query_name_quality();
+    //    lbh.sort(less_than_CBlastHit_pointer_query_quality);
+
+    std::list<CBlastHit*>::iterator it, it2, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    faststring last_name;
+    unsigned i=1;
+
+    while (it != it_end)
+    {
+      if ( (**it).get_query_seq_name() == last_name )
+      {
+	++i; // Count this hit
+	if (i>n)
+	{
+	  // Remove *it:
+	  delete *it;
+	  it = lbh.erase(it);
+	} // it noe points to the hit behind the hit that has been removed.
+	  // it should not be incremented any more.
+      }
+      else
+      {
+	last_name = (**it).get_query_seq_name();
+	i=1;
+	++it;
+      }
+    }
+  }
+
+  // Remove all hits for func does not return true when given gi:
+  void keep_only_hits_for_which_func_returns_true_for_parameter_gi(CTaxonomy *tax,
+								   bool (*func)(CTaxonomy *, unsigned gi),
+								   const char *s)
+  {
+    std::list<CBlastHit*>::iterator it, it2, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    unsigned gi;
+    faststring tmp;
+    unsigned count = 0;
+
+    while (it != it_end)
+    {
+      (**it).extract_GI_number_target(tmp);
+      gi = tmp.ToUnsigned();
+
+      if (!func(tax, gi))
+      {
+	std::cerr << s << (**it).get_target_seq_name() << " Gi: " << gi << ". Blast hit will be removed.\n";
+	++count;
+	
+	// Remove *it:
+	delete *it;
+	it = lbh.erase(it);
+      }
+      else
+      {
+	++it;
+      }
+    }
+
+    std::cerr << "WARNING: Number of blast hits removed since no taxid could be found for gi: "
+	      << count
+	      << std::endl; 
+  }
+
+
+  void keep_only_e_select(double max_e, double factor_max_decrease)
+  {
+    // Sort by query name, then by e-value.
+    // Filter all those with e < max_e and e < best-hit-this-query * factor_max_decrease
+
+    sort_by_query_name_quality();
+    //    lbh.sort(less_than_CBlastHit_pointer_query_quality);
+
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    faststring last_hit_query = "";
+    double     best_e_value_this_query;
+    bool       erase_this;
+
+
+    while (it != it_end)
+    {
+      faststring  this_hit_query   = (*it)->get_query_seq_name();
+      double      this_hit_e       = (*it)->get_evalue();
+      erase_this                   = false;
+
+      if (this_hit_e < max_e)
+      {
+	if (this_hit_query == last_hit_query) // Still the same query
+	{
+	  // 
+	  if (this_hit_e > best_e_value_this_query*factor_max_decrease)
+	  {
+	    erase_this = true;
+	  }
+	  // else // if "<=" then keep
+	  
+	  if (this_hit_e < best_e_value_this_query)
+	  {
+	    // Should never happen since this is sorted.
+	    std::cerr << "Error better evalue found: ";
+	    (*it)->print(std::cerr);
+	    std::cerr << std::endl;
+	  }
+	}
+	else  // A new query sequence
+	{
+	  // Must be best hit this query
+	  last_hit_query          = this_hit_query;
+	  best_e_value_this_query = this_hit_e; 
+	  // keep
+	}
+      } // if (this_hit_e < max_e)
+      else // erase
+      {
+	erase_this = true;
+      }
+
+      // Simple logic to remove this hit.
+      if (erase_this)
+      {
+	  delete *it;
+	  it = lbh.erase(it);
+      }
+      else
+      {
+	++it;
+      }
+    }
+  }
+
+
+
+
+
+  void print_all(std::ostream &os)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    while (it != it_end)
+    {
+      (*it)->print(os);
+      ++it;
+    }
+  }
+
+  void print_all(std::ostream &os,
+	     bool pinternal_number,
+	     bool pqueryname,
+	     bool ptargetname,
+	     bool pperfection,
+	     bool plength,
+	     bool pmismatches,
+	     bool pgaps,
+	     bool pstart_query,
+	     bool pend_query,
+	     bool pstart_target, 
+	     bool pend_target,
+	     bool pe_value, 
+	     bool pscore,
+	     char delim = '\t')
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    while (it != it_end)
+    {
+      (*it)->print(os, 
+		   pinternal_number,
+		   pqueryname,
+		   ptargetname,
+		   pperfection,
+		   plength,
+		   pmismatches,
+		   pgaps,
+		   pstart_query,
+		   pend_query,
+		   pstart_target, 
+		   pend_target,
+		   pe_value, 
+		   pscore,
+		   delim = '\t');
+      ++it;
+    }
+  }
+
+  void print_with_title(std::ostream &os, const std::map<unsigned, faststring> &gi2title_map)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    faststring  tmp;
+    unsigned    target_gi;
+
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    while (it != it_end)
+    {
+      (*it)->print_essential_1(os);
+      os << std::endl;
+      (**it).extract_GI_number_target(tmp);
+      target_gi = tmp.ToUnsigned();
+
+      const_iterator_U_Faststring_map find_it;
+      find_it = gi2title_map.find(target_gi);
+      
+      if (find_it != gi2title_map.end() )
+      {
+	os << find_it->second << std::endl;
+      }
+      else
+      {
+	os << "*** No title available. for gi" << target_gi << " ***" << std::endl;
+      }
+      ++it;	
+    }
+
+
+  }
+
+  void sort_by_query_name_quality()
+  {
+    //    std::cerr << "RESORT" << std::endl;
+    if (!query_name_quality_sorted)
+    {
+      lbh.sort(less_than_CBlastHit_pointer_query_quality);
+      query_name_quality_sorted = true;
+    }
+  }
+
+  // Calling this function is discurraged. We recommend to call:
+  // sort_by_query_name_quality(), since this is more efficient
+  // in the case of multiple calls.
+  void sort_query()
+  {
+    lbh.sort(less_than_CBlastHit_pointer_query);
+    query_name_quality_sorted = false;
+  }
+
+
+  void sort_target()
+  {
+    lbh.sort(less_than_CBlastHit_pointer_target);
+    query_name_quality_sorted = false;
+  }
+
+
+  std::list<CBlastHit*>::iterator begin()
+  {
+    return lbh.begin();
+  } 
+
+
+  std::list<CBlastHit*>::iterator end()
+  {
+    return lbh.end();
+  }
+
+  /*
+  void erase(std::list<CBlastHit*>::iterator it)
+  {
+    lbh.erase(it);
+  }
+  */
+
+  void filter_CSeqNameList_with_major_blast_hit(CSeqNameList &orig, CSeqNameList &result_with,
+						double min_query_prop, double min_perfection, double max_evalue,
+						bool min_query_prop_with_respect_to_all_hits_this_query,
+						const char * accepted_hits_Log_file_name=NULL,
+						CSeqNameList *target_list=NULL, const char * search_expr=NULL)
+  {
+    if ( orig.is_only_names() )
+    {
+      std::cerr << "Object orig was created with the opion <only_names>." << std::endl;
+      std::cerr << "Do not know how to proceed." << std::endl;
+      exit(0);
+    }
+
+    if (min_query_prop_with_respect_to_all_hits_this_query)
+      compute_coverage_map(min_perfection, max_evalue);
+
+    bool check_target_seq_match = target_list!= NULL && search_expr != NULL;
+
+    std::list<CBlastHit*>::iterator it, it_end;
+
+    sort_by_query_name_quality();
+    //    sort_query(); // This guarantees that hits are ordered by query name.
+                        // This will be used here.
+
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    // List of seq names:
+    unsigned id_of_hit;
+
+    //    std::map<faststring *, unsigned, less_than_pointer_to_faststring_struct>::iterator it_find;
+
+    CBlastHit* tmp;
+
+    faststring sname; // = tmp->get_query_seq_name();
+    faststring lastname;
+
+    FILE *accepted_hits_log;
+    if (accepted_hits_Log_file_name != NULL)
+    {
+      accepted_hits_log = fopen(accepted_hits_Log_file_name, "w");
+    }
+
+    // We move through all Blast hits:
+    while (it != it_end)
+    {
+      tmp = *it;
+
+      unsigned seq_len;
+      unsigned hit_len;
+      double   hit_coverage;
+      double   hit_perfection;
+      double   hit_evalue;
+
+      // Get name of query of blast hit:
+      sname = tmp->get_query_seq_name();
+
+      if (sname != lastname) // We never want to add the same sequence twice.
+	                     // If it has been added (see below) we won't check hits with the same query name
+	                     // If the last hit has not been added lastname
+	                     // should not have been updated to this name.
+      {
+	// Look up the name of the query in the list of sequences in the fasta file.
+	// Remember: blast tells us the short name only.
+	id_of_hit = orig.get_id_short_name(sname); 
+ 
+	//      std::cerr << "sname " << sname << " "  << id_of_hit << std::endl;
+	
+	if (id_of_hit == -1u)
+	{
+	  std::cerr << "Error: Could not find sequence name: " 
+		    << tmp->get_query_seq_name()
+		    << " for which a blast hit has been found in fasta file. I guess the files are incompatible or target and query are interchanged!!"
+		    << std::endl;
+	}
+	else // Sequence of blast hit has been found
+	{
+	  seq_len        = orig.get_seq_length(id_of_hit);
+	  if (min_query_prop_with_respect_to_all_hits_this_query)
+	  {
+	    std::map<faststring, unsigned>::iterator it_find;
+	    it_find = total_coverage_map.find(sname);
+	    if (it_find != total_coverage_map.end())
+	      hit_len = it_find->second;
+	    else
+	    {
+	      std::cerr << "Warning: Could not find sequence "<< sname << " in total_coverage_map." << std::endl;
+	      hit_len = 0;
+	    }
+	  }
+	  else
+	  {
+	    //	    hit_len        = tmp->get_length();
+	    // length might be wrong for protein / nucleotide balsts
+	    hit_len = tmp->get_end_query() - tmp->get_start_query() +1;  // We need to add 1 since the end is the last index in hit range.
+	  }
+	  hit_perfection = tmp->get_perfection();
+	  hit_evalue     = tmp->get_evalue();
+	  
+	  hit_coverage = (double)hit_len/seq_len;
+	  
+	  if (hit_coverage >= min_query_prop && hit_perfection >= min_perfection && hit_evalue <= max_evalue)
+	  {
+	    // Query test OK!!
+	    if (check_target_seq_match) // Do we check the target seq. full name for a match??
+	    {
+	      unsigned  t_id;
+	      faststring target_short_name = tmp->get_target_seq_name();
+	      t_id = target_list->get_id_short_name(target_short_name);
+	      faststring target_full_name = target_list->get_name(t_id);
+
+	      // Strange effect: hit_coverage can 1.01 - is this a bug?
+	      if (hit_coverage > 1)
+	      {
+		std::cerr << "Detected hit_coverage>1: " << hit_coverage << "#" << hit_len << "/" << seq_len << "#" << sname << "#" << target_full_name << std::endl;
+	      }
+	      faststring::size_t find_pos = target_full_name.find(search_expr);
+	      if (find_pos != faststring::npos) // search_expr has been found - we have a match
+	      {
+		// This is an accepted hit:
+
+		if (accepted_hits_Log_file_name != NULL)
+		{
+		  fprintf(accepted_hits_log, "Accepted hit (qT and tT passed): %s hc: %.2lf perf: %.3lf e-val: %8lf Tn: %s\n",
+			  sname.c_str(), hit_coverage, hit_perfection, hit_evalue, target_full_name.c_str());
+		}
+		result_with.add_non_redundant(orig,id_of_hit);
+		lastname = sname;  // In case we add the hit, we will ignore other blast hits with the same query name.
+		                   // In other words: A query with one or more hits is only inserted once.
+		//	  std::cerr << "Would add: " << id_of_hit << std::endl;
+	      }
+	      else
+	      {
+		if (accepted_hits_Log_file_name != NULL)
+		{
+		  fprintf(accepted_hits_log, "Hit not accepted (qT OK but tT failed): %s hc: %.2lf perf: %.3lf e-val: %8lf Tn: %s\n",
+			  sname.c_str(), hit_coverage, hit_perfection, hit_evalue, target_full_name.c_str());
+		}
+		
+		std::cerr << "--Hit not accepted (qery-test OK, target does not match). Target seq: " << target_full_name << " ";
+		tmp->print(std::cerr);
+	      }
+	    }
+	    else // Do not check target seq full name - so we have an accepted hit
+	    {
+	      // This is an accepted hit:
+	      result_with.add_non_redundant(orig, id_of_hit);
+	      
+	      if (accepted_hits_Log_file_name != NULL)
+	      {
+		fprintf(accepted_hits_log, "Accepted hit (qT OK, no tT): %s hc: %.2lf perf: %.3lf e-val: %8lf\n",
+			sname.c_str(), hit_coverage, hit_perfection, hit_evalue);
+	      }
+
+	      lastname = sname;  // In case we add the hit, we will ignore other blast hits with the same query name.
+	      //	  std::cerr << "Would add: " << id_of_hit << std::endl;
+	    }
+	  }
+	  else // Does not pass the query test. coverage, perfection, evalue
+	  {
+	    if (accepted_hits_Log_file_name != NULL)
+	    {
+	      fprintf(accepted_hits_log, "Hit not accepted (query-test not passed): %s hc: %.2lf perf: %.3lf e-val: %8lf\n",
+		      sname.c_str(), hit_coverage, hit_perfection, hit_evalue);
+	    }
+
+#ifdef FINANA
+	    std::cerr << "--Hit not accepted (qery-test failed). ";
+	    tmp->print(std::cerr);
+#endif
+	  }
+	}
+	
+      } // End if (sname != lastname)
+	
+      ++it;
+    } // END while (it != it_end)
+
+    if (accepted_hits_Log_file_name != NULL)
+    {
+      fclose(accepted_hits_log);
+    }
+  }
+
+
+  // Typical application:
+  // For a given query, the best hit has an evalue of e-12,
+  // the second best hit has an evalue of e-10.
+  // This indicates two independent good hits for the same query.
+  // These hits shall be saved in the double_hits data structure.
+
+  // Mode 0:
+  //     First  hit has fixed evalue threshold.
+  //     Second hit has a floating threshold depending on the the evalue of the first hit.
+  // Mode 1:
+  //     First and second hits have fixed evalue thresholds.
+  //     This mode makes more sense. Example: First hit: E=10^-90
+  //     Second hits needs e.g. 10^-87, while 10^-10  is already more than significant.
+
+  // Depricated function name detect_2_target_hits
+  void detect_2_target_hits(double max_e_1, double max_e_2, CBlast_parser &double_hits, int mode=1)
+  {
+    detect_2_good_hits_per_query(max_e_1, max_e_2, double_hits, mode);
+  }
+
+  void detect_2_good_hits_per_query(double max_e_1, double max_e_2, CBlast_parser &double_hits, int mode=1)
+  {
+    // Sort by query name, then by e-value.
+    // Filter all those with e < max_e and e < best-hit-this-query * factor_max_decrease
+
+    sort_by_query_name_quality();
+    //    lbh.sort(less_than_CBlastHit_pointer_query_quality);
+
+    std::list<CBlastHit*>::iterator it, it_end, tmp;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    faststring last_hit_query = "";
+    double     best_e_value_this_query = 100; // Initialized to avoid a warning. The code below should always assign a value to it before it is used.
+                                              // This should be the case, since it is only used if (this_hit_query == last_hit_query) which should only be
+                                              // the case if it has been assigned a value. 
+    bool       still_increment_it;
+
+    // mode 0:
+    // First hit threshold:  max_e_1
+    // Second hit threshold: factor_max_decrease*best_e_value_this_query (factor_max_decrease := max_e_2)
+
+    if (mode == 0) 
+    {
+      while (it != it_end)
+      {
+	faststring  this_hit_query      = (*it)->get_query_seq_name();
+	double      this_hit_e          = (*it)->get_evalue();
+	double      factor_max_decrease = max_e_2;
+
+	still_increment_it = true;
+	
+	if (this_hit_query == last_hit_query) // Still the same query
+	{
+	  // 
+	  if (best_e_value_this_query < max_e_1 && 
+	      this_hit_e < best_e_value_this_query*factor_max_decrease)
+	  {
+	    double_hits.add(*it);
+	    it = lbh.erase(it);  // This line does an implicit ++it
+	    still_increment_it = false;
+	  }
+
+	  if (this_hit_e < best_e_value_this_query)
+	  {
+	    // Should never happen since this list is sorted.
+	    std::cerr << "Error better evalue found: ";
+	    (*it)->print(std::cerr);
+	    std::cerr << std::endl;
+	    exit(-1);
+	  }
+	}
+	else // New query. We store the new reference data.
+	{
+	  // Must be best hit this query
+	  last_hit_query          = this_hit_query;
+	  best_e_value_this_query = this_hit_e; 
+	}
+	if (still_increment_it)
+	  ++it;
+      }
+    }
+    // mode 1:
+    // First hit threshold:  max_e_1
+    // Second hit threshold: max_e_2
+
+    else if (mode == 1)
+    {
+
+      while (it != it_end)
+      {
+	faststring  this_hit_query   = (*it)->get_query_seq_name();
+	double      this_hit_e       = (*it)->get_evalue();
+	
+	still_increment_it = true;
+	
+	if (this_hit_query == last_hit_query) // Still the same query
+	{
+	  // 
+	  if ( best_e_value_this_query < max_e_1 && 
+	       this_hit_e              < max_e_2   )
+	  {
+	    double_hits.add(*it);
+	    it = lbh.erase(it);  // This line does an implicit ++it
+	    still_increment_it = false;
+	  }
+
+	  if (this_hit_e < best_e_value_this_query)
+	  {
+	    // Should never happen since this list is sorted.
+	    std::cerr << "Error better evalue found: ";
+	    (*it)->print(std::cerr);
+	    std::cerr << std::endl;
+	    exit(-1);
+	  }
+	}
+	else // New query. We store the new reference data.
+	{
+	  // Must be best hit this query
+	  last_hit_query          = this_hit_query;
+	  best_e_value_this_query = this_hit_e; 
+	}
+	if (still_increment_it)
+	  ++it;
+      }
+    }
+    else
+    {
+      std::cerr << "Intern error: Unknown mode in detect_2_target_hits" << std::endl;
+      exit(-2);
+    }
+  }
+
+
+
+  void filter_CSeqNameList_with_major_reverse_blast_hit(CSeqNameList &orig, CSeqNameList &result_with,
+							double min_query_prop, double min_perfection, double max_evalue, bool multi=true)
+  // The multi paramter determines whether multiple entries are made if the target sequence has multiple hits.
+  // Multiple hits of the query are often not of interest, but multiple hits to the same target should usually be considered as independent.
+  {
+    std::cerr << "Called filter_CSeqNameList_with_major_reverse_blast_hit and multi=" << multi << std::endl; 
+
+    //    compute_coverage_map();
+
+    std::list<CBlastHit*>::iterator it, it_end;
+
+    sort_target(); // This guarantees that hits are ordered by query name.
+                   // This will be used here.
+
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    // List of seq names:
+    unsigned id_of_hit;
+
+    //    std::map<faststring *, unsigned, less_than_pointer_to_faststring_struct>::iterator it_find;
+
+    CBlastHit* tmp;
+
+    faststring sname;
+    faststring lastname;
+
+    // We move through all Blast hits:
+    while (it != it_end)
+    {
+      tmp = *it;
+
+      unsigned seq_len;
+      unsigned hit_len;
+      double   hit_coverage;
+      double   hit_perfection;
+      double   hit_evalue;
+
+      // Get name of target:
+      sname = tmp->get_target_seq_name();
+
+      //      std::cerr << "Target sequence name: " << sname << std::endl;
+
+      if (multi || sname != lastname) // In contrast to the forward direction we usually want to keep multiple hits against the target.
+	                              // If it has been added (see below) we won't check hits with the same query name
+	                              // Here we need that the sequences are ordered - hits to the same sequence are successors.
+      {
+	id_of_hit = orig.get_id_short_name(sname); // Look up the name in the list of sequences in the fasta file.
+ 
+	//      std::cerr << "sname " << sname << " "  << id_of_hit << std::endl;
+	
+	if (id_of_hit == -1u)
+	{
+	  std::cerr << "Error: Could not find sequence name: " 
+		    << sname
+		    << " for which a blast hit (target) has been found in fasta file. I guess the files are incompatible or target and query are interchanged!!"
+		    << std::endl;
+	}
+	else // Sequence of blast hit has been found
+	{
+	  seq_len        = orig.get_seq_length(id_of_hit);
+
+	  //	  hit_len        = tmp->get_length();
+	  // length might be wrong for protein / nucleotide balsts
+
+	  // We need to add 1 since the end is the last index in hit range.
+
+	  hit_len = tmp->get_end_target() - tmp->get_start_target() +1;
+
+
+	  hit_perfection = tmp->get_perfection();
+	  hit_evalue     = tmp->get_evalue();
+	  
+	  hit_coverage = (double)hit_len/seq_len;
+	  
+	  if (hit_coverage >= min_query_prop && hit_perfection >= min_perfection && hit_evalue <= max_evalue)
+	  {
+	    // This is an accepted hit:
+	    //	    result_with.add_non_redundant(orig,id_of_hit);
+	    result_with.add(orig,id_of_hit); // multi=true allows redundant entries.
+	    if (!multi)
+	      lastname = sname;  // In case we add the hit, we will ignore other blast hits with the same target name.
+	    //	  std::cerr << "Would add: " << id_of_hit << std::endl;
+	  }
+	  else
+	  {
+	    std::cerr << "--Hit not accepted (target test). ID: " << id_of_hit << std::endl; 
+	  }
+	}
+	
+      } // End if (sname != lastname)
+	
+      ++it;
+    } // END while (it != it_end)
+      
+  } // END filter_CSeqNameList_with_major_reverse_blast_hit
+
+
+  // Input:  CSeqNameList of all query names
+  // Putput: CSeqNameList of all query names that have a blast hit in *this.
+
+  void filter_CSeqNameList_has_simple_hit(CSeqNameList &orig, CSeqNameList &result_with)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+
+    sort_by_query_name_quality();
+    //    sort_query(); // This guarantees that hits are ordered by query name.
+                  // This simplifies the further algorithm.
+                  // 
+
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    // List of seq names:
+    unsigned id_of_hit;
+
+    CBlastHit* tmp;
+
+    faststring query_name;
+    faststring last_query_name;
+
+    // We move through all Blast hits:
+    //   - we fetch the sequence name and copy the data to the new CSeqNameList.
+
+    while (it != it_end)
+    {
+      tmp = *it;
+
+      // Get name of query of blast hit:
+      query_name = tmp->get_query_seq_name();
+
+      if (query_name != last_query_name) // We never want to add the same sequence twice.
+      {
+	// Look up the name of the query in the list of sequences in the fasta file.
+	// Remember: blast tells us the short name only.
+	id_of_hit = orig.get_id_short_name(query_name); 
+ 
+	//      std::cerr << "query_name " << query_name << " "  << id_of_hit << std::endl;
+	
+	if (id_of_hit == -1u)
+	{
+	  std::cerr << "Error: Could not find sequence name: " 
+		    << query_name
+		    << " for which a blast hit has been found in fasta file. I guess the files are incompatible or target and query are interchanged!!"
+		    << std::endl;
+	}
+	else // Sequence of blast hit has been found
+	{
+	  // This is an accepted hit:
+	  result_with.add_non_redundant(orig, id_of_hit);
+	  last_query_name = query_name;
+	}
+	
+      } // End if (sname != lastname)
+	
+      ++it;
+    } // END while (it != it_end)
+  }
+
+
+
+  void compute_coverage_map(double min_perfection, double max_e_value)
+  {
+    std::cerr << "Started to compute coverage values" << std::endl;
+
+    sort_by_query_name_quality();
+    //    sort_query(); // Sort by query name and coordinates
+
+    std::list<CBlastHit*>::iterator it, it2, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+   
+    const faststring *current_query, *last_query;
+
+    last_query    = NULL;
+    current_query = NULL;
+
+    if (it == it_end)
+    {
+      return;
+    }
+
+    CRangeList rl_current_query;
+    Crange     r_all(0, -1u);
+    unsigned   cov;
+
+    // Move through all hits:
+    while (it != it_end)
+    {
+      // Get sequence name of query of this hit.
+      current_query = &((**it).get_query_seq_name());
+
+      if (last_query && *current_query != *last_query) // next query - not for first!
+      {
+	// Save coverage of last query
+	cov = rl_current_query.coverage_len(r_all);
+
+	// current_query is the next query so last_query contains the correct name for this:
+	std::cerr << *last_query << " cov: " << cov << std::endl;
+
+	total_coverage_map[*last_query] = cov;
+
+	// Clear range list:
+	rl_current_query.clear();
+      }
+
+      // For all queries, We have to add all hits that meet the criteria to the list of ranges: rl_current_query
+      // We add this hit:
+      // Remember: The blast result contains the last position in the range so we have to add one.
+
+      // Let us check the criteria before we add the hit:
+      if ((**it).get_evalue() <= max_e_value && (**it).get_perfection() >= min_perfection)
+	{
+	  rl_current_query.add((**it).get_start_query(), (**it).get_end_query()+1 );
+	  
+	  std::cerr << "Adding to range of " << *current_query << " "
+		    << (**it).get_start_query() << " " << (**it).get_end_query()+1 << std::endl;
+	}
+      else
+	{
+	  std::cerr << "Not adding to range of " << *current_query << " "
+		    << (**it).get_start_query() << " " << (**it).get_end_query()+1 << std::endl;
+	}
+
+      ++it;
+      last_query = current_query;
+    }
+    // After exiting we have to save the last query-sequence:
+    cov = rl_current_query.coverage_len(r_all);
+    std::cerr << *last_query << " cov: " << cov << std::endl;
+    total_coverage_map[*last_query] = cov;
+
+    //    std::cerr << "Coverage map computed- " << std::endl;
+
+    std::cerr << "Finished computing coverage values" << std::endl;
+  }
+
+  /*
+  std::list<CBlastHit*>::iterator blc_lower_bound(faststring &value)
+  {
+    
+    std::list<CBlastHit*>::iterator it, first;
+    unsigned count, step;
+    count = std::distance(lbh.begin(), lbh.end());
+    first = lbh.begin();
+
+    while (count > 0)
+    {
+        it = first; 
+        step = count / 2; 
+        std::advance(it, step);
+        if ((**it).get_query_seq_name() < value)
+	{
+            first = ++it; 
+            count -= step + 1; 
+        }
+        else
+	{
+            count = step;
+	}
+    }
+    return first;
+  }
+
+  // 
+  // Search all blast hits that have a query name that begins identical to the query_beginning_match_str
+  // and determine the maximum hit length in this set.
+  // More formally: Search for all hits with a query that is identical to query_beginning_match_str
+  // when restricte to the first query_beginning_match_str.size() characters.
+  int get_max_hit_query_span__matching_beginning1(faststring &query_beginning_match_str)
+  {
+    int max_len;
+
+    std::cout << "Entering: get_max_hit_query_span__matching_beginning1 with " << query_beginning_match_str << std::endl;
+
+    sort_by_query_name_quality();
+
+    // Find first hit which start with the search string:
+    std::list<CBlastHit*>::iterator it, it_end;
+    it      = blc_lower_bound(query_beginning_match_str);
+    it_end  = lbh.end();
+
+    if (it == it_end)
+    {
+      std::cout << "No hit found (p1) for partial name of query: " << query_beginning_match_str
+		<< std::endl; 
+      return -1;
+    }
+
+    // If there is no Blast hit for the query with this name,
+    // it can be but in most cases will not be equal to it_end
+    // The definitive check is that it points to a hit that matches
+
+    if (fstrncmp(query_beginning_match_str, (**it).get_query_seq_name(),query_beginning_match_str.size() ) != 0)
+    {
+      std::cout << "No hit found (p2) for partial name of query: " << query_beginning_match_str
+		<< std::endl; 
+      return -2;
+    }
+
+    max_len = (**it).get_query_span();
+    ++it;
+
+    while (it != it_end)
+    {
+      // If the strings to not match over the length of query_beginning_match_str.size(), we break
+      if (fstrncmp(query_beginning_match_str, (**it).get_query_seq_name(),query_beginning_match_str.size() ) != 0)
+	break;
+      // If they are still equal over the length of query_beginning_match_str.size(),
+      if ( (int)(**it).get_query_span() > max_len)
+	max_len = (int)(**it).get_query_span();
+      ++it;
+    }
+
+    std::cout << "Found partial name of query: " << query_beginning_match_str
+              << " " << max_len << std::endl; 
+
+    return max_len;
+  }
+  */
+
+  
+  int get_max_hit_query_span__matching_beginning2(faststring &query_beginning_match_str, unsigned verbosity)
+  {
+    int max_len;
+
+    if (verbosity > 100)
+      std::cout << "Entering: get_max_hit_query_span__matching_beginning2 with " << query_beginning_match_str << std::endl;
+
+    // Find first hit which start with the search string:
+    std::map<faststring, CBlastHit*>::iterator it, it_end;
+    it      = bh_map.lower_bound(query_beginning_match_str);
+    it_end  = bh_map.end();
+
+    if (it == it_end)
+    {
+      if (verbosity > 100)
+      {
+	std::cout << "No hit found (p1) for partial name of query: " << query_beginning_match_str
+		  << std::endl; 
+      }
+      return -1;
+    }
+
+    // If there is no Blast hit for the query with this name,
+    // it can be but in most cases will not be equal to it_end
+    // The definitive check is that it points to a hit that matches
+
+    if (fstrncmp(query_beginning_match_str, (it->second)->get_query_seq_name(),query_beginning_match_str.size() ) != 0)
+    {
+      if (verbosity > 100)
+      {    
+	std::cout << "No hit found (p2) for partial name of query: " << query_beginning_match_str
+		  << std::endl; 
+      }
+      return -2;
+    }
+
+    max_len = (it->second)->get_query_span();
+    ++it;
+
+    while (it != it_end)
+    {
+      // If the strings to not match over the length of query_beginning_match_str.size(), we break
+      if (fstrncmp(query_beginning_match_str, (it->second)->get_query_seq_name(),query_beginning_match_str.size() ) != 0)
+	break;
+      // If they are still equal over the length of query_beginning_match_str.size(),
+      if ( (int)(it->second)->get_query_span() > max_len)
+	max_len = (int)(it->second)->get_query_span();
+      ++it;
+    }
+
+    if (verbosity > 100)
+    {
+      std::cout << "Found partial name of query: " << query_beginning_match_str
+		<< " " << max_len << std::endl; 
+    }
+
+    return max_len;
+  }
+  
+
+
+  void set_of_gi_numbers_target(std::set<unsigned> &gi_set)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    faststring tmp_gi;
+
+    while (it != it_end)
+    {
+      (**it).extract_GI_number_target(tmp_gi);
+      gi_set.insert(tmp_gi.ToUnsigned());
+      ++it;
+    }
+  }
+
+  void set_of_query_names(std::set<faststring> &s)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    while (it != it_end)
+    {
+      s.insert( (**it).get_query_seq_name() );
+      ++it;
+    }
+  }
+
+/*   void get_max_query_span_map_for_matching_queries(std::map<faststring, int> m, char stop_char, int num_stop_char) */
+/*   { */
+
+/*   } */
+
+  void write_set_of_gi_numbers_to_file(const char *fname)
+  {
+    std::set<unsigned> gi_set;
+    set_of_gi_numbers_target(gi_set);
+    std::set<unsigned>::iterator it,it_end;
+    it      = gi_set.begin();
+    it_end  = gi_set.end();
+    
+    std::ofstream os(fname);
+    while (it != it_end)
+    {
+      os << *it << std::endl;
+      ++it;
+    }
+    os.close();
+  } // END write_set_of_gi_numbers_to_file
+
+
+
+
+  // fill a map with the following information:
+  // For all gi numbers of the target sequences, the map contains the number of occurences of this target.
+  void get_gi_occurence_map(std::map<unsigned, unsigned> &gim)
+  {
+    std::list<CBlastHit*>::iterator it, it_end;
+    it     = lbh.begin();
+    it_end = lbh.end();
+
+    faststring tmp_gi;
+
+    while (it != it_end)
+    {
+      (**it).extract_GI_number_target(tmp_gi);
+      __add_or_count(gim, tmp_gi.ToUnsigned());
+      ++it;
+    }
+  
+  }
+
+
+};
+
+#endif
diff --git a/CDistance_matrix.h b/CDistance_matrix.h
new file mode 100644
index 0000000..04a2d70
--- /dev/null
+++ b/CDistance_matrix.h
@@ -0,0 +1,811 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CDISTANCE_MATRIX_H
+#define CDISTANCE_MATRIX_H
+
+#include <iostream>
+#include <map>
+#include "faststring2.h"
+#include <list>
+#include <iterator>
+#include <set>
+
+
+typedef unsigned long index_distance_map;
+
+//************************************************
+// Usage-Restrictions:
+//
+// Minimum number of entries:
+// CDistanceCollection: Number of objects >= 0. Note: 0 and 1 Objects cannot be distinguished.
+// CDistance_Cluster:   Number of objects > 1.  2 Objects: remains to be tested.
+
+//************************************************
+
+
+//************************************************
+// Part I: Distance indices
+// In order to index pairs of sequences we do the following:
+// If we have two sequence numbers we assume they are smaller than short integers (16 bits).
+// We can combine the two short numbers to a 32 bit index of both. This index is unique if
+// we put the smaller sequence index into the higher bits and the larger index into the lower bits.
+// Distance indices are of type unsigned and must be 32 bits in size in order to work.
+//
+// The following routines handle the index conversions:
+// makeIndex creates an unsigned combined index from 2 short numbers.
+// first_index and second_index extract the first and the second index of a pair.
+//
+// Note: Initial indices of sequnces: These should be the indices of the sequnces in the file.
+//       They have to be unique in the range 0...taxaNum-1.
+//       During the clustering we create new indices of cluster nodes.
+//       In contrast to the distance indices, cluster indices are of type short.
+//
+// How the clustering is done:
+// cluster_node is the main data structure in the clustering method.
+// The hierachy of clustering steps are stored in the cluster_hierarchy,
+// a vector of cluster nodes.
+// The cluster_hierarchy has a very special form:
+// The index of each node coincides with the this_nodes_index.
+// This makes it efficient to obtain the cluster hierachy without
+// having to search for the correct index.
+// 
+//
+//==============
+// Algorithm:
+//==============
+// We start by adding all pairwise distances to the dist_map.
+// The indices of the pairwise distances are added to the current_cluster_indices
+// as well as the all_cluster_indices.
+// 
+// Initially the pairwise distances are added as terminal nodes to the cluster_hierarchy.
+// This is done by adding the indices of the pairwise distances to the cluster_hierarchy.
+// Internally, they have children set to -1 and distance 0, indicating that they
+// do not represent clustering steps.
+// Note: The cluster_hierarchy is only used to keep track of the clustering steps.
+//       The next step in the algorithm is determined from the sorted_distances,
+//       a list of iterators to the current_cluster_indices. The list of 
+//       sorted_distances keeps a list of iterators in accending order of the 
+//       distances associated with the index. 
+// Later we add cluster_nodes that have other cluster_nodes as children.
+// Distances that have been clustered are marked for deletion and are erased permanently later. (For details, read the code.)
+//************************************************
+
+inline unsigned makeIndex(short i1, short i2)
+{
+  unsigned res;
+  if (i1 > i2)
+  {
+    res = i2;
+    res <<= 16;
+    res += i1;
+    return res;
+  }
+  else
+  {
+    res = i1;
+    res <<= 16;
+    res += i2;
+    return res;
+  }
+}
+
+inline short first_index(unsigned i)
+{
+  i >>= 16;
+  return (short) i;
+}
+
+inline short second_index(unsigned i)
+{
+  return (short) i;
+}
+
+
+
+// CDistanceCollection collects distance of indexed objects, i.e. objects are referred to by their index.
+// Distances are stored in a map, which is useful (i) if new objects are introduced regularly, or (ii) if not
+// all distances are specified. 
+
+class CDistanceCollection
+{
+ public:
+  typedef std::map<index_distance_map, double> CDistanceCollection_map; 
+  typedef std::map<index_distance_map, double>::iterator CDistanceCollection_map_iterator; 
+
+ protected:
+  CDistanceCollection_map dist_map;
+
+ public:
+
+  void clear()
+  {
+    dist_map.clear();
+  }
+
+  void add(short i1, short i2, double d)
+  {
+    dist_map[makeIndex(i1, i2)] = d;
+  }
+
+  void print(std::ostream &os)
+  {
+    CDistanceCollection_map_iterator it     = dist_map.begin();
+    CDistanceCollection_map_iterator it_end = dist_map.end();
+
+    unsigned u;
+    double   d;
+
+    while (it != it_end)
+    {
+      u = it->first;
+      d = it->second;
+
+      os << "d("<< first_index(u) << "," << second_index(u) << ")="<<d << std::endl; 
+      ++it;
+    }
+
+  }
+
+  double max_distance()
+  {
+    CDistanceCollection_map_iterator it     = dist_map.begin();
+    CDistanceCollection_map_iterator it_end = dist_map.end();
+    double d, d_max;
+
+    if (it == it_end)
+      return 0;
+
+    d_max = it->second;
+
+    while (it != it_end)
+    {
+      d = it->second;
+      d_max = (d_max > d ? d_max:d);
+      ++it;
+    }
+    return d_max;
+  }
+
+
+};
+
+struct less_than_distance_iterator
+{
+  bool operator()(CDistanceCollection::CDistanceCollection_map_iterator it1, CDistanceCollection::CDistanceCollection_map_iterator it2)
+  {
+    return it1->second < it2->second; 
+  }
+};
+
+
+struct cluster_node
+{
+  short this_nodes_index; // The index of this node in the cluster_hierarchy vector, but also the index of the node that has the following two children.
+  short child1;
+  short child2;
+  double dist;
+
+  bool unused;
+
+  // constructor
+  cluster_node(short index_this, short ch1, short ch2, double d):
+  this_nodes_index(index_this),child1(ch1), child2(ch2), dist(d), unused(false)
+  {}
+
+  // constructor - terminal node
+  // This node only represents itself and it has no children. So these indices are -1.
+  cluster_node(short index):
+  this_nodes_index(index),child1(-1), child2(-1), dist(0), unused(false)
+  {}
+
+  //  cluster_node(): unused(true)
+  //  {}
+
+  bool is_terminal()
+  {
+    return (child1 == -1);
+  }
+
+  bool is_unused()
+  {
+    return unused;
+  }
+
+
+};
+
+
+
+class CDistance_Cluster : public CDistanceCollection
+{
+  std::list<CDistanceCollection_map_iterator> sorted_distances;
+
+  // Sets of indices that are known:
+  std::set<short> current_cluster_indices;  // Indices of objects added to clustering. (Not indices of distances.)
+                                            // Keeps track of remaining indices that need to be clustered.
+                                            // Indices that have been clustered are removed.
+  std::set<short> all_cluster_indices;      // Keeps track of all cluster indices that have ever been created.
+
+  std::vector< cluster_node > cluster_hierarchy; 
+  unsigned                verbosity;
+
+
+ public:
+ 
+  CDistance_Cluster(unsigned p_verbosity=0):verbosity(p_verbosity)
+  {}
+
+  void clear(unsigned newverbosity=-1u)
+  {
+    sorted_distances.clear();
+    current_cluster_indices.clear();
+    all_cluster_indices.clear();
+    cluster_hierarchy.clear();
+
+    CDistanceCollection::clear();
+ 
+    if (newverbosity != -1u)
+      verbosity = newverbosity;
+  }
+
+  // At the end of the clustering this is the number of clusters.
+  unsigned get_num_groups_in_current_cluster()
+  {
+    return current_cluster_indices.size();
+  }
+
+
+  void sort()
+  {
+    less_than_distance_iterator lti;
+    sorted_distances.sort(lti);
+  }
+
+  // Add terminal node to cluster hierarchy
+  void addto_cluster_hierarchy(short index)
+  {
+    cluster_hierarchy.push_back(cluster_node(index));
+
+    // The index of this new node should be equal to index. 
+    short i = cluster_hierarchy.size();
+
+    if ((i-1) != index)
+    {
+      std::cerr << "Error: Indices must be passed consecutively and 0 based to the cluster hierarchy" << std::endl;
+    }
+  }
+
+  // Add terminal node to cluster hierarchy
+  void addto_cluster_hierarchy(short index, short child1, short child2, double d)
+  {
+    cluster_hierarchy.push_back(cluster_node(index, child1, child2, d));
+
+    // The index of this new node should be equal to index. 
+    short i = cluster_hierarchy.size();
+
+    if ((i-1) != index)
+    {
+      std::cerr << "Error: Indices must be passed consecutively and 0 based to the cluster hierarchy" << std::endl;
+    }
+  }
+
+  void add_singleton(short i)
+  {
+    current_cluster_indices.insert(i);
+    all_cluster_indices.insert(i); 
+  }
+
+
+  void add(short i1, short i2, double d)
+  {
+    if (i1 == i2)
+    {
+      std::cerr << "Distances of indices to itself cannot be added to the distance matrix. They will always be assumed to be 0" << std::endl;
+      exit(-2);
+    }
+
+    std::pair<CDistanceCollection_map_iterator,bool> ret;
+
+    ret = dist_map.insert(std::make_pair(makeIndex(i1, i2), d));
+    if (ret.second)
+      sorted_distances.push_back(ret.first);
+
+    current_cluster_indices.insert(i1);
+    current_cluster_indices.insert(i2);
+
+    all_cluster_indices.insert(i1);
+    all_cluster_indices.insert(i2); 
+  }
+
+  // Do not enter the indices to the sets.
+  // This can be done later.
+  void add_partial(short i1, short i2, double d)
+  {
+    if (i1 == i2)
+    {
+      std::cerr << "Distances of indices to itself cannot be added to the distance matrix. They will always be assumed to be 0" << std::endl;
+      exit(-2);
+    }
+
+    std::pair<CDistanceCollection_map_iterator,bool> ret;
+
+    ret = dist_map.insert(std::make_pair(makeIndex(i1, i2), d));
+    if (ret.second)
+      sorted_distances.push_back(ret.first);
+  }
+
+
+  void print_sorted(std::ostream &os)
+  {
+    sort();
+
+    std::list<CDistanceCollection_map_iterator>::iterator it, it_end;
+
+    it     = sorted_distances.begin();
+    it_end = sorted_distances.end();
+
+    unsigned u;
+    double   d;
+
+    while (it != it_end)
+    {
+      u = (*it)->first;
+      d = (*it)->second;
+
+      os << "d("<< first_index(u) << "," << second_index(u) << ")="<<d << std::endl; 
+      ++it;
+    }
+  }
+
+  void print_current_cluster_indices(std::ostream &os)
+  {
+    std::set<short>::iterator it_cluster_indices     = current_cluster_indices.begin();
+    std::set<short>::iterator it_cluster_indices_end = current_cluster_indices.end();
+
+    while (it_cluster_indices != it_cluster_indices_end)
+    {
+      os << *it_cluster_indices << ",";
+      ++it_cluster_indices;
+    }
+    os << std::endl;
+
+    
+  }
+  
+  
+  void run_clustering(double distance_limit)
+  {
+    std::set<short>::iterator it_cluster_indices     = current_cluster_indices.begin();
+    std::set<short>::iterator it_cluster_indices_end = current_cluster_indices.end();
+    
+    // Add all indices as terminal nodes in cluster_hierarchy.
+    // The cluster_hierarchy is only used to keep track of the clustering steps.
+    while (it_cluster_indices != it_cluster_indices_end)
+    {
+      addto_cluster_hierarchy(*it_cluster_indices);
+      ++it_cluster_indices;
+    }
+
+    if(verbosity > 10)
+    {
+      faststring cluster_string;
+      std::cerr << "Initial cluster string:" << std::endl;
+      get_cluster_string2(cluster_string);
+      std::cerr << cluster_string << std::endl;
+    }
+
+    // The next step in the algorithm is determined from the "sorted_distances",
+    // a list of iterators to the current_cluster_indices. The list of 
+    // sorted_distances keeps a list of iterators in accending order of the 
+    // distances associated with the index.
+
+    std::list<CDistanceCollection_map_iterator>::iterator it, it_end;
+
+    // sorted_distances is a list of iterators of type CDistanceCollection_map_iterator.
+    // We sort this iterator list such that the iterators to the dist_map (index->distance)
+    // is sorted according to the distance. Smaller distances come first.
+
+    sort();
+    it     = sorted_distances.begin();
+    it_end = sorted_distances.end();
+
+    unsigned u;
+    short    index1;
+    short    index2;
+    short    tmp_index;
+
+    short    new_cluster_index;
+
+    // We continue to cluster pairs of indices while we still find distances which are less than the threshold
+    while (sorted_distances.size() > 0 && (*it)->second <= distance_limit)
+    {
+      // The pair with the smalles distance is the first one in the sorted_distances list.
+      // We cluster the pair of indices it is pointing to:
+      u = (*it)->first;
+      index1 = first_index(u);
+      index2 = second_index(u);
+     
+      // Obsolete:      cluster_hierarchy.push_back(std::make_pair(index1, index2));
+      // Determine a new unique index for the next cluster node.
+      new_cluster_index = all_cluster_indices.size();
+
+      if (verbosity > 10)
+	std::cerr << "Outer loop -- Clustering: " << index1 << ", " << index2 << " to " << new_cluster_index << std::endl; 
+
+      // Eliminate all distances of index pairs for which one index is equal to index1 or index2.
+
+      it_cluster_indices     = current_cluster_indices.begin();
+      it_cluster_indices_end = current_cluster_indices.end();
+
+      // Save within distance of new cluster:
+      double within_distance = dist_map[makeIndex(index1, index2)];
+
+      // Add new cluster to hierarchy.
+      addto_cluster_hierarchy(new_cluster_index, index1, index2, within_distance);
+      
+      // Eliminate distance pair  index1, index2:
+      dist_map[makeIndex(index1, index2)] = -1; // Mark as unused
+
+      if (verbosity > 10)
+	std::cerr << "Mark unused: " << index1 << " , " << index2 << std::endl;  
+
+      // Move through all indices that are not in the new cluster.
+      while (it_cluster_indices != it_cluster_indices_end)
+      {
+	tmp_index = *it_cluster_indices;
+	
+	if (verbosity > 10)
+	  std::cerr << "**Loop index: " << tmp_index << std::endl;
+
+	if (tmp_index != index1 && tmp_index != index2)
+	{
+	  if (verbosity > 10)
+	    std::cerr << "**Treat index: " << tmp_index << std::endl;
+	
+	  double dist1 = dist_map[makeIndex(index1, tmp_index)];
+	  double dist2 = dist_map[makeIndex(index2, tmp_index)];
+
+	  double max_dist  = dist1;
+	  //	  short  max_index = index1;
+
+	  if (dist2 > max_dist)
+	  {
+	    //	    max_index = index2;
+	    max_dist = dist2;
+	  }
+
+	  // Add distance between new cluster and tmp_index
+	  add_partial(tmp_index, new_cluster_index, max_dist);
+	  /////// 	  dist_map[makeIndex(tmp_index, new_cluster_index)] = max_dist;
+	  // The distance between tmp_index (!=index1, != index2) and index1 and index2 are not needed any more.
+	  dist_map[makeIndex(tmp_index, index1)] = -1; // Mark as unused
+	  dist_map[makeIndex(tmp_index, index2)] = -1; // Mark as unused
+
+	  if (verbosity > 10)
+	  {
+	    std::cerr << "New distance: " << tmp_index << " , " << new_cluster_index << " " << max_dist << std::endl;  
+	    std::cerr << "Mark unused:  " << tmp_index << " , " << index1 << std::endl;  
+	    std::cerr << "Mark unused:  " << tmp_index << " , " << index2 << std::endl;  
+	  }
+	}
+	++it_cluster_indices;
+      } // END  while (it_cluster_indices != it_cluster_indices_end)
+
+      // Remove index1 and index2 from cluster indices. Add new cluster index.
+
+      if (verbosity > 10)
+      {
+	std::cerr << "Insert new cluster index: " << new_cluster_index << std::endl; 
+	std::cerr << "Erase index: " << index1 << std::endl; 
+	std::cerr << "Erase index: " << index2 << std::endl; 
+      }
+
+      // Now we add the new cluster index to the sets.
+      all_cluster_indices.insert(new_cluster_index);
+      current_cluster_indices.insert(new_cluster_index);
+
+      // We remove the indices we clustered from the current_cluster_indices
+      current_cluster_indices.erase(index1);
+      current_cluster_indices.erase(index2);
+
+      // Adjust sorted_distances:
+      sort();
+
+      it     = sorted_distances.begin();
+      it_end = sorted_distances.end();
+     
+      // TODO: can be done a bit faster:
+      // Delete items marked for deletion.
+      // Delete them from sorted_distances as well as from the distance_map.
+      // Remember: Distances are sorted from small to large, so the distances
+      //           marked for deletion which have distance -1 come first.
+      //           If we passed those with distance -1 we are done. (see loop condition)
+
+      while (it != it_end && (*it)->second == -1)
+      {
+	unsigned u = (*it)->first;
+
+	if (verbosity > 10)
+	  std::cerr << "Erase permanently: " << first_index(u) << " " << second_index(u) << std::endl; 
+
+	dist_map.erase(*it);            // it points to the iterator in the dist_map. That is the object we want to remove. 
+	sorted_distances.erase(it);
+
+	// Next iteration step:
+	// The next distance with distance -1, if present, should be at the beginning again.
+	it = sorted_distances.begin();
+	// All iterators that are not removed should keep their validity.
+	//	it_end = sorted_distances.end();
+      }
+
+      // This completes this clustering step:
+      if(verbosity > 10)
+      {
+	faststring cluster_string;
+	std::cerr << "Cluster string after this step: " << new_cluster_index << std::endl;
+	get_cluster_string2(cluster_string);
+	std::cerr << cluster_string << std::endl;
+      }
+
+      // See above:
+      // Iteration statement: 	it     = sorted_distances.begin();
+
+    } // END while (sorted_distances.size() > 1 && (*it)->second < distance_limit)
+    
+  } // run_clustering(double distance_limit)
+
+
+  void append_to_cluster_string(short node, faststring &str, const std::vector<faststring> &names)
+  {
+    short child1 = cluster_hierarchy[node].child1;
+    short child2 = cluster_hierarchy[node].child2;
+    double within_distance = cluster_hierarchy[node].dist;
+    bool isterminal = cluster_hierarchy[node].is_terminal();
+    bool use_names = false;
+
+    if (names.size() > 0)
+      use_names = true;
+
+    if (cluster_hierarchy[node].this_nodes_index != node)
+    {
+      std::cerr << "Error in cluster hierarchy" << std::endl;
+      exit(-1);
+    }
+
+    if (isterminal)
+    {
+      str.append("(");  // Bracket terminal nodes. This makes parsing easier.
+      if (use_names)
+      {
+	str.append( names[node] );
+      }
+      else
+      {
+	str.append(faststring(node));
+      }
+      str.append(")");
+    }
+    else
+    {
+      str.append("(");
+      append_to_cluster_string(child1, str, names);
+      str.append(",");
+      append_to_cluster_string(child2, str, names);
+      str.append("):");
+      str.append(faststring(within_distance));
+    }
+  }
+
+
+  void get_cluster_string(faststring &str, const std::vector<faststring> &names)
+  {
+    std::set<short>::iterator it_cluster_indices     = current_cluster_indices.begin();
+    std::set<short>::iterator it_cluster_indices_end = current_cluster_indices.end();
+    short    tmp_index;
+    short    count = 0;
+
+    unsigned remaining_cluster_indices = current_cluster_indices.size();
+
+    if (remaining_cluster_indices > 1)
+      str.append("{");
+    else
+      str.append("(");
+    
+    while (it_cluster_indices != it_cluster_indices_end)
+    {
+      if (count > 0)
+	str.append(",");
+	tmp_index = *it_cluster_indices;
+	append_to_cluster_string(tmp_index, str, names);
+	++it_cluster_indices;
+	++count;
+    } // END  while (it_cluster_indices != it_cluster_indices_end)
+
+    if (remaining_cluster_indices > 1)
+      str.append("}:");
+    else
+      str.append("):");
+
+    str.append(faststring(max_distance()));
+  }
+
+
+  void append_to_cluster_string2(short node, faststring &str)
+  {
+    short child1 = cluster_hierarchy[node].child1;
+    short child2 = cluster_hierarchy[node].child2;
+    double within_distance = cluster_hierarchy[node].dist;
+    bool isterminal = cluster_hierarchy[node].is_terminal();
+
+    if (cluster_hierarchy[node].this_nodes_index != node)
+    {
+      std::cerr << "Error in cluster hierarchy" << std::endl;
+      exit(-1);
+    }
+
+    if (isterminal)
+    {
+      str.append("(");  // Bracket terminal nodes. This makes parsing easier.
+      str.append(faststring(node));
+      str.append(")");
+    }
+    else
+    {
+      str.append("(");
+      append_to_cluster_string2(child1, str);
+      str.append(",");
+      append_to_cluster_string2(child2, str);
+      str.append("):");
+      str.append(faststring(within_distance));
+    }
+  }
+
+
+  // As above, but uses indices as names.
+  void get_cluster_string2(faststring &str)
+  {
+    std::set<short>::iterator it_cluster_indices     = current_cluster_indices.begin();
+    std::set<short>::iterator it_cluster_indices_end = current_cluster_indices.end();
+    short    tmp_index;
+    short    count = 0;
+
+    unsigned remaining_cluster_indices = current_cluster_indices.size();
+
+    if (remaining_cluster_indices > 1)
+      str.append("{");
+    else
+      str.append("(");
+    
+    // Each (remaining) index in current_cluster_indices
+    // specifies its own cluster which we now print
+    // in hierarchical form.
+    // The current_cluster_indices are the starting point.
+    // Its sub-clusters will be obtained from the cluster_hierarchy
+    // vector.
+
+    while (it_cluster_indices != it_cluster_indices_end)
+    {
+      if (count > 0)
+	str.append(",");
+	tmp_index = *it_cluster_indices;
+	append_to_cluster_string2(tmp_index, str);
+	++it_cluster_indices;
+	++count;
+    } // END  while (it_cluster_indices != it_cluster_indices_end)
+
+    if (remaining_cluster_indices > 1)
+      str.append("}:");
+    else
+      str.append("):");
+
+    str.append(faststring(max_distance()));
+  }
+
+
+
+  void print_debug(std::ostream &os)
+  {
+    os << "***Debug-stats************************************"                << std::endl;
+    os << "sorted_distances.size()        " << sorted_distances.size()        << std::endl;
+    os << "current_cluster_indices.size() " << current_cluster_indices.size() << std::endl;
+    os << "all_cluster_indices.size()     " << all_cluster_indices.size()     << std::endl;
+    os << "cluster_hierarchy.size()       " << cluster_hierarchy.size()       << std::endl;
+    os << "dist_map.size()                " << dist_map.size()                << std::endl;
+
+
+    os << "Sorted distances:" << std::endl;
+    print_sorted(os);
+
+    os << "Remaining cluster indices:" << std::endl;
+    print_current_cluster_indices(os);
+    os << "**************************************************"                << std::endl;    
+
+  }
+
+  // How to write an adapter to get the clustering result:
+  // The vector current_cluster_indices contains all "umbrella" indices.
+  // There is one cluster for each entry in this vector.
+  // Some entries might not be clustered. Remember: We stopped clustering
+  // if the remaining distances are above the threshold.
+  // Starting from the indices in current_cluster_indices, we obtain
+  // the subclusters from following the cluster_hierarchy.
+
+  // Gets one cluster by index. Returns false if the index is out of range.
+  // Returns true if in range.
+
+  void add_to_set(short node, std::set<short> &cluster, double &max_distance)
+  {
+    short child1 = cluster_hierarchy[node].child1;
+    short child2 = cluster_hierarchy[node].child2;
+    double within_distance = cluster_hierarchy[node].dist;
+    bool isterminal = cluster_hierarchy[node].is_terminal();
+
+    if (cluster_hierarchy[node].this_nodes_index != node)
+    {
+      std::cerr << "Error in cluster hierarchy" << std::endl;
+      exit(-1);
+    }
+
+    if (isterminal)
+    {
+      cluster.insert(node);
+    }
+    else
+    {
+      add_to_set(child1, cluster, max_distance);
+      add_to_set(child2, cluster, max_distance);
+      if (within_distance > max_distance)
+	max_distance = within_distance;
+
+      //      str.append(faststring(within_distance));
+    }
+  }
+
+  // The index must be 0 based.
+  bool get_cluster_by_index(short i, std::set<short> &cluster, double &max_dist)
+  {
+    std::set<short>::iterator it_cluster_indices     = current_cluster_indices.begin();
+    std::set<short>::iterator it_cluster_indices_end = current_cluster_indices.end();
+   
+    advance(it_cluster_indices, i);
+
+    if (it_cluster_indices == it_cluster_indices_end)
+      return false;
+
+    cluster.clear();
+    max_dist = 0;
+    add_to_set(*it_cluster_indices, cluster, max_dist);
+
+    return true;
+  }
+
+
+
+
+};
+
+#endif
diff --git a/CDnaString2.h b/CDnaString2.h
new file mode 100644
index 0000000..72a6d78
--- /dev/null
+++ b/CDnaString2.h
@@ -0,0 +1,445 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef DNASTRING_H
+#define DNASTRING_H
+
+#include "primefactors.h"
+#include "faststring2.h"
+#include <cctype>
+#include "basic-DNA-RNA-AA-routines.h"
+
+
+// Todo:
+//       - Check for correct nucl. in push_back, set routine
+
+inline bool isReducibleUnit_global(const char *beg, const char* end)
+{
+  unsigned       len = end-beg;
+  const char     *test_pos;
+
+  int            factor_index;
+  unsigned       factor;
+  unsigned       factor_len;
+  unsigned       i;
+  bool           composite;
+
+  factor_index = 0;
+  while( (factor = primeFactors[len][factor_index]) != 0 )
+  {
+    composite = true;
+    factor_len = len/factor;
+    test_pos = beg;
+    for (i=1; i<factor; ++i, test_pos += factor_len)
+      if ( strncmp(test_pos, (test_pos + factor_len), factor_len) != 0)
+	composite = false;
+
+    if (composite)
+      return true;
+    ++factor_index;
+  }
+  return false;
+}
+
+
+
+class CDnaString : public faststring
+{
+ public:
+/*   using faststring::c_str; */
+/*   using faststring::reserve; */
+/*   using faststring::size; */
+/*   using faststring::capacity; */
+/*   using faststring::clear; */
+/*   using faststring::check_pos; */
+/*   using faststring::set_unckecked; */
+/*   using faststring::assign; */
+/*   using faststring::push_back; */
+/*   using faststring::set_unchecked; */
+/*   using faststring::begin; */
+/*   using faststring::end; */
+/*   using faststring::tolower; */
+/*   using faststring::toupper; */
+
+
+  CDnaString():faststring()
+  {}
+
+  CDnaString(const char *s):faststring(s)
+  {}
+
+  CDnaString(const faststring &s):faststring(s)
+  {}
+
+  void toupper_assign(const char *str)
+  {
+    faststring::assign(str);
+    toupper();
+  }
+
+  void toupper_assign(const char *str_begin, const char *str_end)
+  {
+    faststring::assign(str_begin, str_end);
+    toupper();
+  }
+
+  void toupper_push_back(char c)
+  {
+    faststring::push_back(std::toupper(c));
+  }
+
+  void toupper_set_unckecked(unsigned pos, char c)
+  {
+    faststring::set_unckecked(pos, std::toupper(c));
+  }
+
+  bool toupper_set(unsigned pos, char c)
+  {
+    return faststring::set(pos, std::toupper(c));
+  }
+
+  unsigned countUnknownBases()
+  {
+    char *b = begin();
+    char *e = end();
+    char c;
+    unsigned errors = 0;
+
+    while (b != e)
+    {
+      c = *b;
+      if (c != 'A' && c != 'C' && c != 'G' && c != 'T' &&
+	  c != 'R' && c != 'Y' &&
+	  c != 'M' && c != 'K' &&
+	  c != 'B' && c != 'V' &&
+	  c != 'D' && c != 'H' &&
+	  c != 'N' )
+	++errors;
+      ++b;
+    }
+    return errors;
+  }
+
+
+  unsigned setToComplementOf(const CDnaString &a)
+  {
+    unsigned   len      = a.size();
+    const char *pos     = a.begin();
+    const char *pos_end = a.end();
+    unsigned   error    = 0;
+
+    reserve(len);
+    clear();
+
+    while( pos != pos_end )
+    {
+      switch (*pos)
+      {
+        case 'A':  faststring::push_back('T'); break;
+        case 'T':  faststring::push_back('A'); break;
+        case 'G':  faststring::push_back('C'); break;
+        case 'C':  faststring::push_back('G'); break;
+
+        case 'R':  faststring::push_back('Y'); break;
+        case 'Y':  faststring::push_back('R'); break;
+
+        case 'M':  faststring::push_back('K'); break;
+        case 'K':  faststring::push_back('M'); break;
+
+        case 'B':  faststring::push_back('V'); break;
+        case 'V':  faststring::push_back('B'); break;
+
+        case 'D':  faststring::push_back('H'); break;
+        case 'H':  faststring::push_back('D'); break;
+
+        case 'N':  faststring::push_back('N'); break;
+        default:
+	  ++error;
+	  push_back('?');
+        break;
+      };
+      ++pos;
+    }
+    return error;
+  }
+
+  unsigned setToReverseComplementOf(const CDnaString &a)
+  {
+    unsigned   len      = a.size();
+    const char *pos     = a.rbegin();
+    const char *pos_end = a.rend();
+    unsigned   error    = 0;
+
+    reserve(len);
+    clear();
+
+    while( pos != pos_end )
+    {
+      switch (*pos)
+      {
+        case 'A':  faststring::push_back('T'); break;
+        case 'T':  faststring::push_back('A'); break;
+        case 'G':  faststring::push_back('C'); break;
+        case 'C':  faststring::push_back('G'); break;
+
+        case 'R':  faststring::push_back('Y'); break;
+        case 'Y':  faststring::push_back('R'); break;
+
+        case 'M':  faststring::push_back('K'); break;
+        case 'K':  faststring::push_back('M'); break;
+
+        case 'B':  faststring::push_back('V'); break;
+        case 'V':  faststring::push_back('B'); break;
+
+        case 'D':  faststring::push_back('H'); break;
+        case 'H':  faststring::push_back('D'); break;
+
+        case 'N':  faststring::push_back('N'); break;
+        default:
+	  ++error;
+	  push_back('?');
+        break;
+      };
+      --pos;
+    }
+    return error;
+  }
+
+
+  void setToReverseOf(const CDnaString &a)
+  {
+    unsigned   len      = a.size();
+    const char *pos     = a.rbegin();
+    const char *pos_end = a.rend();
+
+    reserve(len);
+    clear();
+
+    while( pos != pos_end )
+    {
+      faststring::push_back(*pos);
+      --pos;
+    }
+  }
+
+
+  // Returns true if a subpattern has been found,
+  // false if no subpattern has been found. 
+  void correct_unit_with_subpattern(unsigned &ulen)
+  {
+    unsigned       len   = size();
+    char           *tmp  = new char [2*len+1];
+    const char     *orig = c_str();
+
+    char           *pos  = tmp;
+    char           *pos_end = pos + len;
+    int             strncmp_result;
+
+    strcpy(tmp,     orig);
+    strcpy(tmp+len, orig);
+
+    //    std::cerr << "Correcting unit: " << *this << std::endl;
+    ++pos;
+    for (; pos != pos_end; ++pos)
+    {
+      strncmp_result = strncmp(tmp, pos, len);
+      if ( strncmp_result == 0 ) // Subpattern has been found
+      {
+	ulen = pos-tmp;
+	shorten(ulen);
+	//	std::cerr << "New unit: " << ulen << " " << *this << std::endl;
+	break;
+      }
+    }
+    delete [] tmp;
+  }
+
+
+  // Returns true if a subpattern has been found,
+  // false if no subpattern has been found. 
+  bool setToMinAlphaRepModCyclicPermOf(const CDnaString &s)
+  {
+    unsigned       len   = s.size();
+    char           *tmp  = new char [2*len+1];
+    const char     *orig = const_cast<CDnaString&>(s).c_str();
+
+    char           *pos  = tmp;
+    char           *pos_end = pos + len;
+    //unsigned       i;
+    char           *min_str;
+    int             strncmp_result;
+
+    bool            found_subpattern = false;
+
+    strcpy(tmp,     orig);
+    strcpy(tmp+len, orig);
+
+    min_str = tmp;
+    ++pos;
+    for (; pos != pos_end; ++pos)
+    {
+      strncmp_result = strncmp(pos, min_str, len);
+      if ( strncmp_result < 0 )
+	min_str = pos;
+      else if ( strncmp_result == 0 )
+      {
+	// New pattern is from 
+	found_subpattern = true;
+      }
+    }
+    *(min_str+len) = '\0';     /* At this position within tmp we have the end of the unit */
+    faststring::assign(min_str);
+    delete [] tmp;
+    return found_subpattern;
+  }
+
+  // Returns true if a subpattern has been found,
+  // false if no subpattern has been found. 
+  bool setToMinAlphaRepModRevCompAndCyclicPermOf(const CDnaString &s)
+  {
+    CDnaString tmp;
+    bool       found_subpattern;
+
+    tmp.setToReverseComplementOf(s);
+    found_subpattern = setToMinAlphaRepModCyclicPermOf(tmp);   // *this contains minimum representation of rev comp of s
+
+    tmp.setToMinAlphaRepModCyclicPermOf(s); // tmp contains minimum representation of s itself
+
+    if ( strcmp(c_str(), tmp.c_str() ) > 0 )
+    {
+      assign( tmp.c_str() );
+    }
+    return found_subpattern;
+  }
+
+  // Returns true if a subpattern has been found,
+  // false if no subpattern has been found. 
+  bool setToMinAlphaRepModRevCompAndCyclicPermOf(const CDnaString &s, signed char &direction)
+  {
+    CDnaString tmp;
+    bool       found_subpattern;
+
+    tmp.setToReverseComplementOf(s);
+    found_subpattern = setToMinAlphaRepModCyclicPermOf(tmp);   // *this contains minimum representation of rev comp of s
+
+    tmp.setToMinAlphaRepModCyclicPermOf(s); // tmp contains minimum representation of s itself
+    direction = 1;
+
+    if ( strcmp(c_str(), tmp.c_str() ) > 0 )
+    {
+      assign( tmp.c_str() );
+      direction = -1;
+    }
+    return found_subpattern;
+  }
+
+
+  bool isCompositeUnitLength(int x)
+  {
+    return primeFactors[x][0];
+  }
+
+  // Old and inefficient:
+/*   bool isReducibleUnit_old() */
+/*   { */
+/*     unsigned       len   = size(); */
+/*     char           *tmp  = new char [2*len+1]; */
+/*     const char     *orig = c_str(); */
+
+/*     int            factor_index; */
+/*     unsigned       shift; */
+
+/*     strcpy(tmp,     orig); */
+/*     strcpy(tmp+len, orig); */
+
+/*     factor_index = 0; */
+/*     while( (shift = primeFactors[len][factor_index]) != 0 ) */
+/*     { */
+/*       if ( strncmp(tmp, tmp+shift, len) == 0) */
+/* 	return true; */
+/*       ++factor_index; */
+/*     } */
+/*     return false; */
+/*   } */
+
+  // New and works but is redundent - equivalent to current version
+/*   bool isReducibleUnit_ok() */
+/*   { */
+/*     unsigned       len   = size(); */
+/*     const char     *orig = c_str(); */
+
+/*     int            factor_index; */
+/*     unsigned       factor; */
+/*     unsigned       factor_len; */
+/*     unsigned       i; */
+/*     bool           composite; */
+
+/*     factor_index = 0; */
+/*     while( (factor = primeFactors[len][factor_index]) != 0 ) */
+/*     { */
+/*       composite = true; */
+/*       factor_len = len/factor; */
+/*       orig = c_str(); */
+/*       for (i=1; i<factor; ++i, orig += factor_len) */
+/* 	if ( strncmp(orig, orig+factor_len, factor_len) != 0) */
+/* 	  composite = false; */
+
+/*       if (composite) */
+/* 	return true; */
+/*       ++factor_index; */
+/*     } */
+/*     return false; */
+/*   } */
+
+  bool isReducibleUnit()
+  {
+    return isReducibleUnit_global(c_str(), c_str()+size());
+  }
+
+
+  friend bool operator<(const CDnaString &a, const CDnaString &b)
+  {
+    // Possibly more efficient would be a strncmp. If equally long, take the shorter one.
+    // Not tested yet - thats why its not used!
+
+    //    unsigned minlen = (a.length() < b.length() ? a.length() : b.length());
+    //   short    test   =  strncmp(a.begin(), b.begin(), minlen);
+
+    //    if (test == 0)
+    //     return a.length() < b.length();
+    //   else
+    //      return (test < 0);
+
+    // Hi compiler - how do you like this: Haahaahaahaaaaaaaa
+    return (strcmp(const_cast<CDnaString&>(a).c_str(), const_cast<CDnaString&>(b).c_str() ) < 0);
+  }
+
+};
+
+
+
+
+#endif
diff --git a/CFile/.DS_Store b/CFile/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/CFile/.DS_Store differ
diff --git a/CFile/CFile2_1.h b/CFile/CFile2_1.h
new file mode 100644
index 0000000..d08f4b6
--- /dev/null
+++ b/CFile/CFile2_1.h
@@ -0,0 +1,364 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CFILE_H
+#define CFILE_H
+
+#include <fstream>
+#include <string>
+#include "../faststring2.h"
+
+// Should not exceed 1 000 000 without making sure that the stack is large enough.
+#ifndef BUFFERSIZE
+#define BUFFERSIZE 1000000
+#endif
+#define UNDOs      1
+
+
+// Changes:
+// 22.08.2009: Added getline function for faststring. Disadvantage: addidtional dependence on faststring.h
+// 07.01.2011: Changed Version to CFile2_1.h
+// 07.01.2011: Now uses the faststring2.h
+
+// Idee: ios::   set Buffer size
+
+// TODO: Old mac format not supported.
+//       This requires to allow two successive calls to the internal ungetchar command.
+
+
+class CFile : private std::ifstream
+{
+ private:
+  // There is a problem here: The stack size is limited. One should consider to move this to the heap.
+  // allocate it with malloc, new or declare it as static - the latter is not good in a class since a
+  // static class member is the same for all instances of the class, which we do not want here.
+
+  char      buffer[BUFFERSIZE];
+  char*     buffer_end;
+  char*     buffer_pos;
+  
+  char      __status;
+  unsigned  __line;
+
+  //  bool      __eof;
+  //  bool      __openFailed;
+
+  unsigned fill_buffer(unsigned overlap)
+  {
+    unsigned          good_overlap = buffer_end - buffer;
+    std::streamsize   n;
+
+    if (good_overlap < overlap)
+    {
+      overlap = good_overlap;
+    }
+
+    if (overlap > 0)
+      std::memmove(buffer, buffer_end - overlap, overlap);
+
+    std::ifstream::read(buffer + overlap, BUFFERSIZE - overlap);
+    n = std::ifstream::gcount();
+
+    if ( n == 0 )
+    {
+      __status |=  __eof_flag;     // Set eof flag
+      __status &= ~__good_flag;    // Unset good flag
+      __status |=  __fail_flag;    // Setting the fail flag is not always correct. Needs to be unset in routines that read more than one char. 
+    }
+
+    buffer_pos = buffer+overlap;
+    buffer_end = buffer_pos + n;
+
+    return overlap;
+  }
+
+  char getchar_intern()  // should only be done if we did not fail yet!!!! This would allow us to recover!!!
+  {
+    if ( buffer_pos == buffer_end )
+    {
+      fill_buffer(UNDOs);
+      if (__status & __fail_flag)
+	return '\0';
+    }
+    return *buffer_pos++;
+  }
+
+  void ungetchar_intern()  // should only be done if we did not fail yet!!!! This would allow us to recover!!!
+  {
+    if (buffer_pos != buffer)
+      --buffer_pos;
+    else
+    {
+      __status |=  __fail_flag;      // Set fail flag.
+      __status &= ~__good_flag;     // Unset good flag.
+    }
+  }
+
+ public:
+
+  enum {__eof_flag = 1, __good_flag = 2,  __fail_flag = 4, __bad_flag = 8};
+
+  void open(const char *name)
+  {
+    ffopen(name);
+  }
+
+  void open(std::string name)
+  {
+    ffopen(name);
+  }
+
+  void ffopen(const char *name)
+  {
+    __status = __good_flag;
+
+    std::ifstream::open(name);
+
+    if ( std::ifstream::fail() )
+    {
+      __status |=  __fail_flag;      // Set fail flag.
+      __status &= ~__good_flag;     // Unset good flag.
+    }
+
+    __line        = 1;
+    buffer_end    = buffer;
+    buffer_pos    = buffer;
+  }
+
+  void ffopen(std::string name)
+  {
+    ffopen(name.c_str());
+  }
+
+  void ffclose()
+  {
+    std::ifstream::close();
+  }
+
+  void close()
+  {
+    ffclose();
+  }
+
+  bool exists()  // -- depricated -- do not use this any more - check fail() instead !!!!!!!!
+  {
+    return !fail(); 
+  }
+
+  bool fail()
+  {
+    return (__status & __fail_flag);
+  }
+
+  bool good()
+  {
+    return (__status & __good_flag);
+  }
+
+  unsigned line()
+  {
+    return __line;
+  }
+
+  bool eof()
+  {
+    return (__status & __eof_flag);
+  }
+
+  char status()
+  {
+    return __status;
+  }
+
+  void rewind()
+  {
+    clear();
+    std::ifstream::seekg (0, std::ios::beg);
+    //    clear();
+  }
+
+  void clear(char s = __good_flag)
+  {
+    __status = s;
+    std::ifstream::clear();
+  }
+
+  void ungetchar()
+  {
+    if (*(buffer_pos-1) == '\n' && !(__status & __fail_flag))
+      --__line;
+    ungetchar_intern();
+  }
+
+  void ignore(int delim = -1)
+  {
+    while (__status == __good_flag && getchar() != delim ){}
+  }
+
+  char peekchar()
+  {
+    char c = getchar();
+    ungetchar();
+    return c;
+  }
+
+  char peek()
+  {
+    return peekchar();
+  }
+
+  char getchar()
+  {
+    register char c;
+
+    c = getchar_intern();
+
+    if ( c < 14 && !(__status & __fail_flag) )
+    {
+      if (  c == '\r' )
+      {
+	// Overwrite the last reading position that contained the \r with \n
+	*(buffer_pos-1) = '\n';           // Should always be valid! Works for 1 Undo
+	c = getchar_intern();
+	if ( c != '\n' && !(__status & __fail_flag) )
+	{
+	  // 	std::cerr << "Old mac file format currently not supported." << std::endl;
+	  ungetchar();    /* old mac format, else dos format     */
+	}
+	c = '\n';
+	++__line;
+      }
+      else if ( c == '\n')
+	++__line;
+    }
+    return c;  
+  }
+
+
+  char getrawchar()
+  {
+    return getchar_intern();
+  }
+
+  void getline(faststring& str, char delim='\n')
+  {
+    char c = getchar();
+    str.clear();
+    while ( c != delim && !(__status & __fail_flag) )
+    {
+      str.push_back(c);
+      c = getchar();
+    }
+    if ((__status & __fail_flag) && str.size() > 0)
+      __status &= ~__fail_flag; // Unset fail flag by using & on the complement of the fail flag;
+  }
+
+  void getline(std::string& str, char delim='\n')
+  {
+    char c = getchar();
+    str="";
+    while ( c != delim && !(__status & __fail_flag) )
+    {
+      str.push_back(c);
+      c = getchar();
+    }
+    if ((__status & __fail_flag) && str.size() > 0)
+      __status &= ~__fail_flag; // Unset fail flag by using & on the complement of the fail flag;
+  }
+
+  void getline(char* cstr, unsigned n, char delim='\n')
+  {
+    char     c = getchar();
+    unsigned i = 0;
+
+    while ( !(__status & __fail_flag ) && i < n-1 &&  c != delim)
+    {
+      cstr[i] = c;
+      ++i;
+      c = getchar(); 
+    }
+    if ((__status & __fail_flag) && i > 0)
+      __status &= ~__fail_flag; // Unset fail flag by using & on the complement of the fail flag;
+    cstr[i] = '\0';
+  }
+
+  void readFileIntoString(faststring &str)
+  {
+    char c;
+    
+    str.clear();
+    
+    c = getchar();
+    while (!(__status & __fail_flag))
+    {
+      str.push_back(c);
+      c = getchar();
+    }
+  }
+  
+
+  char lastchar()
+  {
+    char c;
+
+    if ( buffer_pos != buffer_end )
+      c = *(buffer_pos-1);
+    else
+    {
+      __status |= __fail_flag;      // Set fail flag.
+      __status &= ~__good_flag;     // Unset good flag.
+      return 0;
+    }
+
+    /* It could be a '\r' in mac format */
+    if (c == '\r')
+      c = '\n';
+
+    return c;
+  }
+
+  char lastrawchar()
+  {
+    char c;
+
+    if ( buffer_pos != buffer_end )
+      c = *(buffer_pos-1);
+    else
+    {
+      __status |= __fail_flag;      // Set fail flag.
+      __status &= ~__good_flag;     // Unset good flag.
+      return 0;
+    }
+    return c;
+  }
+
+
+};
+
+
+
+
+#endif
diff --git a/CHistogram.h b/CHistogram.h
new file mode 100644
index 0000000..67903da
--- /dev/null
+++ b/CHistogram.h
@@ -0,0 +1,660 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CHISTOGRAM_H
+#define CHISTOGRAM_H
+
+// This is the CHistogram class written by Christoph Mayer, Forschungsmuseum Alexander Koenig, Bonn, Germany.
+// Discription:
+// This class allowes different binning schemes:
+// 1) User supplied number of bins together with lower and upper value.
+// IMPORTANT: The lower value is inclusive, the upper value is exclusive.
+//            Therefore, a value equal to the upper value cannot be added
+//            to the histrogram data.
+//            If this is a problem, increase the upper value, or take
+//            a different constructor. See below.
+// 2) Vector or range of data. From this the lower and upper bound
+//    are determined automatically. Number fo bins or automatic binning
+//    if the number of bins parameter has certain negative values.
+// 3) Discrete data. In this case the data is not binned when it is added,
+//    but stored in a map. The binning is performed upon request.
+
+
+
+
+#include <iostream>
+#include <vector>
+#include <map>
+#include <cmath>
+#include <cctype>
+#include <iterator>
+#include <cstdlib>
+#include <algorithm>
+#include "statistic_functions.h"
+
+#define EPSS  0.00000000001;
+
+
+
+
+
+
+
+
+inline bool greater_than_pair(const std::pair<double, unsigned> &a, const std::pair<double, unsigned> &b )
+{
+  return a.second > b.second;
+}
+
+
+
+
+inline void add_or_count(std::map<double, unsigned> &m, double &x)
+{
+  std::map<double,unsigned>::iterator it;
+
+  it = m.find(x);
+  if (it == m.end() )
+  {
+    m[x] = 1;
+  }
+  else
+  {
+    ++it->second;
+  }
+}
+
+
+
+
+class CHistogram
+
+{
+ private:
+  double   a;   // Inclusive range minimum
+  double   b;   // Exclusive range maximum
+  unsigned bins;
+  double   step;
+  unsigned entries;
+
+  std::vector<unsigned> data;
+
+  bool     discrete_data;  // is determined in initialisation. Switched on with -10.
+  std::map<double, unsigned> discrete_hist_data;
+
+ private:
+  bool add_intern_non_discrete(double x)
+  {
+    // Be careful: If x==b this is allowed, but it places
+    // this hit into the 
+
+    if (x < a || x >= b)
+    {
+      if (x == b)
+	std::cerr << "Warning: CHistrogram::add_intern_non_discrete data.siz\n"
+		  << "   Data points that are added must be exclusive the upper bound of the given range.\n\n";
+      return false;
+    }
+
+    ++entries;
+
+    unsigned bin = (x-a)/step;
+    //    std::cerr << "HH " << bin << " " << data.size() << std::endl;
+
+    ++data[bin];
+    return true;
+  }
+
+  // Adds the value to the discete data map.
+  // Number of bins as well as a and b are not changed.
+  bool add_intern_discrete_no_update(double x)
+  {
+    ++entries;
+    add_or_count(discrete_hist_data, x);
+    return true;
+  }
+
+  void update_a_b_bins_discrete_data()
+  {
+    // Remember: The discrete data is stored in an automatically sorted map.
+    // Therefore, the bounds are determined from the first and last element.
+
+    // Determine a, b and bins:
+    a = discrete_hist_data.begin()->first;
+    b = discrete_hist_data.rbegin()->first;
+
+    bins = discrete_hist_data.size();
+  }
+
+
+ public:
+ void init_with_vector(const std::vector<double> &vals, int bins_param=0)
+ {
+   init_with_range(vals.begin(), vals.end(), vals.size(), bins_param);
+ }
+
+
+ template <typename T>
+   void init_with_range(T         it_beg,         // pointer or iterator to first element
+			T         it_end,         // pointer or iterator to element behind last element
+			unsigned  num_range_elements, // number of elements in range
+			int       bins_param=0)       // number of bins or if <=0 specifies the method
+                                                      // to determine this number
+ {
+   double mi, ma, me, sd;
+
+   discrete_data = false;
+
+   if (num_range_elements == 0) // Fill in some dummy values so that everything is well defined. Pratically this does not make sense, but should prevent other classes using this data from crashing.
+   {
+     a = 0;
+     b = 1;
+     data.push_back(0);
+     bins = 1;
+     step = 1;
+     
+     return;
+   }
+   
+   mi = ma = 0;  // This code silences the used uninitialized warning of some compilers. It is not necessary, since the two variables are initialized in
+                 // range_min_max as the name suggests.
+
+   range_min_max(it_beg, it_end, mi, ma);
+
+   // Special case: Only one category and automatic number of bins, but not discrete data
+   // In principle this is a special case of discrete data but not explicitly mentioned.
+   if (bins_param != -10 && bins_param <= 0 && mi== ma)
+     bins_param = 1;
+
+   
+
+   // Formulas for auto bins number: http://en.wikipedia.org/wiki/Histogram
+
+   if (bins_param == 0) // Sturges formula -- can perform poorly if n < 30.
+   {
+     bins = ceil(log(num_range_elements)/log(2)+1);
+   }
+   else if (bins_param == -1) // Scotts formula
+   {
+     range_mean_sd(it_beg, it_end, me, sd);
+     bins = 3.5*sd/pow(num_range_elements, 1./3.);
+   }
+   else if (bins_param == -2) // sqrt formula
+   {
+     bins = sqrt(num_range_elements);
+   }
+   else if (bins_param == -3) // Freedman-Diaconis' formula // Not implemented
+   {
+     bins = 1;
+   }
+   else if (bins_param == -4) // minimization of risk function // Not implemented
+   {
+     bins = 1;
+   }
+   else if (bins_param == -10) // Each value gets its own bin
+   {
+     discrete_data = true;
+   }
+   else if (bins_param > 0)
+   {
+     bins = bins_param;
+   }
+   else
+   {
+     std::cerr << "Error: the init_param parameter is negative, but its value does not specify a method. This needs to be corrected." << std::endl;
+     exit(-133);
+   }
+
+   // We have minimum (mi), maximum (ma) and number of bins.
+   // Now we determine the step size as well as lower and upper bound (a,b).
+
+   if (!discrete_data) // Add non discrete values:
+   {
+     if (bins > 1)
+     {
+       step = (ma-mi)/(bins-1.0);
+       a = mi - 0.5*step;
+       b = ma + 0.5*step;
+     }
+     else
+     {
+       step = 1.0; // fantasy value
+       a = mi - 0.5*step;
+       b = ma + 0.5*step;
+     }
+
+/*      std::cerr << "--a    " << a << std::endl; */
+/*      std::cerr << "--b    " << b << std::endl; */
+/*      std::cerr << "--bins " << bins << std::endl; */
+/*      std::cerr << "--step " << step << std::endl; */
+
+
+     data = std::vector<unsigned>(bins, 0);
+
+     while (it_beg != it_end)
+     {
+       if (!add_intern_non_discrete(*it_beg) )
+       {
+	 std::cerr << "Internal error: Value out of range when building the histgram.\n" << std::endl;
+	 exit(-144);
+       }
+       ++it_beg;
+     }
+   }
+   else // Add dicrete values
+   {
+     step = 0;
+     // Add all values to map:
+     while (it_beg != it_end)
+     {
+       add_intern_discrete_no_update(*it_beg);
+       ++it_beg;
+     }
+     update_a_b_bins_discrete_data();
+   }
+
+
+ }
+
+// Constructor with: lower and upper value as well as the number of
+// equidistant bins.
+// Here we do not allow to determine the number of bins automatically for the simple reason:
+// The number of necessary bins can only be determined if the number of data points is known
+// which is not assumed here.
+CHistogram(double a_param, double b_param, int bins_param):
+ a(a_param), b(b_param), bins(bins_param), entries(0), data(bins_param, 0)
+ {
+    if (bins_param < 1)
+    {
+      std::cerr << "Critical error in constructor of CHistogram. Parameter bins_param must be positive here.\n" << std::endl;
+      exit(-143);
+    }
+
+    discrete_data = false;
+    step = (b-a)/bins;
+ 
+    // Adds no data.
+ }
+  
+ // Constructor with: range or vector as well as the bins_param
+ // if bins_param < 1: then the parameter specifies the method to determine the number
+ //                    of bins automatically.
+ //                    0: Sturges formula -- can perform poorly if n < 30.
+ //                   -1: Scotts formula
+ //                   -2: sqrt formula
+ //                   -3: Freedman-Diaconis' formula // Not implemented
+ //                   -4: minimization of risk function // Not implemented
+ // if bins_param > 1: this specifies the actual number of bins
+
+ CHistogram(const std::vector<double> &vals, int bins_param=0):entries(0)
+ {
+   init_with_range(vals.begin(), vals.end(), vals.size(), bins_param);
+ }
+
+ CHistogram(const std::vector<unsigned> &vals, int bins_param=0):entries(0)
+ {
+   init_with_range(vals.begin(), vals.end(), vals.size(), bins_param);
+ }
+
+ template <typename T>
+ CHistogram(T it_beg,
+	    T it_end,
+	    int bins_param=0):entries(0)
+ {
+   init_with_range(it_beg, it_end, std::distance(it_beg, it_end), bins_param);
+ }
+
+  double get_lower()
+  {
+    return a;
+  }
+
+  double get_upper()
+  {
+    return b;
+  }
+
+  unsigned get_bins()
+  {
+    return bins;
+  }
+
+  double get_binsize()
+  {
+    return step;
+  }
+
+  // This function should be reimplemented in a cleaner way!!!
+  // The use of the data field to store disc
+  const std::vector<unsigned> &get_histogram_data()
+  {
+    if (discrete_data) // data needs to be prepared:
+    {
+      data.clear();
+
+      std::map<double, unsigned>::iterator it_beg, it_end;
+
+      it_beg = discrete_hist_data.begin(); 
+      it_end = discrete_hist_data.end();
+
+      while (it_beg != it_end)
+      {
+	data.push_back(it_beg->second);
+	++it_beg;
+      }
+    }
+    return data; 
+  }
+
+  void get_bin_coords(std::vector<double> &v)
+  {
+/*     std::cerr << "a    " << a << std::endl; */
+/*     std::cerr << "b    " << b << std::endl; */
+/*     std::cerr << "bins " << bins << std::endl; */
+/*     std::cerr << "step " << step << std::endl; */
+
+
+    unsigned i;
+
+    v.clear();
+
+    if (!discrete_data)
+    { 
+      for (i=0; i<bins; ++i)
+      {
+	v.push_back(a+(i+0.5)*step);
+      }
+    }
+    else
+    {
+      std::map<double, unsigned>::iterator it_beg, it_end;
+
+      it_beg = discrete_hist_data.begin(); 
+      it_end = discrete_hist_data.end();
+
+      while (it_beg != it_end)
+      {
+	v.push_back(it_beg->first);
+	++it_beg;
+      }
+    }
+  }
+
+
+  //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+  // old code - needs revision. See method to compute coordinates
+/*   void print_bin_coord_hist_data(std::ostream &os, bool normal=true) */
+/*   { */
+
+/*     unsigned i; */
+/*     double   tmp; */
+
+/*     // Not very elegant to change this for os - should be changed */
+
+/*     os.setf(std::ios::fixed); */
+/*     os.precision(6); */
+
+/*     if (!discrete_data) */
+/*     { */
+/*       for (i=0; i<bins; ++i) */
+/*       { */
+/* 	if (normal) */
+/* 	  tmp = (double) data[i]/entries/step; */
+/* 	else */
+/* 	  tmp = (double) data[i]; */
+/* 	os << (a+(i+0.5)*step) << "\t"; */
+/* 	os << tmp << std::endl; */
+/*       } */
+/*     } */
+/*     else */
+/*     { */
+/*       std::map<double, unsigned>::iterator it_beg, it_end; */
+
+/*       it_beg = discrete_hist_data.begin();  */
+/*       it_end = discrete_hist_data.end(); */
+
+/*       while (it_beg != it_end) */
+/*       { */
+/* 	if (normal) */
+/* 	  tmp = (double) it_beg->second/entries/step; */
+/* 	else */
+/* 	  tmp = (double) it_beg->second; */
+/* 	os << it_beg->first  << "\t" << it_beg->second << std::endl; */
+
+/* 	++it_beg; */
+/*       } */
+/*     } */
+/*   } */
+
+
+  // Returns false if out of range error, else true.
+  bool add(double x)
+  {
+    if (discrete_data)
+    {
+      add_intern_discrete_no_update(x);
+      update_a_b_bins_discrete_data();
+      return true; // Can never fail
+    }
+    else
+    {
+      return add_intern_non_discrete(x);
+    }
+  }
+
+  bool add(std::vector<double> v)
+  {
+    int i, n=v.size();
+
+    if (!discrete_data) // Non-discrete data:
+    {
+      for (i=0; i<n; ++i)
+	if (!add_intern_non_discrete(v[i]))
+	  return false;
+    }
+    else // discrete data:
+    {
+      for (i=0; i<n; ++i)
+      {
+	add_intern_discrete_no_update(v[i]);
+      }
+      update_a_b_bins_discrete_data();
+    }
+    return true;
+  }
+
+  template<typename T> // T is some iterator or pointer type
+  bool add(T b, T e) // defines range
+  {
+    if (!discrete_data) // Discrete data:
+    { 
+      while (b != e)
+      {
+	if (!add_intern_non_discrete(*b))
+	  return false;
+	++b;
+      }
+    }
+    else
+    {
+      while (b != e)
+      {
+	add_intern_discrete_no_update(*b);
+	++b;
+      }
+      update_a_b_bins_discrete_data();
+    }
+    return true;
+  }
+
+  bool is_discrete_data()
+  {
+    return discrete_data;
+  }
+
+  unsigned num_entries()
+  {
+    return entries;
+  }
+
+  //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+  // old code - needs revision.
+/*   bool get_dominant_category_and_num(double &cat, unsigned &num) */
+/*   { */
+/*     if (discrete_data) */
+/*     { */
+/*       std::map<double, unsigned>::iterator it_beg, it_end; */
+
+/*       it_beg = discrete_hist_data.begin();  */
+/*       it_end = discrete_hist_data.end(); */
+      
+/*       if (it_beg == it_end) */
+/*       { */
+/* 	return false;  */
+/*       } */
+
+/*       cat = it_beg->first; */
+/*       num = it_beg->second; */
+
+/*       while (it_beg != it_end) */
+/*       { */
+/* 	if (it_beg->second > num) */
+/* 	{ */
+/* 	  cat = it_beg->first; */
+/* 	  num = it_beg->second; */
+/* 	} */
+/* 	++it_beg; */
+/*       } */
+/*     } */
+/*     else // Non discrete data: */
+/*     { */
+/*       double   max_key; */
+/*       unsigned max_value; */
+
+/*       unsigned i, n; */
+
+/*       n = data.size(); */
+/*       i = 0; */
+      
+/*       if (n == 0) */
+/*       { */
+/* 	return false;  */
+/*       } */
+
+/*       max_key   = a + step/2; */
+/*       max_value = data[0]; */
+
+/*       while (i != n) */
+/*       { */
+/* 	if (data[i] > num) */
+/* 	{ */
+/* 	  max_key   = a + (i + 0.5)*step; */
+/* 	  max_value = data[i]; */
+/* 	} */
+/* 	++i; */
+/*       } */
+/*     } */
+/*     return true; */
+/*   } */
+
+/*   // Should be tested before it is used. */
+/*   void dominant_category(double &value, double &prop) */
+/*   { */
+/*     double   cat; */
+/*     unsigned num; */
+
+/*     if (get_dominant_category_and_num(cat, num)) */
+/*     { */
+/*       value = cat; */
+/*       prop  = (double)num/entries;  */
+/*     } */
+/*     else */
+/*     { */
+/*       value = 0; */
+/*       prop  = -1; */
+/*     } */
+/*   } */
+
+
+
+  void categories_sorted_by_dominance(std::vector<std::pair<double, unsigned> > &cat_val_pair_vec)
+  {
+    if (discrete_data)
+    {
+      std::map<double, unsigned>::iterator it_beg, it_end;
+
+      it_beg = discrete_hist_data.begin(); 
+      it_end = discrete_hist_data.end();
+      
+      if (it_beg == it_end)
+      {
+	return; 
+      }
+
+      while (it_beg != it_end)
+      {
+	double   cat;
+	unsigned num;
+
+	cat = it_beg->first;
+	num = it_beg->second;
+
+	cat_val_pair_vec.push_back(std::make_pair(cat, num));
+
+	++it_beg;
+      }
+    }
+    else // Non discrete data:
+    {
+      double   key;
+      unsigned value;
+
+      unsigned i, n;
+
+      n = data.size();
+      i = 0;
+      
+      if (n == 0)
+      {
+	return; 
+      }
+
+      while (i != n)
+      {
+	key = a + step/2;
+	value = data[0];
+
+	cat_val_pair_vec.push_back(std::make_pair(key, value));
+	++i;
+      }
+    }
+
+    sort(cat_val_pair_vec.begin(), cat_val_pair_vec.end(), greater_than_pair);
+  }
+
+};
+
+#endif
diff --git a/CRequiredTaxon.h b/CRequiredTaxon.h
new file mode 100644
index 0000000..c7084f6
--- /dev/null
+++ b/CRequiredTaxon.h
@@ -0,0 +1,315 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CREQUIREDTAXA_H
+#define CREQUIREDTAXA_H
+
+#include "faststring2.h"
+#include <iostream>
+#include <fstream>
+#include <set>
+#include <vector>
+#include "CTaxonNamesDictionary.h"
+#include "print_container.h"
+
+class CRequiredTaxa
+{
+  std::vector<std::set<faststring> > required_groups;
+  std::vector<std::set<unsigned> >   required_groups_u;
+  CTaxonNamesDictionary &dictionary;
+  bool empty;
+
+  bool sets_intersect(const set<unsigned> &s1, const set<unsigned> &s2) const
+  {
+    //   cout << "Set1" << endl;
+    //   print_set(cout, s1);
+    //   cout << endl;
+    //   cout << "Set2" << endl;
+    //   print_set(cout, s2);
+    //   cout << endl;
+
+    unsigned size1 = s1.size();
+    unsigned size2 = s2.size();
+
+    unsigned size3 = macromin(size1, size2);
+
+    // We allocate memory for the result set that will be stored in a vector.
+    // Using allocated memory is more efficient than using an insert-iterator
+    // that has more overhead.
+    // Important: Later we have to shorten the vector to its actual size. 
+    vector<unsigned> res(size3);
+    vector<unsigned>::iterator it;
+    it=set_intersection (s1.begin(), s1.end(), s2.begin(), s2.end(), res.begin());
+
+/*     cout << "SET1: "; */
+/*     print_container(cout, s1, "(", ",", ")\n"); */
+/*     cout << "SET2: "; */
+/*     print_container(cout, s2, "(", ",", ")\n"); */
+/*     cout << "SET-RES1: "; */
+/*     print_container(cout, res, "(", ",", ")\n");     */
+/*     cout << "SIZE of intersection (A): " << res.size() << endl; */
+
+    // Shorten the vector to the actual size of the intersection.
+    // Otherwise we have trailing 0s from the constructor of the vector
+    // and the size of res would always be size3.
+    res.resize(it-res.begin());
+/*     cout << "SIZE of intersection (B): " << res.size() << endl; */
+    
+/*     cout << "SET-RES2: "; */
+/*     print_container(cout, res, "(", ",", ")\n");     */
+
+    return (res.size()>0);
+  }
+  
+  // Do not allow gaps:
+  void parse_required_groups(faststring line, int &error)
+  {
+    if (line.empty())
+    {
+      cout << "LOG: Required taxa string is empty. No required taxa specified." << endl;
+      empty = true;
+    }
+
+    //    dictionary.print(cout);
+
+    set<faststring> empty_set;
+    set<unsigned> empty_set_u;
+
+    unsigned i1, i2, N1, N2;
+
+    vector<faststring> splitter1;
+    vector<faststring> splitter2;
+  
+    split_respect(splitter1, line, ", ");
+
+    N1 = splitter1.size();
+
+    for (i1=0; i1<N1; ++i1)
+    {
+      required_groups.push_back(empty_set);
+      required_groups_u.push_back(empty_set_u);
+
+      //    cout << splitter1[i] << endl;
+      split(splitter2, splitter1[i1], "(, )");
+      N2 = splitter2.size();
+      for (i2=0; i2<N2; ++i2)
+      {
+	splitter2[i2].removeSpacesBack();
+	splitter2[i2].removeSpacesFront();
+	required_groups[i1].insert(splitter2[i2]);
+	unsigned index = dictionary.dictionary_get_index_of_taxonname(splitter2[i2]);
+	if (index == -1u)
+	{
+	  std::cerr << "ERROR: Could not find taxon name " << splitter2[i2]
+		    << " in the list of all taxon names found in all given sequence files." << std::endl;
+	  std::cerr << "Please check that the taxon name is spelled properly or remove the taxon name from the list of required"
+		    << " taxa to proceed. Exiting." << std::endl;
+	  error = 3;
+	}
+	required_groups_u[i1].insert(index);
+      }
+    }
+  }
+
+
+ public:
+  // Error codes:
+  // 0: No error,
+  // 1: File does not contain a single line as required. We might have more or less than one line in the file.
+  // 3: Sequence names not found in dictionary 
+
+  // The dummy parameter is only used to distinguish this and the following constructor, since both have the same parameter list
+  // except of this dummy parameter.
+  /* Depricates. Required taxa have to be specified in the parameter file.
+ CRequiredTaxa(faststring infilename, CTaxonNamesDictionary &dict, int &error, int dummy):dictionary(dict),empty(false)
+  {
+    std::ifstream is(infilename.c_str());
+
+    error = 0;
+    std::vector<faststring> file_as_vec;
+
+    appendFileToVector(is, file_as_vec);
+
+    unsigned i;
+    i=0;
+    while (i< file_as_vec.size() )
+    {
+      file_as_vec[i].removeSpacesFront();
+      file_as_vec[i].removeSpacesBack();
+      if (file_as_vec[i].empty() )
+      {
+	file_as_vec.erase(file_as_vec.begin()+i);
+      }
+      else
+      {
+	++i;
+      }
+    }
+    if (file_as_vec.size() != 1)
+    {
+      error = 1;
+      return;
+    }
+    parse_required_groups(file_as_vec[0], error);
+  }
+  */
+
+   // Error codes:
+  // 0: No error,
+  // 1: -,  unused
+  // 3: Sequence names not found in dictionary 
+ CRequiredTaxa(faststring required_string, CTaxonNamesDictionary &dict, int &error):dictionary(dict),empty(false)
+  {
+    error = 0;
+    parse_required_groups(required_string, error);
+  }
+ 
+  bool is_empty() const
+  {
+    return empty;
+  }
+
+  bool check_precense_of_all_groups_of_taxa(std::vector<faststring> taxon_vec) const
+  {
+    if (empty)
+      return true;
+
+    std::set<unsigned> taxon_set;
+
+    unsigned i, N, index;
+    for (i=0, N=taxon_vec.size(); i < N; ++i)
+    {
+      index = dictionary.dictionary_get_index_of_taxonname(taxon_vec[i]);
+      taxon_set.insert(index);
+    }
+
+    // v_set must have a non vanishing intersection with all groups of taxa that are required.
+    
+    unsigned iset, Nset;
+    bool all_taxa_present = true;
+
+    for (iset=0, Nset=required_groups_u.size();iset < Nset; ++iset)
+    {
+      if ( !sets_intersect(taxon_set, required_groups_u[iset] ) )
+      {
+	//		cout << " Sets do not intersect: " << endl;
+	//		print_set(cout, taxon_set);                cout << endl;
+	//		print_set(cout, required_groups_u[iset]);  cout << endl;
+	all_taxa_present = false;
+	break;
+      }
+      
+    }
+    return all_taxa_present;
+  }
+
+  bool check_precense_of_all_groups_of_taxa(std::set<unsigned> taxon_ids) const
+  {
+    if (empty)
+      return true;
+
+    // taxon_ids must have a non vanishing intersection with all groups of taxa that are required.
+    
+    unsigned iset, Nset;
+    bool all_taxa_present = true;
+
+    for (iset=0, Nset=required_groups_u.size();iset < Nset; ++iset)
+    {
+      if ( !sets_intersect(taxon_ids, required_groups_u[iset] ) )
+      {
+	//		cout << " Sets do not intersect: " << endl;
+	//		print_set(cout, taxon_set);                cout << endl;
+	//		print_set(cout, required_groups_u[iset]);  cout << endl;
+	all_taxa_present = false;
+	break;
+      }
+    }
+    return all_taxa_present;
+  }
+
+  
+
+
+  void print(std::ostream &os, int mode = 0)
+  {
+    std::vector<std::set<faststring> >::iterator it_vec_faststrings;
+    std::vector<std::set<unsigned> >::iterator   it_vec_unsigned;
+
+    std::set<faststring>::iterator it_set_faststrings;
+    std::set<unsigned>::iterator   it_set_unsigned;
+
+    it_vec_faststrings = required_groups.begin();
+
+    if (empty)
+    {
+      os << "CRequiredTaxa: empty" << endl;
+      return;
+    }
+
+    while (it_vec_faststrings != required_groups.end())
+    {
+      os << "(";
+      it_set_faststrings = it_vec_faststrings->begin();
+      while (it_set_faststrings != it_vec_faststrings->end() )
+      {
+	os << *it_set_faststrings;
+	++it_set_faststrings;
+	if (it_set_faststrings != it_vec_faststrings->end())
+	  os << ",";
+      }
+      ++it_vec_faststrings;
+      os << "),";
+      if (mode == 1)
+	os << endl;
+    }
+
+    it_vec_unsigned  = required_groups_u.begin();
+
+    os << "*********" << endl;
+
+    while (it_vec_unsigned != required_groups_u.end())
+    {
+      os << "(";
+      it_set_unsigned = it_vec_unsigned->begin();
+      while (it_set_unsigned != it_vec_unsigned->end() )
+      {
+	os << *it_set_unsigned;
+	++it_set_unsigned;
+	if (it_set_unsigned != it_vec_unsigned->end())
+	  os << ",";
+      }
+      ++it_vec_unsigned;
+      os << "),";
+      if (mode == 1)
+	os << endl;
+    }
+
+  }
+  
+
+};
+
+#endif
diff --git a/CSeqNameList.h b/CSeqNameList.h
new file mode 100644
index 0000000..78962a2
--- /dev/null
+++ b/CSeqNameList.h
@@ -0,0 +1,1083 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CSEQNAMELIST_H
+#define CSEQNAMELIST_H
+
+
+#include <iostream>
+#include <fstream>
+#include "faststring2.h"
+#include <map>
+#include <set>
+#include "CFile/CFile2_1.h"
+#include "CSequence_Mol2_1.h"
+#include <iterator>
+#include <algorithm>
+
+
+inline void set_to_short_name(faststring &str)
+{
+  faststring::size_t  pos = str.find(' ');
+  if (pos != faststring::npos) 
+    str.shorten(pos);
+}
+
+
+class CSeqNameList
+{
+  // A note on memory management.
+  // This class collects names and information about sequences.
+  // Sequence names are stored in faststrings. The class keeps pointers to these faststrings.
+  // The class keeps a copy of the original string it obtained. Therefore, it allocates memory
+  // for the strings and it has to release the memory when they are not used any more.
+
+  // When removing entries there vector position is set to "empty" values.
+  // They are not removed entirely, since this would be too inefficient.
+  // Removed entries are removed from the map.
+  // In particular: m.size() provides the number of valid entries.
+  // For every change in this file: Check that this is handled consistent.
+
+ public:
+  typedef std::map<faststring*, unsigned, less_than_pointer_to_faststring_struct> myMap;
+  typedef std::set<faststring>            mySet;
+  typedef myMap::iterator CSeqNameListIterator;
+  typedef mySet::iterator mySetIterator;
+
+ private:
+  faststring infile_name;
+  bool       only_names;  // Formerly, all vectors had been initialized to ensure that all fields are accessible.
+                          // This is not the case any more. If only_names is true, the vectors defined below can be empty.
+                          // TODO: Check that this is handled consistently.
+
+  myMap                            m;  // maps sequence names to id's. id's are indices used to refer to the other sequence data.
+  std::vector<faststring*>         full_names;
+  std::vector<unsigned>            seq_len_vec;
+  std::vector<double>              CG_content;
+  std::vector<unsigned>            corrected_len_vec;
+  std::vector<unsigned>            repeat_density_bp_mbp;
+
+ public:
+  void add(const faststring &full_name, unsigned sl, double CG_c, unsigned cl, unsigned rdens)
+  {
+    // The basic add routine creates a copy of the sequence name that shall be added.
+    faststring *tmp = new faststring(full_name);
+
+    full_names.push_back(tmp);
+    seq_len_vec.push_back(sl);
+    CG_content.push_back(CG_c);
+    corrected_len_vec.push_back(cl);
+    repeat_density_bp_mbp.push_back(rdens);
+
+    //    std::cerr << "Adding new seq: Name " << *tmp << " len " << sl << " CG " << CG_c << " cl " << cl<< std::endl; 
+
+    faststring::size_t pos = full_names.size()-1;
+
+    m[tmp] = pos;
+  }
+
+  void add_only_name(const char *full_name)
+  {
+    faststring *tmp = new faststring(full_name);
+    full_names.push_back(tmp);
+
+    faststring::size_t pos = full_names.size()-1; 
+    m[tmp] = pos;
+  }
+
+  void add(const CSeqNameList &snl, unsigned id)
+  {
+    if (snl.only_names)
+      add_only_name( snl.full_names[id]->c_str() );
+    else
+      add(*(snl.full_names[id]), snl.seq_len_vec[id], snl.CG_content[id], snl.corrected_len_vec[id], snl.repeat_density_bp_mbp[id]);
+  }
+
+  bool add_non_redundant(const CSeqNameList &snl, unsigned id)
+  {
+    if (!snl.only_names)
+    {
+      if (get_id_short_name(*(snl.full_names[id])) == -1u)
+      {
+	add(*(snl.full_names[id]), snl.seq_len_vec[id], snl.CG_content[id], snl.corrected_len_vec[id], snl.repeat_density_bp_mbp[id]);
+	return true;
+      }
+      else
+      {
+	std::cerr << "Detected previous entry of " << *snl.full_names[id] << std::endl;
+	return false;
+      }
+    }
+    else // only_names
+    {
+      if (get_id_short_name(*(snl.full_names[id])) == -1u)
+      {
+	add_only_name( snl.full_names[id]->c_str() );
+	return true;
+      }
+      else
+      {
+	std::cerr << "Detected previous entry of " << *snl.full_names[id] << std::endl;
+	return false;
+      }
+    }
+    
+  }
+
+
+  void reset()
+  {
+    // Release memory. Otherwise we have a memory leak;
+    unsigned i=0, n=full_names.size();
+    while (i<n)
+    {
+      delete full_names[i];
+      ++i;
+    }
+
+    infile_name.clear();
+    only_names = false;
+    m.clear();
+    full_names.clear();
+    seq_len_vec.clear();
+    CG_content.clear();
+    repeat_density_bp_mbp.clear();
+    corrected_len_vec.clear();
+  }
+
+  // This version is the most efficient and should be used if alternative versions can be used.
+  // User has to check that it is an iterator into the map m.
+  void remove(CSeqNameListIterator it)
+  {
+    unsigned index = it->second;
+    // We do not entirely remove these entries, since
+    // this is too inefficient.
+    // The vectors still contain the element, but it is empty.
+    // The element is removed from the map.
+    if (!only_names)
+    {
+      seq_len_vec[index]           = 0;
+      CG_content[index]            = 0;
+      corrected_len_vec[index]     = 0;
+      repeat_density_bp_mbp[index] = 0;
+    }
+
+    *(full_names[index]) = "";
+    m.erase(it);  // Erase this element out of the map.
+  }
+  
+
+  // remove entry from the "list".
+  void remove(unsigned index)
+  {
+    CSeqNameListIterator it;
+    
+    if (index >= full_names.size())
+    {
+      std::cerr << "Internal error: Call to CSeqNameList::remove(unsigned index) but the index is out-of range." << std::endl;
+      exit(-33);
+    }
+
+    it = m.find(full_names[index]);    // We pass a pointer here. Remember that we use less_than_pointer_to_faststring_struct to compare the elements, so in the end we search for the string and not for the pointer.
+
+    if (it == m.end())
+    {
+      std::cerr << "Internal error: Call to CSeqNameList::remove(unsigned index) but the index the iterator found with m.find does not exist." << std::endl;
+      exit(-33);
+    }
+    else
+    {
+      remove(it);
+    }
+  }
+
+
+  void remove(faststring &full_name)
+  {
+    CSeqNameListIterator it;
+    it = m.find(&full_name);    // We have to take the address operator here. Remember that we use less_than_pointer_to_faststring_struct to compare the elements, so in the end we search for the string and not for the pointer.
+
+    if (it == m.end())
+    {
+      std::cerr << "Internal error: Call to CSeqNameList::remove(faststring &full_name) but full_name does not exist in map m." << std::endl;
+      exit(-33);
+    }
+
+    remove(it);
+  }
+
+
+  // Import sequence names from a fasta file
+ CSeqNameList(const char *fasta_file_name, bool read_only_names=false):infile_name(fasta_file_name), only_names(read_only_names)
+  {
+    CFile infile;
+
+    infile.ffopen(fasta_file_name);
+
+    if ( !infile.exists() )
+    {
+      std::cerr << "Sorry! The input file \n   \"";
+      std::cerr << fasta_file_name;
+      std::cerr << "\"\ncould not be opened. I guess it does not exist.\n";
+      exit (-101);
+    }
+    
+    CSequence_Mol seq(CSequence_Mol::unknown);
+
+    if (!only_names)
+    {
+      while (!infile.eof())
+      {
+	seq.readRawFastaSequence(infile);
+	if ( infile.fail() && !infile.eof() )
+	{
+	  std::cerr << "\n\n";
+	  std::cerr << "Warning: A problem was detected while reading the input file \""<< fasta_file_name << "\". The file might be empty or it might not be a valid fasta file.\n";
+	  std::cerr << "File position: line ";
+	  std::cerr << faststring(infile.line()) << std::endl;
+	  std::cerr << std::flush;
+	}
+	else
+	{
+	  faststring name_to_add = seq.getFullName();
+	  
+	  //	 std::cerr << "Procesing sequence: " << name_to_add << std::endl;
+	  
+	  seq.compute_numbers_of_residues();
+	  
+	  //	  unsigned Ambigs      = seq.get_number_of_DNARNA_ambigs();
+	  unsigned bases       = seq.get_number_of_DNARNA_bases();
+	  double   CGc         = seq.get_CG_content();
+	  unsigned rdens       = 0;
+	 
+	  //	 std::cerr << "Adding 2: " << name_to_add << " slen: " << seq.length() << " CG: " << CGc << " bases: " << bases <<  std::endl;
+	  
+	  add(name_to_add, seq.length(), CGc, bases, rdens);
+	}
+      } // End while
+    }
+    else // Read only names:
+    {
+      while (!infile.eof())
+      {
+	seq.readSeqName_ignore_Sequence_data(infile);
+	if ( infile.fail() && !infile.eof() )
+	{
+	  std::cerr << "\n\n";
+	  std::cerr << "Warning: A problem was detected while reading the input file \""<< fasta_file_name << "\". The file might be empty or it might not be a valid fasta file.\n";
+	  std::cerr << "File position: line ";
+	  std::cerr << faststring(infile.line()) << std::endl;
+	  std::cerr << std::flush;
+	  break; // Stop reading this file. 
+	}
+	else
+	{
+	  const char * name_to_add = seq.getFullName();
+	  //	 std::cerr << "Procesing sequence: " << name_to_add << std::endl;
+	  add_only_name(name_to_add);
+        }
+      } // End while
+    } // End else only_names
+
+    infile.ffclose();
+  } // END constructor
+
+
+
+  // Import sequence names from a text file:
+ CSeqNameList(const char *text_file_name, int dummy):infile_name(text_file_name), only_names(true)
+  {
+    CFile infile;
+    faststring name_to_add;
+    (void) dummy;
+
+    infile.ffopen(text_file_name);
+
+    if ( !infile.exists() )
+    {
+      std::cerr << "Sorry! The input file \n   \"";
+      std::cerr << text_file_name;
+      std::cerr << "\"\ncould not be opened. I guess it does not exist.\n";
+      exit (-101);
+    }
+
+    infile.getline(name_to_add);
+    while (!infile.eof())
+    {
+      //	 std::cerr << "Procesing sequence: " << name_to_add << std::endl;
+      add_only_name(name_to_add.c_str());
+      infile.getline(name_to_add);
+    } // End while
+
+    infile.ffclose();
+  } // END constructor
+
+
+  // Default constructor
+ CSeqNameList(bool read_only_names=false):infile_name(""), only_names(read_only_names)
+  {}
+
+
+  
+
+  // File must be of the form:
+  // sequence name\tdenstiy in bp/Mbp
+  void add_repeat_densities(const char * filename)
+  {
+    std::ifstream is(filename);
+    faststring line;
+    std::vector<faststring> vf;
+    faststring sn;
+    unsigned rdens;
+    unsigned id;
+
+    if (only_names)
+    {
+      std::cerr << "Internal error: Reading repeat denstities for names only sequence list.\n";
+      exit(-22);
+    }
+
+
+    getline(is, line);
+    while (is)
+    {
+      split(vf, line, "\t");
+      if (vf.size()!=2)
+      {
+	std::cerr << "Critical error when addind repeat densities. Line " << line << " not a valid input.\n";
+	exit(-21);
+      }
+      sn    = vf[0];
+      rdens = vf[1].ToUnsigned();
+
+      id = get_id_short_name(sn);
+
+      repeat_density_bp_mbp[id] = rdens;
+
+      getline(is, line);
+    }
+    is.close();
+  }
+
+  ~CSeqNameList()
+  {
+/*     unsigned i=0, n=full_names.size(); */
+
+/*     while (i<n) */
+/*     { */
+/*       delete full_names[i]; */
+/*       ++i; */
+/*     } */
+    reset();
+  } // END destructor
+
+
+
+
+
+  void use_list_as_filter(const char *fasta_file_name,
+			  const char *out_in_list,
+			  const char *out_not_in_list,
+			  unsigned char_per_line=50)
+  {
+    CFile infile;
+
+    infile.ffopen(fasta_file_name);
+
+    if ( !infile.exists() )
+    {
+      std::cerr << "Sorry! The input file \n   \"";
+      std::cerr << fasta_file_name;
+      std::cerr << "\"\ncould not be opened. I guess it does not exist.\n";
+      exit (-101);
+    }
+    
+    FILE *os_in_list; // (out_in_list);
+    FILE *os_not_in_list; // (out_not_in_list);
+
+    os_in_list     = fopen(out_in_list, "w");
+    os_not_in_list = fopen(out_not_in_list, "w");
+
+    CSequence_Mol seq(CSequence_Mol::unknown);
+     while (!infile.eof())
+     {
+       seq.readRawFastaSequence(infile);
+       if ( infile.fail() && !infile.eof() )
+       {
+	 std::cerr << "\n\n";
+	 std::cerr << "An error occurred while reading the input file. It might not be a valid fasta file.\n";
+	 std::cerr << "File position: line ";
+	 std::cerr << faststring(infile.line()) << std::endl;
+	 std::cerr << std::flush;
+       }
+
+       faststring fname = seq.getFullName();
+
+       CSeqNameListIterator it;
+       it = m.find(&fname);    // We have to take the address operator here. Remember that we use less_than_pointer_to_faststring_struct to compare the elements, so we do no search for the pointer but for the string indeed. 
+
+       if (it != m.end() )
+       {
+	 seq.writeSequence_fasta(os_in_list, char_per_line);
+       }
+       else
+       {
+	 seq.writeSequence_fasta(os_not_in_list, char_per_line);
+       }
+       
+     } // END while
+
+     infile.ffclose();
+     fclose(os_in_list);
+     fclose(os_not_in_list);
+
+  } // END use_list_as_filter
+
+
+  // Reads the specified fasta file.
+  // If the sequence name is found in this name list write it to output file.
+  // XXXXXXXXXXXX TODO: return value: number of sequences with not only sequence name but also sequence info.
+  void write_sequences_in_list(const char *fasta_file_name,
+			       const char *out_in_list,
+			       const char *write_mode)
+  {
+    CFile infile;
+
+    infile.ffopen(fasta_file_name);
+
+    if ( !infile.exists() )
+    {
+      std::cerr << "Sorry! The input file \n   \"";
+      std::cerr << fasta_file_name;
+      std::cerr << "\"\ncould not be opened. I guess it does not exist.\n";
+      exit (-101);
+    }
+    
+    FILE *os_in_list; // (out_in_list);
+    unsigned line_length;
+
+    os_in_list     = fopen(out_in_list, write_mode);
+
+    CSequence_Mol seq(CSequence_Mol::unknown);
+    while (!infile.eof())
+    {
+      seq.readRawFastaSequence(infile, line_length);
+      if ( infile.fail() && !infile.eof() )
+      {
+	std::cerr << "\n\n";
+	std::cerr << "An error occurred while reading the input file. It might not be a valid fasta file.\n";
+	std::cerr << "File position: line ";
+	std::cerr << faststring(infile.line()) << std::endl;
+	std::cerr << std::flush;
+      }
+
+      // Is the sequence we just read in the list of sequence names??
+      // This uses the full name
+
+      faststring fname = seq.getFullName();
+
+      CSeqNameListIterator it;
+      it = m.find(&fname);    // We have to take the address operator here. Remember that we use less_than_pointer_to_faststring_struct to compare the elements, so we do no search for the pointer but for the string indeed. 
+
+      if (it != m.end() )
+      {
+	seq.writeSequence_fasta(os_in_list, line_length);
+      }
+    } // END while
+    
+    infile.ffclose();
+    fclose(os_in_list);
+    
+  } // END use_list_as_filter
+
+
+  void print(std::ostream &os, short flag=0)
+  {
+    // With flag == 0 we only print the size of the list.
+
+    os << "This CSeqNameList has " << full_names.size() << " entries.\n";
+
+    if (flag > 0)
+      os << "flag: " << flag << std::endl;
+
+    if (flag == 1)
+    {
+      unsigned i=0, n=full_names.size();
+      
+      os << "n: " << n << std::endl;
+      os << "only_names: " << only_names << std::endl;
+
+      if (only_names)
+      {
+	while (i<n)
+	{
+	  os << "Name: " << *(full_names[i]) 
+	     << std::endl;
+	  ++i;
+	}
+      }
+      else  // !only_names
+      {
+	while (i<n)
+	{
+	  os << "Name: " << *(full_names[i]) 
+	     << " " 
+	     << seq_len_vec[i] 
+	     << "  " 
+	     << CG_content[i]
+	     << "  "
+	     << corrected_len_vec[i]
+	     << "  "
+	     << repeat_density_bp_mbp[i]
+	     << std::endl;
+	  ++i;
+	}
+      }
+    }
+    else if (flag ==2) // fasta format:
+    {
+      unsigned i=0, n=full_names.size();
+
+      while (i<n)
+      {
+	os << ">" << *(full_names[i]) 
+	   << std::endl;
+	++i;
+      }
+    }
+
+
+  }
+
+  unsigned size()
+  {
+    return m.size();
+  }
+
+
+  double get_CG_content(unsigned id)
+  {
+    if (only_names)
+      return 0;
+    else
+      return CG_content[id];
+  }
+
+  const char *get_name(unsigned id)
+  {
+      return full_names[id]->c_str();
+  }
+
+  unsigned get_seq_length(unsigned id)
+  {
+    if (only_names)
+      return 0;
+    else
+      return seq_len_vec[id];
+  }
+
+  unsigned get_corrected_len(unsigned id)
+  {
+    if (only_names)
+      return 0;
+    else
+      return corrected_len_vec[id];
+  }
+
+  unsigned get_repeat_content(unsigned id)
+  {
+    if (only_names)
+      return 0;
+    else
+      return repeat_density_bp_mbp[id];
+
+  }
+
+  //XXXXXXXXXXXXXXXXXXXX
+  unsigned get_id(faststring str)
+  {
+    CSeqNameListIterator  it_find;
+    it_find = m.find(&str);   // We have to take the address operator here. Remember that we use less_than_pointer_to_faststring_struct to compare the elements, so we do no search for the pointer but for the string indeed. 
+    if (it_find != m.end())
+      return it_find->second;
+    else
+      return -1u;
+  }
+
+
+  // Search for str_in in the list of sequences. str_in can be the full name or the short name.
+  // The target list can contain full or short names.
+  unsigned get_id_short_name(faststring str) // No refernce since we change the string
+  {
+    // We shorten str to the short name.
+    // If it is the full name and the target only contains
+    // the short name this is important.
+    set_to_short_name(str);
+
+    CSeqNameListIterator  it_find;
+    it_find = m.lower_bound(&str);  // it_find points to an element that is either equal to str or the first element
+                                    // in the map that is greater than str. In case, str contains the short name of the
+                                    // target, we are looking for this element.
+                                    // The question whether the short name is unique is not adressed here. The id of the 
+                                    // first suitable short name is returned.
+    if (it_find == m.end())
+      return -1u;
+
+    //    if (*(it_find->first) == str)      // str is equal to the string that has been found. 
+	    //     return it_find->second;
+
+    // str is not equal to the string that has been found, but it might be equal to its short name.
+    faststring::size_t pos1 = it_find->first->find(' ');
+
+    if (pos1 == faststring::npos)
+      pos1 = it_find->first->size();
+    faststring::size_t pos2 = str.size();
+
+    // The short names differ or the complete string is the short name. Since the short name should have been found above,
+    // we have not found the string.
+    if (pos1 != pos2) 
+      return -1u;                
+    
+    // If str is longer than the target, it cannot be the short name.
+    // If the space is found at a position with index larger thant the size of str, it cannot be the short name of str.
+    // It could be that this case is not possible.
+    //     if (str.size() > it_find->first->size() || pos > str.size() )
+    //        return -1u;
+
+    if (strncmp(str.c_str(), it_find->first->c_str(), pos1) != 0)
+      return -1u;
+    
+    return  it_find->second;
+  }
+
+  // Note: removed names have an empty string as its name.
+  std::vector<faststring*>& get_vec_of_seq_names()
+  {
+    return full_names;
+  }
+
+  void copy_to_this_if_Full_name_has_a_match(CSeqNameList &a, faststring str)
+  {
+    CSeqNameListIterator it_beg, it_end;
+    it_beg = a.m.begin();
+    it_end = a.m.end();
+
+    faststring::size_t find_pos;
+    unsigned id;
+
+    // Copy a to this:
+    while (it_beg != it_end)
+    {
+      find_pos = it_beg->first->find(str);
+
+      if (find_pos != faststring::npos) // we have a match
+      {
+	id = it_beg->second;
+	add(a, id);
+      }
+      ++it_beg;
+    }
+  }
+
+  bool remove_if_Full_name_has_a_match(faststring str, bool report_failure_to_find_match = false)
+  {
+    CSeqNameListIterator it_beg, it_end, it_next;
+    it_beg = m.begin();
+    it_end = m.end();
+   
+    faststring::size_t find_pos;
+    bool one_removed = false;
+
+    while (it_beg != it_end)
+    {
+      // The sequence name is: it_beg->first. In this we search for str:
+      find_pos = it_beg->first->find(str);
+
+      it_next = it_beg;
+      ++it_next;
+
+      if (find_pos != faststring::npos) // we have a match
+      {
+	remove(it_beg);
+	one_removed = true;
+      }
+      it_beg = it_next;
+    }
+    if (!one_removed && report_failure_to_find_match)
+    {
+      std::cout << "NOTE: From CSeqNameList::remove_if_Full_name_has_a_matchNote: No match found for " << str << std::endl;
+    }
+    return one_removed;
+  }
+
+  int remove_if_Full_name_has_a_match(std::vector<faststring> v, bool report_failure_to_find_match = false)
+  {
+    unsigned i,N=v.size();
+    unsigned count=0;
+
+    for (i=0; i<N; ++i)
+    {
+      if (remove_if_Full_name_has_a_match(v[i]), report_failure_to_find_match)
+	++count;
+    }
+    return count;
+  }
+
+
+  void set_to_union_of(CSeqNameList &a, CSeqNameList &b)
+  {
+    // The use of set_union does not seem to be better than this solution:
+
+    set_to(a, "set union");
+
+/*     CSeqNameListIterator it_beg, it_end; */
+/*     unsigned id; */
+
+/*     infile_name = "set union"; */
+
+/*     it_beg = a.m.begin(); */
+/*     it_end = a.m.end(); */
+
+/*     // Copy a to this: */
+/*     while (it_beg != it_end) */
+/*     { */
+/*       id = it_beg->second; */
+/*       add(a, id); */
+/*       ++it_beg; */
+/*     } */
+
+    // Copy b to this, for all elements that have not been added yet:
+
+    add_List_non_redundant(b);
+  }
+
+  void set_to(CSeqNameList &a, faststring name)
+  {
+    reset();
+    infile_name = name;
+    only_names = a.only_names;
+    
+    CSeqNameListIterator it_beg, it_end;
+    unsigned id;
+
+    it_beg = a.m.begin();
+    it_end = a.m.end();
+
+    // Copy a to this:
+    while (it_beg != it_end)
+    {
+      id = it_beg->second;
+      add(a, id);
+      ++it_beg;
+    }
+   
+  }
+
+  void add_List_non_redundant(CSeqNameList &b)
+  {
+    CSeqNameListIterator it_beg, it_end;
+    unsigned id;
+
+    if (only_names != b.only_names)
+    {
+      std::cerr << "CSeqNameList objects can only be added to another list of the only_names field match." << std::endl;
+    }
+
+    it_beg = b.m.begin();
+    it_end = b.m.end();
+
+    while (it_beg != it_end)
+    {
+      id = get_id_short_name(*(it_beg->first));    // Search for sequence in this.
+      if (id == -1u)                               // Sequence is unknown in this, so we add it
+      {
+	add(b, it_beg->second);
+      }
+      ++it_beg;
+    }  
+  }
+
+  bool is_only_names()
+  {
+    return only_names;
+  }
+
+
+  void set_to_intersection_of(CSeqNameList &a, CSeqNameList &b)
+  {
+    infile_name = "set intersection";
+
+    // use set_intersection
+    //    typedef std::set<faststring> faststringSet;
+
+    //   faststringSet            out_fs;
+
+    mySet   out_fs;
+
+    mySetIterator  out_itr( out_fs.begin() );
+
+    mySet a_short;
+    mySet b_short;
+
+    CSeqNameListIterator it1, it2;
+
+    faststring tmp;
+
+    it1 = a.m.begin();
+    it2 = a.m.end();
+    while (it1 != it2)
+    {
+      tmp = *(it1->first);
+      set_to_short_name(tmp);
+      a_short.insert(tmp);
+      ++it1;
+    }
+
+    it1 = b.m.begin();
+    it2 = b.m.end();
+    while (it1 != it2)
+    {
+      tmp = *(it1->first);
+      set_to_short_name(tmp);
+      b_short.insert(tmp);
+      ++it1;
+    }
+
+    set_intersection(a_short.begin(), a_short.end(),
+		     b_short.begin(), b_short.end(),
+		     std::inserter( out_fs, out_itr ) );
+
+    mySetIterator   it_beg, it_end;
+    unsigned        id;
+
+    it_beg = out_fs.begin();
+    it_end = out_fs.end();
+
+    while (it_beg != it_end)
+    {
+      id = a.get_id_short_name(*it_beg);
+      add(a, id);
+
+      ++it_beg;
+    }
+  }
+
+  void set_to_diff_of(CSeqNameList &a,CSeqNameList &b)
+  {
+    infile_name = "set diff";
+
+    //    typedef std::map<faststring*, unsigned> myMap;
+    //    typedef std::set<faststring>            mySet;
+    mySet    out_fs;
+
+    mySetIterator  out_itr( out_fs.begin() );
+
+    mySet a_short;
+    mySet b_short;
+
+    CSeqNameListIterator it1, it2;
+
+    faststring tmp;
+
+    it1 = a.m.begin();
+    it2 = a.m.end();
+    while (it1 != it2)
+    {
+      tmp = *(it1->first);
+      set_to_short_name(tmp);
+      a_short.insert(tmp);
+      ++it1;
+    }
+
+    it1 = b.m.begin();
+    it2 = b.m.end();
+    while (it1 != it2)
+    {
+      tmp = *(it1->first);
+      set_to_short_name(tmp);
+      b_short.insert(tmp);
+      ++it1;
+    }
+
+    set_difference(a_short.begin(), a_short.end(),
+		   b_short.begin(), b_short.end(),
+		   std::inserter( out_fs, out_itr ) );
+
+    mySetIterator it_beg, it_end;
+    unsigned                id;
+
+    it_beg = out_fs.begin();
+    it_end = out_fs.end();
+
+    //    std::cerr << "out_fs" << out_fs.size() << std::endl;
+
+    while (it_beg != it_end)
+    {
+      id = a.get_id_short_name(*it_beg);
+      add(a, id);
+
+      ++it_beg;
+    }
+  }
+
+  void set_to_sym_diff_of(CSeqNameList &a,CSeqNameList &b)
+  {
+   infile_name = "set sym diff";
+
+   //    typedef std::map<faststring*, unsigned> myMap;
+   //    typedef std::set<faststring>            mySet;
+    mySet                                   out_fs;
+
+    mySetIterator  out_itr( out_fs.begin() );
+
+    mySet a_short;
+    mySet b_short;
+
+    CSeqNameListIterator it1, it2;
+
+    faststring tmp;
+
+    it1 = a.m.begin();
+    it2 = a.m.end();
+    while (it1 != it2)
+    {
+      tmp = *(it1->first);
+      set_to_short_name(tmp);
+      a_short.insert(tmp);
+      ++it1;
+    }
+
+    it1 = b.m.begin();
+    it2 = b.m.end();
+    while (it1 != it2)
+    {
+      tmp = *(it1->first);
+      set_to_short_name(tmp);
+      b_short.insert(tmp);
+      ++it1;
+    }
+
+    set_symmetric_difference(a_short.begin(), a_short.end(),
+			     b_short.begin(), b_short.end(),
+			     std::inserter( out_fs, out_itr ) );
+
+    mySetIterator it_beg, it_end;
+    unsigned        id;
+
+    it_beg = out_fs.begin();
+    it_end = out_fs.end(); 
+
+    while (it_beg != it_end)
+    {
+      // The seq can be found either in a or in b.
+      id = a.get_id_short_name(*it_beg);
+      if (id != -1u)
+	add(a, id);
+      else
+      {
+	id = b.get_id_short_name(*it_beg);
+	add(b, id);
+      }
+
+      ++it_beg;
+    }
+
+  }
+
+
+  // Searches for sequence names found in this in list a. If present in list a add it to list c.
+  // If not, search for it in list b. If found add it to d. Oherwise produce error.
+  void divide_this_uppon_existence_in_first_two_sets(CSeqNameList &a, CSeqNameList &b,
+						     CSeqNameList &c, CSeqNameList &d)
+  {
+    c.reset();
+    d.reset();
+
+    CSeqNameListIterator it_beg, it_end;
+
+    it_beg = m.begin();
+    it_end = m.end();
+
+    unsigned id;
+
+    while (it_beg != it_end)
+    {
+      id = a.get_id_short_name(*(it_beg->first));
+      
+      if (id != -1u)
+      {
+	c.add(a, id);
+      }
+      else
+      {
+	id = b.get_id_short_name(*(it_beg->first));
+	if (id != -1u)
+	{
+	  d.add(b, id);
+	}
+	else
+	{
+	  std::cerr << "Internal problem: Sequence found in neither file, even though I think it should be in one of the files: " << it_beg->first << std::endl;
+	}
+      }
+      ++it_beg;
+    }
+  }
+
+  // All sequence names are split according to delim. The field with 1-based number field is actracted and stored in the field_set.
+  bool get_set_of_name_field(unsigned field, char delim, std::set<faststring> &field_set)
+  {
+    unsigned i, n=full_names.size();
+    std::vector<faststring> splitter;
+    bool error=false;
+
+    for (i=0; i<n; ++i) // foreach full name
+    {
+      // Skip removed sequence names:
+      if ( !full_names[i]->empty() )
+      {
+	split(splitter, *full_names[i], "|");
+	if (splitter.size() < field )
+	{
+	  std::cerr << "Warning: In get_set_of_name_field you tried to extract field # "
+		    << field << " after splitting " << full_names[i] << " with deliminator " << delim
+		    << " but this field does not exist." << std::endl;
+	  error = true;
+	}
+	else
+	{
+	  field_set.insert(splitter[field-1]);  // Convert 1-based field number to 0-based index.
+	}
+      }
+    }
+    return error;
+  }
+
+
+};  // END CSeqNameList
+
+
+#endif
diff --git a/CSequence_Mol2_1.h b/CSequence_Mol2_1.h
new file mode 100644
index 0000000..acf225e
--- /dev/null
+++ b/CSequence_Mol2_1.h
@@ -0,0 +1,2837 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CSEQUENCE_MOL_H
+#define CSEQUENCE_MOL_H
+
+// Changes:
+// 22.08.2009: According to the fasta format specifications, the sequence name is only the string between the ">" and
+//             the first space. The rest of the line contains a sequence description or annotation information.
+//             This is now reflected in the CSequence_Mol class. The variables full_name, name, and description
+//             contain this information.
+//             The sequence name variables are now of type faststring (not string as before).
+// 07.01.2011: Migrated to fastring2.h and CFile2_1.h
+// 30.04.2011: Sliding window CG-AT analysis
+
+// TODO: Data type handling is/was not optimal.
+//       In function set_taxon_and_sequence the auto_detect_type always superset the
+//       value the user specified when creating the CSequence_Mol object.
+//       This caused unwanted changes of the data type.
+
+
+#include <vector>
+#include <iostream>
+#include "faststring2.h"
+//#include "CFile/CFile3b.h"
+#include "CFile/CFile2_1.h"
+#include <cstdio>
+#include "basic-DNA-RNA-AA-routines.h"
+#include "fast-realloc-vector.h"
+#include <cstring>
+#include <cstdio>
+
+class CSequence_Mol
+{
+  public:
+  enum DataTypesEnum {
+    standard = 1,	// characters with arbitrarily-assigned,
+			// discrete states, such as discrete
+			// morphological data
+
+    dna,		/* DNA sequences (states A, C, G, T) */
+    rna,		/* RNA sequences (states A, C, G, U) */
+    //    nucleotide,		/* nucleotide sequences */
+    protein,		/* amino acid sequences         */
+    molecular,          /* AA, dna, or rna              */
+    unknown,
+    auto_detect_type,
+    mixed
+  };
+
+  enum processing_flag {
+    convert_toupper                  = 1,
+    convert_ambig2N                  = 2,
+    autodetecttype                   = 4,
+    removegaps                       = 8,
+    removestars                      = 16,
+    compute_numbers_of_residues_flag = 32,
+    gaps_to_ambig                    = 64
+  };
+
+  private:
+  faststring      full_name;   // with description after first space
+  faststring      short_name;  // without desciption after first space
+  faststring      description; // description only
+
+  faststring      data;
+  DataTypesEnum   type;
+  char            general_ambig;
+
+  bool            numbers_of_residues_computed;
+
+  // General rule: If we convert symbols, we count the new symbols we have in memory,
+  // not the symbols in the file. This is more consitent.
+  //
+  unsigned        number_of_AAs;           // Does not include Xs and ?
+  unsigned        number_of_DNARNA_bases;  // Includes Us but not ambigs
+  unsigned        number_of_DNARNA_amgibs; // Includes Ns and '?'
+  unsigned        number_of_Us;
+  unsigned        number_of_gaps;
+  unsigned        number_of_stars;
+  unsigned        number_of_questionmarks;
+
+  unsigned        number_of_Xs;
+  unsigned        number_of_Ns;
+  unsigned        number_raw_original_length; //no spaces, but gaps and stars 
+  unsigned        number_CG;                   // CG content in case of DNA/RNA
+
+
+  fastvector<unsigned> gap_and_star_koords;
+  fastvector<unsigned> gap_koords;
+  fastvector<unsigned> star_koords;
+
+  bool bitcode_recoded;
+
+ private:
+  void find_shortname_and_description()
+  {
+    full_name.removeSpacesBack();
+    full_name.removeSpacesFront();
+
+    unsigned pos_description = full_name.find(' ');
+    unsigned full_name_len   = full_name.size();
+
+    if (pos_description == -1u) // no space -> no sequence description
+    {
+      pos_description = full_name.size();
+      short_name.assign(full_name.begin(), full_name.begin() + pos_description);
+    }
+    else
+    {
+      short_name.assign(full_name.begin(), full_name.begin() + pos_description);
+      // Skip all spaces
+      while (pos_description < full_name_len && full_name.get_unckecked(pos_description) == ' ')
+      {
+	//	std::cerr << "-------------DEBUG: ++pos_description" << std::endl;	
+	++pos_description;
+      }
+
+      //      std::cerr << "-------------DEBUG: " << full_name.end() - (full_name.begin() + pos_description) << std::endl;
+      //      if (full_name.end() - (full_name.begin() + pos_description) > 0) // Should not occur any more!!!!
+      //      {
+      description.assign(full_name.begin() + pos_description, full_name.end() );
+      //      }
+    }
+  }
+
+  void toupper_this_sequence()
+  {
+    data.toupper();
+  }
+
+  
+
+  // TODO: Keep case of ambig.
+  void change_ambigs()
+  {
+    if (type == dna || type == rna)
+    {
+      char * it     = data.begin();
+      char * it_end = data.end();
+
+      number_of_questionmarks  = 0;
+      number_of_Ns             = 0;
+
+      while (it != it_end)
+      {
+	char c       = *it;
+
+	if ( c == 'N' || c == 'n' || c == '?' )
+	{
+	  // Convert all ambiguity codes to N's
+	  *it = general_ambig;
+	  if (general_ambig == '?')
+	    ++number_of_questionmarks;
+	  else
+	    ++number_of_Ns;
+	  //	  ++number_of_DNARNA_amgibs;
+	}
+	++it;
+      }
+    }
+    else if (type == protein)
+    {
+      char * it     = data.begin();
+      char * it_end = data.end();
+      
+      number_of_questionmarks  = 0;
+      number_of_Xs             = 0;
+
+      while (it != it_end)
+      {
+	char c       = *it;
+
+	if ( c == 'X' || c == 'x' || c == '?' )
+	{
+	  // Convert all ambiguity codes to N's
+	  ++number_of_DNARNA_amgibs;
+	  *it = general_ambig;
+	  if (general_ambig == '?' )
+	    ++number_of_questionmarks;
+	  else
+	    ++number_of_Xs;
+	}
+	++it;
+      }
+    }
+
+    // TODO: Adjust the numbers
+  }
+
+
+  void remove_gaps_stars_this_sequence(bool rg, bool rs)
+  {
+    //    char     *it     = data.begin();
+    //    char     *it_end = data.end();
+    
+    
+    // TODO
+
+    if (rg)
+    {}
+
+    if (rs)
+    {}
+      
+
+  }
+
+  void gaps_to_ambig_this_sequence()
+  {
+    char     *it     = data.begin();
+    char     *it_end = data.end();
+    unsigned count=0;
+
+    while (it != it_end)
+    {
+      if (*it =='-')
+      {
+	*it = general_ambig;
+	++count;
+      }
+      ++it;
+    }
+
+    // If residues are computed, we have to change the numbers counts for gaps and ambigs:
+    if (numbers_of_residues_computed)
+    {
+      number_of_gaps -= count; // Should indeed be 0 now.
+
+      if (general_ambig == 'N' || general_ambig == 'n')
+      {
+	number_of_Ns += count;
+      }
+      else if (general_ambig == 'X' || general_ambig == 'x')
+      {
+	number_of_Xs += count;
+      }
+      else if (general_ambig == '?')
+      {
+	number_of_questionmarks += count;
+      }
+      if (type == dna || type == rna)
+      {
+	++number_of_DNARNA_amgibs += count;
+      }
+    }
+  }
+
+
+  void addCharToData(char c)
+  {
+    data.push_back(c);
+  }
+
+
+  // Reads line of data and removes only white spaces
+  void getRawLine(CFile& infile)
+  {
+    register char            c;
+
+    c = infile.getchar();
+    while (!infile.fail() && c != '\n')
+    {
+      if ( isspace(c) )   // We remove white spaces.
+      {
+	c = infile.getchar();
+	continue;
+      }
+      addCharToData(c);
+      c = infile.getchar();
+    }
+  }
+
+  void getRawLine(CFile& infile, unsigned &num)
+  {
+    register char            c;
+    unsigned local_num = 0;
+
+    c = infile.getchar();
+    while (!infile.fail() && c != '\n')
+    {
+      if ( isspace(c) )   // We remove white spaces.
+      {
+	c = infile.getchar();
+	continue;
+      }
+      addCharToData(c);
+      c = infile.getchar();
+      ++local_num;
+    }
+    num = local_num;
+  }
+
+  // Reads line of data and removes only white spaces
+  void getRawLine_toupper(CFile& infile)
+  {
+    register char            c;
+
+    c = infile.getchar();
+    while (!infile.fail() && c != '\n')
+    {
+      if ( isspace(c) )   // We remove white spaces.
+      {
+	c = infile.getchar();
+	continue;
+      }
+      addCharToData(toupper(c));
+      c = infile.getchar();
+    }
+  }
+
+
+  // Called e.g. from Phobos
+  void getLineOfDNA_toupper_ambig2N_removegaps (CFile& infile, unsigned &pos_in_seq)
+  {
+    register char       c;
+    unsigned            pos = pos_in_seq;
+    register char       local_general_ambig = toupper(general_ambig);
+
+    //     ++pos;
+    c = infile.getchar();
+    while (!infile.fail() && c != '\n')
+    {
+      // if the char is a space or something we do not count, we subtract this further below
+      ++number_raw_original_length;
+
+      c = toupper(c);
+
+      if ( c == 'A' || c == 'T' || c == 'G' || c == 'C')
+      {
+	addCharToData(c);
+	++number_of_DNARNA_bases;
+      }
+      else if ( c == 'U')
+      {
+	addCharToData('U');
+	++number_of_DNARNA_bases;
+	++number_of_Us;
+      }
+      else if ( c == 'R' || c == 'Y' || c == 'K' || c == 'M' ||
+		c == 'S' || c == 'W' || c == 'B' || c == 'D' ||
+		c == 'H' || c == 'V' )
+      {
+	// Convert all ambiguity codes to N's
+	addCharToData(local_general_ambig);
+	++number_of_DNARNA_amgibs; // includes N and '?'
+	if (local_general_ambig == 'N')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+      }
+      else if (c == '?' || c == 'N')
+      {
+	addCharToData(local_general_ambig);
+	if (local_general_ambig == 'N')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+	++number_of_DNARNA_amgibs;
+      }
+      else if ( isspace(c) )
+      {
+	--number_raw_original_length; // we do not count spaces
+      }                              // Spaces are removed
+      else if ( c=='-' || c=='*')     // What do we do with gaps and *s - Here they are removed,
+	                              // but their positions are stored in order to able to reconstuct the origianl coordinates.
+      {                               // I don't really know why we tolerate '*' ? They occur in protein sequences as stop codons.
+	gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence,
+	                              // we need to keep track of the positions we cut out.
+	if (c=='-')
+	{
+	  gap_koords.push_back(pos);
+	  ++number_of_gaps;
+	}
+	else
+	{
+	  star_koords.push_back(pos);
+	  ++number_of_stars;
+	}
+	//	c = infile.getchar();
+	//	++pos;
+      }
+      else
+      {
+	// we do not count this -just to be consistent before we bail out 
+	--number_raw_original_length;
+	infile.clear(CFile::__fail_flag);
+	break;
+      }
+      c = infile.getchar();
+      ++pos;
+    }
+    pos_in_seq = pos;
+  }
+
+
+  void getLineOfDNA_generic (CFile& infile, unsigned &pos_in_seq,
+			     processing_flag pflag)
+  {
+    register char            c;
+    register char            c_upper;
+    register char local_general_ambig = general_ambig;
+    unsigned        pos = pos_in_seq;
+    //    register signed char     delta;                  
+    register bool            convert_toupper_bool  = (pflag & convert_toupper);   // handled
+    register bool            convert_ambig2N_bool  = (pflag & convert_ambig2N);   // handled
+    register bool            removegaps_bool       = (pflag & removegaps);        // handled
+    register bool            removestars_bool      = (pflag & removestars);       // handled
+    register bool            gaps_to_ambig_bool    = (pflag & gaps_to_ambig);     // handled
+
+    // In the routine calling this function it should be checked, that the general_ambig
+    // character is upper or lower case, as specified.
+
+
+    if (convert_toupper_bool)
+      local_general_ambig = toupper(general_ambig);
+
+    //     ++pos;
+    c = infile.getchar();
+    c_upper = toupper(c);
+    while (!infile.fail() && c != '\n')
+    {
+      // if the char is a space or something we do not count, we subtract this further below
+      ++number_raw_original_length;
+
+      if (c >= 'a' && c <= 'z' && convert_toupper_bool)
+	c = c_upper;
+
+      if ( c_upper == 'A' || c_upper == 'T' || c_upper == 'G' || c_upper == 'C')
+      {
+	addCharToData(c);
+	++number_of_DNARNA_bases;
+      }
+      else if ( c_upper == 'U')
+      {
+	addCharToData(c);
+	++number_of_DNARNA_bases;
+	++number_of_Us;
+      }
+      else if (c_upper == 'R' || c_upper == 'Y' || c_upper == 'K' || c_upper == 'M' ||
+	       c_upper == 'S' || c_upper == 'W' || c_upper == 'B' || c_upper == 'D' ||
+	       c_upper == 'H' || c_upper == 'V' )
+      {
+	if (convert_ambig2N_bool)
+	{
+	  // Convert all ambiguity codes to N's, but we preserve the case. 'w' -> 'n' and 'W' -> 'N' etc.
+	  if (c <='Z') // i.e. lower case.
+	    addCharToData(  tolower(local_general_ambig)  );
+	  else
+	    addCharToData(  toupper(local_general_ambig)  );
+
+	  ++number_of_DNARNA_amgibs; // includes N and '?'
+	  if (local_general_ambig == '?' )
+	    ++number_of_questionmarks;
+	  else
+	    ++number_of_Ns;
+	}
+	else
+	{
+	  addCharToData(c);
+	}
+      }
+      else if (c == '?' || c_upper == 'N') // c is either: 'N', 'n', '?'
+      {
+	++number_of_DNARNA_amgibs;
+	if (local_general_ambig == '?')
+	{
+	  addCharToData(local_general_ambig);
+	  ++number_of_questionmarks;
+	}
+	else //	c is '?' or 'N' or 'n' and general_ambig is 'N' or 'n' --- add 'N' or 'n'
+	{
+	  ++number_of_Ns;
+ 	  if (c == '?')  // convert to general ambig with proper case:
+	  {
+	    addCharToData(local_general_ambig); // Append general_ambig with appropriate case.
+	  }
+	  else // c is 'N' or 'n', general_ambig is 'N' or 'n'
+	  {
+	    addCharToData(c); // Append N or n and preserve case !!! to be consistent with the flags.
+	  }
+	  // Note: In case of: convert to upper, we have already converted c to upper.
+	}
+      }
+      else if ( isspace(c) )
+      {
+	--number_raw_original_length; // we do not count spaces
+      }                              // Spaces are removed
+      else if ( c=='-' || c=='*')     // What do we do with gaps and *s - Here they are removed,
+	                              // but their positions are stored in order to able to reconstuct the origianl coordinates.
+      {                               // I don't really know why we tolerate '*' ? They occur in protein sequences as stop codons.
+
+	if (c=='-')
+	{
+	  if ( gaps_to_ambig_bool)
+	  {
+	    //	    std::cerr << "Gaps to ambig " << std::endl;
+	    addCharToData(local_general_ambig);
+	    if (general_ambig == '?' )
+	      ++number_of_questionmarks;
+	    else
+	      ++number_of_Ns;
+	    ++number_of_DNARNA_amgibs;
+	  }
+	  else if ( removegaps_bool )
+	  {
+	    //	    std::cerr << "Remove gaps " << std::endl;
+	    gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence,
+	                                         // we need to keep track of the positions we cut out.
+	    gap_koords.push_back(pos);
+	    ++number_of_gaps;
+	  }
+	  else
+	  {
+	    addCharToData('-');
+	    ++number_of_gaps;
+	  }
+	}
+	else if (removestars_bool)
+	{
+	  gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence,
+	                                         // we need to keep track of the positions we cut out.
+	  star_koords.push_back(pos);
+	  ++number_of_stars;
+	}
+	//	c = infile.getchar();
+	//	++pos;
+      }
+      else
+      {
+	// we do not count this -just to be consistent before we bail out 
+	--number_raw_original_length;
+	infile.clear(CFile::__fail_flag);
+	break;
+      }
+      c = infile.getchar();
+      c_upper = toupper(c);
+      ++pos;
+    }
+    pos_in_seq = pos;
+  }
+
+
+  void getLineOfProtein_generic (CFile& infile, unsigned &pos_in_seq,
+				 processing_flag pflag)
+  {
+    register char            c;
+    register char            c_upper;
+    register char            local_general_ambig = general_ambig;
+
+
+    unsigned        pos = pos_in_seq;
+    //    register signed char     delta;                  
+    register bool            convert_toupper_bool  = (pflag & convert_toupper);   // handled
+    //    register bool            convert_ambig2N_bool  = (pflag & convert_ambig2N);   // handled
+    register bool            removegaps_bool       = (pflag & removegaps);        // handled
+    //    register bool            removestars_bool      = (pflag & removestars);       // handled
+    register bool            gaps_to_ambig_bool    = (pflag & gaps_to_ambig);// handled
+
+    // In the routine calling this function it should be checked, that the general_ambig
+    // character is upper or lower case, as specified.
+
+    if (convert_toupper_bool)
+      local_general_ambig = toupper(general_ambig);
+
+    //     ++pos;
+    c = infile.getchar();
+    c_upper = toupper(c);
+    while (!infile.fail() && c != '\n')
+    {
+      // if the char is a space or something we do not count, we subtract this further below
+      ++number_raw_original_length;
+
+      if (c >= 'a' && c <= 'z' && convert_toupper_bool)
+	c = c_upper;
+
+      if (c == '?' || c_upper == 'X' )
+      {
+	if (local_general_ambig == '?')
+	{
+	  addCharToData(local_general_ambig);
+	  ++number_of_questionmarks;
+	}
+	else // c is '?' or 'X' or 'x' and general_ambig is 'X' or 'x'
+	{
+	  ++number_of_Xs;
+	  if (c == '?')
+	  {
+	    addCharToData(local_general_ambig);
+	  }
+	  else // c is 'X' 'x', general_ambig is 'X' 'x'
+	    addCharToData(c); // Append X or x and preserve case !!! to be consistent with the flags.
+	  // Note: In case of convert to upper, we have already converted c to upper.
+	}
+      }
+      else // The following code assumes we do not have X or ?. Otherwise Xs are duplicated in the data.
+	if ( is_aa_or_aa_ambig_extended(c) ) // includes other ambigs (!'X', !'x' ,!'?')
+      {
+	addCharToData(c);
+	++number_of_AAs; // Counts ambigs but not X or ?
+      }
+      else if ( isspace(c) )
+      {
+	--number_raw_original_length; // we do not count spaces
+      }                              // Spaces are removed
+      else if ( c=='-' || c=='*')     // What do we do with gaps and *s - Here they are removed,
+	                              // but their positions are stored in order to able to reconstuct the origianl coordinates.
+      {                               // I don't really know why we tolerate '*' ? They occur in protein sequences as stop codons.
+
+	if (c=='-')
+	{
+	  if ( gaps_to_ambig_bool)
+	  {
+	    addCharToData(local_general_ambig);
+	    if (local_general_ambig == '?' )
+	      ++number_of_questionmarks;
+	    else
+	      ++number_of_Xs;
+	  }
+	  else if ( removegaps_bool )
+	  {
+	    gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence,
+	                                         // we need to keep track of the positions we cut out.
+	    gap_koords.push_back(pos);
+	    ++number_of_gaps;
+	  }
+	  else
+	  {
+	    addCharToData('-');
+	    ++number_of_gaps;
+	  }
+	}
+
+/* 	else if (removestars_bool) */
+/* 	{ */
+/* 	  gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence, */
+/* 	                                         // we need to keep track of the positions we cut out. */
+/* 	  star_koords.push_back(pos); */
+/* 	  ++number_of_stars; */
+/* 	} */
+	//	c = infile.getchar();
+	//	++pos;
+      }
+      else // Unknown symbol
+      {
+	// we do not count this -just to be consistent before we bail out 
+	--number_raw_original_length;
+	infile.clear(CFile::__fail_flag);
+	break;
+      }
+      c = infile.getchar();
+      c_upper = toupper(c);
+      ++pos;
+    }
+    pos_in_seq = pos;
+  }
+
+
+  void getLineOfDNA_toupper_removegaps (CFile& infile, unsigned &pos_in_seq)
+  {
+    register char       c;
+    unsigned            pos = pos_in_seq;
+    register char       local_general_ambig = toupper(general_ambig);
+
+    //     ++pos;
+    c = infile.getchar();
+    while (!infile.fail() && c != '\n')
+    {
+      // if the char is a space or something we do not count, we subtract this further below
+      ++number_raw_original_length; 
+      c = toupper(c);
+
+      if ( c == 'A' || c == 'T' || c == 'G' || c == 'C')
+      {
+	addCharToData(c);
+	++number_of_DNARNA_bases;
+      }
+      else if ( c == 'N' || c == '?')
+      {
+	addCharToData(local_general_ambig);
+	if (general_ambig == 'N')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+	++number_of_DNARNA_amgibs; // includes N and '?'
+      }
+      else if ( c == 'U')
+      {
+	addCharToData('U');
+	++number_of_DNARNA_bases;
+	++number_of_Us;
+      }
+      else if ( c == 'R' || c == 'Y' || c == 'K' || c == 'M' ||
+		c == 'S' || c == 'W' || c == 'B' || c == 'D' ||
+		c == 'H' || c == 'V' )
+      {
+	addCharToData(c);
+	++number_of_DNARNA_amgibs;
+      }
+      else if ( isspace(c) )          // Spaces are removed
+      {
+	--number_raw_original_length; // we do not count spaces
+      }                              
+      else if ( c=='-' || c=='*')     // What do we do with gaps and *s - Here they are removed, but their positions are stored in order to reconstuct the origianl coordinates.
+      {                               // I don't really know why we tolerate '*' ?
+	gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence,
+	                              // we need to keep track of the positions we cut out.
+	if (c=='-')
+	{
+	  gap_koords.push_back(pos);
+	  ++number_of_gaps;
+	}
+	else
+	{
+	  star_koords.push_back(pos);
+	  ++number_of_stars;
+	}
+	//	c = infile.getchar();
+	//	++pos;
+      }
+      else
+      {
+	// Something went wrong -> the last reading event from the file failed
+	// -> we set the fail flag, this informs the user that something went wrong
+	// We do not count this - just to be consistent before we bail out 
+	--number_raw_original_length;
+	infile.clear(CFile::__fail_flag);
+	break;
+      }
+      c = infile.getchar();
+      ++pos;
+    }
+    pos_in_seq = pos;
+  }
+
+
+
+  void getLineOfProtein_toupper_removegaps (CFile& infile, unsigned &pos_in_seq)
+  {
+    register char            c;
+    unsigned        pos = pos_in_seq;
+
+    //     ++pos;
+    c = infile.getchar();
+    char local_general_ambig = toupper(general_ambig);
+
+    while (!infile.fail() && c != '\n')
+    {
+      // if the char is a space or something we do not count, we subtract this further below
+      ++number_raw_original_length;
+      c = toupper(c);
+
+      if (c == 'X' || c=='?')
+      {
+	addCharToData(local_general_ambig);
+	if (local_general_ambig == 'X' )
+	  ++number_of_Xs;
+	else
+	  ++number_of_questionmarks;
+      }
+      else if (is_aa_or_aa_ambig_extended(c) )
+      {
+	addCharToData(c);
+	++number_of_AAs;
+      }
+      else if ( isspace(c) )// Spaces are removed
+      {
+	--number_raw_original_length; // we do not count spaces
+      }
+      else if ( c=='-' || c=='*')     // What do we do with gaps and *s - Here they are removed, but their positions are stored in order to reconstuct the origianl coordinates.
+      {                                        // I don't really know why we tolerate '*' ?
+	gap_and_star_koords.push_back(pos);    // If we want to reconstruct the true position in the sequence,
+	                                       // we need to keep track of the positions we cut out.
+	if (c=='-')
+	{
+	  gap_koords.push_back(pos);
+	  ++number_of_gaps;
+	}
+	else
+	{
+	  star_koords.push_back(pos);
+	  ++number_of_stars;
+	}
+      }
+      else
+      {
+	// we do not count this -just to be consistent before we bail out 
+	--number_raw_original_length;
+
+	infile.clear(CFile::__fail_flag);
+	break;
+      }
+      c = infile.getchar();
+      ++pos;
+    }
+    pos_in_seq = pos;
+  }
+
+  void getLineOfDNA_toupper_ambig2N_gaps2ambig (CFile& infile)
+  {
+    register char            c;
+
+    c = infile.getchar();
+    while (!infile.fail() && c != '\n')
+    {
+      // if the char is a space or something we do not count, we subtract this further below
+      ++number_raw_original_length;
+
+      c = toupper(c);
+
+      if ( c == 'A' || c == 'T' || c == 'G' || c == 'C')
+      {
+	addCharToData(c);
+	++number_of_DNARNA_bases;
+      }
+      else if ( c == 'N' || c == '?')
+      {
+	addCharToData(general_ambig);
+	if (general_ambig == 'N')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+	++number_of_DNARNA_amgibs;
+      }
+      else if ( c == 'U')
+      {
+	addCharToData('U');
+	++number_of_DNARNA_bases;
+	++number_of_Us;
+      }
+      else if ( c == 'R' || c == 'Y' || c == 'K' || c == 'M' ||
+		c == 'S' || c == 'W' || c == 'B' || c == 'D' ||
+		c == 'H' || c == 'V' )
+      {
+	// Convert all ambiguity codes to N's
+	addCharToData(general_ambig);
+	if (general_ambig == 'N')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+	++number_of_DNARNA_amgibs;
+      }
+      else if (c=='-')
+      {
+	addCharToData(general_ambig);
+	if (general_ambig == 'N')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+	++number_of_DNARNA_amgibs;
+      }
+      else if ( isspace(c) )   // We remove white spaces.
+      {                        // I don't really know why we tolerate '*' ?
+	--number_raw_original_length; // we do not count spaces
+      }
+      else
+      {
+	// we do not count this -just to be consistent before we bail out 
+	--number_raw_original_length;
+
+	infile.clear(CFile::__fail_flag);
+	return;
+      }
+      c = infile.getchar();
+    }
+  }
+
+
+
+
+
+ public:
+ CSequence_Mol(DataTypesEnum dt, char p_general_ambig = '\0'):
+  type(dt), general_ambig(p_general_ambig),
+    numbers_of_residues_computed(false), bitcode_recoded(false)
+  {
+    data.reserve(10000);
+    if (p_general_ambig == '\0') // Use the typical ambig character
+    {
+      if      (dt == dna)     general_ambig = 'N';
+      else if (dt == protein) general_ambig = 'X';
+      else                    general_ambig = '?';
+    }
+    reset_numbers_of_residues();
+  }
+
+
+ CSequence_Mol(DataTypesEnum dt, faststring name, unsigned len, char p_general_ambig = '\0'):
+  full_name(name),type(dt), general_ambig(p_general_ambig),
+    numbers_of_residues_computed(false), bitcode_recoded(false)
+  {
+    if (len < -1u)
+      ++len;
+    data.reserve(len);
+
+    find_shortname_and_description();
+
+    if (p_general_ambig == '\0') // Use the typical ambig character
+    {
+      if      (dt == dna)     general_ambig = 'N';
+      else if (dt == protein) general_ambig = 'X';
+      else                    general_ambig = '?';
+    }
+    reset_numbers_of_residues();
+  }
+
+
+  //**************************************************************************
+  // pos1 must be the first column starting with 0.
+  // pos2 must be the index after the last column.
+  // pos2-pos1 must be the number of bases that are copied to this sequence.
+  //**************************************************************************
+ CSequence_Mol(const CSequence_Mol& s, unsigned pos1=0, unsigned pos2 = -1u):
+  full_name(s.full_name),
+    short_name(s.short_name),
+    description(s.description),
+    type(s.type),
+    general_ambig(s.general_ambig),
+    numbers_of_residues_computed(false),
+    bitcode_recoded(s.bitcode_recoded)
+  {
+    if (pos1 == 0 && pos2 >= s.length() )
+      data = s.data;
+    else
+    {
+      if (pos2 > s.length() )
+	pos2 = s.length();
+      if (pos1 >= pos2)
+      {
+	return;
+      }
+      data.assign(s.data, pos1, pos2-pos1);
+    }
+  }
+  
+
+
+  // Should only be applied to dna sequences
+  void convert_ambig2N_this_sequence()
+  {
+    if ( !(type == dna || type == rna) )
+      return;
+
+    // This is a DNA sequence:
+
+    char * it     = data.begin();
+    char * it_end = data.end();
+
+    while (it != it_end)
+    {
+      char c       = *it;
+      char c_upper = toupper(c);
+
+      if ( c_upper == 'R' || c_upper == 'Y' || c_upper == 'K' || c_upper == 'M' ||
+	   c_upper == 'S' || c_upper == 'W' || c_upper == 'B' || c_upper == 'D' ||
+	   c_upper == 'H' || c_upper == 'V' )
+      {
+	// Convert all ambiguity codes to N's
+	*it = general_ambig;
+	if (general_ambig == 'N' || general_ambig == 'n')
+	  ++number_of_Ns;
+	else
+	  ++number_of_questionmarks;
+	++number_of_DNARNA_amgibs;
+      }
+      ++it;
+    }
+  }
+
+  bool has_only_gaps()
+  {
+    char * it     = data.begin();
+    char * it_end = data.end();
+
+    while (it != it_end)
+    {
+      if (*it != '-')
+	return false;
+      ++it;
+    }
+    return true;
+  }
+
+  bool has_only_ambigs()
+  {
+    char * it     = data.begin();
+    char * it_end = data.end();
+
+    if (type == dna || type == rna)
+    {
+      while (it != it_end)
+      {
+	if (!is_DNA_iupac_ambig(*it))
+	  return false;
+	++it;
+      }
+      return true;
+    }
+    else if (type == protein)
+    {
+      while (it != it_end)
+      {
+	if (!is_aa_ambig(*it))
+	  return false;
+	++it;
+      }
+      return true;      
+    }
+    else // This result is undefined, since the data type is not specified.
+    {
+      return false;
+    }
+  }
+
+  bool has_only_ambigs_or_gap()
+  {
+    //    std::cout << "Call to: has_only_ambigs_or_gap" << std::endl; 
+
+    char * it     = data.begin();
+    char * it_end = data.end();
+
+    if (type == dna || type == rna)
+    {
+      //      std::cout << "Datatype is dna or rna" << std::endl; 
+
+      while (it != it_end)
+      {
+	//		std::cout << "Checking " << *it << std::endl;
+	if ( !(is_DNA_iupac_ambig(*it) || *it == '-') )
+	{
+	  //	  	  std::cout << "Returning false." << std::endl;
+	  return false;
+	}
+	++it;
+      }
+      //            std::cout << "Returning true." << std::endl;
+      return true;
+    }
+    else if (type == protein)
+    {
+      while (it != it_end)
+      {
+	if ( !(is_aa_ambig(*it) || *it == '-') )
+	  return false;
+	++it;
+      }
+      return true;
+    }
+    else // This result is undefined, since the data type is not specified.
+    {
+      //      std::cout << "Returning default false for unspecified type." << std::endl;
+      return false;
+    }
+  }
+
+
+  unsigned length() const
+  {
+    return data.size();
+  }
+
+  DataTypesEnum get_datatype()
+  {
+    return type;
+  }
+
+  faststring type_as_string()
+  {
+    if (type == dna)
+      return faststring("DNA");
+    else if (type == rna)
+      return faststring("RNA");
+    else if (type == protein)
+      return faststring("Protein");
+    return "Unknown";
+  }
+  
+
+  void set_taxon_and_sequence(const faststring& taxonName,
+                              const faststring& seqData, DataTypesEnum datatype=auto_detect_type)
+  {
+/*     unsigned pos; */
+
+    if (numbers_of_residues_computed)
+    {
+      reset_numbers_of_residues();
+    }
+
+    full_name = taxonName;
+
+    find_shortname_and_description();
+/*     if ( (pos = taxonName.find(' '))!=faststring::npos) */
+/*     { */
+/*       short_name  = taxonName.substr(0,pos+1); */
+/*       description = taxonName.substr(pos+1); */
+/*     } */
+/*     else */
+/*     { */
+/*       short_name  = taxonName; */
+/*       description.clear(); */
+/*     } */
+    data = seqData;
+
+    //
+    //    toupper_this_sequence();
+
+    // Should not be necessary:
+    //    compute_numbers_of_residues();
+    if (datatype == auto_detect_type || datatype == unknown)
+    {
+      auto_detect_datatype();
+      //    std::cerr << "Data type: " << type_as_string()  << std::endl;
+      //    std::cerr << "General ambig: " << general_ambig  << std::endl;
+      if (auto_detect_ambig_detect_conflict() )
+      {
+	std::cerr << "Conflict in amgiguity code used in imported sequence." << std::endl;
+      }
+    }
+    //    std::cerr << "General ambig: " << general_ambig  << std::endl;
+
+    change_ambigs();
+    //    remove_gaps_stars_this_sequence(true, true);
+
+    //    general_ambig = ambig;
+    //    type = t;
+  }
+
+
+  void set_taxon_and_random_DNA_sequence(const faststring& taxonName,
+					 unsigned len,
+					 double piA, double piC, double piG)
+  {
+    size_t pos;
+
+    type = dna;
+    general_ambig = '?';
+
+    data.clear();
+    data.reserve(len+1);
+
+    reset_numbers_of_residues();
+
+    full_name = taxonName;
+    if ( (pos = taxonName.find(' '))!=faststring::npos)
+    {
+      short_name  = taxonName.substr(0,pos+1);
+      description = taxonName.substr(pos+1);
+    }
+    else
+    {
+      short_name  = taxonName;
+      description.clear();
+    }
+
+    // Compute random sequence:
+    unsigned i;
+    double   z;
+
+    double bA = piA;
+    double bC = bA+piC;
+    double bG = bC+piG;
+
+    for (i=0; i<len; ++i)
+    {
+      z = rand()/(RAND_MAX+1.0);
+      if ( z < bA )
+	data.push_back('A');
+      else if ( z < bC )
+	data.push_back('C');
+      else if ( z < bG )
+	data.push_back('G');
+      else
+	data.push_back('T');
+    }
+
+    compute_numbers_of_residues();
+
+    //    std::cerr << "Data type: " << type_as_string()  << std::endl;
+    //    std::cerr << "General ambig: " << general_ambig  << std::endl;
+    //    std::cerr << "General ambig: " << general_ambig  << std::endl;
+  }
+
+
+  char& operator[](unsigned pos)
+  {
+    return data[pos];
+  }
+
+  char get_pos(unsigned pos)
+  {
+    return data[pos];
+  }
+
+/*   void set_pos(unsigned pos, char c) */
+/*   { */
+/*     data[pos] = c; */
+/*   } */
+
+  bool is_bitcoderecoded()
+  {
+    return bitcode_recoded;
+  }
+
+  unsigned full_original_length() const
+  {
+    // Remember that some numbers include others:
+    // number_of_DNARNA_amgibs includes 'Ns' and '?', so they are not added again:
+    // number_of_DNARNA_bases  includes 'Us'
+    if (type == dna || type == rna )
+    {
+      return number_of_DNARNA_bases + number_of_DNARNA_amgibs + number_of_gaps + number_of_stars;
+    }
+    else if (type == protein)
+    {
+      return number_of_AAs + number_of_gaps + number_of_stars
+	                   + number_of_Xs + number_of_questionmarks;
+    }
+    else
+    {
+      return number_raw_original_length;
+    }
+  }
+
+  unsigned length_DNARNA_bases() const
+  {
+    return number_of_DNARNA_bases;
+  }
+
+  const char* getName() // const
+  {
+    return short_name.c_str();
+  }
+
+  const faststring& getName_faststring() const
+  {
+    return short_name;
+  }
+
+  const faststring& getSeq_faststring() const
+  {
+    return data;
+  }
+
+  faststring getPhylipName()
+  {
+    faststring str(short_name);
+
+    str.resize(10, ' ');
+    return str;
+  }
+
+  const char* getFullName() // const
+  {
+    return full_name.c_str();
+  }
+
+  const faststring getFullName_faststring() const
+  {
+    return full_name;
+  }
+
+  const char* getDescription() // const
+  {
+    return description.c_str();
+  }
+
+  const char* getSeqStr()
+  {
+    return data.c_str();
+  }
+
+  faststring getPartialSeq(size_t pos, size_t n)
+  {
+    return data.substr(pos, n);
+  }
+
+  const char* getSeqBegin()
+  {
+    return data.begin();
+  }
+
+  const char* getSeqEnd()
+  {
+    return data.end();
+  }
+
+  const char* getSeqRBegin()
+  {
+    return data.rbegin();
+  }
+
+  const char*getSeqREnd()
+  {
+    return data.rend();
+  }
+
+  void reset_numbers_of_residues()
+  {
+    numbers_of_residues_computed = false;
+
+    number_of_AAs = 0;
+    number_of_DNARNA_bases = 0;
+    number_of_DNARNA_amgibs = 0;
+    number_of_Us = 0;
+    number_of_gaps = 0;
+    number_of_stars = 0;
+    number_of_questionmarks = 0;
+    number_of_Xs = 0;
+    number_of_Ns = 0;
+
+    number_CG = 0;
+
+    number_of_questionmarks = 0;
+    number_raw_original_length = 0;
+  }
+
+  void compute_numbers_of_residues()
+  {
+    const char *it=data.begin(), *it_end=data.end();
+
+    if (numbers_of_residues_computed)
+    {
+      std::cerr << "Request for computing number of residues - even though they have already been determined" << std::endl; 
+      return;
+    }
+
+    reset_numbers_of_residues();
+
+    for (;it<it_end; ++it)
+    {
+      char c = *it;
+
+      if (is_DNA_or_RNA_base(c))
+      {
+	if (c == 'c' || c == 'C' || c == 'G' || c == 'g' )
+	  ++number_CG;
+	++number_of_DNARNA_bases;
+      }
+
+      if (is_DNA_iupac_ambig(c))
+	++number_of_DNARNA_amgibs;
+
+      if (is_aa_or_aa_ambig_extended(c) && c!= 'X' && c != '?')
+	++number_of_AAs;
+
+      if (c == 'N')
+      {
+	++number_of_Ns;
+      }
+
+      if (c == '-')
+      {
+	++number_of_gaps;
+      }
+
+      if (c == '*')
+      {
+	++number_of_stars;
+      }
+
+      if (c == 'X')
+      {
+	++number_of_Xs;
+      }
+
+      if (c == '?')
+      {
+	++number_of_questionmarks;
+      }
+
+      if (c == 'U' || c == 'u')
+      {
+	++number_of_Us;
+      }
+
+      numbers_of_residues_computed = true;
+    }
+  }
+
+  void auto_detect_datatype()
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+
+    unsigned aa_stuff     = number_of_AAs + number_of_Xs + number_of_stars;
+    unsigned DNARNA_stuff = number_of_DNARNA_bases + number_of_DNARNA_amgibs;
+
+    // reine DNA: 100 > 0.25 * 100 - false - DNA
+
+    if (aa_stuff < 0.1*data.length() && DNARNA_stuff < 0.1*data.length() )
+      type = unknown;
+    else if (aa_stuff > 0.25*DNARNA_stuff)
+    {
+      if (number_of_Us > 0)
+	type = rna;
+      else
+	type = dna;
+    }
+    else
+    {
+      type = protein;
+    }
+  }
+
+  bool auto_detect_ambig_detect_conflict()  // Return true in case of ambig conflict, else false
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+
+    if (type == protein)
+      general_ambig = 'X';
+    else general_ambig = 'N';
+
+    if (number_of_questionmarks > 0)
+      general_ambig = '?';
+
+    // Determine conlict:
+    return (   number_of_questionmarks > 0   && 
+	       (number_of_Xs > 0 || ((type==dna || type==rna) && number_of_Ns > 0))); 
+  }
+
+
+  void assignSeq(faststring &newseq, processing_flag flag=(processing_flag)0)
+  {
+    data.assign(newseq);
+    numbers_of_residues_computed = false;
+
+    if (flag & compute_numbers_of_residues_flag)
+      compute_numbers_of_residues();
+    else
+    {
+      reset_numbers_of_residues();
+    }
+  }
+
+  void maskSeq(const char *start, const char *end, char c)
+  {
+    char *pos = const_cast<char*>(start);
+    while (pos != end)
+    {
+      *pos = c;
+      ++pos;
+    }
+  }
+
+  void maskSeq_tolower(const char *start, const char *end)
+  {
+    char *pos = const_cast<char*>(start);
+    while (pos != end)
+    {
+      *pos = tolower(*pos);
+      ++pos;
+    }
+  }
+
+  unsigned find_pos_first_symbol_not_in_alphabet(const char * alphabet=NULL)
+  {
+    if (alphabet == NULL)
+    {
+      if (type == dna)
+      {
+	alphabet = DNARNA_symbols;
+      }
+      else if (type == protein)
+      {
+	alphabet = aa_symbols;
+      }
+      else
+      {
+	return -1u;
+      }
+    }
+
+    return data.find_first_not_of(alphabet);
+  }
+
+  // Fills str with the sequnce data, that contains gaps and stars, that had been removed
+  // temporarily.
+  void getSequence_fill_in_gaps_and_stars(faststring &str)
+  {
+    if (bitcode_recoded)
+      backrecode_bitcode_sequence();
+
+    unsigned upos = 0;
+    unsigned pos_in_gap_and_star_koords=0;
+    unsigned pos_in_gap_koords=0;
+    unsigned pos_in_star_koords=0;
+
+    const char *pos = data.begin();
+    //    const char *end = data.end();
+
+    unsigned N      = gap_and_star_koords.size();
+    unsigned Ngaps  = gap_koords.size();
+    unsigned Nstars = star_koords.size();
+
+    //    unsigned left_this_line = char_per_line;
+
+    str.clear();
+
+    if (N == 0 && Ngaps == 0 && Nstars == 0)
+    {
+      str = data;
+      return;
+    }
+
+
+    unsigned N_all_char = data.size()+N;
+    str.reserve(N_all_char);
+
+    while (upos < N_all_char)
+    {
+      if (pos_in_gap_and_star_koords == N)
+	break;
+
+      if ( gap_and_star_koords.get_unckecked(pos_in_gap_and_star_koords) == upos )
+      {
+	if ( pos_in_gap_koords < Ngaps && gap_koords.get_unckecked(pos_in_gap_koords) == upos ) // this is a gap
+	{
+	  str.push_back('-');
+	  ++pos_in_gap_koords;
+	  ++pos_in_gap_and_star_koords;
+	}
+	else
+	  if ( pos_in_star_koords < Nstars && star_koords.get_unckecked(pos_in_star_koords) == upos ) // this is a gap
+	  {
+	    str.push_back('*');
+	    ++pos_in_star_koords;
+	    ++pos_in_gap_and_star_koords;
+	  }
+      }
+      else
+      {
+	str.push_back(*pos);
+	++pos;
+      }
+      ++upos;
+      //      --left_this_line;
+
+/*       if (left_this_line == 0) */
+/*       { */
+/* 	str.push_back('\n'); */
+/* 	left_this_line = char_per_line; */
+/*       } */
+    }
+
+    // copy rest without gaps and stars
+    while (upos < N_all_char)
+    {
+      str.push_back(*pos);
+      ++pos;
+      ++upos;
+      //      --left_this_line;
+
+/*       if (left_this_line == 0) */
+/*       { */
+/* 	str.push_back('\n'); */
+
+/* 	left_this_line = char_per_line; */
+/*       } */
+    }
+/*     if (left_this_line != char_per_line)    // We have already written a partial line */
+/*       str.push_back('\n'); */
+  }
+
+  // Replace part of the sequence. pos1 and pos2 are in the destination sequence.
+  // - erases region from pos1 to pos2
+  //   pos1 is the first column pos2-pos1 is the number of bases that are removed,
+  //   i.e. pos2 is the column after the last column that is to be removed.
+  // - insert s with full length.
+  void replace_part_of_sequence(CSequence_Mol &s, unsigned pos1, unsigned pos2)
+  {
+    if (type != s.type)
+    {
+      std::cerr << "Critical warning: Replacing part of sequence with different data type." << std::endl;
+    }
+    data.replace(pos1, pos2-pos1, s.data);
+  }
+
+  void append_sequence(CSequence_Mol &s)
+  {
+    if (type != s.type)
+    {
+      std::cerr << "Critical warning: Appending sequence with different data type." << std::endl;
+    }
+    data.append(s.data);
+  }
+
+  void append_residue_unchecked(char c)
+  {
+    data.push_back(c);
+  }
+
+  void writeSequence_fill_in_gaps_and_stars(FILE *of, unsigned char_per_line=50)
+  {
+    if (bitcode_recoded)
+      backrecode_bitcode_sequence();
+
+    unsigned upos = 0;
+    unsigned pos_in_gap_and_star_koords=0;
+    unsigned pos_in_gap_koords=0;
+    unsigned pos_in_star_koords=0;
+
+    const char *pos = data.begin();
+    //    const char *end = data.end();
+
+    unsigned N      = gap_and_star_koords.size();
+    unsigned Ngaps  = gap_koords.size();
+    unsigned Nstars = star_koords.size();
+
+    unsigned left_this_line = char_per_line;
+
+    unsigned N_all_char = data.size()+N;
+
+    fprintf(of, ">%s\n", full_name.c_str());
+
+    while (upos < N_all_char)
+    {
+      if (pos_in_gap_and_star_koords == N)
+	break;
+
+      if ( gap_and_star_koords.get_unckecked(pos_in_gap_and_star_koords) == upos )
+      {
+	if ( pos_in_gap_koords < Ngaps && gap_koords.get_unckecked(pos_in_gap_koords) == upos ) // this is a gap
+	{
+	  putc('-', of);
+	  ++pos_in_gap_koords;
+	  ++pos_in_gap_and_star_koords;
+	}
+	else
+	  if ( pos_in_star_koords < Nstars && star_koords.get_unckecked(pos_in_star_koords) == upos ) // this is a gap
+	  {
+	    putc('*', of);
+	    ++pos_in_star_koords;
+	    ++pos_in_gap_and_star_koords;
+	  }
+      }
+      else
+      {
+	putc(*pos, of);
+	++pos;
+      }
+      ++upos;
+      --left_this_line;
+
+      if (left_this_line == 0)
+      {
+	putc('\n', of);
+
+	left_this_line = char_per_line;
+      }
+    }
+
+    while (upos < N_all_char)
+    {
+      putc(*pos, of);
+      ++pos;
+      ++upos;
+      --left_this_line;
+
+      if (left_this_line == 0)
+      {
+	putc('\n', of);
+
+	left_this_line = char_per_line;
+      }
+    }
+    if (left_this_line != char_per_line)    // We have already written a partial line
+ 	putc('\n', of);
+  }
+
+
+  void writeSequence(FILE *of, unsigned char_per_line=50) //const
+  {
+    writeSequence_fasta(of, 0, -1u, full_name.c_str(), char_per_line);
+  }
+
+  void writeSequence_fasta(FILE *of, unsigned char_per_line=50) //const
+  {
+    writeSequence_fasta(of, 0, -1u, full_name.c_str(), char_per_line);
+  }
+
+  void writeSequence(FILE *of,
+		     unsigned    pos_beg,
+		     unsigned    pos_end,
+		     const char  *s_name,
+		     unsigned    char_per_line=50) const
+  {
+    writeSequence_fasta(of, pos_beg, pos_end, s_name, char_per_line);
+  }
+
+
+  void writeSequence_fasta(FILE *of,
+			   unsigned    pos_beg, // 0 based
+			   unsigned    pos_end, // 0 based, stop index
+			   const char  *s_name,
+			   unsigned    char_per_line=50) const
+  {
+    const char *beg = data.begin() + pos_beg;
+    const char *end = data.begin() + pos_end;
+    const char *tmp_end;
+ 
+/*     if (bitcode_recoded) */
+/*       backrecode_bitcode_sequence(); */
+
+    if (pos_end == -1u || end > data.end() )
+      end = data.end();
+
+    if (char_per_line == -1u)
+      char_per_line = data.length();
+
+    fprintf(of, ">%s\n", s_name);
+    
+    tmp_end = beg + char_per_line;
+    if (tmp_end > end)
+      tmp_end = end;
+
+    while (beg < end)
+    {
+      fprintf(of, "%.*s\n", int(tmp_end - beg), beg);
+
+      beg = tmp_end;
+      tmp_end = beg + char_per_line;
+      if (tmp_end > end)
+	tmp_end = end;
+    }
+  }
+
+  // Some programs do not accept too many Ns in a row.
+  // This function export sequences so that Nregions are collapsed
+  // to a maximum number of successive Ns.
+  // USE WITH CAUTION: This function changes your sequence data!!!
+  // The output is not identical to your original sequnece data.
+
+
+  void writeSequence_fasta_collaps_NX_regions(FILE *of,
+			   unsigned    char_per_line=50,
+		           unsigned    maximum_number_of_successive_NXs=100)
+  {
+    writeSequence_fasta_collaps_NX_regions(of, 
+					   0,
+					   -1u,
+					   full_name.c_str(),
+					   char_per_line,
+					   maximum_number_of_successive_NXs);
+  }
+
+  void writeSequence_fasta_collaps_NX_regions(FILE *of,
+					      unsigned    pos_beg, // 0 based
+					      unsigned    pos_end, // 0 based , stop index
+					      const char  *s_name,
+					      unsigned    char_per_line=50,
+					      unsigned    maximum_number_of_successive_NXs=100) const
+  {
+    const char *beg = data.begin() + pos_beg;
+    const char *end = data.begin() + pos_end;
+    //    const char *tmp_end;
+ 
+/*     if (bitcode_recoded) */
+/*       backrecode_bitcode_sequence(); */
+
+    if (pos_end == -1u || end > data.end() )
+      end = data.end();
+
+    fprintf(of, ">%s\n", s_name);
+
+    unsigned chars_in_this_line=0;
+    unsigned tmp_succNs=0;
+
+    while (beg != end)
+    {
+      char c = *beg;
+      char c_toupper = toupper(c);
+
+      if (c_toupper == 'N' || c_toupper == 'X')
+      {
+	++tmp_succNs;
+	if (tmp_succNs <= maximum_number_of_successive_NXs) // print the N or X
+	{
+	  putc(c, of);
+	  ++chars_in_this_line;
+
+	  if (chars_in_this_line == char_per_line)
+	  {
+	    putc('\n', of);
+	    chars_in_this_line = 0;
+	  }
+	}
+	// unwritten else: do not print the N or X
+      }
+      else
+      {
+	putc(c, of);
+	tmp_succNs = 0;
+	++chars_in_this_line;
+
+	if (chars_in_this_line == char_per_line)
+	{
+	  putc('\n', of);
+	  chars_in_this_line = 0;
+	}
+      }
+      ++beg;
+    }
+    if (chars_in_this_line != 0)
+	  putc('\n', of);
+  }
+
+  void writeSequence_partial_fasta(FILE *of,
+				   unsigned    pos_beg, // 0 based
+				   unsigned    pos_end, // 0 based , stop index
+				   const char  *s_name,
+				   unsigned    char_per_line=50,
+				   bool        degap=true) const
+  {
+    const char *beg = data.begin() + pos_beg;
+    const char *end = data.begin() + pos_end;
+
+/*     if (bitcode_recoded) */
+/*       backrecode_bitcode_sequence(); */
+
+    if (pos_end == -1u || end > data.end() )
+      end = data.end();
+
+    fprintf(of, ">%s\n", s_name);
+
+    unsigned chars_in_this_line=0;
+    
+    if (degap)
+    {
+      while (beg != end)
+      {
+	char c = *beg;
+
+	if (c != '-')
+	{
+	  putc(c, of);
+	  ++chars_in_this_line;
+
+	  if (chars_in_this_line == char_per_line)
+	  {
+	    putc('\n', of);
+	    chars_in_this_line = 0;
+	  }
+	}
+	// unwritten else: do not print -
+      ++beg;
+      }
+    }
+    else
+    {
+      while (beg != end)
+      {
+	putc(*beg, of);
+	++chars_in_this_line;
+	
+	if (chars_in_this_line == char_per_line)
+	{
+	  putc('\n', of);
+	  chars_in_this_line = 0;
+	}
+	++beg;
+      }
+    }
+  }
+
+  void writeSequence_fasta_filter_sites(FILE *of,
+					std::vector<unsigned> &site_filter,
+					int         offset,   // 0 if site_filter is 0 based, 1 if site_filter is 1 based
+					const char  *s_name,
+					unsigned    char_per_line=50) const
+  {
+    const char *beg = data.begin();
+    const char *end = data.end();
+
+/*     if (bitcode_recoded) */
+/*       backrecode_bitcode_sequence(); */
+
+    fprintf(of, ">%s\n", s_name);
+
+    unsigned chars_in_this_line=0;
+    int i=offset;
+
+    {
+      while (beg != end)
+      {
+	if (site_filter[i] != 0)
+	{
+	  putc(*beg, of);
+	  ++chars_in_this_line;
+	
+	  if (chars_in_this_line == char_per_line)
+	  {
+	    putc('\n', of);
+	    chars_in_this_line = 0;
+	  }
+	}
+	// Move on in sequence and site_filter vector
+	++beg;
+	++i;
+      }
+    }
+  }
+
+  void writeSequence_phylip(FILE *of,
+			    unsigned    pos_beg, // 0 based
+			    unsigned    pos_end, // 0 based, stop index.
+			   const char  *s_name) const
+  {
+/*     if (bitcode_recoded) */
+/*       backrecode_bitcode_sequence(); */
+
+    const char *beg = data.begin() + pos_beg;
+    // const char *end = data.begin() + pos_end;
+ 
+/*     if (pos_end == -1u || end > data.end() ) */
+/*       end = data.end(); */
+
+    unsigned name_len = strlen(s_name);
+    if (name_len < 11)
+      fprintf(of, "%-10.10s", s_name);
+/*     else */
+/*     { */
+/*       char str[11]; */
+/*       std::strncpy(str, s_name, 10); */
+/*       str[10] = '\0'; */
+/*       fprintf(of, "%s", str); */
+/*     } */
+    fprintf(of, "%.*s\n", pos_end - pos_beg, beg);
+  }
+
+  // Expects 0 bases coordinates. The range starts at pos_beg and pos_end
+  // points to the base after the last position in the range.
+  // Clearly pos_end > pos_beg. In the empty range, pos_end = pos_beg+1.
+
+  void writeSequence_revComp(FILE *of,
+			     unsigned pos_beg,  // 0 based index
+			     unsigned pos_end,  // 0 based index after the last pos.
+			     const char *s_name,
+			     unsigned    char_per_line=50) const
+  {
+/*     if (bitcode_recoded) */
+/*       backrecode_bitcode_sequence(); */
+
+    const char *beg = data.begin() + pos_beg;
+    const char *end = data.begin() + pos_end;
+
+    unsigned interleaved = char_per_line;
+
+    fprintf(of, ">%s\n", s_name);
+
+    
+    // Walking backwards, we shift the range:
+    --beg;   // 0 based indices. beg is the rend index. Move beg to pos before "first pos". This is the stop index. 
+    --end;   // 0 based index. Move end to index at which we start to move.
+
+    // Example: Print first 3 bases.
+    // Then: pos_beg=0, pos_end=3, 0 based, pos_end is index behind last pos in range. 
+    // Thus: beg="-1+seq_beg" and end="2+seq_beg", so print 2, 1, 0, and stop at -1
+
+    for (; beg < end; --end)
+    {
+      if (interleaved == 0)
+      {
+	fputc('\n', of);
+	interleaved = char_per_line;
+      }
+      fputc( complementBase(*end), of ); // From CDnaString.h
+      --interleaved;
+    }
+    fputc('\n', of);
+  }
+
+  unsigned baseComposition(std::vector<unsigned> &v) const
+  {
+    if ( v.size() < 256 )
+    {
+      std::cerr << "Internal error. -24" << std::endl;
+      exit(0);
+    }
+
+    char *pos = data.begin();
+    char *end = data.end();
+
+    unsigned len = end - pos;
+
+    while (pos != end)
+    {
+      ++v[*pos];
+      ++pos;
+    }
+    return len;
+  }
+
+  void sliding_window_CG_AT_content(std::vector<double> &v, unsigned window_size)
+  {
+    char *end = data.end();
+
+    const char *range_beg = data.begin();
+    const char *range_end;
+
+    double   CG_prop;
+    unsigned CG_num;
+    unsigned AT_num;
+
+    while (1)
+    {
+      range_end = range_beg + window_size;
+
+      if (range_end > end)
+	range_end = end;
+
+      if (range_end == range_beg)
+	break;
+
+      CG_AT_content_in_region(range_beg, range_end, AT_num, CG_num);
+
+      //      std::cerr << AT_num << " " << CG_num << std::endl;
+
+      if (CG_num == 0 && AT_num == 0) // e.g. if all chars are ambigs
+	CG_prop = -1;
+      else
+	CG_prop = (double)CG_num/(CG_num+AT_num);
+      
+      v.push_back(CG_prop);
+ 
+      range_beg = range_end;
+    }
+  }
+
+
+  unsigned long long AsciiComposition_CpG_CpNpG(unsigned long long v[], unsigned long long &CpG, unsigned long long &CpNpG, unsigned long long &Nislands) const
+  {
+    char *pos = data.begin();
+    char *end = data.end();
+    char last = 'N';  // An island is not counted if located at the beginning or end of the sequnce.
+
+    unsigned long long len = end - pos;
+    
+
+    end = end - 2;
+    while (pos < end)
+    {
+      char c1 = *pos;
+
+      if ( c1 == 'C' || c1 == 'c' )
+      {
+	char c2 = *(pos+1);
+	char c3 = *(pos+2);
+	if ( c2 == 'G' || c2 == 'g') ++CpG;
+	if ( c3 == 'G' || c3 == 'g') ++CpNpG;
+      }
+      if (c1 == 'N' && last != 'N') 
+	++Nislands;
+
+      ++v[(int)c1];
+      ++pos;
+      last = c1;
+    }
+
+    // Now deal with the second last position:
+    if (len > 1 )
+    {
+      char c1 = *pos;
+
+      if ( c1 == 'C' || c1 == 'c' )
+      {
+	char c2 = *(pos+1);
+	if ( c2 == 'G' || c2 == 'g' ) ++CpG;
+      }
+      if (c1 == 'N' && last != 'N') 
+	++Nislands;
+      ++v[(int)c1];
+      ++pos;
+      last = c1;
+    }
+
+    // Now deal with the last position:
+    if (len > 0)
+    {
+      ++v[(int)*pos];
+      if (*pos == 'N') // We don't count the island if at the end of the sequence 
+      {
+	if  (last == 'N') // it has already been counted so undo this 
+	{
+	  --Nislands;
+	}
+      // else
+      //    we don't count it
+      }
+    }
+    return len;
+  }
+
+  void debug_print_gap_coords(std::ostream &os)
+  {
+     unsigned *git = gap_and_star_koords.begin();
+
+     os << "Gap positions:" << std::endl;
+     for (; git < gap_and_star_koords.end(); ++git)
+       os << *git << std::endl;
+  }
+
+
+  unsigned getSeqCoord(const char *seq_pos)
+  {
+    return seq_pos - data.begin() + 1;
+  }
+
+  char get_ambiguity_character()
+  {
+    return general_ambig;
+  }
+
+  unsigned getSeqCoord_gap_correted(const char *seq_pos, unsigned &seq_gap_offset)
+  {
+    unsigned corrected_pos = seq_pos - data.begin()+1+seq_gap_offset;
+
+    unsigned i = seq_gap_offset;
+    unsigned N = gap_and_star_koords.size();
+
+    //   std::cerr << "Entering getSeqCoord_gap_correted i: " << i << " N: " << N << " corr coord: " << corrected_pos << std::endl; 
+
+    while (i < N && gap_and_star_koords.get_unckecked(i) < corrected_pos)
+    {
+      ++i;
+      ++corrected_pos;
+    }
+
+    seq_gap_offset = i;
+
+    //    std::cerr << "Exiting getSeqCoord_gap_correted i: " << i << " : " << N << " corr coord: " << corrected_pos << std::endl; 
+
+    return corrected_pos;
+  }
+
+
+  void writeSequence(std::ostream &os, unsigned char_per_line)
+  {
+    char *pos = data.begin();
+    char *end = data.end();
+    char *tmp_end;
+
+    if (bitcode_recoded)
+      backrecode_bitcode_sequence();
+
+    os << ">" << full_name.c_str() << std::endl;
+    //    os << ">" << full_name.c_str() << std::endl;
+
+    tmp_end = pos + char_per_line;
+    if (tmp_end > end)
+      tmp_end = end;
+
+    while (pos != end)
+    {
+      while (pos != tmp_end)
+      {
+	os << *pos;
+	++pos;
+      }
+      os << std::endl;
+      tmp_end = pos + char_per_line;
+      if (tmp_end > end)
+	tmp_end = end;
+    }
+  }
+
+/*   void set_to_using_phylip_sequential_sequence() */
+/*   { */
+/*   } */
+
+
+  void readRawFastaSequence(CFile& infile, unsigned &num)
+  {
+    char     c   = '\0';
+    bool     first_line = true;
+
+    full_name = "";
+    data.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c)) // Ignore spaces
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')   // Ignore lines starting with #
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )   // Ignore spaces
+	c = infile.getchar();
+    }
+
+    if (c != '>')          // Should be new sequence
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      cerr << data.capacity() << endl;
+      if (first_line)
+	getRawLine(infile, num);
+      else
+	getRawLine(infile);
+      first_line = false;
+      c = infile.peekchar();
+    }
+  }
+
+
+  void readRawFastaSequence(CFile& infile)
+  {
+    char     c   = '\0';
+
+    full_name = "";
+    data.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c)) // Ignore spaces
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')   // Ignore lines starting with #
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )   // Ignore spaces
+	c = infile.getchar();
+    }
+
+    if (c != '>')          // Should be new sequence
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      cerr << data.capacity() << endl;
+      getRawLine(infile);
+      c = infile.peekchar();
+    }
+  }
+
+  void readSeqName_ignore_Sequence_data(CFile& infile)
+  {
+    char     c   = '\0';
+
+    full_name = "";
+    data.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c)) // Ignore spaces
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')   // Ignore lines starting with #
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )   // Ignore spaces
+	c = infile.getchar();
+    }
+
+    if (c != '>')          // Should be new sequence
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    // Ignore the sequence data of this sequnce:
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      std::cerr << data.capacity() << std::endl;
+      infile.ignore('\n');
+      c = infile.peekchar();
+    }
+  }
+
+
+  void readRawFastaSequence_toupper(CFile& infile)
+  {
+    char     c   = '\0';
+
+    full_name = "";
+    data.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c))
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )
+	c = infile.getchar();
+    }
+
+    if (c != '>')
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      std::cerr << data.capacity() << std::endl;
+      getRawLine_toupper(infile);
+      c = infile.peekchar();
+    }
+  }
+
+  // it1 is the first position to fill. This coorindate must be 0 based.
+  // it2 is the position behind the last position to fill. It must be 0 based.
+
+  void fill_range_with(unsigned pos1, unsigned pos2, char c)
+  {
+    numbers_of_residues_computed  = false;
+
+    char     *it1     = data.begin() + pos1;
+    char     *it2     = data.begin() + pos2;
+    char     *it_end  = data.end();
+
+    if (it2 > it_end)
+      it2 = it_end;
+
+    while (it1  < it2)
+    {
+      *it1 = c;
+      ++it1;
+    }
+  }
+
+
+  // Called from Phobos:
+  // TODO: I think we should not remove stars any more.
+  // Stars should only be tolerated in protein sequences.
+  void readFastaSequence_toupper_ambig2N_removegaps(CFile& infile)
+  {
+    char      c   = '\0';
+    unsigned  pos = 0;
+
+    full_name = "";
+    data.clear();
+    gap_and_star_koords.clear();
+    gap_koords.clear();
+    star_koords.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c))
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )
+	c = infile.getchar();
+    }
+
+    if (c != '>')
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      std::cerr << data.capacity() << std::endl;
+      if (type == dna)
+	getLineOfDNA_toupper_ambig2N_removegaps(infile, pos);
+      else
+	std::cout << "Not implemented. Use the readFastaSequence_toupper_removegaps(CFile& infile) function instead." << std::endl;
+      c = infile.peekchar();
+    }
+  }
+
+
+  void readFastaSequence_toupper_removegaps(CFile& infile)
+  {
+    char      c   = '\0';
+    unsigned  pos = 0;
+
+    full_name = "";
+    data.clear();
+    gap_and_star_koords.clear();
+    gap_koords.clear();
+    star_koords.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c))
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )
+	c = infile.getchar();
+    }
+
+    if (c != '>')
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      std::cerr << data.capacity() << std::endl;
+      if (type == dna)
+	getLineOfDNA_toupper_removegaps(infile, pos);
+      else
+	getLineOfProtein_toupper_removegaps(infile, pos);
+      c = infile.peekchar();
+    }
+  }
+
+  // Backward compatible function:
+  // Called e.g. from Phobos
+  void readFastaSequence_toupper_ambig2N_gaps2N(CFile& infile)
+  {
+    readFastaSequence_toupper_ambig2N_gaps2ambig(infile);
+  }
+
+
+  // Has resently been renamed: gaps2N -> gaps2ambig
+  // since we want to prepare for reading proteins.
+  void readFastaSequence_toupper_ambig2N_gaps2ambig(CFile& infile)
+  {
+    char     c   = '\0';
+
+    full_name = "";
+    data.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c))
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )
+	c = infile.getchar();
+    }
+
+    if (c != '>')
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      std::cerr << data.capacity() << std::endl;
+      if (type == dna)
+	getLineOfDNA_toupper_ambig2N_gaps2ambig(infile);
+      else
+	std::cout << "Not implemented." << std::endl;
+      c = infile.peekchar();
+    }
+  }
+
+  void recode_sequence_to_bitcode()
+  {
+    if (type == dna)
+    {
+      char *it     = data.begin();
+      char *it_end = data.end();
+
+      while (it != it_end)
+      {
+	*it = recode_DNA(*it);
+	++it;
+      }
+      bitcode_recoded = true;
+    }
+    else if (type == protein)
+    {}
+  }
+
+  void backrecode_bitcode_sequence()
+  {
+    if (type == dna)
+    {
+      char *it     = data.begin();
+      char *it_end = data.end();
+
+      while (it != it_end)
+      {
+	*it = backrecode_DNA(*it);
+	++it;
+      }
+      bitcode_recoded = false;
+    }
+    else if (type == protein)
+    {}
+  }
+
+  // chrashed in this function on linux - do not know why yet 64 bit problem??
+  void check_allowed_symbols_in_sequence(const char *symbols)
+  {
+    size_t pos=0;
+
+    pos = data.find_first_not_of(symbols, pos);
+    while (pos != faststring::npos)
+    {
+      std::cerr << "Found illegal symbol in sequnces: " << short_name 
+		<< " Position " << pos << ". Found char " << data[pos] << std::endl;
+
+      ++pos;
+      pos = data.find_first_not_of(symbols, pos);
+    }
+
+  }
+
+
+  void export_fasta()
+  {
+    
+
+  }
+
+  void export_phylip()
+  {
+
+
+  }
+
+  void export_nexus()
+  {
+
+
+  }
+
+
+  void readFastaSequence_generic(CFile& infile, processing_flag pflag)
+  {
+    char     c   = '\0';
+    unsigned  pos = 0;
+ 
+    // TODO: Prepare to remove gaps and/or stars:
+
+    // Increase the readability:
+    register bool   convert_toupper_bool  = (pflag & convert_toupper);   //
+    register bool   convert_ambig2N_bool  = (pflag & convert_ambig2N);   //
+    register bool   removegaps_bool       = (pflag & removegaps);        //
+    register bool   removestars_bool      = (pflag & removestars);       //
+    bool            gaps_to_ambig_bool    = (pflag & gaps_to_ambig);     //
+
+    full_name = "";
+    data.clear();
+
+    reset_numbers_of_residues();
+
+    c = infile.getchar();
+    while (!infile.fail() && isspace(c))
+      c = infile.getchar();
+    while (!infile.fail() && c == '#')
+    {
+      infile.ignore('\n');
+      c = infile.getchar();
+      while (!infile.fail() && isspace(c) )
+	c = infile.getchar();
+    }
+
+    if (c != '>')
+    {
+      infile.clear(CFile::__fail_flag);
+      return;
+    }
+    infile.getline(full_name);
+    if (infile.fail())
+    {
+      return;
+    }
+    find_shortname_and_description();
+
+    c = infile.peekchar();
+    while ( !infile.fail() && c != '>' )
+    {
+      //      std::cerr << data.capacity() << std::endl;
+      if (type == dna)
+	getLineOfDNA_generic(infile, pos, pflag);
+      else if (type == protein)
+	getLineOfProtein_generic(infile, pos, pflag);
+      else if (type == molecular)
+      {
+	getRawLine(infile);
+	if (convert_toupper_bool)
+	  toupper_this_sequence();
+
+	if (convert_ambig2N_bool)
+	  convert_ambig2N_this_sequence();
+	if (gaps_to_ambig_bool)
+	  gaps_to_ambig_this_sequence();
+	if (removegaps_bool || removestars_bool)
+	  remove_gaps_stars_this_sequence(removegaps_bool, removestars_bool);
+      }
+      else if (type == auto_detect_type)
+      {
+	getRawLine(infile);
+	if (convert_toupper_bool)
+	  toupper_this_sequence();
+	auto_detect_datatype();
+
+	if (convert_ambig2N_bool)
+	  convert_ambig2N_this_sequence();
+	if (gaps_to_ambig_bool)
+	  gaps_to_ambig_this_sequence();
+	if (removegaps_bool || removestars_bool)
+	  remove_gaps_stars_this_sequence(removegaps_bool, removestars_bool);
+      }
+      c = infile.peekchar();
+    }
+  }
+
+  unsigned get_number_of_Ns()
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+    return number_of_Ns;
+  }
+
+  unsigned get_number_of_gaps()
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+    return number_of_gaps;
+  }
+
+  unsigned get_number_raw_original_length()
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+    return number_raw_original_length;
+  }
+
+  unsigned get_number_of_DNARNA_bases()
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+    return number_of_DNARNA_bases;
+  }
+
+  unsigned get_number_of_AAs()
+  {
+    if (!numbers_of_residues_computed)
+      compute_numbers_of_residues();
+    return number_of_AAs;
+  }
+
+  unsigned get_number_of_DNARNA_ambigs()
+  {
+    return number_of_DNARNA_amgibs;
+  }
+
+  double get_CG_content()
+  {
+    //    std::cerr << "number_CG " << number_CG   << std::endl;
+    //    std::cerr << "number_of_DNARNA_bases " << number_of_DNARNA_bases   << std::endl;
+    //    //    std::cerr << "number_of_DNARNA_amgibs  " << number_of_DNARNA_amgibs << std::endl;
+
+    return ((double) number_CG)/(number_of_DNARNA_bases);
+  }
+
+
+  bool range_contains_gaps_or_Ns(unsigned pos1, unsigned pos2)
+  {
+    unsigned len = length();
+
+    if (pos1 >= pos2 || pos1 > len) // Empty range
+      return false;
+    if (pos2 > len)
+      pos2 = len;
+
+    const char *p1, *p2;
+    p1 = getSeqBegin() + pos1;
+    p2 = getSeqBegin() + pos2;
+
+    char c='\0';
+
+    while (p1 != p2)
+    {
+      c = *p1;
+      if (c == 'N' || c == 'n' || c == '-')
+	break;
+      ++p1;
+    }
+    if (c == 'N' || c == 'n' || c == '-')      
+      return true;
+    else
+      return false;
+  }
+
+
+
+
+
+  // void readFastaSequence(CFile& infile) is depricated:
+  // Use one of the other read functions below.
+  // This function used to by of type
+  // toupper_ambig2N_removegaps
+
+/*   void readFastaSequence(CFile& infile) */
+/*   { */
+/*     #warning "The readFastaSequence function is deprecated." */
+
+/*     char     c   = '\0'; */
+
+/*     full_name = ""; */
+/*     data.clear(); */
+
+/*     c = infile.getchar(); */
+/*     while (!infile.fail() && isspace(c)) */
+/*       c = infile.getchar(); */
+/*     while (!infile.fail() && c == '#') */
+/*     { */
+/*       infile.ignore('\n'); */
+/*       c = infile.getchar(); */
+/*       while (!infile.fail() && isspace(c) ) */
+/* 	c = infile.getchar(); */
+/*     } */
+
+/*     if (c != '>') */
+/*     { */
+/*       infile.clear(CFile::__fail_flag); */
+/*       return; */
+/*     } */
+/*     infile.getline(full_name); */
+/*     if (infile.fail()) */
+/*     { */
+/*       return; */
+/*     } */
+/*     find_shortname_and_description(); */
+
+/*     c = infile.peekchar(); */
+/*     while ( !infile.fail() && c != '>' ) */
+/*     { */
+/*       //      cerr << data.capacity() << endl; */
+/*       if (type == dna) */
+/* 	getLineOfDNA_toupper_ambig2N_removegaps(infile); */
+/*       else */
+/* 	std::cout << "Not implemented." << std::endl; */
+/*       c = infile.peekchar(); */
+/*     } */
+/*   } */
+
+};
+
+// Functions provided to read sequences:
+//  void readRawFastaSequence(CFile& infile)                         // No character checks
+//  void readRawFastaSequence_toupper(CFile& infile)                 // No character checks
+//  void readFastaSequence_toupper_ambig2N_removegaps(CFile& infile) // 
+//  void readFastaSequence_toupper_ambig2N_gaps2ambig(CFile& infile)     // 
+//  void readFastaSequence_toupper_removegaps(CFile& infile)         // In Arbeit
+//
+#endif
diff --git a/CSequences2.h b/CSequences2.h
new file mode 100644
index 0000000..cae590a
--- /dev/null
+++ b/CSequences2.h
@@ -0,0 +1,3153 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+// TODO: Check all new whether they have a corresponding delete
+
+
+
+//////////////////////////////////////////////////////////////////////
+// CSequences.h: interface for the CSequences class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef  CSEQUENCES2_H
+#define  CSEQUENCES2_H
+
+#include <vector>
+#include <map>
+#include "faststring2.h"
+#include "fast-realloc-vector.h"
+#include "CSplit2.h"
+#include "CSequence_Mol2_1.h"
+#include <cassert>
+#include <cmath>
+#include <utility>
+#include "basic-DNA-RNA-AA-routines.h"
+
+#include <algorithm>
+
+//#include "basic-DNA-RNA-AA-routines.h"
+
+#define PrintMessage_cerr(s1)                fputs(s1, stderr)
+#define ErrorMessage(s1)                     fputs(s1, stderr)
+#define flush_cerr()                         fflush(stderr)
+
+////////////////////////////////////////////////////////////////////
+// Head file for a DNA or PROTEIN sequence collection. 
+//
+// Characteristics:
+// - most member functions assume that sequences have identical lengths, though this is not true for all.
+//   If sequences are not of equal length, it is recommended to revise the code in this head file first.
+//
+////////////////////////////////////////////////////////////////////
+
+
+
+// Global Functions
+//////////////////////////////////
+
+// Criteria for reference taxa:
+// - Original reference taxa have 2 pipes (3 sections), other sequences have 3 pipes (4 sections) in sequence names.
+// - Hamstered reference taxa are those for which section 2 and 3 are identical in the first 4 characters.
+
+
+/* inline bool is_1kite_hamstered_core_seq_id(faststring seq_id) */
+/* { */
+/* #ifdef DEBUG */
+/*   std::cerr << "Called: CSequences2.h:is_1kite_hamstered_core_seq_id with parameter " << seq_id << std::endl; */
+/* #endif */
+
+/*   //  std::cerr << "Calling outdated function: is_1kite_hamstered_core_seq_id " << std::endl; */
+/*   //  exit(-1); */
+
+/*   std::vector<faststring> l; */
+
+/*   split(l, seq_id, "|"); */
+
+/*   unsigned num_sections = l.size(); */
+
+/*   if (num_sections > 4 || num_sections < 3) */
+/*   { */
+/*     std::cerr << "Error: Non standard 1kite seq_id encountered: " << seq_id << std::endl; */
+/*     exit(0); */
+/*   } */
+
+/* #ifdef DEBUG */
+/*   std::cerr << "num_sections: " << num_sections << std::endl; */
+/* #endif */
+
+/*   if (num_sections == 3) */
+/*     return true; */
+/*   else */
+/*     return false; */
+/* } */
+
+
+
+inline bool is_1kite_original_reference_taxon_seq_id(faststring seq_id)
+{
+#ifdef DEBUG
+  std::cerr << "Called: CSequences2.h:is_1kite_original_reference_taxon_seq_id with parameter " << seq_id << std::endl;
+#endif
+
+  std::vector<faststring> l;
+
+  split(l, seq_id, "|");
+
+  unsigned num_sections = l.size();
+
+  if (num_sections > 4 || num_sections < 3)
+  {
+    std::cerr << "Error: Non standard 1kite seq_id encountered: " << seq_id << std::endl;
+    exit(0);
+  }
+
+#ifdef DEBUG
+  std::cerr << "num_sections: " << num_sections << std::endl;
+#endif
+
+  if (num_sections == 3)
+    return true;
+  else
+    return false;
+}
+
+
+inline bool is_1kite_hamstered_reference_seq_id(faststring seq_id)
+{
+  std::vector<faststring> l;
+
+  split(l, seq_id, "|");
+
+#ifdef DEBUG
+  std::cerr << "Called: CPfamScanParser.h:is_1kite_hamstered_reference_seq_id with parameter " << seq_id << std::endl;
+#endif
+
+  if (l.size() != 4)
+  {
+    std::cerr << "Error: Non standard 1kite seq_id encountered: " << seq_id << std::endl;
+    exit(0);
+  }
+  faststring part2 = l[1];
+
+  part2.shorten_to_first_occurrence_of('_');
+  faststring part3 = l[2];
+
+  part2.shorten(4);
+  part3.shorten(4);
+
+#ifdef DEBUG
+  std::cerr << "num_sections: " << l.size() << " " << part2 << " " << part3 << std::endl;
+#endif
+
+  return (part2 == part3);
+}
+
+
+
+
+//template<class T>
+inline void add_or_count(std::map<faststring, unsigned> &m, faststring &x)
+{
+  std::map<faststring,unsigned>::iterator it;
+
+  it = m.find(x);
+  if (it == m.end() )
+  {
+    m[x] = 1;
+  }
+  else
+  {
+    ++it->second;
+  }
+}
+
+
+//////////////////////////////////
+// Data types
+//////////////////////////////////
+
+//////////////////////////////////
+// Class CSequences
+//////////////////////////////////
+
+// Class for aligned sequences
+
+class CSequences2
+{
+public:
+  typedef char chartype;
+
+private:
+  CSequence_Mol::DataTypesEnum	datatype;            // DNA, Protein, or other
+  unsigned                  taxaNum;
+  char                      ambig_char;
+  bool                      originalPosNumbers_supplied;
+
+  unsigned	            posNum;
+
+  std::vector<unsigned>         originalPosNumbers;  // In case we excluded positions from the alignment, we want to remember the original positions.
+  std::vector<CSequence_Mol*>   seqData;             // The vector of pointers to sequences
+
+
+  std::map<faststring, CSequence_Mol*> sn_map;       // Obtain pointer to the sequence by sequence name.
+
+  void add_seq(CSequence_Mol* seq)
+  {
+    //    std::cerr << "Adding: " << seq->getName() << std::endl;
+
+    seqData.push_back(seq);
+    sn_map[seq->getName()] = seq;
+  }
+
+  bool equal_length_of_all_sequences()
+  {
+    size_t len;
+    unsigned i;
+
+    if (taxaNum==0)
+      return true;
+
+    len = seqData[0]->length();
+
+    for (i=1; i<taxaNum; ++i)
+    {
+      if (len != seqData[i]->length())
+	return false;
+    }
+    return true;
+  }
+
+  void determine_map_of_sequence_names()
+  {
+    if (sn_map.size() == 0)
+    {
+      int i, N=seqData.size();
+      for(i=0; i<N; ++i)
+      {
+	sn_map[seqData[i]->getName()] = seqData[i];
+      }
+    }
+  }
+
+
+public:
+  // Minimal constructor: Empty sequences object
+ CSequences2(CSequence_Mol::DataTypesEnum Dt, char set_ambig_char='?'):
+  datatype(Dt), taxaNum(0), ambig_char(set_ambig_char), originalPosNumbers_supplied(false),posNum(0)
+
+  {}
+
+  // Constructor for a set of empty sequences with names and length.
+ CSequences2(CSequence_Mol::DataTypesEnum Dt, std::vector<faststring> names, unsigned len):
+  datatype(Dt), taxaNum(names.size()), ambig_char('?'), originalPosNumbers_supplied(false),posNum(0)
+
+  {
+    seqData.reserve(taxaNum);
+    unsigned        i;
+    CSequence_Mol   *seq;
+
+    for (i=0; i<taxaNum; ++i)
+    {
+      seq = new CSequence_Mol (CSequence_Mol::dna, names[i], len, ambig_char);
+      add_seq(seq);
+    }
+  }
+
+
+  ~CSequences2()
+  {
+    int i, n=taxaNum;
+
+    for (i=0; i<n; ++i)
+    {
+      delete seqData[i];
+    }
+
+  }
+
+
+  // This constructor can be used to
+  //  - general copy constructor
+  //  - extract a range of sites
+  // Coordinates:
+  //    pos1 must be the first column starting with 0.
+  //    pos2 must be the index after the last column.
+  //    pos2-pos1 must be the number of bases that are copied to this sequence.
+
+ CSequences2(const CSequences2 &s, unsigned pos1 = 0, unsigned pos2 = -1u):
+  datatype(s.datatype), taxaNum(s.taxaNum), ambig_char(s.ambig_char),
+    originalPosNumbers_supplied(false), posNum(0)
+  {
+    unsigned        i, n=taxaNum;
+    CSequence_Mol   *seq;
+
+    for (i=0; i<n; ++i)
+    {
+      seq = new CSequence_Mol ( *(s.seqData[i]), pos1, pos2);
+      add_seq(seq);
+    }
+    if (i != n)
+    {
+      std::cerr << "Critical error in CSequences2 constructor: taxaNum and number of sequences found disagree." << std::endl;
+    }
+    
+    if (n > 0)
+      posNum = seq->length();
+  }
+ 
+  CSequence_Mol* get_seq_by_name(faststring name)
+  {
+    // Test code:
+    {
+      //      print_DEBUG(cerr, 0);
+    }
+
+    std::map<faststring, CSequence_Mol*>::iterator find_it = sn_map.find(name);
+    if (find_it != sn_map.end() )
+      return find_it->second;
+    else
+      return NULL;
+  }
+
+  CSequence_Mol* get_seq_by_index(unsigned id)
+  {
+    if (id >= seqData.size())
+    {
+      return NULL;
+    }
+    else
+    {
+      return seqData[id];
+    }
+  }
+
+  // Depreciated:
+  CSequence_Mol* get_seq(unsigned id)
+  {
+    return get_seq_by_index(id);
+  }
+
+  const char* get_Seq_Data(unsigned id)
+  {
+    if (id >= seqData.size())
+    {
+      return NULL;
+    }
+    else
+    {
+      return seqData[id]->getSeqStr();
+    }
+  }
+
+ const char* get_Seq_Name(unsigned id)
+  {
+    if (id >= seqData.size())
+    {    
+      return NULL;
+    }
+    else
+    {
+      return seqData[id]->getName();
+    }
+  }
+  
+  unsigned         GetTaxaNum() { return taxaNum;}
+  unsigned         GetPosNum()  { return posNum;}
+
+  CSequence_Mol::DataTypesEnum    get_datatype()
+  {
+    return datatype;
+  }
+
+  chartype         GetChar(unsigned TaxaIndex,
+			   unsigned PosIndex) const
+  {
+    assert(TaxaIndex < taxaNum);
+    assert(PosIndex  < posNum);
+    return seqData[TaxaIndex]->get_pos(PosIndex);
+  }
+  
+   void print_DEBUG(std::ostream &os, unsigned flag=1)
+  {
+    if (flag & 1) // scalars:
+    {
+      os << "Debug output CSequences2 object, flag==0" << std::endl;
+      os << "Data type:  " << (int)datatype<< std::endl;
+      os << "taxaNum:    " << taxaNum      << std::endl;
+      os << "posNum:     " << posNum       << std::endl;
+      os << "ambig_char: " << ambig_char   << std::endl;
+      os << "originalPosNumbers_supplied " << (int)originalPosNumbers_supplied << std::endl;
+
+      os << "size of originalPosNumbers vector: " << originalPosNumbers.size() << std::endl;
+      os << "size of seqData                  : " << seqData.size()            << std::endl;
+      os << "size of sn_map                   : " << sn_map.size()             << std::endl;
+    }
+
+    if (flag & 2)
+    {
+      int i, n=seqData.size();
+
+      os << "Data types of sequences:\n";
+      for (i=0; i<n; ++i)
+      {
+	  os << i << ": " << seqData[i]->get_datatype() << " " << seqData[i]->type_as_string() << std::endl;
+      }
+    }
+  }
+
+
+
+/*    void             SetChar(unsigned TaxaIndex, unsigned PosIndex, chartype mychar) */
+/*    { */
+/*      assert(TaxaIndex < taxaNum); */
+/*      assert(PosIndex < posNum); */
+/*      seqData[TaxaIndex]->set_pos(PosIndex, mychar); */
+/*    } */
+
+   void SetOriginalPosNumber(unsigned index, unsigned theOriginalPosNumber)
+   {
+     originalPosNumbers_supplied = true;
+     assert(index < posNum);
+     originalPosNumbers[index] = theOriginalPosNumber;
+   }
+
+   unsigned GetOriginalPosNumber(unsigned index) const
+   {
+     assert(index < posNum);
+     if (originalPosNumbers_supplied)
+       return originalPosNumbers[index];
+     else
+       return -1u;
+   }
+
+   // Moves taxon with index index to top, preseving the order of all other taxa. 
+   // Of course this changes all indices with the only exception that this taxon is
+   // already at the top of the vector.
+   // The index is of course 0 based.
+   void reorder_move_seq_to_top(unsigned index)
+   {
+     if (index < taxaNum && index > 0)
+     {
+       seqData.insert(seqData.begin(), seqData[index]);
+       seqData.erase(seqData.begin()+index+1); // We have to add 1 since we have one additional entry at the beginning
+     }
+   }
+
+   // TODO: Not very efficient!!
+   // Return true if taxon_name has been found, false otherwise
+   bool reorder_move_seq_to_top(faststring &taxon_name)
+   {
+     unsigned i;
+     for (i=0; i< taxaNum; ++i)
+     {
+       faststring iname = seqData[i]->getFullName();
+       if (seqData[i]->getFullName() == taxon_name)
+       {
+	 std::cerr << "Move to top: " << i << std::endl;
+	 reorder_move_seq_to_top(i);
+	 return true;
+       }
+     }
+     return false;
+   }
+
+   // Reorder the sequences such the those in the given vector are at the top
+   // in the order given by the vector.
+   // TODO: Not very efficient! - Very simple and thus secure implementation.
+   bool reorder_sort_by(std::vector<faststring> &names)
+   {
+     int  i,n=names.size();
+     bool success = true;
+
+     for (i=n-1; i>=0; --i)
+     {
+       success = success & reorder_move_seq_to_top(names[i]);
+     }
+     return success;
+   }
+
+   bool get_Originalposnumbers_Supplied()
+   {
+     return originalPosNumbers_supplied;
+   }
+
+   char get_ambiguity_character()
+   {
+     return ambig_char;
+   }
+
+
+   // Returns the maximum sequence, length
+   void get_sequence_names(std::vector<faststring> &snames)
+   {
+     snames.clear();
+     unsigned  i;
+     //     unsigned  max=0;
+
+     for (i=0; i < taxaNum; ++i)
+     {
+       snames.push_back(seqData[i]->getFullName());
+/*        if (snames[i].size() > max) */
+/*        { */
+/* 	 max = snames[i].size(); */
+/*        } */
+     }
+     //     return max;
+   }
+
+   // Not yet implemented
+/*    void unique_full_names(std::vector<faststring> &snames) */
+/*    { */
+     
+/*    } */
+
+   // Not yet implemented
+/*    void unique_short_names(std::vector<faststring> &snames) */
+/*    { */
+     
+/*    } */
+
+
+
+   void unique_phylip_names(std::vector<faststring> &snames)
+   {
+     snames.clear();
+     std::map<faststring, unsigned>  m_snames;
+     std::map<faststring, unsigned>  m_shortend_names;
+     std::map<faststring, unsigned>::iterator  f_it, f_it2;
+     
+     unsigned                             digits = (unsigned)log10(taxaNum) + 1;
+     unsigned                             i;
+     
+     for (i=0; i < taxaNum; ++i)
+     {
+       // push_back first sequence phylip sequence name. This is already trimmed to 10 characters.
+       snames.push_back(seqData[i]->getPhylipName());
+       // Search for this name in m_snames map.
+       f_it = m_snames.find(snames[i]);
+
+       // If we find it it is not unique
+       if (f_it != m_snames.end() ) // This name is not unique
+       {
+	 ++f_it->second; // We count this occurence
+       }
+       else // If we do not find it, we insert it and set the counter to 1
+       {
+	 m_snames.insert(std::make_pair(snames[i], 1));
+       }
+     }
+     // We have build the map that count the number of occurences - now we need to create unique names:
+
+     // We will shorten the names to add a number.
+     // When shortening names, previously unique names might become non-unique so we have to take care of this first:
+
+     f_it = m_snames.begin();
+     while (f_it != m_snames.end() )
+     {
+       //       std::cout << f_it->first << " " << f_it->second << std::endl;
+
+       if (f_it->second > 1) // If the 10 character sequence name occurs more than one, we have to number them:
+       {
+	 faststring temp = f_it->first;
+	 temp.shorten(9-digits);
+	 
+	 f_it2 =  m_shortend_names.find(temp);
+	 if (f_it2 == m_shortend_names.end() ) // We already have this name in the map:
+	 {
+	   m_shortend_names[temp] += f_it->second;
+	 }
+	 else // Create this entry:
+	 {
+	    m_shortend_names[temp] = f_it->second;
+	 }
+       }
+       ++f_it;
+     }
+
+     // Now we have two maps:
+     // The first has entries for all names
+     // The second has entries for all names that need to be shortend.
+
+     // For all names that need to be shortend:
+     f_it = m_shortend_names.begin();
+     while (f_it != m_shortend_names.end() )
+     {
+       unsigned internal_counter = 1;
+       unsigned j;
+       faststring temp;
+       for (j=0; j<taxaNum; ++j)
+       {
+	 temp = snames[j];
+	 if ( m_snames[temp] != 1 )
+	 {
+	   temp.shorten(9-digits);
+	 }
+	 if (temp == f_it->first)
+	 {  
+	   faststring nn = faststring(internal_counter, '0', digits);
+	   //	   nn.replace_char(' ', '0');
+
+	   snames[j]  = temp;
+	   snames[j].append('_');
+
+	   snames[j].append(nn);
+	   ++internal_counter;
+	 }
+       }
+       ++f_it;
+     }
+   }
+
+
+   unsigned PairwiseSequenceSymbolMatches(unsigned taxon1, unsigned taxon2,
+					  char     numDistCharacters,
+					  const signed char* pos_vec,
+					  signed char* match_vec) const
+   {
+     unsigned  count    = 0;
+     unsigned  pos;
+     
+     for (pos = 0; pos < posNum; ++pos)
+     {
+       if (pos_vec[pos]  &&
+	   seqData[taxon1]->get_pos(pos) == seqData[taxon2]->get_pos(pos) &&
+	   seqData[taxon1]->get_pos(pos) < numDistCharacters)
+       {
+	 ++count;
+	 match_vec[pos] = 1;
+       }
+       else
+	 match_vec[pos] = 0;
+     }
+     return count;
+   }
+   
+ 
+   unsigned PairwiseSequenceSymbolMatches(
+					  unsigned taxon1,
+					  const faststring & ref_seq,
+					  char               numDistCharacters,
+					  const signed char* pos_vec,
+					  signed char* match_vec) const
+  
+
+   // Ist hier alles OK?????????????????????????????????????????
+   {
+     unsigned  count    = 0;
+     unsigned  pos;
+     
+     for (pos = 0; pos < posNum; ++pos)
+     {
+       if (pos_vec[pos]  &&  seqData[taxon1]->get_pos(pos) == ref_seq[pos]
+	              &&  ref_seq[pos] < numDistCharacters)
+       {
+	 ++count;
+	 match_vec[pos] = 1;
+       }
+       else
+	 match_vec[pos] = 0;
+     }
+     return count;
+   }
+   
+
+   void     ConsensusSequence(faststring&           conSeq,
+			      const CSplit&         setOfTaxa,
+			      char                  numDistCharacters,
+			      unsigned              numSymbols,
+			      double                consensusThreshold )
+   {
+     unsigned          pos;
+     unsigned          taxon, maxindex, equalindex;
+     unsigned          taxaCount = 0;
+     unsigned          consensusSymMinimum;
+     char              i;
+
+
+     std::vector<unsigned>  counterSymbolsVec(numSymbols,0);
+     
+     for (pos=0; pos < posNum; ++pos)
+     {
+       // Initialise variable
+       taxaCount = 0;
+       for (i=0; i < numDistCharacters; ++i)
+	 counterSymbolsVec[i] = 0;
+       
+       // Count number of occuring symbols for this position over all taxa
+       for (taxon = 0; taxon < taxaNum; ++taxon)
+       {
+	 if (setOfTaxa.test(taxon))
+	 {
+	   ++taxaCount;
+	   ++counterSymbolsVec[seqData[taxon]->get_pos(pos)];
+	 }
+       }
+       
+       consensusSymMinimum = (unsigned) std::ceil(consensusThreshold * taxaCount);
+       
+       maxindex = 0;
+       equalindex = numDistCharacters;
+       for (i = 1; i < numDistCharacters; ++i)
+       {
+	 if (counterSymbolsVec[i] >= counterSymbolsVec[maxindex])
+	 {
+	   if (counterSymbolsVec[i] == counterSymbolsVec[maxindex])
+	     equalindex = i;
+	   maxindex = i;
+	 }
+       }
+       if (counterSymbolsVec[maxindex] >= consensusSymMinimum &&
+	   maxindex != equalindex)
+	 conSeq[pos] = maxindex;
+       else // Default value, in case consensus cannot be determined
+	 conSeq[pos] = numDistCharacters;
+     }
+   }
+   
+
+   void GetSymbolFrequenciesAtPosition(unsigned pos, const CSplit &taxaSet,
+				       unsigned numSymbols,
+				       std::vector<unsigned>& frequencies)
+   {
+     unsigned i;
+     //  chartype sym;
+     
+     //  assert(frequencies.size() <= numDistCharacters);
+     
+     for (i=0; i<numSymbols; ++i)
+       frequencies[i]=0;
+     
+     for (i=0; i<taxaNum; ++i)
+     {
+       if (taxaSet.test(i))
+       {
+	 ++frequencies[seqData[i]->get_pos(pos)];
+       }
+     }
+   }
+
+   int read_from_Fasta_File(CFile& infile,
+			    CSequence_Mol::processing_flag pflag,
+			    unsigned first_seq,
+			    unsigned last_seq,
+			    bool report_status_to_cerr=true
+			    )
+   {
+     CSequence_Mol   *seq;
+     unsigned        count_seq = 0;
+     unsigned        count_seqs_stored = 0;
+
+
+     // TODO
+     (void) report_status_to_cerr;
+
+     // Remove all sequences from this object - we want to read a new data set.
+     clear(datatype);
+
+     while (!infile.eof())
+     {
+       seq = new CSequence_Mol (datatype);
+       ++count_seq;
+
+       seq->readFastaSequence_generic(infile, pflag);
+
+       // PrintMessage_cerr(seq.getName());PrintMessage_cerr("-\n");PrintMessage_cerr(seq.getFullName());PrintMessage_cerr("-\n");PrintMessage_cerr(seq.getDescription());PrintMessage_cerr("-\n");
+       if ( infile.fail() && !infile.eof() )
+       {
+	 PrintMessage_cerr("\n\n");
+	 faststring errormsg;
+	 errormsg   =  "An error occurred while reading the input file. It might not be a valid fasta file.\n";
+	 errormsg  +=  "File position: line ";
+	 errormsg  +=  faststring(infile.line());
+	 ErrorMessage(errormsg.c_str());
+	 PrintMessage_cerr("\n");
+	 flush_cerr();
+	 return -25;
+       }
+
+       if ( count_seq < first_seq || count_seq > last_seq )
+       {
+	 if (report_status_to_cerr)
+	 {
+	   PrintMessage_cerr("Skipping sequence ");
+	   PrintMessage_cerr(faststring(count_seq).c_str());
+	   PrintMessage_cerr(": ");
+	   PrintMessage_cerr(seq->getName());
+	   PrintMessage_cerr("\n");
+	   flush_cerr();
+	 }
+	 continue;
+       }
+
+       if (report_status_to_cerr)
+       {
+	 PrintMessage_cerr("Processing sequence ");
+	 PrintMessage_cerr(faststring(count_seq).c_str());
+	 PrintMessage_cerr(": ");
+	 PrintMessage_cerr(seq->getName());
+	 PrintMessage_cerr("\n");
+	 flush_cerr();
+       }
+
+       add_seq(seq);
+       ++count_seqs_stored;
+     } // End while
+
+     // Check that all sequences have the same length - we require that they have the same length
+     if (!equal_length_of_all_sequences() )
+       return -1;
+
+     // Check equal data type and ambig character:
+
+     taxaNum = count_seqs_stored;
+
+     if (taxaNum > 0)
+     {
+       posNum  = seqData[0]->length();
+       ambig_char = seqData[0]->get_ambiguity_character();
+     }
+
+     return 0;
+   }  // End this element function.
+
+
+
+   // Can read sequential and interleaved phylip files
+   // Cannot read multi phylip files.
+
+   // format_flag: 0 strict phylip standard. Sequence names are exactly 10 characters long.
+   //              1 relaxed sequence name length. Sequence names end with first space and can have anly length.
+   //                Spaces are not allowed in sequence names.
+
+   int read_from_Phylip_File(CFile& infile, unsigned format_flag = 1)
+   {
+     CSequence_Mol   *seq;
+     //     unsigned        count_seq;
+     //     unsigned        global_sequence_from=0, global_sequence_to=-1u;
+     //     bool            global_gaps_to_Ns=false;
+     unsigned        all_lines_N;
+     unsigned        curr_taxon;
+
+     char read_mode;
+
+     // The allowed symbols from the phylip manual:
+
+
+     char ch;
+     faststring line;
+     std::vector<faststring> fsvec;
+     faststring *p;
+
+     // Clear the oject and initialize it with the supplied data type
+     clear(datatype); // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+     ch = infile.peek();
+
+     // If the first char is a white space or a digit, we expect this
+     // is the line with the number of taxa and seq. positions.
+     if ( isspace(ch) || isdigit(ch) )
+     {
+       infile.getline(line);
+       split(fsvec, line);
+
+       if (fsvec.size()==2 && fsvec[0].isAnUnsigned() && fsvec[1].isAnUnsigned() )
+       {
+	 taxaNum = fsvec[0].ToUnsigned();
+	 posNum  = fsvec[1].ToUnsigned();
+
+/* 	 std::cout << "Number of taxa     " << taxaNum << std::endl; */
+/* 	 std::cout << "Number of residues " << posNum  << std::endl; */
+       }
+     }
+
+     //     std::vector<faststring*> sqs;
+     std::vector<faststring*> all_lines;
+
+/*      if (taxaNum == 0 && posNum == 0) */
+/*      { */
+/*        faststring *pp = new faststring; */
+/*        *pp = line; */
+/*        all_lines.push_back(pp); */
+/*      } */
+
+     // We read the complete file into a vector of strings.
+     p = new faststring();
+     infile.getline(*p);
+     p->removeSpacesFront();
+     p->removeSpacesBack();
+
+     while (!infile.fail() )
+     {
+       all_lines.push_back(p);
+       p = new faststring();
+       infile.getline(*p);
+       p->removeSpacesFront();
+       p->removeSpacesBack();
+     }
+
+     // The problem is: The phylip format is very difficult
+     // to parse. Main problem is to distinguish between
+     // sequential and interleaved format.
+     // The interleaved format is distinguished as follows:
+     // After each block there must be a blank line.
+     // So if we find blank lines which are not the last line
+     // the format is interleaved. Otherwise it is sequential.
+
+     // Another problem is relaxed versus strict format.
+     // In the related format the sequence name and the sequence are separated by white spaces.
+     // In the strict format the sequence name is less or sequal to 10 character.
+     // Example: Name123456A MILLV
+     // Can be interpreted as sequence AMILLV or as sequence MILLV with the two different names.
+     // In the strit format the following would be legal:
+     // NAME123456MILLVWSAL LADDPKHIMV
+     // The sequence name would be NAME123456 the rest is the sequence.
+     // Note that the format allows spaces in the sequence.
+     // The two versions cannot be distinguished unambiguously!!
+     // Pragmatic approach: In the presence of one white space island, we assume the relaxed format.
+     // Otherwise the strict format.
+
+     // Since empty lines are allowed at the end of the file in all formats we remove them.
+     // They cannot be indicative of the interleaved format.
+
+     unsigned i;
+     all_lines_N = all_lines.size();
+
+     //     std::cerr << all_lines[all_lines_N-1]->length() << std::endl;
+          
+     while (all_lines[all_lines_N-1]->length() == 0)
+     {
+       --all_lines_N;
+       delete all_lines[all_lines_N];
+       std::vector<faststring*>::iterator it = all_lines.end();
+       --it;
+       all_lines.erase(it);
+     }
+
+     unsigned number_blank_lines=0;
+
+     for (i=0; i<all_lines_N; ++i)
+     {
+       if (all_lines[i]->length() == 0)
+       {
+	 ++number_blank_lines;
+       }
+     }
+     
+     if (all_lines_N == 0 || number_blank_lines == all_lines_N) // Nothing to do???
+       return 0;
+  
+     if (number_blank_lines == 0) // sequential format
+     {
+       read_mode = 's';
+       // Example:
+       //a          ATGATTCAAC CTCAGACCCT TTTAAATGTA GCAGATAACA GTGGAGCTCG 
+       //           AAAATTGATG 
+       //b          ATGATTCAAC CTCAGACCCA TTTAAATGTA GCGGATAACA GCGGGGCTCG 
+       //           AGAATTGATG 
+
+       // This can only be interpreted, if the number
+       // of taxa and positions has been specified in
+       // the first line.
+       // What makes it more complicated
+       // is the fact, that the phylip format tolerates
+       // numbers and other stuff at the beginning of pure sequence lines.
+
+       faststring  seq_taxon_name;
+       faststring  seq_in_one_line;
+       //       unsigned    current_length = 0;
+       unsigned    curr_line_num=0;
+
+       faststring  *currLine;
+
+
+       if (taxaNum == 0 || posNum == 0)
+       {
+	 // delete all faststrings in all_lines
+	 for (unsigned ind=0; ind < all_lines.size(); ++ind)
+	   delete all_lines[ind];
+	 return -3;
+       }
+
+
+       // For all taxa
+       //
+       for (curr_taxon = 0; curr_taxon < taxaNum; ++curr_taxon)
+       {
+	 if (curr_line_num >= all_lines_N)
+	 {
+	   std::cerr << "Parse error while reading the input file:\nUnexpected end of file in line: " << curr_line_num <<  std::endl;
+	   std::cerr << "Trying to read " << taxaNum << " taxa but found only " << curr_taxon << "!" <<  std::endl;
+
+	   exit(-45);
+	 }
+
+	 currLine       = all_lines[curr_line_num];
+	 const char* pos = currLine->c_str();
+	 //	 currLineLen     = currLine->length();
+	 seq_taxon_name.clear();
+	 seq_in_one_line.clear();
+	 
+	 // Copy the sequence name
+	 if (format_flag == 0)
+	 {
+	   for (i=0; i<10 && *pos != '\0'; ++i, ++pos)
+	   {
+	     seq_taxon_name.push_back(*pos);
+	   }
+	   if (i<10) // Fill name with spaces.
+	     seq_taxon_name.append(10-i, ' ');
+	 }
+	 else
+	 {
+	   for (;*pos != '\0' && *pos != ' '; ++pos)
+	   {
+	     seq_taxon_name.push_back(*pos);
+	   }
+	 }
+
+	 // Skip all spaces:
+	 while (*pos == ' ' && *pos != '\0')
+	   ++pos;
+
+	 // Read data after sequence name:
+	 if (*pos)
+	 {
+	   // Copy the sequence data:
+	   {
+	     // Find first character that shall be copied.
+	     // pos should point to the first char of the sequence.
+	     char c;
+
+	     // Skip all non-allowed symbols - since we skiped spaces, there should be none.
+	     c = *pos;
+	     while (!is_phylip_aa_dna_symbol(c) && !is_allowed_non_ABC(c) )
+	     {
+	       ++pos;
+	       c = *pos;
+	     }
+	   }
+	   // Now pos points to the first char that should be copied:
+	   while (*pos)
+	   {
+	     if (*pos != ' ')
+	     {
+	       seq_in_one_line.push_back(*pos);
+	     }
+	     ++pos;
+	   }
+	 } // END if (*pos) AND read data after sequence name.
+ 
+	 // Read lines until we have the required number of residues:
+	 // TODO: More error checking could be done here:
+	 // We could check that only allowed symbols are added.
+	 // By this we also might be able to detect an error earlier
+	 while (seq_in_one_line.length() < posNum)
+	 {
+	   ++curr_line_num;
+	   if (curr_line_num >= all_lines_N)
+	   {
+	     std::cerr << "Parse error while reading the input file. The file has been interpreted as being in sequential phylip format." << std::endl;
+	     std::cerr << "Several problems can trigger this error: (i) Wrong number of residues in sequences compared to the number specified " << std::endl;
+	     std::cerr << "in the file header. (ii) Wrong number of taxa (sequences) compared to the number specified in the file header." << std::endl;
+	     std::cerr << "(iii) Missing blank line between blocks of data if this file should be in interleaved format." << std::endl;
+	     exit(-44);
+	   }
+	   currLine       = all_lines[curr_line_num];
+	   //	   const char* pos = currLine->c_str();
+	   {
+	     // Find first character that shall be copied.
+	     char c;
+	     pos = currLine->c_str();
+	     c = *pos;
+	     while (!is_phylip_aa_dna_symbol(c) && !is_allowed_non_ABC(c) )
+	     {
+	       ++pos;
+	       c = *pos;
+	     }
+	   }
+	   // Now pos points to the first char that should be copied:
+	   // Here we are in the sequential section, reading all residues until
+	   // we have filled our sequence.
+	   while (*pos)
+	   {
+	     if (*pos != ' ')
+	     {
+	       seq_in_one_line.push_back(*pos);
+	     }
+	     ++pos;
+	   }
+	 }
+	 // If we are here, the sequence should have been copied to
+	 // seq_in_one_line
+
+	 seq = new CSequence_Mol (datatype);
+	 seq->set_taxon_and_sequence(seq_taxon_name, seq_in_one_line, datatype);
+	 add_seq(seq);
+
+	 // The next line should start with a new sequence:
+	 ++curr_line_num;
+
+       } // End for loop - for all taxa
+
+       if (curr_line_num != all_lines_N)
+       {
+	 std::cerr << "Parse error while reading the input file: This can have several reasons:\n"
+                      "(i) The number of taxa found in the first block does not match the number specified in the file header.\n"
+	              "(ii) Since only one data block was found, this file is interpreted as sequential format. If this should be a file\n"
+                      "in interleaved format, blank line must be added between blocks of data.\n"
+                      "(iii) It could also be that the number of residues in the sequences is larger than specified in the header, so that addtional\n"
+	              "lines of data are interpreted as additional taxa in the sequential format." << std::endl;
+	 exit(-67);
+       }
+
+     }    // End sequential format
+     else // Interleaved format
+     {
+       read_mode = 'i';
+       // In the first block, the first 10 characters are
+       // the sequence name. Then the first base starts
+       // the sequence.
+       // After the first block, the sequence beginns/continues at
+       // the first base symbol in each line. Thus, numbers and spaces are ignored.
+       // Sequence names are not allowed in interleaved blocks.
+
+       // With format_flag == 1 we may have a different number of sequence name characters.
+       // But then, no spaces are allowed in the sequnce name. 
+
+       unsigned     curr_line_num=0;
+       faststring   *currLine;
+
+       //       unsigned current_length = 0;
+       unsigned curr_taxon = 0;
+
+       faststring *pseq_taxon_name   = NULL;
+       faststring *pseq_in_one_line  = NULL;
+
+       std::vector<faststring*> taxonnames;
+       std::vector<faststring*> sequences;
+
+       currLine        = all_lines[curr_line_num];
+       const char* pos;
+
+       // read first block (interleaved) - until we find a blank line:
+       while ( currLine->length() != 0 ) // We read all lines of the first block. Counter: curr_line_num 
+       {
+	 pos = currLine->c_str();
+
+	 // We will store all pointer to sequences in the vectors defined above,
+	 // so we do not delete sequences here. We keep on creating new ones.
+	 pseq_taxon_name  = new faststring;
+	 pseq_in_one_line = new faststring;
+
+	 // Copy the sequence name
+	 if (format_flag == 0)
+	 {
+	   for (i=0; i<10 && *pos != '\0'; ++i, ++pos)
+	   {
+	     pseq_taxon_name->push_back(*pos);
+	   }
+	   if (i<10) // Fill name with spaces.
+	     pseq_taxon_name->append(10-i, ' ');
+	 }
+	 else
+	 {
+	   for (;*pos != '\0' && *pos != ' '; ++pos)
+	   {
+	     pseq_taxon_name->push_back(*pos);
+	   }
+	 }
+
+	 // Skip all spaces:
+	 while (*pos == ' ' && *pos != '\0')
+	   ++pos;
+
+	 // Read data after sequence name:
+	 if (*pos) // we neeed to read the rest of the line
+	 {
+	   // Copy the sequence data:
+	   {
+	     char c;
+	     
+	     c = *pos;
+	     while (!is_phylip_aa_dna_symbol(c) && !is_allowed_non_ABC(c) )
+	     {
+	       ++pos;
+	       c = *pos;
+	     }
+	   }
+	   // Now pos points to the first char that should be copied:
+	   while (*pos)
+	   {
+	     if (*pos != ' ')
+	       pseq_in_one_line->push_back(*pos);
+	     ++pos;
+	   }
+	 } // if (*pos) AND read data after sequence name.
+	 
+	 // Another taxon has been read: Let us store it:
+
+	 taxonnames.push_back(pseq_taxon_name);
+	 sequences.push_back(pseq_in_one_line);	 
+
+	 //	 std::cerr << "Read partial sequence" << std::endl;
+	 //	 std::cerr << pseq_taxon_name->c_str() << std::endl;
+	 //	 std::cerr << pseq_in_one_line->c_str() << std::endl;
+
+
+	 // Read next line with next taxon name
+	 ++curr_taxon;
+	 ++curr_line_num;
+	 if (curr_line_num >= all_lines_N)
+	   break;
+	 // If we break, currLine will be set to its new value further down
+	 currLine       = all_lines[curr_line_num];
+       } // End while loop over all non blank lines in first block (interleaved)
+
+       // All remaining blocks still need to be read.
+
+       if (taxaNum == 0 && posNum == 0)
+	 taxaNum = curr_taxon;
+
+       // Check that the number of taxa that might had been specified agrees with the
+       // number of taxa we found now.
+       if (taxaNum != 0 && taxaNum != curr_taxon) // do we have a problem?
+       {
+	 std::cerr << "Parse error while reading the input file:\nThe number of taxa in the first block of the input file ("
+		   << curr_taxon  << ") does not match the number of taxa specified in the header of the phylip file (" << taxaNum << ") " 
+		   << std::endl;
+	 exit(-55);
+       }
+
+       // This line should be blank: Skip blank lines between the blocks
+       while (curr_line_num < all_lines_N && all_lines[curr_line_num]->length()==0)
+       {
+	 ++curr_line_num;
+       }
+
+       // Now we need to read all remaining blocks:
+       while (true)  // (curr_line_num < all_lines_N)
+       {
+	 // Read the next block:
+	 for (curr_taxon=0; curr_taxon < taxaNum; ++curr_taxon)
+	 {
+	   // The current line should be the first line of this block
+	   if (curr_line_num >= all_lines_N)
+	   {
+	     // We are within a block and ran out of lines:
+	     std::cerr << "Parse error while reading the input file:\nUnexpected end of file. More data has been expected." << std::endl;
+	     exit(-46);
+	   }
+	   
+	   currLine       = all_lines[curr_line_num];
+
+	   // Find first character that shall be copied.
+	   char c;
+	   pos = currLine->c_str();
+	   c = *pos;
+	   while (!is_phylip_aa_dna_symbol(c) && !is_allowed_non_ABC(c) )
+	   {
+	     ++pos;
+	     c = *pos;
+	   }
+
+	   // Copy the sequence on this line to our data.
+	   while (*pos)
+	   {
+	     if (*pos != ' ')
+	       sequences[curr_taxon]->push_back(*pos);
+	     ++pos;
+	   }
+	   ++curr_line_num;
+	 } // End of for loop which reads the next block
+	 
+	 // The next line(s) should be blank or we should be at the end of the list of lines
+	 if (curr_line_num < all_lines_N && all_lines[curr_line_num]->length()!=0)
+	 {
+	   std::cerr << "Parse error while reading the input file:\nThe phylip file was interpreted to be in the phylip format."
+                        "Either the number of lines of data in one of the data blocks is not identical to the number of taxa\n"
+	                "or a blank line might be missing between different data blocks in the interleaved format." << std::endl;
+	   std::cerr << "This problem was detected in line " << curr_line_num+1 << " of the file, but it could have occured earlier." << std::endl;
+	   exit(-77);
+	 }
+
+	 while (curr_line_num < all_lines_N && all_lines[curr_line_num]->length()==0)
+	 {
+	   ++curr_line_num;
+	 }
+	 if (curr_line_num >= all_lines_N) // we parsed all lines of the data set.
+	 {
+	   break;
+	 }
+	 // This should be the first line of the next block
+	 currLine = all_lines[curr_line_num];
+	 // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+       } // End while loop read all blocks
+
+       if (taxaNum > 0 && posNum == 0)
+	 posNum = sequences[0]->length();
+
+       // Now we should have read the sequences
+       // and we can delete the data we reserved.
+       for (curr_taxon=0; curr_taxon < taxaNum; ++curr_taxon)
+       {
+	 seq = new CSequence_Mol (datatype);
+	 seq->set_taxon_and_sequence(*taxonnames[curr_taxon], *sequences[curr_taxon], datatype);
+	 add_seq(seq);
+	 delete taxonnames[curr_taxon];
+	 delete sequences[curr_taxon];
+       }
+     } // End interleaved format
+     
+
+     // Do some final error checking
+
+     if (taxaNum == 0)
+     {
+       // delete all faststrings in all_lines
+       for (unsigned ind=0; ind < all_lines.size(); ++ind)
+	 delete all_lines[ind];
+       return 0;
+     }
+
+     unsigned len1 = seqData[0]->length();
+
+     if (len1 != posNum)
+     {
+       std::cerr << "Parse error while reading the input file:\n"
+	         << "The file was interpreted in the " << (read_mode == 's'? "sequential":"interleaved") << " format.\n" 
+	            "The number of positions specified in the file header is not identical to the number of positons\n"
+	            "in the first sequence.\n"
+	            "This can have multiple reasons:\n"
+	            "In the interleaved format, make sure, taxon names only occur in the first block of sequences.\n"
+	            "In the interleaved format a blank line must be found between all blocks of data." << std::endl;
+       std::cerr << "The number of positions in the first sequence is: " << len1
+		 << ", while the number specified in the header is " << posNum << "."<<  std::endl;
+
+       //       std::cerr << seqData[0]->getSeqStr() << std::endl;
+
+       exit(-66);
+     }
+
+     unsigned len2;
+     // Check that the number of positions is correct and equal for all sequences: 
+     for (curr_taxon=1; curr_taxon < taxaNum; ++curr_taxon)
+     {
+       seq = seqData[curr_taxon]; 
+       len2 = seq->length();
+
+       if (len1 != len2)
+       {
+	 std::cerr << "Parse error while reading the input file:\nThe number of residues in sequence " << curr_taxon+1 << " differs from the number of residues in sequence 1. The sequence lengths for sequence 1 and sequence " << curr_taxon+1 
+		   <<  " are respectively " << len1 << " and " << len2 << "." << std::endl;
+       exit(-67);
+       }
+     }
+
+     // Check that the data type is equal for all sequences and that 
+     CSequence_Mol::DataTypesEnum dt_tmp;
+     
+     datatype = seqData[0]->get_datatype();
+     for (curr_taxon=1; curr_taxon < taxaNum; ++curr_taxon)
+     {
+       dt_tmp = seqData[curr_taxon]->get_datatype();
+	
+       if (datatype != dt_tmp)
+       {
+	 std::cerr << "Warning: Not all sequences seem to have the same data type.\n";
+	 datatype = CSequence_Mol::mixed;
+       }
+     }
+    
+     char ambig0, ambig_tmp;
+     ambig0 = seqData[0]->get_ambiguity_character();
+     for (curr_taxon=1; curr_taxon < taxaNum; ++curr_taxon)
+     {
+       ambig_tmp = seqData[curr_taxon]->get_ambiguity_character();
+	
+       if (ambig0 != ambig_tmp)
+       {
+	 std::cerr << "Warning: Not all sequences seem to have the same ambiguity character.\n";
+       }
+     }
+  
+
+
+ 
+/*      // PrintMessage_cerr(seq.getName());PrintMessage_cerr("-\n");PrintMessage_cerr(seq.getFullName());PrintMessage_cerr("-\n");PrintMessage_cerr(seq.getDescription());PrintMessage_cerr("-\n"); */
+/*      if ( infile.fail() && !infile.eof() ) */
+/*      { */
+/*        PrintMessage_cerr("\n\n"); */
+/*        faststring errormsg; */
+/*        errormsg   =  "An error occurred while reading the input file. It might not be a valid fasta file.\n"; */
+/*        errormsg  +=  "File position: line "; */
+/*        errormsg  +=  faststring(infile.line()).c_str(); */
+/*        ErrorMessage(errormsg.c_str()); */
+/*        PrintMessage_cerr("\n"); */
+/*        flush_cerr(); */
+/*        return -25; */
+/*      } */
+     
+/*      if ( count_seq < global_sequence_from || count_seq > global_sequence_to ) */
+/*      { */
+/*        if (false) */
+/*        { */
+/* 	 PrintMessage_cerr("Skipping sequence "); */
+/* 	 PrintMessage_cerr(faststring(count_seq).c_str()); */
+/* 	 PrintMessage_cerr(": "); */
+/* 	 PrintMessage_cerr(seq->getName()); */
+/* 	 PrintMessage_cerr("\n"); */
+/* 	 flush_cerr(); */
+/*        } */
+/*        continue; */
+/*      } */
+     
+/*      PrintMessage_cerr("Processing sequence "); */
+/*      PrintMessage_cerr(faststring(count_seq).c_str()); */
+/*      PrintMessage_cerr(": "); */
+/*      PrintMessage_cerr(seq->getName()); */
+/*      PrintMessage_cerr("\n"); */
+/*      flush_cerr(); */
+     
+/*      seqData.push_back(seq); */
+/*    } // End while */
+   
+     unsigned j;
+     
+     for (j=0; j<all_lines.size(); ++j)
+       delete all_lines[j];
+     
+     return 0;
+   }  // End read_from_Phylip_File
+
+
+   // Normal export to different formats:
+   void ExportSequences(std::ostream &os, char format, unsigned interleaved_len)
+   {
+     if (taxaNum == 0)
+       return;
+
+     // vector of sequences with gaps and stars.
+     // Why do we need a vector here?? 9.9.2912
+     std::vector<faststring> vofs;
+
+     unsigned i;
+
+     for (i=0; i< taxaNum; ++i)
+     {
+       vofs.push_back(faststring('\0', (size_t)10000));
+       seqData[i]->getSequence_fill_in_gaps_and_stars(vofs[i]);
+     }
+
+     if (format=='r') // relaxed phylip
+     {
+       std::vector<faststring> phynames;
+       get_sequence_names(phynames);
+
+       unsigned pos=0;
+       unsigned i;
+
+       for (i=0; i < taxaNum; ++i)
+       {
+	 phynames[i].replace_char(' ', '_');
+       }
+       os << "\t" << taxaNum << "\t" << posNum << std::endl;
+
+       // write first block with sequence names:
+       if (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+           os << phynames[i] << " ";
+           os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	 }
+	 os << std::endl; // Separate blocks
+	 pos += interleaved_len;
+       }
+
+       while (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+           os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	 }
+	 os << std::endl; // Separate blocks
+	 pos += interleaved_len;
+       }
+     }
+     else if (format=='p') // Phylip
+     {
+       std::vector<faststring> uphynames;
+       unique_phylip_names(uphynames);
+
+       unsigned pos=0;
+       unsigned i;
+
+       for (i=0; i<taxaNum; ++i)
+       {
+	 uphynames[i].fill_if_shorter(10, ' ');
+       }
+
+       os << "\t" << taxaNum << "\t" << posNum << std::endl;
+
+       // write first block with sequence names:
+       if (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+           os << uphynames[i] << " ";
+           os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	 }
+	 os << std::endl; // Separate blocks
+	 pos += interleaved_len;
+       }
+
+       while (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+           os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	 }
+	 os << std::endl; // Separate blocks
+	 pos += interleaved_len;
+       }
+     }
+     else if (format=='f')
+     {
+       unsigned pos=0;
+       unsigned i;
+
+       for (i=0; i<taxaNum; ++i)
+       {
+         os << ">" << seqData[i]->getFullName() << std::endl;
+	 pos = 0;
+	 while (pos < posNum)
+	 {
+           os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	   pos += interleaved_len;
+	 }
+       }
+     }
+     else if (format=='n')
+     {
+/*        Begin data; */
+/*        Dimensions ntax=4 nchar=15; */
+/*        Format datatype=dna symbols="ACTG" missing=? gap=-; */
+/*        Matrix */
+/* 	 Species1   atgctagctagctcg */
+/* 	 Species2   atgcta??tag-tag */
+/* 	 Species3   atgttagctag-tgg */
+/* 	 Species4   atgttagctag-tag            */
+/* 	 ; */
+/*        End; */
+
+       os << "Begin data;" << std::endl;
+       os << "Dimensions ntax="<< taxaNum << " nchar="<< posNum << ";" << std::endl;
+       os << "Format datatype="<< seqData[0]->type_as_string()
+	 //  << " symbols=\" "<< <<  "\"" 
+	 << " missing=" << ambig_char << " gap=-;" << std::endl;
+       os << "matrix" << std::endl;
+       
+       unsigned pos=0;
+       unsigned i;
+
+       while (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+           os << "'" << seqData[i]->getName() << "'" << " ";
+           os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	 }
+	 pos += interleaved_len;
+       }
+       os << ";" << std::endl << "end;" << std::endl;
+
+     }
+     else
+     {
+       std::cerr << "Internal error in ExportSequences(std::ostream, char, unsigned):\n"
+	            "Unkown value for format parameter. No output has been generated."
+		 << std::endl;
+     }
+   }
+
+   // Export do different formats with site-filter
+   // Commented out since not finished and not tested.
+/*    void ExportSequences(std::ostream &os, char format, unsigned interleaved_len, */
+/* 			std::vector<unsigned> site_filter) */
+/*    { */
+/*      // TODO: Currently onyl supports fasta without interleaved_len */
+
+/*      if (taxaNum == 0) */
+/*        return; */
+
+/*      // vector of sequences with gaps and stars. */
+/*      // Why do we need a vector here?? 9.9.2912 */
+/*      std::vector<faststring> vofs; */
+
+/*      unsigned i; */
+
+/*      for (i=0; i< taxaNum; ++i) */
+/*      { */
+/*        vofs.push_back(faststring('\0', (size_t)10000)); */
+/*        seqData[i]->getSequence_fill_in_gaps_and_stars(vofs[i]); */
+/*      } */
+
+/*      if (format=='p') // Phylip */
+/*      { */
+/* /\*        std::vector<faststring> uphynames; *\/ */
+/* /\*        unique_phylip_names(uphynames); *\/ */
+
+/* /\*        unsigned pos=0; *\/ */
+/* /\*        unsigned i; *\/ */
+
+/* /\*        os << "\t" << taxaNum << "\t" << posNum << std::endl; *\/ */
+
+/* /\*        while (pos < posNum) *\/ */
+/* /\*        { *\/ */
+/* /\* 	 for (i=0; i<taxaNum; ++i) *\/ */
+/* /\* 	 { *\/ */
+/* /\*            os << uphynames[i] << " "; *\/ */
+/* /\*            os << vofs[i].substr(pos, interleaved_len) << std::endl; *\/ */
+/* /\* 	 } *\/ */
+/* /\* 	 os << std::endl; *\/ */
+/* /\* 	 pos += interleaved_len; *\/ */
+/* /\*        } *\/ */
+/*      } */
+/*      else if (format=='f') */
+/*      { */
+/*        unsigned pos=0; */
+/*        unsigned i; */
+
+/*        for (i=0; i<taxaNum; ++i) */
+/*        { */
+/*          os << ">" << seqData[i]->getFullName() << std::endl; */
+/* 	 pos = 0; */
+/* 	 faststring &seq_ref = vofs[i]; */
+/* 	 while (pos < posNum) */
+/* 	 { */
+/* 	   if (site_filter[pos] != 0) */
+/* 	     os << seq_ref[pos] << std::endl; */
+/* 	   ++pos; */
+/* 	 } */
+/*        } */
+/*      } */
+/*      else if (format=='n') */
+/*      { */
+/* /\*        Begin data; *\/ */
+/* /\*        Dimensions ntax=4 nchar=15; *\/ */
+/* /\*        Format datatype=dna symbols="ACTG" missing=? gap=-; *\/ */
+/* /\*        Matrix *\/ */
+/* /\* 	 Species1   atgctagctagctcg *\/ */
+/* /\* 	 Species2   atgcta??tag-tag *\/ */
+/* /\* 	 Species3   atgttagctag-tgg *\/ */
+/* /\* 	 Species4   atgttagctag-tag            *\/ */
+/* /\* 	 ; *\/ */
+/* /\*        End; *\/ */
+
+/* /\*        os << "Begin data;" << std::endl; *\/ */
+/* /\*        os << "Dimensions ntax="<< taxaNum << " nchar="<< posNum << ";" << std::endl; *\/ */
+/* /\*        os << "Format datatype="<< seqData[0]->type_as_string() *\/ */
+/* /\* 	 //  << " symbols=\" "<< <<  "\""  *\/ */
+/* /\* 	 << " missing=" << ambig_char << " gap=-;" << std::endl; *\/ */
+/* /\*        os << "matrix" << std::endl; *\/ */
+       
+/* /\*        unsigned pos=0; *\/ */
+/* /\*        unsigned i; *\/ */
+
+/* /\*        while (pos < posNum) *\/ */
+/* /\*        { *\/ */
+/* /\* 	 for (i=0; i<taxaNum; ++i) *\/ */
+/* /\* 	 { *\/ */
+/* /\*            os << "'" << seqData[i]->getName() << "'" << " "; *\/ */
+/* /\*            os << vofs[i].substr(pos, interleaved_len) << std::endl; *\/ */
+/* /\* 	 } *\/ */
+/* /\* 	 pos += interleaved_len; *\/ */
+/* /\*        } *\/ */
+/* /\*        os << ";" << std::endl << "end;" << std::endl; *\/ */
+
+/*      } */
+
+/*    } */
+
+
+   void ExportSequences_no_fill_in_ext_phylip_range(std::ostream &os, unsigned begin_exp, unsigned end_exp)
+   {
+     if (taxaNum == 0)
+       return;
+
+     if (end_exp > posNum || end_exp <= begin_exp)
+       return;
+
+     unsigned i;
+     
+     os << "\t" << taxaNum << "\t" << end_exp-begin_exp << std::endl;
+     
+     for (i=0; i<taxaNum; ++i)
+     {
+       os.write(seqData[i]->getName(), seqData[i]->getName_faststring().length());
+       os.put(' ');
+       os.write(seqData[i]->getSeqBegin()+begin_exp, end_exp-begin_exp);
+       os.put('\n');
+     }
+   }
+
+
+   void ExportSequences_no_fill_in_ext_phylip_range(std::ostream &os, unsigned *coords, unsigned num_coord_pairs)
+   {
+     if (taxaNum == 0)
+       return;
+
+     //     if (end_exp > posNum || end_exp <= begin_exp)
+     //       return;
+
+     unsigned i,j, N=0;
+     unsigned begin_exp;
+     unsigned end_exp;     
+
+
+     for (j=0; j<num_coord_pairs; ++j)
+     {
+	 begin_exp = coords[2*j];
+	 end_exp   = coords[2*j+1];
+	 if (end_exp > posNum)
+	   end_exp = posNum;
+	 if (begin_exp < end_exp)
+	   N += end_exp-begin_exp;
+     }
+
+     os << "\t" << taxaNum << "\t" << N << std::endl;
+     
+     for (i=0; i<taxaNum; ++i)
+     {
+       os.write(seqData[i]->getName(), seqData[i]->getName_faststring().length());
+       os.put(' ');
+       for (j=0; j<num_coord_pairs; ++j)
+       {
+	 begin_exp = coords[2*j];
+	 end_exp   = coords[2*j+1];
+	 if (end_exp > posNum)
+	   end_exp = posNum;
+	 if (begin_exp < end_exp)
+	   os.write(seqData[i]->getSeqBegin()+begin_exp, end_exp-begin_exp);
+       }
+       os.put('\n');
+     }
+   }
+
+
+
+   // Not yet well tested!!!!!
+   void Export_Single_Sequence(std::ostream &os, const faststring& fullname,
+			       char format, unsigned interleaved_len)
+   {
+     if (taxaNum == 0)
+       return;
+
+     // vector of sequences with gaps and stars.
+     // Why do we need a vector here?? 9.9.2912
+     std::vector<faststring> vofs;
+
+     unsigned i;
+
+     for (i=0; i< taxaNum; ++i)
+     {
+       vofs.push_back(faststring());
+       if ( seqData[i]->getFullName() == fullname)
+	 seqData[i]->getSequence_fill_in_gaps_and_stars(vofs[i]);
+     }
+
+     if (format=='p') // Phylip
+     {
+       std::vector<faststring> uphynames;
+       unique_phylip_names(uphynames);
+
+       unsigned pos=0;
+       unsigned i;
+
+       for (i=0; i<taxaNum; ++i)
+	 uphynames[i].fill_if_shorter(10, ' ');
+
+       os << "\t" << taxaNum << "\t" << posNum << std::endl;
+
+       while (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+	   if (!vofs[i].empty())
+	   {
+	     os << uphynames[i] << " ";
+	     os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	   }
+	 }
+	 os << std::endl;
+	 pos += interleaved_len;
+       }
+     }
+     else if (format=='f')
+     {
+       unsigned pos=0;
+       unsigned i;
+
+       for (i=0; i<taxaNum; ++i)
+       {
+	 if (!vofs[i].empty())
+	 {
+	   os << ">" << seqData[i]->getFullName() << std::endl;
+	   pos = 0;
+	   while (pos < posNum)
+	   {
+	     os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	     pos += interleaved_len;
+	   }
+	 }
+       }
+     }
+     else if (format=='n')
+     {
+/*        Begin data; */
+/*        Dimensions ntax=4 nchar=15; */
+/*        Format datatype=dna symbols="ACTG" missing=? gap=-; */
+/*        Matrix */
+/* 	 Species1   atgctagctagctcg */
+/* 	 Species2   atgcta??tag-tag */
+/* 	 Species3   atgttagctag-tgg */
+/* 	 Species4   atgttagctag-tag            */
+/* 	 ; */
+/*        End; */
+
+       os << "Begin data;" << std::endl;
+       os << "Dimensions ntax="<< 1 << " nchar="<< posNum << ";" << std::endl;
+       os << "Format datatype="<< seqData[0]->type_as_string()
+	 //  << " symbols=\" "<< <<  "\"" 
+	 << " missing=" << ambig_char << " gap=-;" << std::endl;
+       os << "matrix" << std::endl;
+       
+       unsigned pos=0;
+       unsigned i;
+
+       while (pos < posNum)
+       {
+	 for (i=0; i<taxaNum; ++i)
+	 {
+	   if (!vofs[i].empty())
+	   {
+	     os << seqData[i]->getName() << " ";
+	     os << vofs[i].substr(pos, interleaved_len) << std::endl;
+	   }
+	 }
+	 pos += interleaved_len;
+       }
+       os << ";" << std::endl << "end;" << std::endl;
+
+     }
+
+
+   }
+
+
+
+
+
+   //   void            GetBaseFrequencies(unsigned, std::vector<unsigned>);
+   
+   //   void            initSplits();
+   //   void            computeSplits();
+   //   CSplits         *splits;
+   //   CBasefreq       *basefreq;
+
+   double compute_site_pattern_stat(bool filter_gap_abmig_symbols=true)
+   {
+     unsigned i, j;
+     
+     // Here we will store pointers to all sequences for fast access:
+     const char **tax = new const char* [taxaNum];
+
+     if (taxaNum == 0 || posNum == 0)
+       return 0;
+
+     // Store pointers to all sequences in the tax array - this will be faster
+     for (j=0; j < taxaNum; ++j)
+     {
+       tax[j] = seqData[j]->getSeqStr();
+     }
+
+     faststring tmp;
+     std::map<faststring, unsigned> m;
+
+     bool contains_gap_ambig;
+     char c;
+
+     // For all positions in alignment
+     for (i=0; i<posNum; ++i)
+     {
+       tmp.clear();
+       contains_gap_ambig = false;
+
+       // Old and slow version:
+       // Copy all symbols to site pattern vector
+/*        for (j=0; j < taxaNum; ++j) */
+/*        { */
+/* 	 c = tax[j][i]; */
+/*  	 if (filter_gap_abmig_symbols) */
+/*  	 { */
+/* 	   // Check whether this is a position we do not want to consider. */
+/*  	   if (datatype == CSequence_Mol::dna && (is_DNA_iupac_ambig(c) || c == '-') ) */
+/*  	   { */
+/* 	     contains_gap_ambig = true; */
+/*  	   } */
+/* 	   else */
+/* 	   { */
+/* 	     if (datatype == CSequence_Mol::protein && (is_aa_ambig(c) || c == '-') ) */
+/* 	     { */
+/* 	       contains_gap_ambig = true; */
+/* 	     } */
+/* 	   } */
+/*  	 } // END if (filter_gap_abmig_symbols) */
+/* 	 tmp.push_back(c); */
+/*        } // END: For all taxa */
+
+       // Faster version:
+       if (filter_gap_abmig_symbols && datatype == CSequence_Mol::dna)
+       {
+	 for (j=0; j < taxaNum; ++j) // Copy all symbols to site pattern vector
+	 {
+	   c = tax[j][i];
+	   if (is_DNA_iupac_ambig(c) || c == '-')
+ 	   {
+	     contains_gap_ambig = true;
+ 	   }
+	   tmp.push_back(c);
+	 }
+       }
+       else if (filter_gap_abmig_symbols && datatype == CSequence_Mol::protein)
+       {
+	 for (j=0; j < taxaNum; ++j) // Copy all symbols to site pattern vector
+	 {
+	    c = tax[j][i];
+	   if (is_aa_ambig(c) || c == '-')
+ 	   {
+	     contains_gap_ambig = true;
+ 	   }
+	   tmp.push_back(c);
+	 }
+       }
+       else
+       {
+	 for (j=0; j < taxaNum; ++j) // Copy all symbols to site pattern vector
+	 {
+	    c = tax[j][i];
+	    tmp.push_back(c);
+	 } 
+       }
+       if (!contains_gap_ambig)  
+	 add_or_count(m, tmp);
+     } // END: for all positions in alignment
+
+     std::map<faststring, unsigned>::iterator it, it_end;
+     it     = m.begin();
+     it_end = m.end();
+
+     double res=0;
+     double x;
+
+     // Formula from "Statistical Tests of Models of DNA Substitution", Journal of Molecular Evolution, Springer-Verlag NewYork Inc. 1993
+     // Nick Goldman
+     // Formula: \sum   N_i*ln(N_i) - N*ln(N), where N_i are the pattern frequencies and N ist the total number of sites.
+
+     while (it != it_end)
+     {
+       x = it->second;
+       if (x > 0)
+	 res += x*log(x);
+       //       std::cout << x << " " << res << std::endl;
+       ++it;
+     }
+     delete [] tax;
+
+     x = posNum;
+     res -= x*log(x);
+     //     std::cout << x << " " << res << std::endl;
+
+     return res;
+   } // END compute_site_pattern_stat(bool filter_gap_abmig_symbols=true)
+
+
+   double compute_site_pattern_stat(std::map<faststring, unsigned> &m, bool filter_gap_abmig_symbols=true)
+   {
+     unsigned i, j;
+     m.clear();
+     
+     // Here we will store pointers to all sequences for fast access:
+     const char **tax = new const char* [taxaNum];
+
+     if (taxaNum == 0 || posNum == 0)
+       return 0;
+
+     // Store pointers to all sequences in the tax array - this will be faster
+     for (j=0; j < taxaNum; ++j)
+     {
+       tax[j] = seqData[j]->getSeqStr();
+     }
+
+     faststring tmp;
+
+     bool contains_gap_ambig;
+     char c;
+
+     // For all positions in alignment
+     for (i=0; i<posNum; ++i)
+     {
+       tmp.clear();
+       contains_gap_ambig = false;
+
+       // Old and slow version:
+       // Copy all symbols to site pattern vector
+/*        for (j=0; j < taxaNum; ++j) */
+/*        { */
+/* 	 c = tax[j][i]; */
+/*  	 if (filter_gap_abmig_symbols) */
+/*  	 { */
+/* 	   // Check whether this is a position we do not want to consider. */
+/*  	   if (datatype == CSequence_Mol::dna && (is_DNA_iupac_ambig(c) || c == '-') ) */
+/*  	   { */
+/* 	     contains_gap_ambig = true; */
+/*  	   } */
+/* 	   else */
+/* 	   { */
+/* 	     if (datatype == CSequence_Mol::protein && (is_aa_ambig(c) || c == '-') ) */
+/* 	     { */
+/* 	       contains_gap_ambig = true; */
+/* 	     } */
+/* 	   } */
+/*  	 } // END if (filter_gap_abmig_symbols) */
+/* 	 tmp.push_back(c); */
+/*        } // END: For all taxa */
+
+       // Faster version:
+       if (filter_gap_abmig_symbols && datatype == CSequence_Mol::dna)
+       {
+	 for (j=0; j < taxaNum; ++j) // Copy all symbols to site pattern vector
+	 {
+	   c = tax[j][i];
+	   if (is_DNA_iupac_ambig(c) || c == '-')
+ 	   {
+	     contains_gap_ambig = true;
+ 	   }
+	   tmp.push_back(c);
+	 }
+       }
+       else if (filter_gap_abmig_symbols && datatype == CSequence_Mol::protein)
+       {
+	 for (j=0; j < taxaNum; ++j) // Copy all symbols to site pattern vector
+	 {
+	    c = tax[j][i];
+	   if (is_aa_ambig(c) || c == '-')
+ 	   {
+	     contains_gap_ambig = true;
+ 	   }
+	   tmp.push_back(c);
+	 }
+       }
+       else
+       {
+	 for (j=0; j < taxaNum; ++j) // Copy all symbols to site pattern vector
+	 {
+	    c = tax[j][i];
+	    tmp.push_back(c);
+	 } 
+       }
+       if (!contains_gap_ambig)  
+	 add_or_count(m, tmp);
+     } // END: for all positions in alignment
+
+     std::map<faststring, unsigned>::iterator it, it_end;
+     it     = m.begin();
+     it_end = m.end();
+
+     double res=0;
+     double x;
+
+     while (it != it_end)
+     {
+       x = it->second;
+       if (x > 0)
+	 res += x*log(x);
+       //       std::cout << x << " " << res << std::endl;
+       ++it;
+     }
+     delete [] tax;
+
+     x = posNum;
+     res -= x*log(x);
+     //     std::cout << x << " " << res << std::endl;
+
+     return res;
+   }
+
+
+
+   void get_partial_pattern(unsigned pos, unsigned n, faststring &pat)
+   {
+     unsigned i;
+
+     if (n > taxaNum)
+       n = taxaNum;
+
+     pat.clear();
+     for(i=0; i<n; ++i)
+       pat.push_back((seqData[i]->getSeqStr())[pos]);
+   }
+
+
+
+   // Does not yet provide the possibility to remove amig positions.
+   void get_vector_of_site_pattern_frequencies(fastvector<unsigned> &spf)
+   {
+     unsigned i, j;
+     
+     const char **tax = new const char* [taxaNum];
+
+     for (j=0; j < taxaNum; ++j)
+     {
+       tax[j] = seqData[j]->getSeqStr();
+     }
+
+     faststring tmp;
+     std::map<faststring, unsigned> m;
+
+     for (i=0; i<posNum; ++i)
+     {
+       tmp.clear();
+
+       for (j=0; j < taxaNum; ++j)
+       {
+	 tmp.push_back(tax[j][i]);
+       }
+       add_or_count(m, tmp);
+     }
+     std::map<faststring, unsigned>::iterator it, it_end;
+     it     = m.begin();
+     it_end = m.end();
+
+     while (it != it_end)
+     {
+       spf.push_back(it->second);
+       ++it;
+     }
+     delete [] tax;
+   }
+
+   void clear(CSequence_Mol::DataTypesEnum     datatype_param = CSequence_Mol::unknown,
+	      char ambig_char_param = '?')
+   {
+     taxaNum    = 0;
+     posNum     = 0;
+     ambig_char = ambig_char_param;
+     datatype   = datatype_param;
+
+     originalPosNumbers.clear();
+     originalPosNumbers_supplied = false;
+
+     int i, n=seqData.size();
+
+     // Recently resolved memory leak:
+     for (i=0; i<n; ++i)
+         delete seqData[i];
+
+     seqData.clear();
+     sn_map.clear();
+   }
+
+   void remove_gap_only_sequences()
+   {
+     int i, n=seqData.size();
+
+     // We do this in reversed order, since this avoids adapting i and n after
+     // an element has been removed.    
+     for (i=n-1; i>=0; --i)
+     {
+       if (seqData[i]->has_only_gaps() )
+       {
+	 remove_del(i);
+       }
+     }
+   }
+
+   void remove_ambig_only_sequences()
+   {
+     int i, n = seqData.size();
+    
+     // We do this in reversed order, since this avoids adapting i and n after
+     // an element has been removed.
+     for (i=n-1; i>=0; --i)
+     {
+       if (seqData[i]->has_only_ambigs() )
+       {
+	 remove_del(i);
+       }
+     }
+   }
+
+   void remove_gap_or_ambig_only_sequences()
+   {
+     int i, n = seqData.size();
+
+     // We do this in reversed order, since this avoids adapting i and n after
+     // an element has been removed.
+     for (i=n-1; i>=0; --i)
+     {
+       //              std::cout << "Checking sequence: " << i+1 << std::endl;
+       if (seqData[i]->has_only_ambigs_or_gap() )
+       {
+	 remove_del(i);
+       }
+     }
+   }
+
+   void steal_sequence(CSequences2 &seqs, unsigned i)
+   {
+     if (i < seqs.taxaNum)
+     {
+       add_seq(seqs.seqData[i]);
+       seqs.remove(i);
+     }
+   }
+
+   void remove_del(unsigned seq_num)
+   {
+     CSequence_Mol *p = seqData[seq_num];
+     faststring sname = p->getName();
+
+     --taxaNum;
+     seqData.erase(seqData.begin()+seq_num);
+     std::map<faststring, CSequence_Mol*>::iterator find_it = sn_map.find(sname);
+     if (find_it != sn_map.end() )
+       sn_map.erase(find_it);
+     delete p;
+   }
+
+   CSequence_Mol* remove(unsigned seq_num)
+   {
+     CSequence_Mol *p = seqData[seq_num];
+     faststring sname = p->getName();
+
+     --taxaNum;
+     seqData.erase(seqData.begin()+seq_num);
+     std::map<faststring, CSequence_Mol*>::iterator find_it = sn_map.find(sname);
+     if (find_it != sn_map.end() )
+       sn_map.erase(find_it);
+     return p;
+   }
+
+   void add_seq_to_alignment(CSequence_Mol::DataTypesEnum     datatype_param,
+                             const faststring                  &fullname_param,
+                             const faststring                  &seq_data_param,
+			     char                              ambig_param='\0' // default auto
+			    )
+   {
+     if (datatype != datatype_param)
+     {
+	 std::cerr << "Warning: Not all sequences seem to have the same data type.\n";
+	 datatype = CSequence_Mol::mixed;
+     }
+
+     //     std::cout << "datatype_param: " << datatype_param  << std::endl;
+
+     // Handle general ambig TODO XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+     //     if (general_ambig == CSequence_Mol::unknown)
+
+     CSequence_Mol   *seq;
+     seq = new CSequence_Mol (datatype_param, ambig_param);
+     //     std::cout << "Datatype after constructor: " << seq->get_datatype() << std::endl;
+     seq->set_taxon_and_sequence(fullname_param, seq_data_param, datatype_param);
+     //     std::cout << "Datatype after constructor+set_taxon_and_sequence: " << seq->get_datatype() << std::endl;
+
+
+
+
+     ++taxaNum;
+     if (posNum == 0)
+       posNum = seq->length();
+     else if (posNum != seq->length())
+     {
+       std::cerr << "Error: Sequence added has different length than existing sequences." << std::endl;
+       delete seq;
+       return;
+     }
+
+     add_seq(seq);
+
+     // Further autodetect stuff???????
+
+
+   }
+
+
+   void alignment_without_gap_N_positions(CSequences2 &seqs)
+   {
+     seqs.clear(datatype, seqs.ambig_char);
+
+     std::vector<bool> gap_N_positions(posNum, false);
+
+     size_t i, j;
+     const char *the_seq;
+     char c;
+
+     if (datatype == CSequence_Mol::dna)
+     {
+       for (i=0; i< taxaNum; ++i)
+       {
+	 the_seq = seqData[i]->getSeqStr();
+	 for(j=0; j<posNum; ++j)
+	 {
+	   c = the_seq[j];
+	   if (is_DNA_iupac_ambig(c) || c == '-')
+	   {
+	     gap_N_positions[j] = true;
+	   }
+	 }
+       }
+     }
+
+     if (datatype == CSequence_Mol::protein)
+     {
+       for (i=0; i< taxaNum; ++i)
+       {
+	 the_seq = seqData[i]->getSeqStr();
+	 for(j=0; j<posNum; ++j)
+	 {
+	   c = the_seq[j];
+	   if (is_aa_ambig(c) || c == '-')
+	   {
+	     gap_N_positions[j] = true;
+	   }
+	 }
+       }
+     }
+
+     faststring new_seq;
+
+     for (i=0; i< taxaNum; ++i)
+     {
+       new_seq.clear();
+       the_seq = seqData[i]->getSeqStr();
+
+       for(j=0; j<posNum; ++j)
+       {
+	 if (!gap_N_positions[j])
+	   new_seq.push_back(the_seq[j]);
+       }
+       seqs.add_seq_to_alignment(datatype, seqData[i]->getFullName(), new_seq, seqData[i]->get_ambiguity_character() );
+     }
+   }
+
+
+   void alignment_without_gap_only_positions(CSequences2 &seqs)
+   {
+     //     std::cout << "Entering alignment_without_gap_only_positions" << std::endl;
+
+     seqs.clear(datatype, ambig_char);
+
+     // Count the number of gaps at all positions.
+     // Gap only positions are those that have taxaNum gaps.
+     std::vector<unsigned> gap_positions(posNum, 0);
+
+     size_t i, j;
+     const char *the_seq;
+     char c;
+
+     for (i=0; i< taxaNum; ++i)
+     {
+       the_seq = seqData[i]->getSeqStr();
+       for(j=0; j<posNum; ++j)
+       {
+	 c = the_seq[j];
+	 if (c == '-')
+	 {
+	   ++gap_positions[j];
+	 }
+       }
+     }
+
+     faststring new_seq_str;
+
+     for (i=0; i< taxaNum; ++i)
+     {
+       new_seq_str.clear();
+       the_seq = seqData[i]->getSeqStr();
+
+       for(j=0; j<posNum; ++j)
+       {
+	 if (gap_positions[j] != taxaNum) // only gaps
+	   new_seq_str.push_back(the_seq[j]);
+       }
+       seqs.add_seq_to_alignment(datatype,seqData[i]->getFullName(),new_seq_str,
+				 seqData[i]->get_ambiguity_character());
+     }
+/*      std::cout << "DEBUGOUT-alignment_without_gap_only_positions" << std::endl; */
+/*      seqs.print_DEBUG(std::cout,3); */
+   }
+
+
+   void replace_sequence_interval(const CSequences2 &s, unsigned pos1=0, unsigned pos2=-1u) 
+   {
+     determine_map_of_sequence_names();
+
+     faststring name;
+     unsigned i, N = s.seqData.size();
+     std::map<faststring, CSequence_Mol*>::iterator find_it;
+ 
+    if (taxaNum != s.taxaNum)
+     {
+ 	 std::cerr << "Critical error in replace_sequence_interval: Number of taxa are not equal"
+		   << std::endl;
+	 exit(-1);       
+     }
+
+     for (i=0; i<N; ++i)
+     {
+       name = s.seqData[i]->getName();
+       find_it = sn_map.find(name);
+       if (find_it == sn_map.end())
+       {
+	 std::cerr << "Critical error in replace_sequence_interval: Sequence "
+		   << name << " does not exist." << std::endl;
+	 exit(-1); 
+       }
+       find_it->second->replace_part_of_sequence(*(s.seqData[i]), pos1, pos2);
+     }
+     if (seqData.size() > 0)
+       posNum = seqData[0]->length();
+   }
+
+   void append_to_sequences(const CSequences2 &s) 
+   {
+     determine_map_of_sequence_names();
+
+     faststring name;
+     unsigned i,N=s.seqData.size();
+     std::map<faststring, CSequence_Mol*>::iterator find_it;
+
+     if (taxaNum != s.taxaNum)
+     {
+ 	 std::cerr << "Critical error in append_sequences: Number of taxa are not equal"
+		   << std::endl;
+	 exit(-1);       
+     }
+
+     for (i=0; i<N; ++i)
+     {
+       name = s.seqData[i]->getName();
+       find_it = sn_map.find(name);
+       if (find_it == sn_map.end())
+       {
+	 std::cerr << "Critical error in append_sequences: Sequence "
+		   << name << " does not exist." << std::endl;
+	 exit(-1); 
+       }
+       find_it->second->append_sequence(*(s.seqData[i]));
+     }
+     if (seqData.size() > 0)
+       posNum = seqData[0]->length();
+   }
+
+   void append_to_sequences(const faststring &site_pattern)
+   {
+     unsigned i;
+
+     if ( taxaNum != site_pattern.size() )
+     {
+       std::cerr << "Error when calling the append_to_sequences method:\n"
+	            "the number of sites in the pattern that shall be\n"
+                    "appended the sequences ofject differs from the\n"
+	            "number of sequences. This pattern will not be appended." << std::endl; 
+       exit(-22);
+     }
+     for (i=0; i<taxaNum; ++i)
+     {
+       seqData[i]->append_residue_unchecked(site_pattern[i]);
+     }
+     ++posNum;
+   }
+
+
+   bool is_insertion_column(unsigned col_pos)
+   {
+     unsigned i_tax;
+     char c;
+
+     for (i_tax=0; i_tax<taxaNum; ++i_tax)
+     {
+       c = seqData[i_tax]->get_pos(col_pos);
+       if (c == '.' || (c >='a' && c <= 'z') )
+	 return true;
+     }
+     return false;
+   }
+
+
+   bool is_mainly_gap_pos(unsigned col_pos, double min_prop)
+   {
+     unsigned i_tax;
+     char c;
+     unsigned count_gap= 0;
+
+     for (i_tax=0; i_tax<taxaNum; ++i_tax)
+     {
+       c = seqData[i_tax]->get_pos(col_pos);
+       if (c == '-' || c == '.')
+	 ++count_gap;
+     }
+     if ((float)count_gap/taxaNum >= min_prop)
+       return true;
+     else
+       return false;
+   }
+
+
+   // Assumes that insertion positions have lower case characters
+   // and they could have dots '.' instead of gaps.
+   // The letter is not necessary, since insertion positions should
+   // at least have one lower case character.
+   // So dots could have been replaced by gaps already.
+   unsigned get_next_insertion_column(unsigned col_pos)
+   {
+     for (; col_pos < posNum; ++col_pos)
+       if (is_insertion_column(col_pos))
+	 return col_pos;
+     return col_pos;
+   }
+
+   unsigned get_next_insertion_or_mainly_gap_column(unsigned col_pos, float min_gap_prop)
+   {
+     for (; col_pos < posNum; ++col_pos)
+       if (is_insertion_column(col_pos) || is_mainly_gap_pos(col_pos, min_gap_prop))
+	 return col_pos;
+     return col_pos;
+   }
+
+   // Assumes that non insertion positions have upper case characters.
+   // If dots have already been converted to gaps, they are not
+   // indicative of non insertion positions!!
+   unsigned get_next_non_insertion_column(unsigned col_pos)
+   {
+     for (; col_pos < posNum; ++col_pos)
+       if (!is_insertion_column(col_pos))
+	 return col_pos;
+	 //	 if (c == '.' || c >='a' && c <= 'z') // Not a non-insertion column
+     return col_pos;
+   }
+
+   unsigned get_next_non_insertion_and_non_mainly_gap_column(unsigned col_pos, float  min_gap_prop)
+   {
+     for (; col_pos < posNum; ++col_pos)
+       if (!(is_insertion_column(col_pos) || is_mainly_gap_pos(col_pos, min_gap_prop)) )
+	 return col_pos;
+	 //	 if (c == '.' || c >='a' && c <= 'z') // Not a non-insertion column
+     return col_pos;
+   }
+
+   // RETURN VALUE NEEDS TO BE SET. DO NOT USE IN THIS FORM.
+/*    void get_bp_entropies_nucleotide(double *ent) */
+/*    { */
+/*      const char **tax = new const char* [taxaNum]; */
+/*      unsigned  j; */
+
+/*      if (taxaNum == 0 || posNum == 0) */
+/*        return; */
+
+/*      // Store pointers to all sequences in the tax array - this will be faster */
+/*      for (j=0; j < taxaNum; ++j) */
+/*      { */
+/*        tax[j] = seqData[j]->getSeqStr(); */
+/*      } */
+/*    } */
+
+   // Computes relative amount of residues that are non gap and non ambig in this range:
+   double get_non_ambig_non_gap_coverage_in_range(unsigned pos, unsigned pos_end, int flag=0)
+   {
+     const char **tax = new const char* [taxaNum];
+     unsigned i, j;
+     unsigned N = 0;
+
+
+     if (taxaNum == 0 || posNum == 0)
+       return -1; // Indicates an error
+
+     // Store pointers to all sequences in the tax array - this will be faster
+     if (flag == 0 || flag == 1) // 1kite all or general mode
+     {
+       N = taxaNum;
+       for (j=0; j < taxaNum; ++j)
+       {
+	 tax[j] = seqData[j]->getSeqStr();
+       }
+     }
+     else if (flag == 13) // Special 1kite flag: Filter hamstered reference taxa:
+     {
+#ifdef DEBUG
+       std::cerr << "Called: CSequences2.h:get_non_ambig_non_gap_coverage_in_range with flag==1" << std::endl;
+#endif
+
+       unsigned jj=0;
+
+       for (j=0; j < taxaNum; ++j)
+       {
+	 // In case we compute coverage values, we only have hamstered reference taxa left in 1kite:
+	 if (is_1kite_hamstered_reference_seq_id(seqData[j]->getFullName() ) )
+	 {
+	   tax[jj] = seqData[j]->getSeqStr();
+	   ++jj;
+	 }
+       }
+       N = jj;
+     }
+     else
+     {
+       return -1; // Indicates an error
+     }
+
+
+     unsigned count_all=0;
+     unsigned count_non_ambig_non_gap=0;
+     double   res;
+     char     c;
+
+     if (datatype ==  CSequence_Mol::protein)
+     {
+       for (i =pos; i< pos_end && i < posNum; ++i)
+       {
+	 for (j=0; j< N; ++j)
+	 {
+	   c = tax[j][i];
+	   ++count_all;
+	   if ( !(is_aa_ambig(c) || c == '-') )
+	     ++count_non_ambig_non_gap;
+	 }
+       }
+     }
+     else if (datatype ==  CSequence_Mol::dna)
+     {
+       for (i =pos; i< pos_end && i < posNum; ++i)
+       {
+	 for (j=0; j< taxaNum; ++j)
+	 {
+	   c = tax[j][i];
+	   ++count_all;
+	   if ( !(is_DNA_iupac_ambig(c) || c == '-' ) )
+	     ++count_non_ambig_non_gap;
+	 }
+       }
+     }
+     res = count_non_ambig_non_gap;
+     res /= count_all;
+
+     //          std::cerr << count_non_ambig_non_gap << std::endl;
+     //          std::cerr << count_all               << std::endl;
+
+     return res;
+   }
+
+
+
+   void get_1kite_original_reference_taxa_vec(std::vector<faststring> &vec) const
+   {
+#ifdef DEBUG
+       std::cerr << "Called: CSequences2.h:get_1kite_original_reference_taxa_vec" << std::endl;
+#endif
+     unsigned i;
+
+     for (i=0; i < taxaNum; ++i)
+     {
+       if ( is_1kite_hamstered_reference_seq_id( seqData[i]->getFullName() ) )
+       {
+	 vec.push_back(seqData[i]->getFullName() );
+       }
+     }
+   }
+
+   // Determines all 1kite original reference taxa, sorts them and moves them to the top of the alignment.
+   int move_1kite_original_reference_taxa_sorted_to_top()
+   {
+#ifdef DEBUG
+     std::cerr << "Called: CSequences2.h:move_1kite_original_reference_taxa_sorted_to_top" << std::endl;
+#endif
+
+     std::vector<faststring> vec;
+     get_1kite_original_reference_taxa_vec(vec);
+     std::sort(vec.begin(), vec.end());
+
+     int i;
+
+     for (i=vec.size()-1; i>= 0; --i)
+     {
+       reorder_move_seq_to_top(vec[i]);
+     }
+     return vec.size();
+   }
+
+
+/*    int move_1kite_core_of_other_seqs_to_top(const CSequences2 &other_seqs) */
+/*    { */
+/* #ifdef DEBUG */
+/*      std::cerr << "Called: CSequences2.h:move_1kite_core_of_other_seqs_to_top" << std::endl; */
+/* #endif */
+
+/*      std::vector<faststring> vec; */
+
+/*      other_seqs.get_1kite_cores_vec(vec); */
+     
+/*      int i; */
+
+/*      for (i=vec.size()-1; i>= 0; --i) */
+/*      { */
+/*        reorder_move_seq_to_top(vec[i]); */
+/*      } */
+/*      return vec.size(); */
+/*    } */
+
+
+
+   // Currently only implemented for datatype DNA
+   //  Allowed flag values:
+   // 0:  normal mode
+   // 1:  Gap regions always get a distance of -3
+   // 2:  Compute gap distance, i.e. count gap versus non-gap nucleotides.
+   // The result is in the range from 0..1.
+   // Ns are treated as mismatch. If this is not desired, use the other overwrite of this function below.
+   double sequence_distance(unsigned s1, unsigned s2, unsigned begin_range, unsigned end_range, unsigned flag=0)
+   {
+     char   c1, c2;
+
+     if (s1 >= taxaNum || s2 >= taxaNum)
+       return -1;
+
+     CSequence_Mol* seq1 = seqData[s1];
+     CSequence_Mol* seq2 = seqData[s2];
+
+     // Do some range checks:
+     if (end_range < begin_range) // This is considered a major error and the caller should correct this problem.
+     {
+       std::cerr << "Error in sequence_distance: end_range < begin_range" << std::endl;
+       exit(-33);
+     }
+
+     // Out of range checks are corrected silently.
+     // It is not clear this is always the best method to deal with this.
+     if ((end_range > seq1->length()))
+     {
+       end_range = seq1->length();
+       if (begin_range > seq1->length())
+	 begin_range = seq1->length();
+     }
+     if ((end_range > seq2->length()))
+     {
+       end_range = seq2->length();
+       if (begin_range > seq2->length())
+	 begin_range = seq2->length();
+     }
+     
+     unsigned i = begin_range;
+
+     unsigned len  = 0;
+     unsigned diff = 0;
+
+     if (flag < 2)
+     {
+       if (seq1->get_datatype() != CSequence_Mol::dna)
+	 return -2;
+
+       while (i != end_range)
+       {
+	 // TODO: DO WE NEED TOUPPER??
+	 c1 = toupper(seq1->get_pos(i));
+	 c2 = toupper(seq2->get_pos(i));
+
+	 if (c1 != '-' && c2 != '-')
+	 {
+	   ++len;
+	   if (c1 != c2 || c1 == 'N') // If they differ or if both are Ns we count this as a difference.
+	   {
+	     ++diff;
+	   }
+	 }
+	 else
+	 {
+	   if (flag == 1)
+	     return -3.0;
+	 }
+	 ++i;
+       }
+       if (len == 0)
+       {
+	 diff = 2;
+	 len  = 1;
+       }
+       return (double)diff / (double)len;
+     }
+     else if (flag == 2)
+     {
+       //       len = end_range - begin_range;
+
+       while (i != end_range)
+       {
+	 // TODO: DO WE NEED TOUPPER??
+	 c1 = toupper(seq1->get_pos(i));
+	 c2 = toupper(seq2->get_pos(i));
+
+	 // We only count differences in the gap structur: Non-gap versus gap.
+	 if ( (c1 == '-' && c2 != '-') || (c1 != '-' && c2 == '-') )
+	 {
+	   ++diff;
+	 }
+	 ++i;
+       }
+       return diff;
+     }
+     else
+     {
+       std::cerr << "Flag value undefined in CSequences2:sequence_distance(..);" << std::endl;
+       exit(-127);
+     }
+   }
+
+
+
+
+   // Currently only implemented for datatype DNA
+   // Note: N positions are not counted if the other sequence contains a gap.
+   // In this case only the gap and not the N is counted, since the sequence positions
+   // are not comparable.
+   // The function does to compute the distance but the length, differences, gaps
+   // and Ns positions.
+   // Note: length_comparable_nucleotieds + gaps_extensions + Ns must add up to
+   //       the length of the range.
+   void sequence_distance(unsigned s1, unsigned s2, unsigned begin_range, unsigned end_range,
+			  unsigned &differences,  unsigned &length_comparable_nucleotieds,
+			  unsigned &gap_openings, unsigned &gaps_extensions, unsigned &Ns)
+   {
+     unsigned i = begin_range;
+     char     c1, c2;
+
+     if (s1 >= taxaNum || s2 >= taxaNum)
+     {
+       differences = -1;
+       return;
+     }
+
+     CSequence_Mol* seq1 = seqData[s1];
+     CSequence_Mol* seq2 = seqData[s2];
+
+     if (end_range < begin_range)
+     {
+       std::cerr << "Error in sequence_distance: end_range < begin_range" << std::endl;
+       exit(-33);
+     }
+
+     if ((end_range - begin_range > seq1->length()) || (end_range - begin_range > seq2->length()) )
+     {
+       end_range = begin_range + seq1->length();
+       if (end_range - begin_range > seq2->length())
+	 end_range = begin_range + seq2->length();
+     }
+
+     unsigned local_len           = 0;
+     unsigned local_numgapsopen   = 0;
+     unsigned local_numgapext     = 0;
+     unsigned local_differences   = 0;
+     unsigned local_numNs         = 0;
+     bool     in_gap        = false;
+
+     if (seq1->get_datatype() != CSequence_Mol::dna)
+     {
+       differences = -2;
+       return;
+     }
+
+
+     while (i != end_range)
+     {
+       // TODO: DO WE NEED TOUPPER??
+       c1 = toupper(seq1->get_pos(i));
+       c2 = toupper(seq2->get_pos(i));
+
+       if (c1 == '-' || c2 == '-')
+       {
+	 if (!in_gap)
+	 {
+	   ++local_numgapsopen;
+	   in_gap = true;
+	 }
+	 ++local_numgapext;
+       }
+       else
+       {
+	 in_gap = false;
+	 if (c1 == 'N' || c2 == 'N')
+	   ++local_numNs;
+	 else
+	 {
+	   ++local_len;
+	   if (c1 != c2)
+	     ++local_differences;
+	 }
+       }
+       ++i;
+     }
+
+     differences                   = local_differences;
+     length_comparable_nucleotieds = local_len;
+     gap_openings                  = local_numgapsopen;
+     gaps_extensions               = local_numgapext;
+     Ns                            = local_numNs;
+   }
+
+
+   // Currently only implemented for datatype DNA
+   //  Allowed flag values:
+   // 0: normal mode.
+   // 1: Gap regions always get a distance of -3.
+   void get_sequences_distances(unsigned begin_range, unsigned end_range, void (*call_back_distance)(short, short, double), unsigned flag=0)
+   {
+     // Compute all pairwise distances:
+     short N = taxaNum;
+     short i, j;
+     double dist;
+     
+     for (i=0; i<N; ++i)
+     {
+       for (j=i+1; j<N; ++j)
+       {
+	 dist = sequence_distance(i, j, begin_range, end_range, flag);
+	 call_back_distance(i,j,dist);
+       }
+     }
+   }
+
+   // Same as above, but for some distances, those that have a false value in vector
+   // we assign an invalidly large value to the distance.
+   // Here a value of 100 is assigned to those distances
+   void get_sequences_distances(unsigned begin_range, unsigned end_range, void (*call_back_distance)(short, short, double), const std::vector<bool> &sequences_valid, unsigned flag=0)
+   {
+     // Compute all pairwise distances:
+     unsigned N = taxaNum;
+     unsigned i, j;
+     double dist;
+     
+     if (sequences_valid.size() != N)
+     {
+       std::cerr << "Critical internal error: In function get_sequences_distances the size of the vector sequences_valid must be equal to the number of sequences in the sequences object." << std::endl;
+       exit(-3);
+     }
+
+     for (i=0; i<N; ++i)
+     {
+       for (j=i+1; j<N; ++j)
+       {
+	 if (!sequences_valid[i] || !sequences_valid[j])
+	 {
+	   dist = 100;
+	 }
+	 else
+	 {
+	   dist = sequence_distance(i, j, begin_range, end_range, flag);
+	 }
+	 call_back_distance(i,j,dist);
+       }
+     }
+   }
+
+
+   CSequence_Mol* get_sequence_with_sequence_name_match(faststring &partial_name)
+   {
+     unsigned i;
+
+     for (i=0; i < taxaNum; ++i)
+     {
+       if ( seqData[i]->getFullName_faststring().find(partial_name) != faststring::npos )
+       {
+	 return seqData[i];
+       }
+     }
+     return NULL;
+   }
+   
+   void get_alignment_as_copy(std::vector<faststring> &v)
+   {
+     v.clear();
+     v.reserve(taxaNum+1);
+
+     unsigned i;
+     for (i=0; i<taxaNum; ++i)
+     {
+       v.push_back(seqData[i]->getSeq_faststring());
+       v[i].c_str();  // Make buffer 0-teminated.
+     }
+   }
+
+};
+
+
+
+// inline CSequences::CSequences():posNum(0),datatype(0),splits(NULL){}
+
+
+//inline string    CSequences::GetTaxonLabel(unsigned i)
+//                             {return taxa.GetTaxonLabel(i);}
+//inline void      CSequences::SetTaxonLabel(unsigned i, string s)
+//                             {taxa.SetTaxonLabel(i,s);}
+
+
+
+
+
+
+/* inline void PrintSpecial_TaxaSeq(ostream& os, */
+/* 			  const std::vector<unsigned>& taxa_vec, */
+/* 			  const std::vector<unsigned>& pos_vec, */
+/* 			  const CTaxa       *ptaxa, */
+/* 			  const CSequences2 *pseq, */
+/* 			  const char*      symbolsList, */
+/* 			  bool       printTaxonLabels, */
+/* 			  unsigned   taxonLabelPrintWidth, */
+/* 			  unsigned   maxTaxonLabelLength) */
+/* { */
+/*   std::vector<unsigned>::const_iterator taxa_vec_it; */
+/*   std::vector<unsigned>::const_iterator taxa_vec_end = taxa_vec.end(); */
+
+/*   std::vector<unsigned>::const_iterator pos_vec_it; */
+/*   std::vector<unsigned>::const_iterator pos_vec_end = pos_vec.end(); */
+
+/*   unsigned theTaxonNumber; */
+
+/*   std::ios_base::fmtflags orig_ios_flag = os.flags(); */
+/*   os.flags(orig_ios_flag | ios::left); */
+
+/*   for (taxa_vec_it=taxa_vec.begin(); taxa_vec_it!=taxa_vec_end; ++taxa_vec_it) */
+/*   { */
+/*     theTaxonNumber = *taxa_vec_it; */
+
+/*     if (printTaxonLabels) */
+/*     { */
+/*       os.width(maxTaxonLabelLength); */
+/*       faststring tl = ptaxa->GetTaxonLabel(theTaxonNumber); */
+/*       tl.shorten(maxTaxonLabelLength); */
+/*       os << tl; */
+/*       int morespaces = (int)taxonLabelPrintWidth-(int)maxTaxonLabelLength; */
+
+/*       if ( morespaces > 0 ) */
+/* 	{ */
+/* 	  os.width(morespaces); */
+/* 	  os << " "; */
+/* 	} */
+/*     } */
+
+/*     for (pos_vec_it = pos_vec.begin(); pos_vec_it != pos_vec_end; ++pos_vec_it) */
+/*     { */
+/*       os << symbolsList[pseq->GetChar(theTaxonNumber,*pos_vec_it)]; */
+/*     } */
+/*     os << std::endl; */
+/*   } */
+/*   os.flags(orig_ios_flag); */
+/* } */
+
+/* inline  */
+/* void PrintSpecial_PosNumbers(ostream& os, */
+/* 			     std::vector<unsigned> pos_vec, // we get a real copy */
+/* 			     const CSequences2 *pseq, */
+/* 			     unsigned         taxonLabelPrintWidth, */
+/* 			     bool             UseNexusComments) */
+/* { */
+/*   unsigned i; */
+/*   unsigned numPos           = pos_vec.size(); */
+/*   unsigned printNoZerosTill = numPos; */
+/*   bool     printNoZero_set  = false; */
+
+/*   // We determine the original position numbers: */
+/*   for (i=0; i<numPos; ++i) */
+/*     pos_vec[i] = pseq->GetOriginalPosNumber(pos_vec[i]); */
+
+/*   unsigned maxDigits = ((unsigned)log10((double)pos_vec[numPos-1]))+1; */
+/*   unsigned factor    = 1; */
+/*   unsigned digit; */
+
+/*   for (i=1; i<maxDigits; ++i) */
+/*     factor *= 10; */
+
+/*   for (; factor; factor /= 10, printNoZero_set = false) */
+/*   { */
+/*     if (UseNexusComments) */
+/*     { */
+/*       os.width(taxonLabelPrintWidth); */
+/*       os << "[ "; */
+/*     } */
+/*     else */
+/*     { */
+/*       os.width(taxonLabelPrintWidth); */
+/*       os << ' '; */
+/*     } */
+/*     for (i=0; i < numPos; ++i) */
+/*     { */
+/*       digit = pos_vec[i]/factor; */
+
+/*       if ( i >= printNoZerosTill || digit > 0) */
+/*       { */
+/* 	if (!printNoZero_set) */
+/* 	{ */
+/* 	  printNoZerosTill = i; */
+/* 	  printNoZero_set = true; */
+/* 	} */
+/* 	os << (char)(digit+'0'); */
+/* 	pos_vec[i] -= factor*digit; */
+/*       } */
+/*       else */
+/*       { */
+/* 	os << ' '; */
+/*       } */
+/*     } */
+/*     if (UseNexusComments) */
+/*     { */
+/*       os << "]" << std::endl; */
+/*     } */
+/*     else */
+/*     { */
+/*       os << std::endl; */
+/*     } */
+/*   } */
+/* } */
+
+
+/* inline void      CSequences::GetBaseFrequencies(unsigned ti, */
+/* 						std::vector<unsigned> bf) */
+/* { */
+/*   unsigned pos; */
+/*   for (pos = 0; pos < posNum; ++pos) */
+/*     ++bf[seqData[ti][pos]] */
+/* } */
+
+
+#endif
diff --git a/CSplit2.h b/CSplit2.h
new file mode 100644
index 0000000..e2bbd2b
--- /dev/null
+++ b/CSplit2.h
@@ -0,0 +1,271 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CSplitH
+#define CSplitH
+
+#include "fast-dynamic-bitset/fast-dynamic-bitset.h"
+#include <iostream>
+#include <vector>
+#include <fstream>
+//#include "number2cstring.h"
+
+class CSplit
+{
+ private:
+  fast_dynamic_bitset split;
+
+ public:
+  // Bitset with a specfied number of bits, here taxa
+  CSplit(unsigned long size):split(size) {
+    split.clear();
+  }
+
+ CSplit(const fast_dynamic_bitset& b):split(b){}
+
+ CSplit(const CSplit& b):split(b.split){}
+    //  CSplit(unsigned long, const vector<unsigned long>&);
+    //  CSplit(unsigned long, unsigned long*, unsigned long);
+
+  friend bool operator ==(const CSplit&, const CSplit&);
+  friend bool operator <(const CSplit&, const CSplit&);
+  friend bool lessThan_mod_flip_friend(const CSplit&, const CSplit&);
+
+  fast_dynamic_bitset& get_split()
+  {
+    return split;
+  }
+
+  void reset()
+  {
+    split.reset();
+  }
+
+  void set(unsigned i)
+  {
+    split.set(i);
+  }
+
+  void reset(unsigned i)
+  {
+    split.reset(i);
+  }
+
+  bool test(unsigned i) const
+  {
+    return split.test(i);
+  }
+
+  void set(std::vector<int> vec)
+  {
+    int i=0, n=vec.size();
+
+    for (; i<n; ++i)
+    {
+      split.set(vec[i]);
+    }
+  }
+
+  void flip()
+  {
+    split.flip();
+  }
+
+  void flip(unsigned i)
+  {
+    split.flip(i);
+  }
+
+
+  unsigned count_taxa_in_ingroup()
+  {
+    return split.count();
+  }
+
+  unsigned size()
+  {
+    return split.size();
+  }
+
+  bool compatible_with(const CSplit& s_b) const
+  {
+    CSplit s_a_flipped(split);
+    CSplit s_b_flipped(s_b.split);
+    s_a_flipped.split.flip();
+    s_b_flipped.split.flip();
+
+    if( ((split & s_b.split).none())             || ((split & s_b_flipped.split).none())            || 
+	((s_a_flipped.split & s_b.split).none()) || ((s_a_flipped.split & s_b_flipped.split).none()) )
+      return true;
+    else
+      return false;
+  }
+
+  // Returns true if all 1s in (*this) are also 1s in s_b
+  bool is_this_a_subset_of_the_parameter(const CSplit& s_b) const
+  {
+    CSplit s_b_flipped(s_b.split);
+     s_b_flipped.split.flip();
+
+     // Some debug code:
+     //     std::cout << "*this & parameter_flipped: " << (split & s_b_flipped.split) << std::endl;
+
+     return  (split & s_b_flipped.split).none();
+  }
+
+  // Returns true if all 1s in s_b are also 1s in (*this)
+  bool is_parameter_a_subset_of_this(const CSplit& s_b) const
+  {
+    CSplit s_a_flipped(split);
+     s_a_flipped.split.flip();
+
+     // Some debug code:
+     //     std::cout << "*this flipped & parameter: " << (s_a_flipped.split & s_b.split) << std::endl;
+
+     return  (s_a_flipped.split & s_b.split).none();
+  }
+
+  void print(std::ostream& os) const
+  {
+    os << split;
+  }
+
+  const std::string as_string_lowBitsFirst() const
+  {
+    return split.as_string_lowBitsFirst();
+  }
+
+  const std::string as_string_highBitsFirst() const
+  {
+    return split.as_string_highBitsFirst();
+  }
+
+};
+
+
+/* // Neue Reihenfolge der Argumente */
+/* CSplit::CSplit(unsigned long len, const vector<unsigned long>& vec):split(len) { */
+/*   vector<unsigned long>::const_iterator it; */
+/*   it = vec.begin(); */
+/*   while( it != vec.end() ) { */
+/*     split.set(*it);       //indexerror */
+/*     ++it; */
+/*   } */
+/* } */
+
+/* // Neue Reihenfolge der Argumente */
+/* CSplit::CSplit(unsigned long len, unsigned long *u, unsigned long array_len):split(len) { */
+/*   split.clear(); */
+/*   int i = 0; */
+/*   while(i < array_len) { */
+/*     split.set(u[i]);      //indexerror */
+/*     i++; */
+/*     *u++; */
+/*   } */
+/* } */
+
+
+
+
+
+inline bool operator ==(const CSplit& split_a, const CSplit& split_b) {
+  if ( split_a.split == split_b.split ) {
+    return true;
+  } else {
+    CSplit split_b_flipped(split_b);
+    split_b_flipped.split.flip();
+    if( split_a.split == split_b_flipped.split ) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+}
+
+inline bool operator <(const CSplit& split_a, const CSplit& split_b)
+{
+  if ( split_a.split < split_b.split ) {
+    return true;
+  }
+  else {
+    return false;
+  }
+}
+
+/* inline bool lessThan_mod_flip_friend(const CSplit& split_a, const CSplit& split_b) */
+/* { */
+/*   CSplit s_a_flipped(split_a); */
+/*   CSplit s_b_flipped(split_b); */
+
+/*   s_a_flipped.split.flip(); */
+/*   s_b_flipped.split.flip(); */
+
+/*   //  return (split_a < split_b) || (s_a_flipped < s_b_flipped); */
+/*   return (s_a_flipped < s_b_flipped); */
+/* } */
+
+/* struct lessThan_mod_flip */
+/* { */
+/*   bool operator()(const CSplit& split_a, const CSplit& split_b) const */
+/*   { */
+/*     return lessThan_mod_flip_friend(split_a, split_b); */
+/*   } */
+/* }; */
+
+//
+// Split with branch length:
+//
+class CSplit_l : public CSplit
+{
+  double b_length;
+
+ public:
+
+ CSplit_l(unsigned long u):CSplit(u), b_length(-1)
+ {}
+
+ CSplit_l(const fast_dynamic_bitset& b, double bl = -1):CSplit(b), b_length(bl) {}
+
+ CSplit_l(const CSplit& b,  double bl = -1):CSplit(b), b_length(bl){}
+
+ CSplit_l(const CSplit_l& b):CSplit(b), b_length(b.b_length){}
+
+  
+
+  void set_b_length(double b_l)
+  {
+    b_length = b_l;
+  }
+
+  double get_b_length() const
+  {
+    return b_length;
+  }
+
+
+};
+
+#endif
diff --git a/CTaxonNamesDictionary.h b/CTaxonNamesDictionary.h
new file mode 100644
index 0000000..9c8d04b
--- /dev/null
+++ b/CTaxonNamesDictionary.h
@@ -0,0 +1,178 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef  CTAXONNAMESDICTIONARY_H
+#define  CTAXONNAMESDICTIONARY_H
+
+#include "faststring2.h"
+#include "CDistance_matrix.h"
+#include "CSequences2.h"
+#include "CFile/CFile2_1.h"
+#include "CSeqNameList.h"
+#include <set>
+#include <list>
+#include <map>
+#include <vector>
+
+class CTaxonNamesDictionary
+{
+  CSeqNameList *snl;
+  CSeqNameList all;
+
+  // Each index storen in the taxon_names_to_index map is equal to the index of the same taxon name in the taxon_names_vec.
+  // This allows us to translate indices and names back and forth.
+
+  std::vector<faststring>        taxon_names_vec;
+  std::map<faststring, unsigned> taxon_names_to_index; 
+
+ public: 
+
+ CTaxonNamesDictionary(faststring directoryname, std::list<faststring> &list_of_fasta_file_names, unsigned short sequence_name_taxon_field_number, char field_delimiter):all(true)
+ {
+    // Collect all taxon names to build a taxon name dictionary
+    // The collection of all sequence names is stored in the all object. 
+    faststring full_transcript_file_name;
+
+    std::list<faststring>::iterator file_names_it, file_names_it_end, file_names_it_begin;
+
+    file_names_it_begin = file_names_it = list_of_fasta_file_names.begin();
+    file_names_it_end = list_of_fasta_file_names.end();
+
+    // For each fasta file
+    while (file_names_it != file_names_it_end)
+    {
+      full_transcript_file_name = directoryname + "/" + *file_names_it;
+
+      //    std::cout << "Reading sequence names in " << full_transcript_file_name << std::endl;
+      snl = new CSeqNameList(full_transcript_file_name.c_str(), true);
+
+      if (file_names_it == file_names_it_begin)
+      {
+	all.set_to(*snl, "all-names-union");
+      }
+      else
+      {
+	all.add_List_non_redundant(*snl);
+      }
+      ++file_names_it;
+    }
+    //  all.print(cout,0);
+
+    // TAXON NAMES DICTIONARY: consists of a vector, and map
+    // A set is used to store all names temporarily.
+
+    std::set<faststring>           taxon_names_set;
+    bool                           error_get_set_of_name_field;
+
+    // Take the names of the sequences, divide it according to the delimiter '|' and 
+    // extract field number sequence_name_taxon_field_number. Store all names in the set.
+    error_get_set_of_name_field = all.get_set_of_name_field(sequence_name_taxon_field_number+1, field_delimiter, taxon_names_set);
+
+    if (error_get_set_of_name_field)
+    {
+      std::cerr << "WARNING: At least one error occured when trying to read taxon names from the fasta sequence headers."
+		<< " Usually this error occurs, when headers are not in the proper format, when the parameter file contains a wrong"
+		<< " wrong sequence name field delimiter or if the taxon name field number is wrong." << std::endl;
+      std::cerr << "This error will influence: TODO." << std::endl;
+    }
+
+    // Now we have a set that contains all taxon names found in all fasta files.
+
+    std::set<faststring>::iterator it, it_end;
+    it      = taxon_names_set.begin();
+    it_end  = taxon_names_set.end();
+
+    unsigned i;
+    i=0;
+    while (it != it_end)
+    {
+      // Since the taxon_names_vec was empty originally, the names have an index equal to i.
+      taxon_names_vec.push_back(*it); // push all names into the vector.            unique-index -> name
+      taxon_names_to_index[*it] = i;  // for each name store its index in the map.  name -> unique-index
+      ++it;
+      ++i;
+    }
+    // Now we can translate unique indices and taxon names back and forth.
+  }
+
+  void print(std::ostream &outfile)
+  {
+    outfile << "## Index <-> taxon name:" << std::endl;
+
+    unsigned i, N = taxon_names_vec.size();
+    for (i=0; i<N; ++i)
+    {
+      outfile << i << " "  << taxon_names_vec[i] << std::endl;
+    }
+  }
+
+
+  // Main dictionary retrieval function.
+  unsigned dictionary_get_index_of_taxonname(faststring taxonname)
+  {
+/*     map<faststring, unsigned>::iterator it, it_end; */
+/*     it     = taxon_names_to_index.begin(); */
+/*     it_end = taxon_names_to_index.end(); */
+/*     cout << "taxon_names_to_index map" << endl; */
+/*     while (it != it_end) */
+/*     { */
+/*       cout << it->first << "=>" << it->second << endl; */
+/*       ++it; */
+/*     } */
+
+
+    std::map<faststring, unsigned>::iterator it_find = taxon_names_to_index.find(taxonname);
+
+    if (it_find != taxon_names_to_index.end() )
+      return it_find->second;
+    else
+      return -1u;
+  }
+
+  const std::vector<faststring> & get_taxon_names_vec()
+  {
+    return taxon_names_vec;
+  }
+
+  void print_taxon_names_to_index(std::ostream &os)
+  {
+    std::map<faststring, unsigned>::iterator it, it_end;
+    it     = taxon_names_to_index.begin();
+    it_end = taxon_names_to_index.end();
+
+    os << "Content of taxon names to global index dictionary: " << std::endl;
+    while (it != it_end)
+    {
+      os.width(30);
+      os << it->first << " " << it->second << std::endl;
+      ++it;
+    }
+  }
+
+};
+
+
+#endif
diff --git a/Csequence_cluster_and_center_sequence.cpp b/Csequence_cluster_and_center_sequence.cpp
new file mode 100644
index 0000000..f9db12c
--- /dev/null
+++ b/Csequence_cluster_and_center_sequence.cpp
@@ -0,0 +1,1083 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include "Csequence_cluster_and_center_sequence.h"
+#include "DEBUG_STUFF.h"
+
+using namespace std;
+
+CDistance_Cluster *p_global_distcluster;
+bool               global_bad_dist_this_range;
+
+
+void call_back_distance(short i1, short i2, double dist)
+{
+  if (dist < 0)
+    global_bad_dist_this_range = true;
+  else
+    p_global_distcluster->add(i1, i2, dist);
+}
+
+
+
+void Csequence_loci_cluster_collection::cluster_locus(faststring & region_name, const faststring &filename)
+{
+  // TODO:
+  // We have to check how many (valid) sequences we have.
+  // If this number is just 0 or 1, the clustering will fail and we need a workaround.
+
+  // The number of valid sequences has been determined in the constructor of this object.
+  if (number_of_valid_sequences < 2)
+  {
+    if (number_of_valid_sequences == 0)
+    {
+      if (global_VERBOSITY >= VERBOSITY_MOREWARNINGS)
+      {
+	cout << "WARNING: Found 0 valid sequences in bait window in Csequence_loci_cluster_collection::cluster_locus()." << endl;
+	cout << "         Alignment file:          " << filename    << endl;
+	cout << "         Region/gene name:        " << region_name << endl;
+	cout << "         Within gene coordiantes: " << pos_start+1 << "-" << pos_end << endl;
+      }
+    }
+    if (number_of_valid_sequences == 1)
+    {
+      // TODO: Report this only if 
+      if (global_VERBOSITY  >= VERBOSITY_MOREWARNINGS)
+      {
+	cout << "Note: Found 1 valid sequence in bait window in Csequence_loci_cluster_collection::cluster_locus(). Clustering will be skipped. Bait will be constructed from single sequence." << endl;
+	cout << "      Alignment file:          " << filename    << endl;
+	cout << "      Region/gene name:        " << region_name << endl;
+	cout << "      Within gene coordiantes: " << pos_start+1 << "-" << pos_end << endl;
+      }
+
+      // TODO: Uncomment and adapt:
+      Csequence_cluster_and_center_sequence empty_cluster_and_center_sequence;
+
+      // Add an empty object
+      list_of_clusters.push_back(empty_cluster_and_center_sequence);
+      
+      if (global_VERBOSITY > 2000)
+       {
+	 cout << "Object that will be assigned: *******" << endl;
+	 list_of_clusters.back().print(cout);
+	 cout << "*************************************" << endl;
+       }
+       // Fill the object
+      set<short> seq_set;
+      unsigned   i, N = valid_sequences.size();
+      for (i=0; i < N; ++i)
+      {
+	if (valid_sequences[i])
+	  seq_set.insert(i);
+      }
+      list_of_clusters.back().assign(pos_start, pos_end, 0, seq_set, this, msa);
+      if (global_VERBOSITY > 2000)
+      {
+	cout << "Object after having been assigned:***" << endl;
+	list_of_clusters.back().print(cout);
+	cout << "*************************************" << endl;
+      }
+    } // END if (number_of_valid_sequences == 1)
+    // Prints data for all clusters in this locus. Center sequences are not computed yet.
+    if (global_VERBOSITY > 2000)
+    {
+      print(cout);
+    }
+    return;
+  } // END if (number_of_valid_sequences < 2)
+
+  // Create cluster object:
+  CDistance_Cluster cluster_object;
+
+  // We initialize the global pointer to the cluster_object.
+  // This pointer is used by the global call_back_distance function,
+  // which we pass to the CSequences2 class where it is used to
+  // fill the cluster_object with the distances of the sequences.
+  p_global_distcluster = &cluster_object;
+
+  // One problem exists with the sequences that contain gaps or Ns in the window we investigate.
+  // The clustering algorithm assumes that all sequence numbers are present during clustering,
+  // so we cannot skip sequences. So. we have to add distances for all sequences in the sequences objects.
+  // We also do not want to copy the sequences to a new CSequences2 object. Then we have to keep track
+  // of the new sequence number, and we have global unique numbers, sequence numbers in the exon,
+  // sequence numbers in the window.
+  // The best compromise is to add very large distances to the clustering algorithm and to remove
+  // the "non-present" sequences after the clusting has been done.
+  // Due to the large distances we assign to all sequence pairs in which one sequence is not valid, non of
+  // the invalid sequences will be clustered with any other sequence.
+
+  // Valid distances among sequences are in the range 0..1.
+  // With a larger value we indicate a problem, e.g. Ns or gaps in the sequences.
+  // In order not to cluster sequences that contain Ns or gaps, we 
+  // set the dist_threshold to a maximum value of 10.
+  // Distances with a value >10 will not be clustered.
+  // A good value for distances of sequences that contain gaps or Ns is 100.
+
+  // Add distances:
+  seqs->get_sequences_distances(pos_start, pos_end,
+				call_back_distance,
+				valid_sequences, 0); 
+    
+  if (global_VERBOSITY > 3000)
+  {
+    cout << "Sorted distances in this cluster object" << endl;
+    cluster_object.print_sorted(cout);
+    cout << endl;
+  }
+
+  if (global_VERBOSITY >= 900)
+  {
+    // Print filename, region name, within gene/alignment coordinate, maximum sequence distance
+    // for this starting position/locus.
+    cout << "Maximum distance:\t" << filename << "\t" << region_name << "\t" << pos_start+1 << "\t"
+	 << cluster_object.max_distance() << endl;
+  }
+
+  // Do clustering:
+  cluster_object.run_clustering(dist_threshold);
+    
+  if (global_VERBOSITY > 900)
+  {
+    faststring cluster_string;
+    cluster_object.get_cluster_string2(cluster_string);
+    cout << "Clustering string: " << cluster_string << endl;
+  }
+
+  // Retrieve results: Store all valid clusters in the list of clusters "list_of_clusters" of this locus.
+  set<short> seq_set;
+  //  set<short> seq_set_uniq_numbers;
+  set<short>::iterator it_set, it_set_end;
+  double max_dist_in_clu;
+  short i;
+  bool  valid_cluster;
+
+  Csequence_cluster_and_center_sequence empty_cluster_and_center_sequence;
+  
+  i=0;
+  // For all clusters at this locus:
+  while ( cluster_object.get_cluster_by_index(i, seq_set, max_dist_in_clu) )
+  {
+    valid_cluster = true;
+    // Determine whether this is a good set of sequences in this range.
+    // Bad sequences should never cluster with others with our settings. (distance=100)
+    // So bad sequences should be clusters with just one sequence.
+    if (seq_set.size() == 1)
+    {
+      it_set     = seq_set.begin();
+      unsigned seq_index = *it_set;
+
+      valid_cluster = valid_sequences[seq_index];
+    }
+    // else - the cluster must be valid in our setup since clusters with more than 1 element cannot contain bad sequences.
+
+
+    // Do something with the cluster:
+    // Debug code - more important it shows how to extract
+    // the resulting clustering data
+    if (global_VERBOSITY > 3000)
+    {
+      it_set     = seq_set.begin();
+      it_set_end = seq_set.end();
+
+      cout << "Found cluster: (";
+      while (it_set != it_set_end)
+      {
+	cout << *it_set;
+	++it_set;
+	if (it_set != it_set_end)
+	  cout << ",";
+      }
+      cout << "):" << max_dist_in_clu;
+      if (valid_cluster)
+	cout << endl;
+      else
+	cout << "(invalid)" << endl;
+    }
+
+    // Copy the clustering data to the Csequence_loci_cluster_collection data
+
+    if (valid_cluster)
+    {
+      // Too bad: emplace_back is a C++11 feature
+      //      list_of_clusters.emplace_back(pos_start, pos_end, max_dist_in_clu, seq_set, this);
+
+      // Add an empty object
+      list_of_clusters.push_back(empty_cluster_and_center_sequence);
+
+      if (global_VERBOSITY > 2000)
+      {
+            cout << "Object that will be assigned: *******" << endl;
+            list_of_clusters.back().print(cout);
+            cout << "*************************************" << endl;
+      }
+      // Fill the object
+      list_of_clusters.back().assign(pos_start, pos_end, max_dist_in_clu, seq_set, this, msa);
+      if (global_VERBOSITY > 2000)
+      {
+	cout << "Object after having been assigned:***" << endl;
+	list_of_clusters.back().print(cout);
+	cout << "*************************************" << endl;
+      }
+    }
+    ++i;
+
+  } // END while ( cluster_object.get_cluster_by_index(i, seq_set, max_dist_in_clu) )
+
+  // Prints data for all clusters in this locus. Center sequences are not computed yet.
+  if (global_VERBOSITY > 1000)
+  {
+    print(cout);
+  }
+} // END Csequence_loci_cluster_collection::cluster_locus()
+
+///////////////////////////////////////////////////////
+///////////////// CLUSTERING //////////////////////////
+///////////////////////////////////////////////////////
+
+// Helper functions:
+
+// Indices:
+// First index:  Row, i.e. sequence
+// Second index: Col, i.e. sequence position
+
+void recode_range(char * b, char *e)
+{
+  while (b != e)
+  {
+    *b = recode_DNA(*b);
+    ++b;
+  }
+}
+
+void back_recode_range(char * b, char *e)
+{
+  while (b != e)
+  {
+    *b = backrecode_DNA(*b);
+    ++b;
+  }
+}
+
+// inline bool is_valid_recode_DNA_range(const char *p1, const char *p2)
+// {
+//   while (p1 != p2)
+//   {
+//     if (!is_valid_recode_DNA(*p1))
+//       return false;
+//     ++p1;
+//   }
+//   return true;
+// }
+
+
+void recode_MSA(char **sequences, int num_taxa, int num_pos)
+{
+  int  row;
+
+  for (row=0; row < num_taxa; ++row)
+  {
+    recode_range(sequences[row], sequences[row]+num_pos);
+  }
+}
+
+// Requires recoded sequences as input.
+// The consensus will also be recoded.
+////////////////// UPDATED/////////////////
+void find_consensus(char **msa, int num_taxa, unsigned pos_start_msa,
+		    unsigned pos_end_msa, char *consensus, char *isAmbig)
+{
+  int  row, col, col_in_msa;
+  char c;
+
+  int len = pos_end_msa - pos_start_msa;
+
+  for (col=0, col_in_msa = pos_start_msa; col < len; ++col, ++col_in_msa)
+  {
+    c = msa[0][col_in_msa];  // Take symbol from row=0
+    for (row=1; row < num_taxa; ++row)
+    {
+      c = c | msa[row][col_in_msa];  // Add all symbols of all other rows.
+    }
+    consensus[col] = c;
+    if (recode_is_DNA_ambig(c) )
+    {
+      isAmbig[col] = 1; // Keep track of amibig characters: set isAmbig to true
+    }
+    else
+    {
+      isAmbig[col] = 0; // Keep track of amibig characters: set isAmbig to false
+    }
+  }
+}
+
+// ONLY DEBUGGING OUTPUT:
+// Should work unchanged. CHECK!!!!
+void print_all_variants(char *consensus, char *variant, char *isAmbig, int pos, int len)
+{
+  while (pos < len && !isAmbig[pos])
+    ++pos;
+
+  if (pos == len)
+  {
+    faststring p = variant;
+    back_recode_range(p.begin(), p.end());
+    cout << p << endl;
+  }
+  else
+  {
+    if (consensus[pos]&1)
+    {
+      variant[pos] = 1;
+      print_all_variants(consensus, variant, isAmbig, pos+1, len);
+    }
+    if (consensus[pos]&2)
+    {
+      variant[pos] = 2;
+      print_all_variants(consensus, variant, isAmbig, pos+1, len);
+    }
+    if (consensus[pos]&4)
+    {
+      variant[pos] = 4;
+      print_all_variants(consensus, variant, isAmbig, pos+1, len);
+    }
+    if (consensus[pos]&8)
+    {
+      variant[pos] = 8;
+      print_all_variants(consensus, variant, isAmbig, pos+1, len);
+    }
+  }
+} // END find_consensus(..)
+
+
+
+
+// Important: msa, consensus, and variant are expected to be passed as recoded msa.
+//
+// pos1 ... pos2 is the range to work on. pos2 is the index after the end of the range.
+//
+////////////////// UPDATED/////////////////
+void find_center_sequence_exhaustive(char **msa, char *consensus,
+				     char *variant, char *isAmbig,
+				     int len_variant,
+				     int pos_start, int num_taxa, 
+				     int pos_start_msa, int pos_end_msa,
+				     int *distances, faststring &best_variant,
+				     int *p_best_maximum_distance)
+{
+  int i;
+  int len_remaining = pos_end_msa - pos_start_msa;
+  int pos_end       = pos_start   + len_remaining;
+
+  // Skip all bases for which isAmbig == 0
+  while (pos_start < pos_end && !isAmbig[pos_start])
+  {
+    ++pos_start;
+    ++pos_start_msa;
+  }
+
+  if (pos_start == pos_end)
+  {
+    // We have a new variant:
+    // Check wether this is better than the best we found so far.
+
+    // Determine maximum distance:
+    int m_dist = maximum(distances, distances+num_taxa);
+
+    if (global_VERBOSITY > 800)
+    {
+      cout << "Current sequence:\nDistance: " << m_dist << endl;
+      faststring p = variant;
+      back_recode_range(p.begin(), p.end());
+      cout << p << endl;
+
+      print_container(cout, distances, distances+num_taxa, "distances: ", ":", "\n\n");
+    }
+
+    if (m_dist < *p_best_maximum_distance) // We found a better sequence:
+    {
+
+      // Be careful in the following assignment: "=" does not work here, since variant is not 0 terminated!!!
+      best_variant.assign(variant, 0, len_variant);
+      *p_best_maximum_distance = m_dist;
+
+      // Some debug output:
+      if (global_VERBOSITY > 500)
+      {
+	cout << "*** New best variant: ***" << endl;
+	faststring tmp = best_variant;
+	back_recode_range(tmp.begin(), tmp.end() );
+	cout << tmp << endl;
+	cout << "Distance: " << *p_best_maximum_distance << endl << endl;
+      }
+    }
+  }
+  else
+  {
+    int *tmp_dist = new int [num_taxa];
+
+    // If we get here, we have an non unique "consensus at pos_start.
+    // So let us try all variants which are found in the msa.
+    if (consensus[pos_start]&1)
+    {
+      variant[pos_start] = 1;
+
+      // Determine new distances:
+      memcpy(tmp_dist, distances, sizeof(int)*num_taxa);
+      // Adjust distances for this new base:
+      for (i=0; i<num_taxa; ++i)
+      {
+	if (variant[pos_start] != msa[i][pos_start_msa])
+	  ++tmp_dist[i];
+      }
+
+      find_center_sequence_exhaustive(msa, consensus, variant, isAmbig, len_variant,
+				      pos_start+1, num_taxa, pos_start_msa+1, pos_end_msa,
+				      tmp_dist, best_variant, p_best_maximum_distance);
+    }
+    if (consensus[pos_start]&2)
+    {
+      variant[pos_start] = 2;
+
+      // Determine new distances:
+      memcpy(tmp_dist, distances, sizeof(int)*num_taxa);
+      // Adjust distances for this new base:
+      for (i=0; i<num_taxa; ++i)
+      {
+	if (variant[pos_start] != msa[i][pos_start_msa])
+	  ++tmp_dist[i];
+      }
+
+      find_center_sequence_exhaustive(msa, consensus, variant, isAmbig, len_variant,
+				      pos_start+1, num_taxa, pos_start_msa+1, pos_end_msa,
+				      tmp_dist, best_variant, p_best_maximum_distance);
+    }
+    if (consensus[pos_start]&4)
+    {
+      variant[pos_start] = 4;
+
+      // Determine new distances:
+      memcpy(tmp_dist, distances, sizeof(int)*num_taxa);
+      // Adjust distances for this new base:
+      for (i=0; i<num_taxa; ++i)
+      {
+	if (variant[pos_start] != msa[i][pos_start_msa])
+	  ++tmp_dist[i];
+      }
+
+      find_center_sequence_exhaustive(msa, consensus, variant, isAmbig, len_variant,
+				      pos_start+1, num_taxa, pos_start_msa+1, pos_end_msa,
+				      tmp_dist, best_variant, p_best_maximum_distance);
+    }
+    if (consensus[pos_start]&8)
+    {
+      variant[pos_start] = 8;
+
+      // Determine new distances:
+      memcpy(tmp_dist, distances, sizeof(int)*num_taxa);
+      // Adjust distances for this new base:
+      for (i=0; i<num_taxa; ++i)
+      {
+	if (variant[pos_start] != msa[i][pos_start_msa])
+	  ++tmp_dist[i];
+      }
+
+      find_center_sequence_exhaustive(msa, consensus, variant, isAmbig, len_variant,
+				      pos_start+1, num_taxa, pos_start_msa+1, pos_end_msa,
+				      tmp_dist, best_variant, p_best_maximum_distance);
+    }
+    delete [] tmp_dist;
+  } // END else of if (pos1 == pos2)
+} // END void find_center_sequence_exhaustive
+
+// distances must be initialized by caller.
+void find_center_sequence_heuristic(char **msa,     char *consensus,
+				    char *center,  char *isAmbig,
+				    unsigned len_center,
+				    unsigned pos_start, unsigned num_taxa, 
+				    unsigned pos_start_msa, unsigned pos_end_msa,
+				    unsigned *distances,
+				    unsigned *p_best_maximum_distance)
+{
+  static char recode_A = recode_DNA('A');
+  static char recode_C = recode_DNA('C');
+  static char recode_G = recode_DNA('G');
+  static char recode_T = recode_DNA('T');
+
+  unsigned len_remaining = pos_end_msa - pos_start_msa;
+  unsigned pos_end       = pos_start   + len_remaining;
+
+  // pos_start walks through isAmbig and consensus.
+  // pos_start_msa walks through the msa. 
+
+  // The following static variables are initialized only when calling this function for the first time.
+  static unsigned max_num_taxa = 20;
+  static unsigned *dist_A = new unsigned [max_num_taxa];
+  static unsigned *dist_C = new unsigned [max_num_taxa];
+  static unsigned *dist_G = new unsigned [max_num_taxa];
+  static unsigned *dist_T = new unsigned [max_num_taxa];
+
+  if (num_taxa > max_num_taxa)
+  {
+    max_num_taxa = num_taxa; // max_num_taxa takes on the new maximum value. It will be used as size when reallocating new arrays.
+
+    if (dist_A != NULL)
+    {
+      delete [] dist_A;
+      delete [] dist_C;
+      delete [] dist_G;
+      delete [] dist_T;
+
+      dist_A = new unsigned [max_num_taxa];
+      dist_C = new unsigned [max_num_taxa];
+      dist_G = new unsigned [max_num_taxa];
+      dist_T = new unsigned [max_num_taxa];
+    }
+  }
+
+  unsigned distances_sum_squares;
+  unsigned dist_A_sum_squares;
+  unsigned dist_C_sum_squares;
+  unsigned dist_G_sum_squares;
+  unsigned dist_T_sum_squares;
+
+//   unsigned dist_max_A;
+//   unsigned dist_max_C;
+//   unsigned dist_max_G;
+//   unsigned dist_max_T;
+//   unsigned dist_max;
+
+  unsigned j;
+
+  // Search for first non-invariant site:
+  while (pos_start < pos_end && !isAmbig[pos_start])
+  {
+    ++pos_start;
+    ++pos_start_msa;
+  }
+
+  if (pos_start == pos_end) // This is the case if all sites are invariant.
+  {
+    return;
+  }
+
+  // pos_start is first non-invariant site:
+  {
+    unsigned A=0, C=0, G=0, T=0;
+    char c;
+
+    for (j=0; j<num_taxa; ++j)
+    {
+      if (msa[j][pos_start_msa] == recode_A )
+	++A;
+      else if (msa[j][pos_start_msa] == recode_C )
+	++C;
+      else if (msa[j][pos_start_msa] == recode_G )
+	++G;
+      else if (msa[j][pos_start_msa] == recode_T )
+	++T;
+    }
+
+    if (A > C)
+    {
+      if (G > T)
+      {
+	if (A > G)
+	  c = recode_A;
+	else
+	  c = recode_G;
+      }
+      else // (G <= T)
+      {
+	if (A > T)
+	  c = recode_A;
+	else
+	  c = recode_T;
+      }
+    }
+    else // (A <= C)
+    {
+      if (G > T)
+      {
+	if (C > G)
+	  c = recode_C;
+	else
+	  c = recode_G;
+      }
+      else // (G <= T)
+      {
+	if (C > T)
+	  c = recode_C;
+	else
+	  c = recode_T;
+      }
+    }
+    center[pos_start] = c; // First position has been determined.
+    distances_sum_squares = 0;
+    //    dist_max = 0;
+
+    for (j=0; j<num_taxa; ++j)
+    {
+      if (center[pos_start] != msa[j][pos_start_msa])
+	++distances[j];
+      distances_sum_squares += distances[j]*distances[j];
+//       if (dist_max < distances[j])
+// 	dist_max = distances[j];
+    }
+  } // pos_start is first non-invariant site:
+
+  ++pos_start;
+  ++pos_start_msa;
+
+  while (pos_start < pos_end)
+  {
+    if (isAmbig[pos_start]) // He now search for best nulceotide in center.
+    {
+      // Try 'A'
+      if (consensus[pos_start]&recode_A)
+      {
+	memcpy(dist_A, distances, sizeof(unsigned)*num_taxa);
+	center[pos_start] = recode_A;
+	dist_A_sum_squares = 0;
+	for (j=0; j<num_taxa; ++j)
+	{
+	  if (center[pos_start] != msa[j][pos_start_msa])
+	    ++dist_A[j];
+	  dist_A_sum_squares += dist_A[j]*dist_A[j];
+	}
+      }
+      else
+	dist_A_sum_squares = -1u;
+      // END // Try 'A'
+      // Try 'C'
+      if (consensus[pos_start]&recode_C)
+      {
+	memcpy(dist_C, distances, sizeof(unsigned)*num_taxa);
+	center[pos_start] = recode_C;
+	dist_C_sum_squares = 0;
+	for (j=0; j<num_taxa; ++j)
+	{
+	  if (center[pos_start] != msa[j][pos_start_msa])
+	    ++dist_C[j];
+	  dist_C_sum_squares += dist_C[j]*dist_C[j];
+	}
+      }
+      else
+	dist_C_sum_squares = -1u;
+ // END // Try 'C'
+      // Try 'G'
+      if (consensus[pos_start]&recode_G)
+      {
+	memcpy(dist_G, distances, sizeof(unsigned)*num_taxa);
+	center[pos_start] = recode_G;
+	dist_G_sum_squares = 0;
+	for (j=0; j<num_taxa; ++j)
+	{
+	  if (center[pos_start] != msa[j][pos_start_msa])
+	    ++dist_G[j];
+	  dist_G_sum_squares += dist_G[j]*dist_G[j];
+	}
+      }
+      else
+	dist_G_sum_squares = -1u;
+      // END // Try 'G'
+      // Try 'T'
+      if (consensus[pos_start]&recode_T)
+      {
+	memcpy(dist_T, distances, sizeof(unsigned)*num_taxa);
+	center[pos_start] = recode_T;
+	dist_T_sum_squares = 0;
+	for (j=0; j<num_taxa; ++j)
+	{
+	  if (center[pos_start] != msa[j][pos_start_msa])
+	    ++dist_T[j];
+	  dist_T_sum_squares += dist_T[j]*dist_T[j];
+	}
+      }
+      else
+	dist_T_sum_squares = -1u;
+      // END // Try 'T'
+
+      // Which "Try" is the best?
+      {
+	// Smallest dist_x_sum_squares is the best:
+	if (dist_A_sum_squares  < dist_C_sum_squares) // A is better than C
+	{
+	  if (dist_G_sum_squares  < dist_T_sum_squares) // G is better than T
+	  {
+	    if (dist_A_sum_squares  < dist_G_sum_squares) // A is better than G
+	    {
+	      // A is the best: 
+	      center[pos_start] = recode_A;
+	      memcpy(distances, dist_A, sizeof(unsigned)*num_taxa);
+	    }
+	    else
+	    {
+	      // G is the best:
+	      center[pos_start] = recode_G;
+	      memcpy(distances, dist_G, sizeof(unsigned)*num_taxa);
+	    }
+	  }
+	  else  // T is better than or equal to G
+	  {
+	    if (dist_A_sum_squares  < dist_T_sum_squares) // A is better than T
+	    {
+	      // A is the best
+	      center[pos_start] = recode_A;
+	      memcpy(distances, dist_A, sizeof(unsigned)*num_taxa);
+	    }
+	    else
+	    {
+	      // T is the best
+	      center[pos_start] = recode_T;
+	      memcpy(distances, dist_T, sizeof(unsigned)*num_taxa);
+	    }
+	  }
+	}
+	else // C is better than or equal to A
+	{
+	  if (dist_G_sum_squares  < dist_T_sum_squares) // G is better than T
+	  {
+	    if (dist_C_sum_squares  < dist_G_sum_squares) // C is better than G
+	    {
+	      // C is the best: 
+	      center[pos_start] = recode_C;
+	      memcpy(distances, dist_C, sizeof(unsigned)*num_taxa);
+	    }
+	    else
+	    {
+	      // G is the best:
+	      center[pos_start] = recode_G;
+	      memcpy(distances, dist_G, sizeof(unsigned)*num_taxa);
+	    }
+	  }
+	  else  // T is better than or equal to G
+	  {
+	    if (dist_C_sum_squares  < dist_T_sum_squares) // C is better than T
+	    {
+	      // C is the best
+	      center[pos_start] = recode_C;
+	      memcpy(distances, dist_C, sizeof(unsigned)*num_taxa);
+	    }
+	    else
+	    {
+	      // T is the best
+	      center[pos_start] = recode_T;
+	      memcpy(distances, dist_T, sizeof(unsigned)*num_taxa);
+	    }
+	  }
+	} // END C is better than or equal to A
+      } // END Which "Try" is the best?
+    } // END ELSE (!isAmbig[pos_start])
+    ++pos_start;
+    ++pos_start_msa;
+  } // END while (pos_start < pos_end)
+  // We have the greedy center sequence.
+ *p_best_maximum_distance = maximum(distances, distances+num_taxa);
+} // END find_center_sequence_heuristic
+
+
+
+
+// TODO ///////////////////
+
+// Requires:
+// Multiple sequence alignment that is already recoded.
+// References to (empty) faststrings for the center.
+// Number of taxa
+// Start and end indices of range for which the center sequence shall be computed.
+// The center sequence is returned in recoded form.
+void find_center_sequence_for_msa_exhaustive(char **msa, faststring &center_seq,
+					     int num_taxa,
+					     int pos_start_msa, int pos_end_msa,
+					     double &mdist)
+{
+  faststring cons;
+  faststring isAmbig;
+  faststring variant;
+  faststring best_variant;
+  int        best_maximum_distance = INT_MAX;
+  // The equality len_variant = pos_end - pos_start is only valid before ever incrementing
+  // pos_start, which is always true in this function.
+  int        len_variant = pos_end_msa - pos_start_msa;
+  int        pos_start   = 0;
+  //  int        pos_end     = len_variant;
+
+
+  cons.assign(len_variant,    ' ');
+  isAmbig.assign(len_variant, ' ');
+
+  // Here we can pass .data() since we do not assign it
+  find_consensus(msa, num_taxa, pos_start_msa, pos_end_msa, cons.begin(), isAmbig.begin() );
+  variant = cons;
+
+  int *dist_array = new int [num_taxa];
+  memset(dist_array, 0, num_taxa*sizeof(int));
+//   for (i=0; i< num_taxa; ++i)
+//   {
+//     dist_array[i] = 0;
+//   }
+
+   //  print_all_variants(cons.data(), variant.data(), isAmbig.data(), 0, len);
+  
+//   if (global_VERBOSITY > 5)
+//   {
+//     cout << "Start time: " << time(NULL) << endl;
+//   }
+
+  find_center_sequence_exhaustive(msa, cons.data(), variant.data(), isAmbig.data(),
+				  len_variant,
+				  pos_start, num_taxa,
+				  pos_start_msa, pos_end_msa,
+				  dist_array, best_variant,
+				  &best_maximum_distance);
+
+//   if (global_VERBOSITY > 5)
+//   {
+//     cout << "End time: " << time(NULL) << endl;
+//   }
+
+  center_seq = best_variant;
+  // TODO remove if is clear this cannot happen
+  if (len_variant == 0)
+  {
+    cerr << "ERROR: len_variant == 0 in find_center_sequence_for_msa_exhaustive. Please report this bug." << endl;
+    exit(-54);
+  }
+  mdist = (double)best_maximum_distance/len_variant;
+
+  delete [] dist_array;
+  // 
+  //  back_recode_range(center_seq.begin(), center_seq.end() );
+} // END find_center_sequence_for_msa_exhaustive
+
+// Requires:
+// Multiple sequence alignment that is already recoded.
+// References to (empty) faststrings for the center.
+// Number of taxa
+// Start and end indices of range for which the center sequence shall be computed.
+// The center sequence is returned in recoded form.
+void find_center_sequence_for_msa_heuristic(char **msa, faststring &center_seq,
+					    int num_taxa,
+					    int pos_start_msa, int pos_end_msa,
+					    double &mdist)
+{
+  faststring cons;
+  faststring isAmbig;
+  faststring variant;
+  unsigned   best_maximum_distance = 0;
+  // The equality len_variant = pos_end - pos_start is only valid before ever incrementing
+  // pos_start, which is always true in this function.
+  unsigned   len_variant = pos_end_msa - pos_start_msa;
+  unsigned   pos_start   = 0;
+  //  unsigned   pos_end     = len_variant;
+
+
+  cons.assign(len_variant,    ' ');
+  isAmbig.assign(len_variant, ' ');
+
+  // Here we can pass .data() since we do not assign it
+  find_consensus(msa, num_taxa, pos_start_msa, pos_end_msa, cons.begin(), isAmbig.begin() );
+  variant = cons;
+
+  unsigned *dist_array = new unsigned [num_taxa];
+  memset(dist_array, 0, num_taxa*sizeof(int));
+//   for (i=0; i< num_taxa; ++i)
+//   {
+//     dist_array[i] = 0;
+//   }
+
+   //  print_all_variants(cons.data(), variant.data(), isAmbig.data(), 0, len);
+
+//   if (global_VERBOSITY > 5)
+//   {
+//     cout << "Start time: " << time(NULL) << endl;
+//   }
+
+  find_center_sequence_heuristic(msa, cons.data(), variant.data(), isAmbig.data(),
+				 len_variant,
+				 pos_start, num_taxa,
+				 pos_start_msa, pos_end_msa,
+				 dist_array, &best_maximum_distance);
+
+//   if (global_VERBOSITY > 5)
+//   {
+//     cout << "End time: " << time(NULL) << endl;
+//   }
+
+//   for (i=0; i< num_taxa; ++i)
+//   {
+//     if (dist_array[i] > best_maximum_distance)
+//       best_maximum_distance = dist_array[i];
+//   }
+//  best_maximum_distance = maximum(distances, distances+num_taxa);
+
+  center_seq = variant;
+
+  // TODO remove is clear this cannot happen
+  if (len_variant == 0)
+  {
+    cerr << "ERROR: len_variant == 0 in find_center_sequence_for_msa_heuristic. Please report this bug." << endl;
+    exit(-55);
+  }
+
+  mdist = (double)best_maximum_distance/len_variant;
+
+  if (global_VERBOSITY > 100)
+  {
+    cout << "Reporting mdist for a center sequence with starting position: " << pos_start << " " << mdist << endl;
+  }
+  // 
+  //  back_recode_range(center_seq.begin(), center_seq.end() );
+  delete [] dist_array;
+} // END find_center_sequence_for_msa_heuristic
+
+
+void Csequence_cluster_and_center_sequence::compute_center(char center_computation_mode)
+{
+  // The msa is prepared for the center algorithm:
+  // We still need: the "consensus" and the "ambig" strings.
+
+  int num_sequences = taxon_set.size();
+
+//   if (global_VERBOSITY > 5)
+//   {
+//     cout << "Computing center sequence: " << endl << flush;
+//   }
+
+  if (num_sequences == 1)
+  {
+    center_sequence.assign(msa[0]+pos_start, msa[0]+pos_end);
+    max_dist_bait_to_msa = 0;
+  }
+  else // We have to compute a center sequence:
+  {
+    if (center_computation_mode == 0) // exhausitve
+    {
+      find_center_sequence_for_msa_exhaustive(msa, center_sequence, num_sequences, pos_start, pos_end, max_dist_bait_to_msa);
+    }
+    else if (center_computation_mode == 1) // heuristic
+    {
+      find_center_sequence_for_msa_heuristic(msa, center_sequence, num_sequences, pos_start, pos_end, max_dist_bait_to_msa);
+    }
+    else // Comparison mode
+    {
+      std::set<short>::iterator it;
+      it     = taxon_set.begin();
+
+      {
+	unsigned i;
+	cout << "The MSA for the result below:" << endl;
+	cout << "Time: " << time(NULL) << endl;
+	
+	for (i=0; i<taxon_set.size(); ++i, ++it)
+	{
+	  faststring tmp( msa[i]+pos_start, msa[i]+pos_end);
+	  back_recode_range(tmp.begin(), tmp.end());
+	  cout.width(4);
+	  cout << *it << ":" << tmp << std::endl;
+	}
+      }
+
+      unsigned t1, t2, t3;
+      faststring c1, c2;
+      double md1, md2;
+      t1 = time(NULL);
+      find_center_sequence_for_msa_exhaustive(msa, c1, num_sequences, pos_start, pos_end, md1);
+      t2 = time(NULL);
+      find_center_sequence_for_msa_heuristic(msa, c2, num_sequences, pos_start, pos_end, md2);
+      t3 = time(NULL);
+    
+      // This assignment must come before backrecoding c1.
+      // Otherwise we backrecode twice, which is not correct.
+      center_sequence = c1;
+
+      back_recode_range(c1.begin(), c1.end());
+      back_recode_range(c2.begin(), c2.end());
+
+      cout << "Cent1:     " << c1    << endl;
+      cout << "max_dist1: " << md1   << endl;
+      cout << "Tdiff1:    " << t2-t1 << endl;
+      
+      cout << "Cent2:     " << c2    << endl;
+      cout << "max_dist2: " << md2   << endl;
+      cout << "Tdiff2:    " << t3-t2 << endl;
+
+
+      max_dist_bait_to_msa = md1;
+
+      if (md1 != md2)
+      {
+	cout << "Deviating distances found: " << md2-md1 << " " << (md2-md1)*120 << endl;
+      }
+      else 
+      {
+	cout << "Same distance." << endl;
+      }
+    } // END  else // Comparisson mode
+  } // END  else // We have to compute a center sequence:
+
+  //  cout << "LOG: pos: " << pos_start << " mis " << max_dist_bait_to_msa*120 << endl;
+
+  // We have to back recode the center sequence:
+  back_recode_range(center_sequence.begin(), center_sequence.end() );
+  
+  if (!center_sequence.empty())
+  {
+    unsigned CG, AT;
+    
+    CG_AT_content_in_region(center_sequence.begin_str(), center_sequence.end_str(), AT, CG);
+    double dCG=CG, dAT=AT;
+    CG_content = (dCG / (dCG+dAT));
+  }
+}
+
+
+void Csequence_loci_cluster_collection::compute_center_for_all_clusters(char center_computation_mode)
+{
+  std::list<Csequence_cluster_and_center_sequence>::iterator it_list     =  list_of_clusters.begin();
+  std::list<Csequence_cluster_and_center_sequence>::iterator it_list_end =  list_of_clusters.end();
+
+  //  unsigned t1, t2;
+
+  while (it_list != it_list_end)
+  {
+//     t1 = time(NULL);
+//     cout << "T1: " << t1 << endl;
+    it_list->compute_center(center_computation_mode);
+//     t2 = time(NULL);
+//     cout << "T2: " << t2 << endl;
+//     cout << "Tdiff: " << t2-t1 << endl;
+    
+
+    if (!it_list->center_computed() )
+    {
+      cerr << "ERROR: Internal error: Center sequence not computed even though it was requested! Number of sequences in cluster: " << it_list->get_number_of_elements_in_cluster() << endl;
+    }
+
+    ++it_list;
+  }
+  
+}
diff --git a/Csequence_cluster_and_center_sequence.h b/Csequence_cluster_and_center_sequence.h
new file mode 100644
index 0000000..018890f
--- /dev/null
+++ b/Csequence_cluster_and_center_sequence.h
@@ -0,0 +1,570 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CSEQUENCE_CLUSTER_AND_CENTER_SEQUENCE
+#define CSEQUENCE_CLUSTER_AND_CENTER_SEQUENCE
+
+#include "DEBUG_STUFF.h"
+#include <set>
+#include <list>
+//#include "CTaxonNamesDictionary.h" // Has been used in earlier version, in which clusters where reported with unique sequence number. This intermediate step was not convenient for the user and is not used any more.
+#include <iostream>
+#include <fstream>
+#include "faststring2.h"
+#include "basic-DNA-RNA-AA-routines.h"
+#include <climits>
+#include "statistic_functions.h"
+#include "print_container.h"
+//#include "csv-toolbox.h"
+//#include "mydir.h"
+//#include "sequence-cluster-result-parser.h"
+#include "CSequences2.h"
+#include "CSequence_Mol2_1.h"
+#include "CDistance_matrix.h"
+#include "CSeqNameList.h"
+#include <vector>
+#include <ctime>
+
+
+// Prototypes of global functions implemented in csequence_cluster_and_center_sequence.cpp
+void recode_range(char * b, char *e);
+void back_recode_range(char * b, char *e);
+void recode_MSA(char **sequences, int num_taxa, int num_pos);
+void find_center_sequence(char **msa, char *consensus,
+			    char *variant, char *isAmbig,
+			    int len_variant,
+			    int pos_start, int num_taxa,
+			    int pos_start_msa, int pos_end_msa,
+			    int *distances, faststring &best_variant,
+			    int *p_best_maximum_distance);
+void find_center_sequence_for_msa_exhaustive(char **msa, faststring &center_seq,
+					       int num_taxa,
+					       int pos_start_msa, int pos_end_msa,
+					       double &mdist);
+
+void find_center_sequence_for_msa_heuristic(char **msa, faststring &center_seq,
+					      int num_taxa,
+					      int pos_start_msa, int pos_end_msa,
+					      double &mdist);
+
+
+class Csequence_loci_cluster_collection;
+
+class Csequence_cluster_and_center_sequence
+{
+  unsigned    pos_start; // 0 based
+  unsigned    pos_end;   // 0 based, after last element of range
+
+  double      max_dist_in_cluster;  // Maximum distance within this cluster
+  double      max_dist_bait_to_msa;
+                                    // This is not the threshold but the true maximum distance.
+
+  std::set<short>     taxon_set;  // This is the set of sequence numbers in the cluster.
+                                  // Sequence numbers are the numbers that can be used to access the sequences in the CSequences2 object
+                                  // The sequences can be accessed from this class by following the *loci variable.
+  faststring center_sequence;
+  char       **msa;               // MSA of this cluster. In the assign function, the filter the sequences that belong to the cluster.
+
+  Csequence_loci_cluster_collection *loci;  // Via the loci we have access to the CSequnces2 object and the CTaxonNamesDictionary object.
+  double     CG_content;
+
+
+ public:
+ Csequence_cluster_and_center_sequence():pos_start(-1u-1), pos_end(-1u), max_dist_in_cluster(-1), msa(NULL), loci(NULL), CG_content(0)
+  {}
+
+  // Constructor: Never used, never tested.
+/*  Csequence_cluster_and_center_sequence(unsigned          P_pos_start, */
+/* 					 unsigned           P_pos_end, */
+/* 					 double             P_max_dist_in_cluster, */
+/* 					 std::set<short> P_taxon_set, */
+/* 					 Csequence_loci_cluster_collection *P_loci): */
+/*   pos_start(P_pos_start), pos_end(P_pos_end), max_dist_in_cluster(P_max_dist_in_cluster), max_dist_bait_to_msa(-1), */
+/*     taxon_set(P_taxon_set), msa(NULL), loci(P_loci), CG_content(0) */
+/*   {} */
+
+  ~Csequence_cluster_and_center_sequence()
+  {
+    if (msa)
+      delete [] msa;
+    else
+    {
+      // We can get here if we destroy a default constructed object
+      // that has not been assigned any data. That can happen.
+    }
+  }
+
+  // The only function that is allowed to assign data to objects of this class.
+  // The msa that is passed to this member function is not the msa that is being stored
+  // in the object, since not all sequences belong to the cluster we deal with.
+  void assign(unsigned           P_pos_start,
+	      unsigned           P_pos_end,
+	      double             P_max_dist_in_cluster,
+	      std::set<short>    &P_taxon_set, // Contains the indices of the sequences in P_msa that are copied to the msa array.
+	      Csequence_loci_cluster_collection *P_loci,
+	      char **P_msa)
+  {
+    pos_start = P_pos_start;
+    pos_end   = P_pos_end;
+    max_dist_in_cluster  = P_max_dist_in_cluster;
+    // We could swap the content of the two sets. This might be faster.
+    taxon_set = P_taxon_set;
+    loci      = P_loci;
+
+    std::set<short>::iterator it, it_end;
+
+    it     = taxon_set.begin();
+    it_end = taxon_set.end();
+    short i;
+
+    if (msa)
+    {
+      std::cerr << "WARNING: An existing msa is overwritten. This behaviour is not expected. " << std::endl;
+      delete msa;
+    }
+
+    msa = new char * [taxon_set.size()];
+
+    i=0;
+    while (it != it_end)
+    {
+      msa[i] = P_msa[*it];
+      ++i;
+      ++it;
+    }
+  }
+
+
+  unsigned get_number_of_elements_in_cluster()
+  {
+    return taxon_set.size();
+  }
+
+  bool center_computed()
+  {
+    return !center_sequence.empty();
+  }
+
+  const faststring& get_center_sequence()
+  {
+    return center_sequence;
+  }
+
+  double get_CG()
+  {
+    return CG_content;
+  }
+
+  double get_max_dist_in_cluster()
+  {
+    return max_dist_in_cluster;
+  }
+
+  double get_max_dist_bait_to_msa()
+  {
+    return max_dist_bait_to_msa;
+  }
+
+  unsigned window_size()
+  {
+    return pos_end - pos_start;
+  }
+
+  // Implemented in Csequence_cluster_and_center_sequence.cpp
+  void compute_center(char);
+
+  void print(std::ostream &os)
+  {
+    os << "Cluster: " << pos_start+1 << " " << pos_end << " "
+       << max_dist_in_cluster << " ";
+    print_container(os, taxon_set, "{", ",", "}\n");
+
+    if (msa != NULL)
+    {
+      print_msa_backrecoded(os);
+    }
+
+    if (center_sequence.empty())
+    {
+      os << " ## Center sequenuence has not been computed yet." << std::endl;
+    }
+    else
+    {
+      os << center_sequence << std::endl;
+    }
+  }
+
+  void print_msa_backrecoded(std::ostream &os, int flag = 0)
+  {
+    std::set<short>::iterator it;
+
+    it     = taxon_set.begin();
+
+    unsigned i;
+    os << "Cluster MSA: " << pos_start+1 << " " << pos_end << std::endl;
+    for (i=0; i<taxon_set.size(); ++i, ++it)
+    {
+      faststring tmp( msa[i]+pos_start, msa[i]+pos_end);
+      back_recode_range(tmp.begin(), tmp.end());
+      os.width(4);
+      os << *it << " " << tmp << std::endl;
+    }
+    if (flag == 1)
+    {
+      if (center_computed() )
+      {
+	os << "Cent " << center_sequence << std::endl;
+	os << "Max dist: " << max_dist_bait_to_msa << std::endl;
+      }
+      else
+	os << "Center sequence not computed." << std::endl; 
+    }
+  }
+
+};
+
+
+// Stores and handles all clusters for a specific bait window: 
+
+class Csequence_loci_cluster_collection
+{
+  CSequences2                                       *seqs;
+  unsigned                                          pos_start;      // 0 based
+  unsigned                                          pos_end;        // 0 based, after last element of range
+  double                                            dist_threshold; //
+  //  CTaxonNamesDictionary                             &taxon_names_dict;
+  std::vector<bool>                                 valid_sequences; // Does the sequence with given index have Ns or gaps in this range?
+                                                                     // Indices are the indices in the CSequences2 object.
+
+  char**                                             msa;            // Pointer to a recoded copy of the data
+                                                                     // pos_start and pos_end are the coordinates
+                                                                     // in these sequences.
+
+  std::list<Csequence_cluster_and_center_sequence> list_of_clusters;
+  unsigned                                           number_of_valid_sequences;
+
+
+
+ public:
+  CSequences2 *get_pointer_to_sequences()
+  {
+    return seqs;
+  }
+
+  //  CTaxonNamesDictionary& get_taxonNamesDictionary()
+  //  {
+  //    return taxon_names_dict;
+  //  }
+
+  // Constructor:
+ Csequence_loci_cluster_collection(unsigned P_pos_start, unsigned P_pos_end, CSequences2 *P_seqs,
+				   //				   CTaxonNamesDictionary &P_taxon_names_dict,
+				   double P_dist_threshold,
+				   char** P_msa):
+  seqs(P_seqs), pos_start(P_pos_start), pos_end(P_pos_end), dist_threshold(P_dist_threshold),
+    //taxon_names_dict(P_taxon_names_dict),
+    valid_sequences(P_seqs->GetTaxaNum()), msa(P_msa)
+  {
+    //     std::cerr << "Call to constructor: Csequence_loci_cluster_collection "
+    // 	      << pos_start+1 << " " << pos_end << " " << dist_threshold << std::endl;
+
+    unsigned          i, N=seqs->GetTaxaNum();
+    CSequence_Mol*    seq;
+
+    number_of_valid_sequences = 0;
+
+// IMPORTANT: If this code should be uncommented, code further down needs to be uncommented as well.
+/*     if (global_VERBOSITY > 200) */
+/*     { */
+/*       std::cerr << "#1 " << "Constructor: Csequence_loci_cluster_collection, range: " << pos_start+1 << " " << pos_end << std::endl; */
+/*       std::cerr << "#1 " << "Valid: "; */
+/*     } */ 
+
+    for (i=0; i<N; ++i)
+    {
+      seq = seqs->get_seq_by_index(i);
+      
+      // Has no gaps, Ns in range?
+      // In principle we have already conducted this check in check_full_coverage_and_required_taxa_in_range.
+      // This information is not shared a global scope, so it is not available any more.
+      valid_sequences[i] = !seq->range_contains_gaps_or_Ns(pos_start, pos_end);
+      if (valid_sequences[i])
+      {
+	//	std::cerr << i << ", ";
+	++ number_of_valid_sequences;
+      }
+    }
+    //    std::cerr << std::endl;
+
+    // DEBUG code: Check output of back translation 
+    if (global_VERBOSITY > 100)
+    {
+      std::cout << "#1 MSA:" << std::endl;
+      print_msa_backrecoded(std::cout);
+    }
+
+    // Valid distances among sequences are in the range 0..1.
+    // With a larger value we indicate a problem, e.g. Ns or gaps in the sequences.
+    // In order not to cluster sequences that contain Ns or gaps, we 
+    // set the dist_threshold to a maximum value of 10.
+    // Distances with a value >10 will not be clustered.
+    // A good value for distances of sequences that contain gaps or Ns is 100.
+    if (dist_threshold > 1)
+      dist_threshold = 10;
+  }
+
+  void print_msa_backrecoded(std::ostream &os)
+  {
+    unsigned          i, N=seqs->GetTaxaNum();
+
+    os << "Exon-locus MSA:" << pos_start+1 << " " << pos_end << std::endl;
+    for (i=0; i < N; ++i)
+    {
+      faststring tmp(	msa[i]+pos_start, msa[i]+pos_end);
+      back_recode_range(tmp.begin(), tmp.end());
+      os.width(4);
+      if (valid_sequences[i])
+      {
+	//	std::cerr.setf(ios::right);
+	os << i << "+ " << tmp << std::endl;
+      }
+      else
+      {
+	os << i << "- " << tmp << std::endl;
+      }
+    }
+  }
+
+
+  void print_msa_backrecoded_all(std::ostream &os, int flag = 0)
+  {
+    print_msa_backrecoded(os);
+
+    std::list<Csequence_cluster_and_center_sequence>::iterator it, it_end;    
+    it       = list_of_clusters.begin();
+    it_end   = list_of_clusters.end();
+    while (it != it_end)
+    {
+      it->print_msa_backrecoded(os, flag);
+      ++it;
+    }
+  }
+
+
+  ~Csequence_loci_cluster_collection()
+  {
+  }
+
+  // Implemented in Csequence_cluster_and_center_sequence.cpp
+  void cluster_locus(faststring &, const faststring &);
+
+  // Implemented in Csequence_cluster_and_center_sequence.cpp
+
+  void compute_center_for_all_clusters(char);
+
+  void print(std::ostream &os)
+  {
+    std::list<Csequence_cluster_and_center_sequence>::iterator it, it_end;
+
+    os << "Collection of clusters and their center sequences: "
+       << pos_start+1 << " " << pos_end
+       << " dist_threshold " << dist_threshold
+       << std::endl;
+
+    it     = list_of_clusters.begin();
+    it_end = list_of_clusters.end();
+
+    while (it != it_end)
+    {
+      it->print(os);
+      ++it;
+    }
+  }
+
+  void get_numbers_of_valid_sequences_number_of_clusters(unsigned short &valid_sequences, unsigned short &number_of_clusters)
+  {
+    valid_sequences = number_of_valid_sequences;
+    number_of_clusters = list_of_clusters.size();
+  }
+
+  unsigned append_center_sequences(std::vector<faststring> &v, std::vector<double> &vCG, std::vector<double> &vMaxDist)
+  {
+    unsigned count = 0;
+    std::list<Csequence_cluster_and_center_sequence>::iterator it, it_end;
+
+    it     = list_of_clusters.begin();
+    it_end = list_of_clusters.end();
+
+    while (it != it_end)
+    {
+      v.push_back(  it->get_center_sequence() );
+      vCG.push_back(it->get_CG() );
+
+      //      std::cerr << "Getting max_dist_bait_to_msa: " << it->get_max_dist_bait_to_msa() << std::endl;
+
+      vMaxDist.push_back(it->get_max_dist_bait_to_msa() );
+      ++it;
+      ++count;
+    }
+    return count;
+  }
+
+
+};
+
+
+
+class CBait_region_information
+{
+  faststring     gene_name;
+  short          exon_number;
+  short          number_of_exons;
+  unsigned       start_pos;
+  //  unsigned short bait_length;
+  //  unsigned short offset;
+  unsigned short number_of_baits_in_region;
+
+  std::vector<Csequence_loci_cluster_collection *> loci_this_bait_region;
+
+  // The total_number_of_valid_bait_windows_over_all_sequences_this_bait_region is effectively,
+  // the size of the evidence, or the number of sequences the baits are based on, after adding all contributions in a bait region.
+  unsigned short total_number_of_valid_bait_windows_over_all_sequences_this_bait_region;
+  unsigned short total_number_of_clusters_this_region;
+
+
+ public:
+ CBait_region_information(faststring &P_gene_name, short P_exon_number, short P_number_of_exons, unsigned P_start_pos, //    unsigned short P_bait_length, unsigned short P_offset, 
+			  unsigned short P_number_of_baits_in_region):
+  gene_name(P_gene_name), exon_number(P_exon_number), number_of_exons(P_number_of_exons),
+    start_pos(P_start_pos), //bait_length(P_bait_length), offset(P_offset),
+    number_of_baits_in_region(P_number_of_baits_in_region),
+    total_number_of_valid_bait_windows_over_all_sequences_this_bait_region(0),
+    total_number_of_clusters_this_region(0)
+  {}
+
+  void add_info__cluster_locus(Csequence_loci_cluster_collection *p,
+			       unsigned short add_to_number_of_sequences,
+			       unsigned short add_to_number_of_baits)
+  {
+    loci_this_bait_region.push_back(p);
+    total_number_of_valid_bait_windows_over_all_sequences_this_bait_region += add_to_number_of_sequences;
+    total_number_of_clusters_this_region                                      += add_to_number_of_baits;
+  }
+
+
+  void get_vector_of_bait_sequences(std::vector<faststring> &v, std::vector<unsigned> &bait_counts, std::vector<double> &vCG, std::vector<double> &vMaxDist)
+  {
+    v.clear();
+    vCG.clear();
+    vMaxDist.clear();
+
+    if (total_number_of_clusters_this_region != 0)
+    {
+      v.reserve(total_number_of_clusters_this_region);
+      vCG.reserve(total_number_of_clusters_this_region);
+      vMaxDist.reserve(total_number_of_clusters_this_region);
+    }
+    else
+    {
+      v.reserve(10*number_of_baits_in_region);
+      vCG.reserve(10*number_of_baits_in_region);
+      vMaxDist.reserve(10*number_of_baits_in_region);
+    }
+
+    int i, N=loci_this_bait_region.size();
+    unsigned count;
+    for (i=0; i<N; ++i)
+    {
+      count = loci_this_bait_region[i]->append_center_sequences(v, vCG, vMaxDist);
+      bait_counts.push_back(count);
+    }
+  }
+
+
+  void print_baits_result(std::ostream &os, const faststring &filename)
+  {
+    std::vector<faststring> v;
+    std::vector<double>     vCG;
+    std::vector<double>     vMaxDist;
+    std::vector<unsigned>   bait_counts;
+
+    get_vector_of_bait_sequences(v, bait_counts, vCG, vMaxDist);
+
+    os.setf(std::ios::fixed);
+    os.precision(3);
+
+    os << filename        << "\t"
+       << gene_name       << "\t"
+       << exon_number     << "\t"
+       << number_of_exons << "\t"
+       << start_pos+1     << "\t"
+       << total_number_of_valid_bait_windows_over_all_sequences_this_bait_region << "\t"
+       << total_number_of_clusters_this_region
+       << "\t";
+
+    //    print_container(os, bait_counts, "(",",",")\t");
+
+    unsigned i, N;
+    N = v.size();
+
+    if (v.size() != vCG.size())
+    {
+      std::cerr << "Internal error: v and vCG have different sizes. Sizes are " << v.size() << " and " << vCG.size() << std::endl;
+      exit(-1);
+    }
+
+    if (N == 0)
+    {
+      std::cerr << "ERROR: NUMBER OF BAITS IS 0 for this locus. NEEDS TO BE VERIFIED." << std::endl;
+      exit(-11);
+    }
+
+    int       index_bait_counts=0;
+    unsigned  bait_sum=0;
+
+    bait_sum += bait_counts[index_bait_counts];
+    ++index_bait_counts;
+
+    for (i=0; i<N-1; ++i)
+    {
+      if (i == (bait_sum-1) )
+      {
+	os << index_bait_counts << " " << v[i] << " " << vCG[i] << " " << vMaxDist[i] << ",";
+
+	 bait_sum += bait_counts[index_bait_counts];
+	 ++index_bait_counts;
+      }
+      else
+      {
+	os << index_bait_counts << " " << v[i] << " " << vCG[i] << " " << vMaxDist[i] << ",";
+      }
+    }
+    os  << index_bait_counts << " " << v[i] << " " << vCG[i] << " "  << vMaxDist[i] << std::endl << std::flush;
+  } // END void print_baits_result(std::ostream &os, const faststring &filename)
+}; // END class CBait_region_information
+
+
+#endif
diff --git a/Ctriple.h b/Ctriple.h
new file mode 100644
index 0000000..851333e
--- /dev/null
+++ b/Ctriple.h
@@ -0,0 +1,85 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CTRIPLE_H
+#define CTRIPLE_H
+
+#include <iostream>
+
+//class Ctriple;
+//bool Ctriple::operator<(Ctriple &a, Ctriple &b)
+
+template <typename T1, typename T2, typename T3>
+class Ctriple
+{
+ private:
+  T1 t1;
+  T2 t2;
+  T3 t3;
+
+ public:
+ Ctriple(const T1 &pt1,const T2 &pt2,const T3 &pt3):t1(pt1),t2(pt2),t3(pt3)
+  {}
+
+  T1 first()  { return t1; }
+  T2 second() { return t2; }
+  T3 third()  { return t3; }
+
+  friend bool operator<(const Ctriple<T1, T2, T3> &a, const Ctriple<T1, T2, T3> &b)
+  {
+    if (a.t1 != b.t1)
+      return a.t1 < b.t1;
+    if (a.t2 != b.t2)
+      return a.t2 < b.t2;
+    return a.t3 < b.t3;
+  }
+
+  void print(std::ostream &os) const
+  {
+    os << "(" << t1 << "," << t2 << "," << t3 << ")";
+  }
+
+};
+
+
+template <typename T1, typename T2, typename T3>
+inline std::ostream &operator<<(std::ostream &os, const Ctriple<T1, T2, T3> &t)
+{
+  t.print(os);
+  return os;
+}
+
+
+
+
+
+
+
+
+
+#endif
+
+
diff --git a/DEBUG_STUFF.h b/DEBUG_STUFF.h
new file mode 100644
index 0000000..e8be718
--- /dev/null
+++ b/DEBUG_STUFF.h
@@ -0,0 +1,54 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef DEBUG_STUFF_H
+#define DEBUG_STUFF_H
+
+#define DEBUG
+//#define VERBOSITY 11
+
+// Variant 1:
+extern unsigned global_VERBOSITY;
+
+//Variant 2:
+// Also:
+// comment out: unsigned global_VERBOSITY = 0; in bait-fisher.cpp
+//              remove & in front of verbosity in parse_parameter_file(..) in bait-fisher.cpp 
+
+
+
+#define  VERBOSITY_ERROR_EXIT   0
+#define  VERBOSITY_WARNINGS     1
+#define  VERBOSITY_MOREWARNINGS 2
+#define  VERBOSITY_PROGRESS     3
+#define  VERBOSITY_MOREPROGRESS 4
+#define  VERBOSITY_COORDINATES  8
+#define  VERBOSITY_FILEINFO     10
+#define  VERBOSITY_DEBUG        20
+
+             
+//#define global_VERBOSITY 0
+#endif
diff --git a/Example/Example-without-alignment-cutting/BaitFilter-analysis/run-BaitFilter b/Example/Example-without-alignment-cutting/BaitFilter-analysis/run-BaitFilter
new file mode 100755
index 0000000..b95dde7
--- /dev/null
+++ b/Example/Example-without-alignment-cutting/BaitFilter-analysis/run-BaitFilter
@@ -0,0 +1,6 @@
+../../../BaitFilter-v1.0.5  -m ab -i ../BaitFisher-results/loci_baits.txt  -o baits_filtered_best-in-alignment_minNumBaits.txt  1> console_o_filter_bestBaits 2> console_e_filter_bestBaits
+../../../BaitFilter-v1.0.5  -m as -i ../BaitFisher-results/loci_baits.txt  -o baits_filtered_best-in-alignment_maxNumSeq.txt    1> console_o_filter_bestSeqs  2> console_e_filter_bestSeqs
+
+## Produce bait file that can be uploaded at a bait producing company. So war all companies accepted the file produced with the following command.
+../../../BaitFilter-v1.0.5 -c Agilent-Germany -i baits_filtered_best-in-alignment_maxNumSeq.txt   -o Final_baits_filtered_best-in-alignment_maxNumSeq.txt   --ID-prefix My-project-name- 1> conversion_maxNumSeq.o   2> conversion_maxNumSeq.e
+../../../BaitFilter-v1.0.5 -c Agilent-Germany -i baits_filtered_best-in-alignment_minNumBaits.txt -o Final_baits_filtered_best-in-alignment_minNumBaits.txt --ID-prefix My-project-name- 1> conversion_minNumBaits.o 2> conversion_minNumBaits.e
\ No newline at end of file
diff --git a/Example/Example-without-alignment-cutting/alignments/EOG505R03.fas b/Example/Example-without-alignment-cutting/alignments/EOG505R03.fas
new file mode 100644
index 0000000..bea74cb
--- /dev/null
+++ b/Example/Example-without-alignment-cutting/alignments/EOG505R03.fas
@@ -0,0 +1,48 @@
+>EOG505R03|AMELL_prerelease2|Stizoides_tridentatus|C354790-321
+---ATGGACGATCAAGCCTGTCCAAGATGCAAAACCACCAAATACCGAAATCCATCATTAAAAATGATGGTAAACGTCTGTGGGCATACATTGTGCGAAAGCTGTGTAGATTTACTATTTTTAAAAGGCTCCGGATCTTGCCCAGAATGTAAAATTGCATTGAGAAGAACGAATTTCAGAGTACAGTTGTTCGAGGACCCGATGGTGGAAAAAGAAATAAACATAAGAAAGAGAATACTCCGGGACTTCAACAAAAAGGAGGAAGACTTCGCCACGCTACGCGAGTACAACGATTACTTAGAGGAAATCGAGAGTATAATTTATAACTTAGCGAACAATATCGATGTGATCGAGACTAACAAGAAGATAGAACAGTACAAGAAGGACAATAAAGAGCAAATAACGAAGAGTAAATCTAAAATGGGTAGAAGCGAATACGAACTGGAGGAGATGATAGAATTAGAAAAACAAAAGGAGGAAGAGAGAAGACTG [...]
+>EOG505R03|AMELL_prerelease2|Gorytes_laticinctus|scaffold7338-321
+---ATGGATGATCAAGCGTGTCCAAGATGCAAGACCACCAAATACCGAAATCCATCGTTGAAAATGATGGTAAACGTATGCGGACACACATTGTGCGAAAGTTGCGTGGACTTGTTGTTCTTAAAAGGTTCCGGATCCTGTCCAGAATGCAAAATTCCACTGCGGAGGACGAATTTCAGGGTACAGTTGTTCGAAGACCCAATGGTTGAGAAAGAAGTAAACATAAGGAAGAGGATTCTCAGAGACTTCAACAAAAGGGAAGAAGACTTTGGATCATTAAGAGAATACAACGATTACCTAGAAGAAATTGAGACTATAATATACAACTTGGCAAATAACATTGATGTTATTGAAACAAACAGAAAGATAGATCAGTACAAGAAGGACAACAAGGAGCAGATAACAAAAAGCAAGTCCAAATTGGGCAGGAGTGAATATGAGCTAGAAGAAATGATTGAATTAGAGAAACAAAAGGAAGAAGAAAGAAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Chalybion_californicum|C341654-321
+---ATGGATGACCAAGCGTGTCCAAGATGCAAAACCACAAAATATCGGAATCCGTCATTAAAAATGATGGTAAATGTCTGTGGACATACACTGTGTGAAAGCTGTGTGGATCTGTTATTCTTGAAAGGATCTGGATCATGTCCGGAATGTAAGATTCCATTAAGGAGAACCAACTTTCGTGTCCAACTTTTTGAAGATCCAATGGTTGAAAAGGAGGTGAACATAAGGAAAAGAATACTGCGAGACTTTAATAAGAAGGAAGAGGACTTTACTAATTTGCGTGAATATAATGATTACTTGGAGGAGATAGAAAGTATAATATATAATTTAGCAAATAACATTGATGTAATTGAAACAAATAAGAAAATAGAGCAGTACAAAAAAGACAATAAGGAACAAATATCAAAGAGTAAGTCAAAACTAGGAAGGAGTGAATATGAATTAGAAGAATTGATAGAATTGGAGAAACAGAAGGAGGAGGAAAGGCGGCTT [...]
+>EOG505R03|AMELL_prerelease2|Crossocerus_quadrimaculatus|scaffold6874-321
+---ATGGATGAACAAGCGTGTCCAAGATGCAAAACCACCAAATATCGAAATCCATCGTTGAAGATGATGGTGAACGTCTGCGGGCACACGTTGTGCGAGAGTTGCGTTGACCTGCTCTTCCTAAAAGGATCTGGCTCTTGTCCTGACTGTAAAATTCCATTGAGGAGAGCAAATTTCCGTGTACAGCTATTCGAGGACCCAATGGTAGAGAAGGAGATCAACATAAGAAAACGGATACTTAGAGATTTCACTAAGAAGGAAGAGGACTTCTCGAGTCTGAGGGAGTATAATGATTACTTGGAAGACATTGAAAATATAATATATAATTTAGTCAATAACATAGAAGTCGTGGAGACCAACAGAAAGATAGAACAGTACAAGAAGGACAATAAAGAACAGATTACAAAAAGCAAATCAAAGCTTGGAAGGAGTGAATATGAATTAGAAGAGATGATAGAGCTTGAGAAGCAAAAAGAGGAGGAGAGGAGGCAG [...]
+>EOG505R03|AMELL_prerelease2|Isodontia_mexicana|scaffold15816-321
+---ATGGACGACCAAGCATGTCCACGGTGCAAAACTACTAAATATCGAAATCCATCATTAAAAATGATGGTCAACGTCTGTGGGCATACACTCTGCGAAAGCTGCGTAGATTTACTCTTCTTAAAAGGTTCCGGCTCCTGTCCAGAATGTAAGATCCCCTTAAGGAGGACAAACTTTCGGGTACAGTTGTTCGAGGATGCAATGGTTGAGAAGGAGGTAAACATAAGAAAAAGAATTTTGAAGGATTTTAATAAGAAAGAGGAAGATTTTGCAACTCTGCGGGAATATAACGATTACTTAGAAGAAGTGGAAACGATAATCTACAACTTAGCCAATAACATAGATGTGATAGAGACCAACAAGAAGATAGAACAATACAAGAGGGATAACAAGGATCAGATATCTAAGAGCAAATCCAAAATGGGCAGAAGTGAATACGAACTAGAAGAACTTATAGAGCTAGAGAAACAGAAGGAGGAGGAGAGAAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Tachysphex_fulvitarsis|scaffold7636-321
+---ATGGATGAGCAAGCGTGCCCAAGATGCAAAACTACCAAATACAGAAATCCATCATTGAAAATGATGGTAAATGTCTGTGGACATACATTGTGCGAAAGCTGTGTGGACCTACTCTTCTTAAAAGGGTCTGGATCTTGTCCAGAATGCAAAATTCCATTAAGAAGAACAAACTTTAGGGTACAGCTATTCGAAGATGCCATGGTAGAAAAGGAGGTGAATATTCGTAAGAGGATACTCAGAGATTTTAACAAGAGAGAAGAGGATTTTGCAACCTTGAGGGAGTACAACGACTACTTGGAAGAAATTGAGACCATAATTTATAATTTGGCTAACAATATTGATGTCATTGAGACAAACAAAAGAATTGAACAATACAAGAAAGACAACAAAGAACAGATCACAAAAAGTAAATCTAAAATTGGTAGGAGTGAGTATGAGTTGGAGGAGATGATCGAATTGGAAAAACAGAAGGAGGAAGAGAGAAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Alysson_spinosus|scaffold3509-321
+---ATGGATGACCAAGCTTGTCCAAGATGCAAAACTACAAAATATCGAAATCCATCATTGAAAATGCTGGTCAACGTGTGCGGGCACACGTTGTGCGAAAGTTGCGTTGATCTTCTGTTCTTGAAAGGTTCTGGTTCCTGTCCCGAGTGCAAAATCCCATTAAGGCGGGCAAACTTTAGGGTCCAGCTGTTCGAAGACCCAATGGTAGAAAAGGAGATGAACATAAGAAAGAGGATATTACGTGATTTCAACAAGAGGGAGGAGGATTTTGCGACTCTTCGAGAGTACAACGATTACTTGGAGGAGATCGAGTCCATAATCTACAACTTGGCGAACAATATCGACATTATTGAAACAAACAAGAAAATTGAGCAGTACAAGAGGGATAACAGGGAGCAAATCACAAAGAGCAAATCGAAGCTGGGCAGAAGCGAGTATGAGTTGGAGGAAATGCTGGAATTGGAGAAACAGAAAGAAGACGAAAGGAGGATG [...]
+>EOG505R03|AMELL_prerelease2|Trypoxylon_figulus|scaffold7063-321
+---ATGGATGAACAAGCTTGTCCAAGATGCAAAACCACCAAATACAGAAATCCATCATTAAAAATGATGGTAAACGTTTGCGGGCACACGTTGTGCGAAAGTTGTGTGGACCTACTATTTTTAAAGGGCTCCGGATCCTGCCCAGAATGCAAGATCCCATTAAGAAGAACAAACTTCAGGGTACAACTGTTCGAAGATCCTATGGTGGAAAAAGAGGTAAATATACGGAAAAGAATACTCAGAGATTTCAATAAGAAGGAAGAAGATTTTGCGAATTTGAGAGAGTACAACGATTATCTGGAAGAAATCGAGAGCATAATATATAATTTAGCTAATAATATTGAGGTCATCGAAACGAATAAAAGAATCGAACAGTACAAGAAGGACAATAAAGATCAGATTACGAAAAGTAAAGCCAAACTTGGTAGAAGCGAGCACGAATTGGAAGAAATGATAGAGCTGGAGAAACAAAAAGAAGAGGAAAGAAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Cerceris_arenaria|C320251-321
+---ATGGATGATCAAGCTTGCCCAAGATGCAAAACTACCAAATATCGCAATCCATCATTAAAAATGATGGTAAATGTTTGCGGACATACCCTGTGCGAAAGTTGTGTAGATTTATTATTTCTAAAAGGTTCTGGATCTTGCCCCGAATGTAAGATTCCATTGAGGAGAACAAATTTTCGTGTTCAGTTATTCGAGGATCCGATGGTAGAAAAAGAAGTAGATATAAGGAAGAGGATTCTCAGAGACTTCAACAAGAAAGAAGAGGACTTTGGTTCGTTGCGTGAATACAATGATTACTTGGAGGATATTGAAGCTATTATTTATAACTTAGTAAATAATATAGACGTAATAGAAACAAATAAGAAAATTGAACAATATAAAAGAGACAACAAAGACCAAATAACAAAGAGTAAATCTAAGATTGGTAGAAGCGAATATGAGCTAGAAGAGATGATAGAGTTAGAGAAACAGAAAGAAGAAGAGAGGAGACTA [...]
+>EOG505R03|AMELL_prerelease2|Sphex_funerarius|C422918-321
+---ATGGACGACCAAGCGTGTCCAAGATGCAAGACTACGAAATACCGAAATCCATCGTTAAAAATGATGGTAAACGTTTGCGGGCATACGCTCTGTGAAAGCTGTGTCGATCTGCTCTTCCTAAAAGGTTCTGGATCGTGTCCTGAATGCAAGATTCCACTGAGGAGGACAAACTTTCGGGTTCAGCTGTTCGAAGATCCGATGGTCGAAAAGGAGGTGAACATAAGGAAGAGGATCCTAAGGGACTTCAACAAAAAGGAGGAGGACTTTTCAACCTTGCGCGAGTACAACGATTACTTGGAAGAGGTGGAAAGCATTATATACAACCTGGCAAACAACATCGACGTAATAGAAACTAACAAGAAGATAGAGCAGTACAAGAAGGACAACAAGGAGCAGATATCCAAGAGCAAGTCCAAACTGGGCAGAAGCGAATACGAACTGGAAGAACTGATAGAGCTGGAGAAACAGAAGGAGGAGGAGAGGAGGCAG [...]
+>EOG505R03|AMELL_prerelease2|Philanthus_triangulum|scaffold6237-321
+---ATGGATGACCAAGCCTGTCCAAGATGCAAAACTACCAAATACCGAAATCCATCCTTGAAGATGATGGTAAATGTTTGTGGGCACACATTGTGTGAAAGCTGTGTAGACTTATTATTTTTAAAAGGTTCTGGATCATGTCCGGAATGTAAGATTCCATTGCGGAGGACAAACTTTCGTGTACAATTGTTTGAGGATCCAATGGTTGAAAAGGAAGTGAATATAAGAAAGCGAATACTCAGAGATTTCAACAAGAAGGAAGAAGATTTTGCGAACTTACGAGAGTACAATGATTATTTAGAAGAGATTGAAACTATAATATATAATTTAGCAAACAACATTGATGTAATAGAAACTAATAAGAGAATTGAACAGTATAAGAAAGACAACAAAGACCAGATAACTAAGAGTAAATCCAAAATTGGTAGAAGTGAGTATGAATTAGAAGAGATGATAGAATTAGAAAAACAGAAAGAAGAGGAAAGGAGACTT [...]
+>EOG505R03|AMELL_prerelease2|Psenulus_fuscipennis|scaffold10348-302
+------------------------------------------------------------AAATCCATCATTAAAAATGATGGTAAACGTNTGTGTGAAAGTTGTGTGGACTTGCTTTTCTTAAAAGGATCTGGATCTTGTCCAGAATGCAAGATTCCATTACGCAGGACAAACTTTAGAGTGCAGTTGTTTGAAGATCCAATGGTGGAGAAAGAGGTAAACATAAGAAAAAGGATACTTCGAGATTTCAATAAAAAAGAGGAAGACTTTGGCTCGTTGCGGGAATTCAATGATTACTTGGAAGAAATTGAGACAATAATATATAATTTAGCAAACAACATTGATGTAATAGAGACAAACAAGAAAATAGATCAATACAAAAAGGACAACAAAGATCAGATAACCAAGAGTAAATCTAAAATTGGCAGAAGTGAATATGAACTGGAGGAAATGTTAGAATTAGAGAAACAAAAGGAGGAGGAAAGGAGATTA [...]
+>EOG505R03|AMELL_prerelease2|Oxybelus_bipunctatus|scaffold3815-321
+---ATGGATGACCAAGCATGTCCAAGATGCAAAACAACAAAATATCGAAATCCATCATTAAAAATGATGGTCAATGTTTGTGGCCATACATTGTGTGAAAGTTGTGTTGATTTACTTTTCTTAAAAGGTTCTGGATCTTGTCCTGAATGCAAAATTCCATTGAGAAGGGCAAATTTCAGAGTACAACTCTTTGAAGATCCGATGGTGGAAAAGGAAGTTAACATACGGAAGAGGATACTCAGGGACTTTAATAAAAAGGAAGAAGACTTTGCAAGTTTAAGGGAATACAATGATTACTTAGAAGAAATTGAAAATATAATATATAATTTAGTTAACAATATAGATATTGTTGAGACAAACAAGAAAATAGAACAGTATAAGAAAGATAATAAGGAACAGATTACAAAGAGTAAATCGAAAATTGGTAGATGCGAATATGAATTAGAAGAGATGATAGAACTTGAGAAACAGAAAGAAGAAGAGAGGAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Sceliphron_curvatum|scaffold8417-321
+---ATGGATGACCAAGCTTGTCCAAGATGCAAAACCACGAAATATCGGAACCCATCATTGAAAATGATGGTAAATGTTTGCGGACATACGCTCTGTGAAAGCTGTGTGGATCTGTTATTCCTGAAAGGATCTGGATCGTGTCCGGAATGCAAGATTCCACTGAGAAGGACAAATTTTCGGGTTCAACTGTTCGAAGATCCAATGGTTGAGAAAGAGGTTAATATAAGAAAGAGAATACTGCGGGACTTTAATAAAAGGGAAGAGGACTTTGCGAATCTGCGCGAATACAATGATTATTTGGAAGAAATAGAAACTATAATATATAATTTAGCTAATAACATAGATGTGATCGAAACTAATAAGAAGATAGAACAGTATAAGAAAGACAACAAAGAACAGATATCGAAGAGCAAGTCAAAATTAGGAAGATGCGAATATGAATTGGAGGAGTTAATAGAGCTGGAGAAACAGAAAGAAGAGGAGAGGAGACTC [...]
+>EOG505R03|NVITR_1.2|Nasonia_vitripennis|NV17775-RA-319
+---ATGGAAGATCAGGCTTGTCCAAGATGTAAAACAACGAAATATAGAAATCCATCATTAAAATTGATGGTTAATGTTTGCGGTCACACTTTGTGTGAGAGTTGTGTGGATTTACTGTTTTTGAAAGGTTCTGGTTCCTGTCCCGAGTGTCAGACACCTTTGAGAAGAGCAAACTTTAGGGTTCAATTGTATGAAGATGCAATGGTAGAAAAAGAAGTAGATATTCGAAAGAGAATATTACGTGACTTTAATAAGAAGGAAGAAGACTTTGCGACTCAACGTGAATATGATGATTATTTGGAGGAAGTAGAAAATATTATTTATAATTTAGCTAATAATATTGATGTTATTGAAACCAATAAGAAAATAGAACAGTACAAAAGAGAAAATAGAGAACTCATACTTAAAAATAAAACAAAGTTAGGGAAGAAAGAAAGTGAACTGGAAGAACTTCTTGAGTTGGAGAAAATGGAGCAAGAAGAGAGAAGATTG [...]
+>EOG505R03|AECHI_3.8|Podalonia_hirsuta|scaffold1457-321
+AAAATGGATGATCAGGCGTGTCCAAGATGCAAGACGACCAAGTACCGGAATCCATCGTTAAAAATGATGGTGAACGTATGCGGTCATACGCTGTGCGAGAGTTGCGTCGACCTGCTGTTCCTGAAGGGTTCCGGTTCCTGTCCCGAGTGCAAAATTCCACTCAGGAGGACAAACTTTCGGGTTCAGCTGTTCGAGGACCCGATGGTGGAAAAGGAGGTAAACATAAGGAAAAGAATTCTGCGGGACTTCAACAAGAGAGAGGAAGACTTTGCGTCTCTACGCGAATACAACGACTACTTGGAGGAGATAGAAACCATAATATACAACTTGGCGAACAACATAGACGTGATCGAGACCAACAAAAGGATAGAGCAGTACAAGAGGGACAACAAGGAACAGATCTCGAAGAGCAAGTCCAAGCTGGGCAGAAGCGAATACGAGTTGGAGGAACTGATAGAATTGGAGAAACAGAAGGAGGAGGAGCGGAGGCTG [...]
+>EOG505R03|AMELL_prerelease2|Harpactus_elegans|C390304-321
+---ATGGATGAGCAAGCGTGTCCAAGATGCAAGACCACGAAATATCGGAATCCGTCATTGAAAATGATGGTAAACGTTTGCGGGCACACACTGTGCGAGAGTTGCGTGGACTTGTTGTTCTTAAAAGGTTCCGGATCCTGCCCAGAGTGTAAAATTCCGCTGCGAAGGACGAATTTTAGGGTACAGCTGTTCGAGGATCCAATGGTGGAGAAAGAGGTAAACATAAGAAAGAGGATTCTCAGGGACTTCAACAAGAGGGAAGAAGACTTTGCTACGTTAAGAGAGTACAATGATTACCTGGAGGAAATTGAGAGTATAATATATAACTTGGCAAATAACATTGATGTTATTGAGACAAACAAGAAGATAGATCAGTACAAGAAGGACAACAAGGAGCAGATAACGAAGAGCAAGTCCAAACTAGGCAGGAGTGAGTACGAGCTAGAAGAGATGATAGAATTAGAGAAACAAAAGGAGGAGGAGAGAAGGCTA [...]
+>EOG505R03|AMELL_prerelease2|Bembix_rostrata|scaffold12184-321
+---ATGGACGAACAAGCCTGTCCAAGATGCAAAACTACCAAATATCGAAATCCATCGTTGAAAATGATGGTAAACGTCTGCGGGCACACTTTATGCGAAAGCTGCGTAGATTTATTATTTTTAAAAGGTTCCGGATCTTGTCCAGAATGTAAAATTCCATTACGTAGGACTAACTTTAGGGTACAATTATTCGAGGATCCTATGGTGGAAAAGGAGGTAAACATAAGGAAAAGAATACTACGAGACTTCAACAAAAAGGAAGAAGACTTTGCAACACTAAGAGAGTACAATGATTACTTAGAAGAAGTTGAAACTATAATTTATAACTTAGTTAACAATATCGACGTACTAGAAACTAATAAGAAGATAGATCAATACAAGAAGGATAACAAAGAACAGATAACGAAGAGCAAATCGAAAATGGGAAGAAGTGAATACGAGCTGGAAGAAATGATAGAATTAGAGAAACAAAAAGAGGAAGAGAGGAAACTA [...]
+>EOG505R03|AMELL_prerelease2|Dinetus_pictus|C306329-319
+---ATGGATGACCAAGCGTGCCCAAGATGCAAAACTACCAAATACCGAAATCCATCATTGAAAATGATGGTAAACGTTTGTGGACACACATTGTGTGAAAGCTGCGTGGACTTACTATTTTTAAAAGGTTCTGGATCATGCCCGGAATGCAAAATACCATTAAGAAGGACGAACTTCAGGGTCCAGCTATTCGAAGACCCCATGGTAGAGAAGGAGGTCAACATAAGGAAGAGGATTCTCAAAGACTTCAACAAGAGGGAGGAAGATTTTGCGAGTCTACGTGAATATAATGATTACTTGGAAGAAATTGAAACTATAATATATAATTTAGCTAATAACATTGATGTCATCGAGACGAACAAGAGGATAGAACAGTACAAGAAGGAAAACAGGGAACAGATAACCAAAAGTAAATCCAAGATTGGTAGAAGCGAGTACGAACTGGAGGAAATGATAGAACTGGAGAAACAGAAGGAAGAAGAGAGAAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Sphecius_convallis|scaffold6993-321
+---ATGGATGATCAAGCGTGTCCAAGATGCAAAACTACCAAATATCGAAATCCATCATTGAAAATGATGGTAAATGTGTGCGGGCATACACTGTGTGAAAGCTGCGTGGACTTATTATTCCTAAAAGGTTCCGGATCATGCCCAGAGTGTAAGATTCCACTACGAAGAACAAACTTCAGAGTACAGTTATTTGAAGATCCAATGGTAGAGAAGGAGGTAAATATAAGGAAAAGGATTCTTCGGGACTTCAATAAAAAGGAAGAAGACTTTGGATCATTGCGCGAATATAACGATTACCTAGAAGAAATCGAGAGTATCATATATAACTTAGCTAACAATATCGATGTCATTGAAACGAATAAGAAGATAGAACAGTACAAGAAAGACAACAGAGAGCAGATAACGAAAAGTAAATCCAAGTTAGGCAGAAGTGAATACGAACTGGAAGAAATGATAGAGTTGGAAAAGCAGAAAGAAGAGGAGAGGAGGTTG [...]
+>EOG505R03|AMELL_prerelease2|Nysson_niger|C277342-321
+---ATGGACGACCAAGCTTGCCCAAGATGCAAAACTACCAAATATCGAAATCCATCATTAAAAATGATGGTAAACGTATGTGGACATACATTGTGTGAAAGTTGTGTAGACTTATTATTTCTGAAAGGTTCTGGTTCTTGCCCGGAGTGTAAGATCCCTCTCAGAAGAACAAACTACCGTGTACAATTGTTTGAAGATCCAATGGTAGAGAAAGAGGTGAACATAAGGAAAAGGATTCTTCGTGACTTTAACAAGAGGGAAGAAGATTTCGCTACACTAAGGGAATATAACGATTATTTAGAAGATATCGAATCTATAATATATAATTTAGCCAACAACATTGATGTGATTGAAACAAACAAAAAAATCGATCAGTATAAGAAAGATAACAGGGAGCAGATAAATAAAAGTAAGGCGAAGCTGGGTAGAAGCGAATATGAGCTGGAGGAATTGATAGAGTTAGAAAAGCAGAAAGAAGAAGAGAAACGGCTA [...]
+>EOG505R03|AMELL_prerelease2|Prionyx_kirbii|scaffold8779-321
+---ATGGACGATCAAGCGTGCCCGAGATGTAAAACTACCAAATATCGAAATCCATCGTTAAAAATGATGGTAAATGTCTGCGGGCACACTCTCTGCGAGAGCTGCGTTGATTTGCTCTTCCTGAAAGGTTCGGGCTCTTGTCCAGAATGCAAGATCCCTCTCAGGAGAACAAACTTTCGAGTCCAGTTGTTCGAAGACCCAATGGTGGAGAAGGAGGTGAATATAAGAAAGAGGATTTTAAGAGATTTTAATAAAAAAGAAGAAGACTTTGCAACCCTACGAGAATATAATGATTACTTAGAAGAAGTAGAGTCTATAATTTACAACTTAGCTAATAATATAGATGTGATAGAGACAAATAAGAAGATAGATCAATATAAAAGAGATAATAAAGAACAGATATCAAAAAGCAAGTCCAAGATGGGTAGGAGTGAATACGAGCTGGAAGAATTGATAGAGCTGGAAAAACAAAAGGAGGAGGAGAGAAGAATA [...]
+>EOG505R03|AMELL_prerelease2|Diodontus_minutus|C386102-320
+---ATGGATGATCAAGCTTGTCCAAGATGCAAAACTACCAAATATCGAAATCCATCGTTGAAAATGATGGTAAACGTTTGCGGACACACATTGTGCGAAAGCTGCGTGGATTTATTGTTCCTGAAAGGTTCTGGATCATGTCCCGAATGCAAAATTACACTACGAAGGGGAAACTTTCGGGTGCAGATGTTCGAAGATCCGATGGTAGAGAAAGAGGTCAACATAAGGCAAAGGATACTTAGAGACTTCAATAAAAAAGAGGAGGATTTTGCGACGCTGCGGGAGTACAACGACTACTTAGAGGAAATTGAGACCATAATTTATAATTTAGCGAATAACATCGACGTAGTAGAGACCAACAAGAGGATAGAACAGTACAAGAAAGACAACAAGGATCAAATCACCAAGAGTAAATCTAAAATTGGTAGAAGCGAGTACGAGTTGGAAGAGATGATAGAGTTGGAGAAACAAAAGGAGGAAGAGAGGAGAATG [...]
+>EOG505R03|AMELL_prerelease2|Pemphredon_lugens|C399712-321
+---ATGGATGACCAAGCCTGCCCAAGATGCAAAACTACCAAATATCGAAATCCATCATTGAAAATGATGGTAAACGTTTGCGGACACACGTTGTGTGAAAGCTGCGTAGATTTATTGTTCCTGAAAGGTTCCGGATCTTGTCCCGAATGCAAAATCCCACTGCGAAGGGGAAACTTTCGCGTGCAGCTATTCGAGGATCCGATGGTGGAAAAAGAGGTGAACATAAGGCAGAGGATACTTAGAGACTTCAATAAGAAAGAGGAAGATTTTGCGACTTTGCGGGAATACAACGATTACTTAGAGGAAATTGAAACCATAATTTATAATTTAGCAAATAACATCGATGTAGTAGAAACCAACAAAAGGATAGATCAGTATAAGAAAGACAACAAGGATCAAATCACCAAGAGTAAATCTAAAATTGGTAGAAGCGAATACGAATTGGAAGAGATGATAGAATTGGAGAAACAGAAGGAGGATGAAAGAAGAATG [...]
diff --git a/Example/Example-without-alignment-cutting/alignments/EOG57H4P2.fas b/Example/Example-without-alignment-cutting/alignments/EOG57H4P2.fas
new file mode 100644
index 0000000..f55ffae
--- /dev/null
+++ b/Example/Example-without-alignment-cutting/alignments/EOG57H4P2.fas
@@ -0,0 +1,48 @@
+>EOG57H4P2|HSALT_3.3|Tachysphex_fulvitarsis|C302758-283
+ATGGCACCACCCACATATGGTGATCTTGGAAAATCTGCTCGTGATGTGTTCGGCCAGGGTTATCATTTTGGTCTATTCAAATTAGATGTGAAATCAAAAACTAGCTCTGGAGTTGAGTTCTGTTGTGGTGGAGTTTCTAATCAGGATACCTGTAAAGTGTTTGGTACCTTAGAAACCAAATACAAAATCAAAGATTATGGCCTCAGCTTGAGTGAGAAATGGAACACTGATAATACGCTTGCTAGTGACATTACCCTGACTGACAAATTGCTCAAAGGGCTTACCCTTGGTTATAGCTGTACTTTTGCTCCACAAACTGGAGCCAGAACTGGCAAGTTGAAGACAACTTACAAACATGAAAATGTGTCTGCAACATCTGATGTTGACCTCAGCTTATCGACTCTGCCTTTGGTCAATGCATCTGCTGTGTTTGGTTACCAAGGATGGTTGGCAGGTTACCAGGTAGCCTTTGATGTCCAAAGGAATAAACTT [...]
+>EOG57H4P2|AMELL_prerelease2|Sceliphron_curvatum|C313470-283
+ATGGCTCCACCGGTGTACAGCGATTTAGGCAAGAGCGCTCGCGATGTATTCAGCAACGGTTATCATTTTGGATTGATCAAACTCGATGTTAAAACCAAAACTGAGACTGGTTTGGAGTTTTCGACCGGAGGAGTGTCCAATCAAGATACGGGAAAAGTGCACGGCAGTTTGGAGACAAAGTATGTTATTAAGCAACACGGACTGACGTTCGTCGAAAAATGGTCCACCGATAATACGCTTGGAACCGATGTTAAGCTTGTGGACAAGCTGTTAAAGGGACTCACCCTTAGCTACAACTGTACTTTCTCTCCACAAACAGGAGCAAGAGCGGGAAAGGTAAAGACAGTCTACAAGCATGAGAACATATCGGCGACTGCTGATTTCGATCTCAGCCTCTCCAGTGGACCTCTCATTAATACATCAGCGGTCGTGGGATACCAAGGTTGGCTCGCCGGCTATCAAGCCTCTTTTGACACACAGCAGAATAAACTG [...]
+>EOG57H4P2|LHUMI|Oxybelus_bipunctatus|scaffold13558-283
+ATGGCCCCTCCCACTTATGGTGATCTTGGAAGATGTGCCCGGGACATATTCAGCCAGGGATATCATTTCGGTCTAATCAAATTAGATGTGAAATCTAAAACAAGCTCTGGAGTTGAATTCTCCAGCGGTGGTGTATCCAATCAGGATACTGGAAAAGTATTTGGCAATTTAGAAACCAAGTACAAGTTTAAGGATTATGGGCTACAATTGAATGAGAAATGGAACACTGATAACACGCTTGCTAGTGAAATCACCTTGACTGACAAATTGCTCAAAGGGCTTACACTTGGTTATAGCTGTACCTTTGCTCCCCAGACAGGGACAAAAACTGGAAAGTTGAAGACAGCCTACAAACACGAAAATGTTGCTGCAAATGCTGATGTTGATCTTAGTCTGTCTACCTTGCCTCTGGTTAATGCCTCTGCTGTCCTTGGTTACCAAGGCTGGTTGGCTGGTTATCAAGTTTCCTTCGATGTTCAGAGGAACAAGTTA [...]
+>EOG57H4P2|AMELL_prerelease2|Nysson_niger|scaffold5116-283
+ATGGCTCCCCCAACATACAATGACTTAGGCAAAAGTGCCCGTGACATATTTGGCAGCGGCTATCACTTTGGTTTAATGAAATTAGATGTTAAAACCAAAACCAGCTCAGGTCTCGAATTCTCGAGCGGCGGTGTGTCCAATCAGGATACAGGAAAGGTATTTGGTACATTGGAAACCAAATACAAGATAAAGGATTACGGTCTGTCGTTCAGTGAAAAATGGAACACCGATAATACGATCGCTACCGACGTTACTCTCACCGATAAATTGCTCAACGGACTTACCCTTGGATATAGCTGCACGCTTTCCCCGCAAAAAGGGACCAAGACTGGAAAGTTAAAGACAAGTTACAAGCACGAGAATGTCAGCGCAAATGCAGATTTCGATCTCAGTCTTTCTACATGGCCTCTTATTAACGCAAGTGCCGTCGTGGGATACCAAGGATGGTTGGCTGGTTACCAGGCCTCCTTCGATACCCAACGAAACAAGCTC [...]
+>EOG57H4P2|AMELL_prerelease2|Stizoides_tridentatus|scaffold9970-283
+ATGGCCCCTCCGACATACAATGACCTAGGAAAAAGTGCACGCGACATATTTAGCAGTGGTTACCATTTTGGTTTAATCAAATTAGACGTGAAGACCACTACCAAGTCTGGCGTTGAATTCTCCAGCGGTGGTGTATCTAATCAAGATAGCGGAAAGGTATTTGGTACCTTGGAGACCAAATACAAAATCAAAGATTATGGACTGACATTTAGCGAGAAGTGGAACACCGATAACACGCTCTCGACCGACGTCACTGTGGCCGATAAGTTGCTCAAGGGACTTACTCTCGGCTATAGCTGCACCTTCTCCCCCCAAACTGGGACCAAGGCTGGAAAGTTCAAGACAACCTACAAACATGAAAACGTATCAGCAACTGCCGATTTTGATCTGAGCCTCTCTGCCGGACCTCTTATCAACGCAACATCCGTTGTTGGATATCAAGGCTGGCTGGCCGGTTATCAGGCCTCTTTCGATACACAGAGAAACAAACTG [...]
+>EOG57H4P2|AMELL_prerelease2|Sphex_funerarius|scaffold12456-283
+ATGGCTCCGCCAGTATACAGTGACTTAGGAAAGAGCGCGCGCGACGTGTTCAACAATGGTTATCACTTTGGTTTGATCAAGCTCGACGTGAAGACCAAAACTCAGACCGGGCTAGAATTCTCCACTGGAGGAGTGTCTAACCAGGATACAGGAAAGGTCCATGGCAGCTTGGAGACTAAGTACGTTATCAAACAGCACGGACTGACGTTCGTCGAGAAGTGGTCCACCGATAACACTCTTGGGACCGACGTCAAGCTCGTGGATAAGCTGCTGAAGGGTCTGACCCTTAGCTACAACTGCACTTTCTCCCCACAGACGGGAGCGAGAACAGGAAAGATAAAGACTATTTACAAGGATGAGAACATAGCAGCCACTGCCGATTTTGATCTTAGCCTTTCCAGTGGACCACTCATCAACACTTCTGGAGTAGTGGGTTACCATGGTTGGCTCGCTGGTTATCAGGTCTCCTTCGATACACAGCAGAATAAACTC [...]
+>EOG57H4P2|HSALT_3.3|Psenulus_fuscipennis|C380548-283
+ATGGCACCTCCAACATACAGTGATCTTGGTAGAAATGCCCGTGATATATTTGGCCAAGGATTTCATTTTGGTTTACTCAAATTAGATGTAAAAACTAAAACTGACTCCGGTGTAGAGTTTTCCTCCGGTGGAGTATCTAATCAAGATACAGGAAAGGTATTTGGTACCTTGGAAACTAAATACAAAATCAAAGATTATGGGCTCACATTCAGTGAGAAGTGGAACACTGACAACACTCTAGCAACTGATGTAACTTTTGCCGATAAATTGCTCAAAGGACTTACCCTTGGTTATAGCTGCACTTTCTCCCCACAAACAGGGTCCAAGACTGGAAAGTTAAAGACAACTTACAAACATGAGAATGTATCTGCAACAGCTGATTTTGATCTCAGCCTTTCTGCTGGTCCACTTATTAATGCAACATCTGTTGTAGGATACCAAGGATGGCTTGCTGGTTATCAAGCCTCTTTTGATACACAAAGAAATAAGCTT [...]
+>EOG57H4P2|AMELL_prerelease2|Pemphredon_lugens|scaffold7726-283
+ATGGCTCCCCCGTCATACAGTGACCTAGGAAATAGTGCTCGCGATATATTCGGCCAAGGATTCCATTTTGGTCTAATTAAATTAGATGTTAAAACCAAGACTAGCTCTGGGGTAGAGTTCTCCAGTGGTGGAGTATCCAATCAGGATACAGGAAAGGTATTTGGTACCTTGGAAACCAAATACAAAATTAAAGATTATGGGCTATCGTTTACCGAGAAGTGGAACACTGATAACACGCTTGCTACTGATGTCACTCTTACCGATAAATTGCTCAAAGGTCTTACCCTTGGCTATAGTTGCACCTTCTCCCCGCAAACAGGGACCAAGACTGGGAAGTTGAAGACTACTTATAAACATGACTATGTATCCGCAAATTCTGATTTTGATCTCAGTCTCTCTACTTGGCCTCTTATAAACGCATCGTCTGTAGTAGGATATCAAGGGTGGTTGGCTGGTTATCAGGCTTCTTTTGATACACAAAGAAACAAACTT [...]
+>EOG57H4P2|HSALT_3.3|Cerceris_arenaria|scaffold11516-283
+ATGGCTCCTCCGACATACAATGACTTGGGAAAACATGCTCGCGATATATTTGGCCAAGGATATCATTTTGGTCTGATGAAGTTGGATGTGAAGACCAAAACTAGCTCAGATGTAGAATTCTCTACCGGTGGTGTATCTAATCAAGATACGGGAAAAGTATTTGGTACTTTGGAAACCAAATATAAAATCAAAGATTACGGATTGTCATTTGTTGAAAAATGGAACACTGATAACACGCTTGCTACTGATGTCACCCTGACTGACAAATTGCTCAATGGACTTACCCTTGGCTATAGCTGCACCTTCTCCCCGCAAACGGGGACCAAGACTGGAAAGTTGAAGACAACTTATAAACATGAAAATGTATCTGCAACTGCTGATTTTGACCTTAGCTTGTCTGCTGGACCCCTCATCAATGCTACAGCTGTTGTAGGGCATCACGGTTGGCTGGCCGGCTATCAAGCTTCATTCGATACACAGAGAAACAAGCTG [...]
+>EOG57H4P2|AMELL_prerelease2|Gorytes_laticinctus|scaffold3341-283
+ATGGCTCCTCCAACATACAATGACTTAGGAAAAAGTGCACGCGACATATTTAGCAGTGGTTATCACTTTGGCCTGCTCAAGCTAGATGTCAAAACTAAGACCAACTCTGGAGTTGAATTCTCCAGTGGCGGAGTATCTAATCAGGATACCGGAAAGGTATTTGGTACCTTGGAAACCAAATACAAAATCAAAGATTATGGTTTAACATTCTCTGAAAAATGGAATACCGATAACACACTTGCAACCGACTTTACTTGGTCTGATAAATTGCTCAATGGTCTTACCCTTGGCTATAGCAGCACCTTTTCCCCACAAACAGGGACCAAGACCGGAAAGTTAAAGACTACTTACAAACATGAGAACGTGTCGGCAACTGCTGATTTTGACCTTAGCCTTTCTGCTGGCCCCCTTATCAATGCAACAGCTGTTGTAGGTTATCAAGGCTGGTTGGCTGGTTATCAGGCTTCTTTTGATACACAGAGGAACAAACTT [...]
+>EOG57H4P2|NVITR_1.2|Nasonia_vitripennis|NV11806-RA-283
+ATGTCTCCTCCCACGTACGGTGATCTTGGAAAGAGCGCTCGCGACGTATTCGGCAAGGGATACCACTTTGGTCTTCTGAAGCTCGATGTCAGTACCAAGACAGACTCTGGTGTGGAATTCTCCTCCGGTGGAGTCTCCAACCAAGATACCGGCAAGGTCTTTGGTACCCTTGAGAGCAAGTACAAGGTCAAGGAGTATGGCCTGACCTTTGTCGAAAAATGGAATACGGACAACACTCTTGGAGCTGATATTACTCTTGCTGACAAGCCACTACAAGGTCTCACTATCGGTTACAGTTCCACTTTCTCTCCTCAGACTGGAAACAAAACTGGTAAGCTGAAGAGCACATACAAACACGAAAATGTTGCTGTCACTGCTGACTTCGATCTGAGCCTGTCTGCTGGTCCTCTGATCAATGCCACCACAGTAGTAGGATACCAGGGTTGGTTAGCCGGCTACCAAGCTGGTTTCGATTCCCAAACCAGCAAAGTT [...]
+>EOG57H4P2|AMELL_prerelease2|Alysson_spinosus|scaffold14225-283
+ATGTCTCCGCCAACATACAGTGACTTGGGAAGACAGGCCCGTGACATATTCAGCAGTGGTTACCATTTTGGTCTGTACAAGTTGGACCTGAAGACCAAGACCAGCTCTGGTGTTGAATTCTCCAGCGGTGGTGTGTCCAATCAGGATACTGGCAAAGTATTCGGAAACCTTGAGACCAAATACAAGATCAAGGAATACGGTCTAACATTCGTCGAGAAGTGGGACACTGACAATTTGCTTGCCACTGATGTTACGTTTGCTGATAAATTGCTCAATGGACTCAGCATTGGTTACAGTTGCACCTTCTCCCCCCAGACCGGGACTAAGACTGGAAAGTTGAAGACTACTTATAAGCACCAGCATGTATCAGCGAATGCTGACTTCGACCTAAGCCTCTCCACTGGGCCTCTTATCAATACATCGGCCGTTCTTGGTTATCAAGGATGGTTGGCCGGTTATCAAGCGGCCTTCGATACACAGAGAAACAAACTT [...]
+>EOG57H4P2|HSALT_3.3|Philanthus_triangulum|scaffold2560-283
+ATGGCTCCACCATCGTACAATGACCTCGGAAAAAGTGCTCGCGACGTATTCGGCCAAGGGTATCATTTTGGTCTAATAAAATTAGATGTAAAAACTAAAACTCAGTCTGGTGTAGAATTCTCCTGTGGTGGTGTATCTAATCAAGATACAGGAAAGGTATTTGGTACTCTGGAAACCAAGTATAAAATTAAAGATTATGGATTATCTTTTACTGAGAAGTGGAATACTGATAACACACTTGCTACTGATATCACCCTTACCGATAAATTGCTCAAAGGACTTACCCTTGGCTACAGCTGCACCTTTTCTCCACAAACAGGGAGCAAGACTGGAAAGTTGAAGACAACTTATAAACATGAGAATGTGTCTGCAACTGCTGATTTTGACCTAAGTCTCTCCGCTGGACCTCTTATCAATGCAACAGCTGTTGTCGGATATCAAGGATGGTTGGCTGGTTATCAGGCTTCTTTTGATACGCAACGAAATAAGCTG [...]
+>EOG57H4P2|AMELL_prerelease2|Isodontia_mexicana|scaffold15604-283
+ATGGCTCCGCCTGTGTACAGCGACCTGGGAAAGAGCGCCCGCGATGTATTTAACAACGGTTATCACTTCGGCTTGATCAAGCTCGACGTGAAGACCAAAACCGAGACCGGACTGCAGTTCTCCACGGGCGGTGTGTCCAACCAGGATACCGGAAAGGTTCAGGGCAGCTTGGAGACTAAATACGTGATCAAGCAGCACGGATTGACGTTCGTCGAAAAATGGTCCACCGACAATACCCTTGGAACCGACGTCAAACTGGTGGACAAGTTGCTGAAGGGTCTGACCCTTGGCTACAACTGCACCTTCTCTCCGCAAACGGGAGCGAGGACGGGAAAGATAAAGACGATCTACAAGGACGAGAACGTAGCTGCCACCGCCGATTTCGATCTTAGCCTTTCCAGCGGTCCCCTGATCAACGCTTCCGGAGTAGTGGGTTATCACGGTTGGCTCGCCGGTTATCAGGTCTCCTTCGATACGCAACAGAACAAGCTC [...]
+>EOG57H4P2|HSALT_3.3|Crossocerus_quadrimaculatus|C255474-283
+ATGGCTCCACCAACGTACGGTGATCTCGGAAGGTCCGCCCGCGACGTATTCGGCCAGGGTTATCATTTCGGTCTAATCAAATTAGATGTGAAATCAAAGACCAGCTCTGGAGTTGAGTTCTCCAGTGGCGGAGTGTCCAACCAGGACACTGGAAAAGTATTTGGTACCTTAGAAACCAAGTACAAAATCAAAGACTATGGTCTGCAATTGAGCGAGAAATGGAACACTGATAATACACTGGCCAGCGACATCACGTTGACTGACAAATTGCTCAAAGGTCTCACCCTTGGTTATAGCTGTACCTTTGCTCCCCAGACAGGAGCCAGAACTGGCAAGTTGAAGACAACTTACAAGCACGAGAATGTCTCTGCCAATGCTGATGTTGATCTCAGCCTTGCTTCCCTGCCCATGGTTAATGCTGCTGCAGTCTTCGGTTATCAAGGCTGGTTGGCTGGTTACCAGGTTTCCTTTGATGTGCAAAGGAATAAACTT [...]
+>EOG57H4P2|AMELL_prerelease2|Dinetus_pictus|scaffold3518-283
+ATGGCTCCACCAACATACGGCGATCTTGGAAGATCTGCTCGTGACGTATTCAACAATGGTTATCATTTTGGTCTAATCAAATTAGACGTAAAATCCAAAACTAGCTCAGGAGTTGAGTTTTGTAGTGGTGGAGTTTCCAATCAGGATACTGGGAAGGTATTTGGTACCTTAGAGACCAAATACAAAATAAAAGATTATGGAATACAGTTCTCGGAGAAGTGGACCACTGATAACACGCTTGCTAGTGATGTGACCCTGACTGATAAATTGCTCAATGGGCTCACCCTTGGTTATAGCTGTACCTTTTCTCCGCAAACAGGGACCAAAACTGGAAAATTCAAGACAACTTACAAACATGAAAATGTTTCTGCTGCTGCTGATGTTGATCTTGGCCTTTCCACATTGCCCCTTGTTAATGCATCATCCGTCTTTGGATACCAAGGATGGCTGGCTGGTTACCAGGTCTCCTTTGATGTACAAAGGAACAAACTT [...]
+>EOG57H4P2|AMELL_prerelease2|Diodontus_minutus|C394690-283
+ATGGCTCCTCCAACATACAATGACCTAGGAAAAAGTGCTCGCGATATATTCGGGCAAGGATACCATTTTGGTCTAATTAAACTAGACGTTAAAACCAAGACTAGCTCTGGGGTAGAGTTTTCCAGTGGCGGAGTATCCAATCAGGATACTGGAAAGGTGTTTGGTACCTTGGAAACCAAATACAAAATTAAAGATTATGGGCTATCGTTTACTGAGAAGTGGAACACAGATAACACGCTTGCTACTGATGTCACTCTTACCGATAAATTGCTCAAAGGGCTTACCCTTGGCTATAGTTGCACTTTCTCCCCGCAAACAGGGACCAAAACAGGAAAGTTGAAGACAACTTACAAACATGACTACGTATCTGCAAATTCTGATTTCGATCTCAGCCTCTCTACTTGGCCTCTTATAAACGCAACGGCTGTTGTAGGATACCAAGGATGGTTGGCCGGTTATCAGGCTTCATTTGATACGCAGAGGAACAAACTT [...]
+>EOG57H4P2|AMELL_prerelease2|Sphecius_convallis|scaffold9022-283
+ATGGCCCCTCCAACATACAATGATCTTGGAAAAAGTGCTCGCGACATATTCAGCAGTGGATATCATTTTGGTTTAATCAAATTAGATGTAAAAACTACAACTACTTCTGGAGTCCAATTCTCTAGTGGGGGGGTATCTAATCAAGATACTGGAAAGGTATTTGGTACCTTGGAAACCAAATACAAAGTCAAAGATTATGGGCTAACATTCACAGAGAAGTGGAACACTGATAACACACTTGCGACTGATGTCACTTTAGCTGATAAATTGCTCAATGGTCTGACTCTTTGTTATAGCTGCACCTTTTCCCCGCAAACAGGGACCAAGGCTGGAAAGTTGAAGTCCACTTACAAGCATGAAAATGTATCAGCGACTGCTGACTTTGATCTCAGTCTTTCTGCCGGCCCTCTTATCAATGCAACGGCTGTCGTCGGATATCAAGGCTGGTTGGCCGGATATCAGGCTTCCTTTGATACGCAAAGAAACAAGCTT [...]
+>EOG57H4P2|HSALT_3.3|Crabro_peltarius|scaffold9047-283
+ATGGCCCCACCAACGTACGGTGATCTCGGAAGGTCCGCCCGCGATGTATTCGGCCAGGGTTATCATTTCGGTCTAATCAAATTAGATGTGAAATCAAAGACCAGCTCTGGAGTCGAGTTCTCCAGTGGCGGAGTGTCCAACCAGGACACTGGAAAAGTATTTGGTACCTTAGAAACCAAATACAAAATCAAAGACTATGGTCTGCAATTGAGCGAGAAATGGAACACTGATAATACACTCGCCAGCGACATCACGTTGACTGACAAATTGCTCAAAGGTCTTACCCTTGGTTATAGCTGTACCTTTGCTCCCCAGACAGGAGCCAGGACTGGCAAGTTGAAGACAACTTACAAGCATGAGAATGTCTCTGCCAATGCTGATGTTGATCTTAGCCTTGCTGCTTTGCCCATGGTCAATGCTGCGGCAGTCTTTGGCTATCAAGGCTGGTTGGCTGGTTACCAGGTCTCCTTTGATGTGCAAAGGAACAAACTT [...]
+>EOG57H4P2|AMELL_prerelease2|Harpactus_elegans|scaffold8683-283
+ATGGCTCCACCAACATACAACGACTTAGGAAAGAGCGCGCGCGACATATTTAGCAGCGGCTATCACTTTGGTCTGCTCAAGCTAGACGTAAAAACTAAAACCGAATCTGGAGTCGAGTTCTGCAGTGGTGGCGTGTCCAATCAGGATACCGGAAAGGTGTTTGGTACTTTGGAGACCAAATACAAAATCAAGGATTACGGACTAACATTCTCCGAGAAATGGAATACCGATAACACGCTCGCGACTGATGTTACTTGGTCCGACAAGTTGCTCAGTGGTCTTACCCTTGGCTATAGCAGCACCTTTTCCCCGCAAACAGGGAGCAAGACCGGAAAGTTAAAGACGACTTACAAACACGAGAATGTGTCAGCGACTGCTGACTTCGACCTCAGCCTCTCTGCTGGGCCTCTTATCAATGCAACAGCCGTTGTAGGTTATCAAGGCTGGTTGGCCGGTTATCAGGCTTCCTTTGATACACAGAGGAACAAACTC [...]
+>EOG57H4P2|AMELL_prerelease2|Prionyx_kirbii|scaffold9111-283
+ATGGCTCCACCGGTGTACAGCGACCTGGGAAAGAACGCGCGTGACGTCTTCAACAATGGCTACCATTTCGGGTTGATCAAGCTCGACGTGAAGACCAAGACCGAGACTGGATTGGAGTTCTCGACTGGTGGAGTGTCGAACCAAGACACCGGAAAGGTGCACGGCAGCTTGGAAACGAAGTATGTGATTAAGCAGCACGGACTGACGTTCGTCGAGAAATGGTCCACCGACAACACCCTTGGGACCGACGTAAAGCTGGTGGACAAGCTGCTGAAGGGCCTCACTCTTAGCTACAACTGCACTTTCTCACCACAGACTGGAGCGAGGACAGGAAAGGTAAAGACCGTGTACAAGGACGAGAACGTGGCGGCCACCGCTGACTTTGATCTCAGCCTTTCCAGTGGCCCTCTGATCAATACCTCCGGAGTCGTCGGATACCACGGTTGGCTCGCTGGCTACCAGGTATCCTTCGATACACAGCAGAACAAACTG [...]
+>EOG57H4P2|AMELL_prerelease2|Bembix_rostrata|scaffold14310-283
+ATGGCCCCTCCAACGTACAATGATCTAGGAAAGAGTGCTCGTGATATATTTAGCAGTGGTTACCATTTTGGTCTAATCAAATTAGATGTAAAAACCACAACTAACTCTGGCGTTGAATTCTCTAGTGGTGGGGTATCTAATCAAGATACTGGAAAAGTGTTTGGTACCTTGGAAACCAAATACAAGATCAAAGATTATGGGCTAACATTCAGCGAGAAGTGGAATACCGATAACACACTTGCCACTGATGTTACTTTGGCTGATAAATTGCTCAATGGTCTTACTCTTGGTTACAGCTGCACCTTTTCTCCTCAAACAGGGAGCAAGGCTGGAAAATTGAAGACAACTTACAAGCATGAAAATGTATCAGCAACCGCTGATTTTGATCTCAGCCTTTCTGCTGGACCTTTGATCAATGCGACAGCCGTTGTCGGATATCAAGGCTGGTTGGCTGGTTATCAGGCTTCTTTTGACACACAAAGAAATAAACTT [...]
+>EOG57H4P2|AMELL_prerelease2|Podalonia_hirsuta|C368799-283
+ATGGCTCCACCAGTGTACAGTGACCTGGGCAAAAGCGCGCGCGATGTGTTCAACAATGGCTACCACTTTGGGCTGATCAAGCTCGACGTGAAGACCAAGACCGAGACCGGTCTGGAGTTCTCCACGGGTGGAGTTTCCAACCAGGACACAGGCAAGGTGCACGGAAGCTTGGAGACCAAATACGTGATCAAACAGCACGGTCTGACCTTCGTCGAGAAGTGGTCCACTGACAACACCCTTGGAACTGACGTGAAGCTCGTCGACAAGCTGCTGAAGGGCCTGACTCTCAGCTACAACTGCACCTTCTCACCGCAGACAGGGGCGAAAACAGGAAAGATAAAGACAGTCTACAAGGACGAGAATGTGGCAGCGACCGCCGACTTTGATCTTAGCCTTTCCAGTGGACCCCTTATCAATACGTCCGGTGTTATCGGCTACCATGGTTGGCTCGCCGGCTACCAGGTGTCCTTTGATACACAGCAGAACAAGCTC [...]
+>EOG57H4P2|HSALT_3.3|Trypoxylon_figulus|scaffold9021-283
+ATGGCTCCACCAACATACGGTGATCTTGGAAGATCCGCTCGTGACATATTCGGCCAGGGTTATCATTTTGGTATAATCAAGTTAGATGTGAAATCTAAAACCAGCTCTGGGGTTGAATTCTGTAGCGGTGGAGTCTCTAACCAGGATACTGGAAAAGTATTTGGTACATTAGAAACCAAATATAAAATTAAAGAATATGGACTTCAGCTGAGCGAGAAGTGGAACACTGATAATACACTTGCCAGTGACATTACGCTTACTGACAAATTGTTGAAGGGGCTTACCTTGGGCTATAGCTGTACCTTTGCTCCACAAACAGGGGCTAGAACTGGCAAGTTGAAGACAACGTATAAACATGAAAATGTATCTGCGACCGCAGATGTTGATCTTAGTTTGTCTACTCTCCCTATGGTCAACGCAACAACCGTGTTTGGTTATCAAGGGTGGTTAGCTGGATATCAACTTTCTTTTGACGTACAAAGGAATAAACTC [...]
diff --git a/Example/Example-without-alignment-cutting/alignments/EOG5DV4JW.fas b/Example/Example-without-alignment-cutting/alignments/EOG5DV4JW.fas
new file mode 100644
index 0000000..defd53e
--- /dev/null
+++ b/Example/Example-without-alignment-cutting/alignments/EOG5DV4JW.fas
@@ -0,0 +1,50 @@
+>EOG5DV4JW|AMELL_prerelease2|Podalonia_hirsuta|scaffold1817-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAGGGTGTGGAGACATTCGAAGATATTTGGCAGAAAGTTCATAATGCCACGAACAGCAATCAAAAGGAAAAGTATGAAGCGGATCTTAAGAAGGAAATCAAAAAGCTTCAAAGGTTACGCGATCAGATTAAAAGTTGGATCGCATCAGGAGAAATTAAAGATAAAAGCACACTGCTCGATTACAGGAAGTTAATTGAAACTCAAATGGAGAGGTTTAAGGTAGTGGAGAGAGAGACGAAAACGAAGGCTTATTCGAAGGAGGGTTTAGGGGCAGCTCAAAAGCTTGATCCGGCTCAAAAAGAAAGGGAAGAAGTCAGTAACTGGCTAACGAATTCCATAGATTCTTTGAACCTTCAGGTGGACACCTTCGAATCCGAGATGGAGTCGTTACTCGCGGGGAAGAAGAAAAGGCTAGATAAGGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Oxybelus_bipunctatus|scaffold6189-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAAGGTGTGGAAACATTTGAAGATATCTGGCAAAAAGTTCATAATGCTACCAACAGTAACCAGAAGGAAAAGTATGAAGCAGATCTTAAGAAGGAGATCAAAAAGCTTCAAAGGTTACGCGATCAGATCAAGAGCTGGATCGCATCAGGAGAAATCAAGGATAAGAGTACACTCCTTGATTACAGAAAGTTAATTGAGACTCAAATGGAAAGGTTTAAAGTTGTAGAAAGGGAAACCAAAACAAAGGCTTACTCAAAGGAAGGTTTAGGGGCAGCTCAGAAACTTGATCCAGCACAAAAAGAAAGGGAAGAAGTTAGCAATTGGCTTGCGAATTCCATAGATGCTTTAAATCTTCAGCTGGATACTTTTGAATCGGAAATAGAATCCTTACTAGCGGGAAAGAAAAAGAAATTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|NVITR_1.2|Nasonia_vitripennis|NV13753-RA-684
+ATGGCTGCGACGAGAAAGTTGCAAGGGGAAATCGATAGGTGCCTTAAGAAAGTAACAGAAGGTGTTGAGACTTTTGAGGATATCTGGCAAAAAGTACATAATGCCACAAACAGCAATCAGAAGGAAAAGTATGAAGCTGATCTCAAAAAAGAGATCAAGAAGCTTCAGAGGTTACGAGATCAAATCAAAAGTTGGATTGCTTCCGGAGAAATCAAGGATAAGAGTACACTGCTCGATTACCGAAAACTTATTGAGACGCAAATGGAAAGATTCAAGGTTGTGGAACGAGAAACCAAAACAAAAGCTTACTCTAAAGAAGGCTTAGGAGCTGCTCAAAAATTAGATCCTGCACAAAAAGAAAAGGAGGAAGTCAGTAACTGGCTTGCAAACTCTATAGATACTCTTAATTTGCAGATTGATACTTTTGAATCAGAAATTGAATCCTTACTAGCAGGAAAGAAAAAAAAGTTGGACAAGGATAAACAAGATAGA [...]
+>EOG5DV4JW|AMELL_prerelease2|Stizoides_tridentatus|scaffold9470-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAGGGAGTGGAGACGTTTGAAGATATTTGGCAGAAGGTTCATAATGCGACAAACAGCAATCAGAAGGAGAAATATGAAGCGGATCTTAAGAAGGAAATCAAAAAGCTTCAGAGGTTACGCGACCAAATCAAAAGTTGGATTGCGTCAGGCGAAATTAAGGATAAGAGTACGCTTCTTGACTACAGGAAGCTAATCGAGACTCAAATGGAAAGGTTTAAGGTCGTGGAGAGAGAAACGAAAACAAAGGCTTACTCGAAGGAGGGCTTAGGGGCAGCTCAAAAGCTCGATCCAGCCCAGAAAGAGAGAGAGGAAGTTAGTAATTGGCTCGCGAGTTCCATAGACGCTTTAAATATTCAGCTGGATACGTTTGAATCCGAGATAGAATCGTTACTCGCAGGAAAGAAAAAAAAGTTAGATAGAGATAAGCAAGACAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Prionyx_kirbii|scaffold12604-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAAGGTGTGGAGACATTTGAGGATACCTGGCAGAAAGTTCATAATGCCACAAACAGCAATCAAAAAGAAAAATATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTTCAAAGGTTACGCGACCAGATTAAAAGTTGGATTGCATCAGGAGAAATTAAAGATAAAAGCACATTGCTTGATTACAGGAAGTTAATTGAGACTCAAATGGAGAGGTTTAAGGTTGTAGAGAGAGAAACAAAAACTAAGGCTTATTCTAAGGAAGGTCTTGGGGCAGCTCAAAAACTTGATCCAGCTCAGAAAGAGAGAGAAGAAGTTAGCAATTGGCTCACGAATTCCATAGATTCTTTGAATCTTCAGGTGGATACGTTTGAATCCGAGATGGAATCGTTACTCGCGGGAAAGAAGAAAAGGTTAGATAAGGATAAGCAGGATAGA [...]
+>EOG5DV4JW|AMELL_prerelease2|Sphex_funerarius|scaffold12310-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAAGGTGTGGAGACATTTGAAGATATCTGGCAGAAAGTTCATAATGCCACGAACAGCAATCAAAAAGAAAAATATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTTCAAAGGTTACGCGATCAGATTAAAAGTTGGATTGCATCTGGAGAAATTAAAGATAAAAGCACACTGCTTGATTACAGGAAGTTAATTGAGACTCAAATGGAAAGGTTTAAAGTTGTAGAGAGAGAAACGAAGACAAAAGCTTATTCAAAAGAAGGTTTAGGGGCAGCTCAAAAACTTGACCCGGCTCAAAAGGAAAGAGAAGAAGTTAGCAATTGGCTCACAAATTCTATAGATTCTTTGAACCTTCAGGTGGATACGTTTGAATCCGAGATGGAATCCTTGCTTGCGGGGAAAAAGAAAAGGTTAGATAAAGATAAGCAGGATAGA [...]
+>EOG5DV4JW|AMELL_prerelease2|Cerceris_arenaria|scaffold10959-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGAACGGTGCCTTAAAAAAGTAACGGAGGGTGTAGAGACGTTCGAGGATATCTGGCAGAAGGTTCATAATGCCACGAATAGCAACCAGAAAGAAAAGTATGAAGCAGATCTTAAGAAGGAAATTAAAAAACTTCAAAGGTTACGTGATCAAATCAAAAGTTGGATTGCATCAGGCGAGATTAAGGATAAGAGCACGCTTCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAAAGGTTTAAAGTTGTGGAGAGAGAAACAAAAACAAAGGCTTATTCGAAAGAAGGTTTAGGAGCAGCTCAGAAGCTAGATCCAGCTCAAAAAGAAAGAGAAGAAGTTAGCAATTGGCTTGCGAATTCCATAGATGCTTTAAATCTTCAGATGGATACATTTGAATCCGAGATAGAATCGTTACTCGCGGGAAAGAAGAAAAGGTTAGATAAGGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Crabro_peltarius|scaffold5257-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGACCGGTGCCTTAAAAAAGTAACAGAGGGTGTGGAAACATTTGAGGACATTTGGCAGAAGGTTCATAATGCCACTAACAGCAATCAAAAGGAAAAATACGAGGCCGATCTCAAGAAGGAGATCAAAAAGCTTCAAAGGTTACGAGATCAAATCAAGAGTTGGATTGCATCTGGAGAGATCAAGGACAAAAGTACCCTCCTTGATTACAGGAAGCTAATTGAGACTCAAATGGAAAGGTTTAAAGTAGTTGAGAGGGAGACGAAAACAAAGGCGTATTCGAAGGAAGGTTTAGGTGCAGCTCAAAAACTTGATCCAGCTCAAAAGGAAAGGGAAGAAGTTAGCAATTGGCTCGCAAATTCCATAGACGCTTTAAATCTGCAGCTGGATACATTTGAATCGGAAATAGAGTCGTTACTCGCGGGGAAGAAAAAGAAATTAGACAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Isodontia_mexicana|scaffold5063-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAAGGTGTGGAGACATTCGAGGATATTTGGCAGAAAGTTCATAATGCCACGAACAGCAATCAAAAGGAAAAATATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTTCAAAGGTTACGCGACCAGATTAAAAGTTGGATTGCATCAGGAGAAATTAAAGATAAAAGCACGTTGCTTGATTACAGAAAGTTAATCGAGACTCAAATGGAGAGGTTTAAAGTTGTAGAGAGAGAAACAAAAACGAAGGCTTATTCGAAAGAAGGCTTGGGGGCAGCTCAAAAACTTGATCCAGCTCAAAAAGAAAGGGAAGAAGTTAGCAATTGGCTCACGAATTCCATAGATTCATTGAACCTTCAGGTGGATACGTTTGAATCCGAAATGGAATCGTTACTTGCGGGGAAGAAAAAAAGGTTAGATAAAGATAAGCAGGATAGA [...]
+>EOG5DV4JW|AMELL_prerelease2|Sceliphron_curvatum|scaffold5052-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAAGGTGTGGAGACATTTGAGGACATTTGGCAGAAAGTTCATAATGCCACAAACAGCAATCAAAAGGAAAAATATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTTCAAAGGTTACGTGACCAGATTAAAAGTTGGATTGCATCAGGAGAAATTAAAGATAAAAGCACACTGCTTGATTACAGGAAGTTAATTGAAACTCAAATGGAGAGGTTTAAAGTTGTAGAAAGAGAAACAAAAACCAAGGCTTACTCAAAGGAAGGCTTAGGGGCAGCTCAAAAACTTGATCCGGCTCAAAAGGAGAGGGAAGAAGTTAGCAATTGGCTTGCGAATTCCATAGATTCTTTAAACCTTCAGTTGGATACATTTGAATCCGAGATGGAATCGTTACTCGCGGGGAAGAAGAAAAGGTTAGACAAAGATAAGCAGGATAGA [...]
+>EOG5DV4JW|AMELL_prerelease2|Gorytes_laticinctus|C305731-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGTGTGGAAACATTTGAGGATATTTGGCAGAAGGTTCATAATGCTACAAACAGTAATCAGAAGGAGAAGTATGAAGCGGATCTTAAGAAGGAAATCAAAAAGCTCCAGAGGTTACGTGATCAGATCAAAAGTTGGATTGCGTCAGGCGAAATTAAGGATAAGAGTACACTCCTTGACTACAGGAAGTTAATCGAAACTCAAATGGAAAGGTTTAAGGTCGTGGAGAGAGAAACAAAAACAAAGGCTTACTCGAAGGAGGGCTTAGGGGCAGCTCAGAAGCTTGATCCAGCCCAGAAAGAGCGGGAAGAAGTTAGTAATTGGCTTGCGAGCTCCATAGACGCATTAAATATTCAGCTGGATACGTTTGAATCCGAGATAGAATCGTTACTCGCAGGAAAGAAAAAAAAGTTAGATAGAGATAAGCAGGACAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Psenulus_fuscipennis|scaffold11629-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAAGGTGTAGAGACGTTTGAAGATATTTGGCAGAAAGTTCATAATGCCACAAACAGCAATCAGAAGGAGAAATATGAAGCAGATCTTAAGAAGGAAATCAAAAAGCTCCAGAGGCTACGCGATCAAATCAAAAGCTGGATTGCGTCAGGAGAGATTAAGGATAAGAGCACGCTTCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAAAGGTTTAAAGTTGTGGAGAGAGAAACAAAAACAAAGGCTTATTCGAAGGAAGGTTTAGGGGCAGCTCAAAAACTTGATCCAGCTCAAAAAGAAAGGGAAGAAGTCAGCAATTGGCTTGCAAATTCCATAGATGCTTTAAATCTACAGCTGGATACGTTTGAATCTGAGATAGAGTCGTTACTCGCGGGAAAGAAAAAAAGGTTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Crossocerus_quadrimaculatus|scaffold8567-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGACCGGTGCCTTAAAAAAGTAACAGAGGGTGTGGAAACATTTGAGGACATTTGGCAGAAGGTTCATAATGCCACTAACAGCAATCAAAAGGAAAAATACGAGGCCGATCTCAAGAAGGAGATCAAAAAGCTTCAAAGGCTACGAGATCAAATCAAGAGTTGGATCGCATCTGGAGAGATCAAGGACAAAAGTACCCTCCTTGATTACAGGAAGCTAATTGAGACTCAAATGGAAAGGTTTAAAGTAGTTGAGAGGGAGACGAAAACGAAGGCGTATTCGAAGGAAGGTTTAGGTGCAGCTCAAAAACTTGATCCAGCTCAAAAGGAAAGGGAAGAAGTTAGCAATTGGCTCGCAAATTCCATAGACGCTTTAAATCTGCAGCTGGATACATTTGAATCGGAAATAGAGTCGTTACTCGCGGGGAAGAAAAAGAAATTAGACAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Philanthus_triangulum|scaffold11297-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGTGTAGAGACGTTTGAAGATATTTGGCAGAAAGTTCATAATGCCACAAACAGCAACCAGAAGGAGAAATATGAAGCAGATCTTAAGAAGGAAATCAAAAAACTCCAGAGGTTACGCGATCAGATTAAAAGCTGGATTGCATCCGGCGAGATTAAGGATAAGAGCACGCTTCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAGAGGTTTAAAGTTGTGGAGAGAGAAACTAAAACAAAGGCTTATTCGAAAGAAGGTTTAGGGGCAGCTCAGAAACTCGATCCAGCTCAAAAAGAAAGAGAAGAAGTTAACAATTGGCTTGCAAGTTCCATAGAGGCTTTAAATTTTCAGCTGGATAAATTTGAATCCGGGATAGAATCGTTAGGCGCAGGAAAGAAAAAAAAGTTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Pemphredon_lugens|C404992-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGTGTGGAAACCTTTGAGGATATTTGGCAGAAGGTTCATAATGCTACAAACAGCAATCAGAAGGAAAAGTATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTCCAAAGGTTACGCGATCAGATCAAAAGCTGGATTGCATCTGGCGAGATTAAGGATAAGAGCACGCTTCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAAAGGTTTAAAGTCGTGGAGAGAGAAACGAAAACAAAGGCTTACTCGAAGGAAGGTTTAGGGGCAGCTCAAAAGCTCGATCCAGCTCAAAAAGAAAGAGAAGAAGTTAGTAATTGGCTCGCAAATTCCATAGACGCTTTAAATATACAGCTGGATACGTTTGAATCCGAGATAGAATCCTTACTCGCAGGAAAGAAAAAAAGGTTAGATAAAGATAAGCAAGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Chalybion_californicum|scaffold9674-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAGGGTGTGGAGACATTCGAGGACATTTGGCAGAAAGTTCATAATGCCACAAACAGCAATCAAAAAGAAAAATATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTTCAAAGGTTACGTGACCAGATTAAAAGTTGGATTGCATCAGGAGAAATTAAAGATAAGAGCACACTACTTGATTACAGGAAGTTAATTGAAACTCAAATGGAGAGGTTTAAAGTTGTAGAGAGAGAAACAAAAACGAAGGCTTATTCAAAGGAAGGCTTAGGAGCAGCTCAAAAACTTGATCCGGCTCAAAAAGAAAGGGAAGAAGTTAGCAATTGGCTTGCGAATTCCATAGACTCTTTAAATCTTCAGCTGGATACATTTGAATCCGAGATGGAATCGTTACTTGCGGGGAAGAAGAAAAGGTTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Sphecius_convallis|C323183-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAGGGAGTGGATACCTTTGAGGATATTTGGCAGAAGGTTCATAATGCTACAAACAGTAATCAGAAGGAAAAATATGAAGCAGATCTTAAGAAGGAAATCAAAAAACTCCAGAGGTTACGCGATCAAATCAAAAGTTGGATTGCGTCAGGCGAAATTAAGGATAAGAGCACGCTTCTTGATTACAGGAAGTTAATCGAAACTCAAATGGAAAGGTTTAAAGTGGTGGAGAGAGAAACAAAAACAAAGGCTTACTCGAAGGAGGGCTTAGGGGCAGCTCAAAAGCTTGATCCAGCCCAGAAAGAAAGAGAGGAAGTTAGTAATTGGCTCGCAAGCTCAATAGATGCTTTAAATATTCAGCTGGATACGTTTGAATCCGAGATAGAATCGTTACTCGCAGGAAAGAAAAAAAAGTTAGATAGAGATAAGCAGGACAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Harpactus_elegans|scaffold8562-676
+------------------------GGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGTGTGGAAACATTTGAGGATATTTGGCAGAAGGTTCATAATGCTACAAACAGTAATCAGAAGGAGAAGTATGAAGCGGATCTTAAGAAGGAAATCAAAAAGCTCCAAAGGTTACGTGATCAGATCAAAAGTTGGATTGCGTCAGGCGAAATTAAGGATAAGAGTACACTTCTTGACTACAGGAAGTTAATCGAAACTCAAATGGAAAGGTTTAAGGTCGTGGAGAGAGAAACAAAAACAAAGGCTTACTCGAAGGAGGGCTTAGGGGCAGCTCAAAAGCTTGATCCAGCCCAGAAAGAGAGGGAGGAAGTTAGTAATTGGCTTGCAAGCTCCATAGACGCGCTAAATATTCAGCTGGATACGTTTGAATCCGAGATAGAATCGTTACTCGCAGGAAAGAAAAAAAAGTTAGATAGAGATAAGCAGGACAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Dinetus_pictus|C317002-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAGGGTGTGGAAACATTTGAGGATATCTGGCAAAAAGTTCATAATGCCACAAATAGCAATCAGAAGGAGAAATATGAAGCAGATCTTAAGAAGGAAATCAAAAAACTCCAAAGGTTACGCGATCAGATCAAGAGCTGGATTGCATCAGGAGAGATTAAGGATAAGAGTACTCTTCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAAAGGTTTAAAGTCGTGGAAAGGGAAACAAAAACAAAGGCATATTCTAAGGAAGGCTTAGGGGCAGCTCAGAAGCTTGATCCAGCTCAAAAAGAAAGGGAAGAAGTTAGCAATTGGCTTGCAAATTCCATAGATGCTTTAAATCTTCAGCTGGATACGTTTGAATCCGAGATAGAATCGTTACTCGCAGGAAAGAAAAAAAAGTTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Alysson_spinosus|scaffold3007-685
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTGACAGAGGGTGTGGAGACATTCGAGGACATTTGGCAGAAAGTTCACAATGCCACTAACAGTAATCAGAAGGAGAAGTATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTCCAGAGGTTACGCGATCAGATCAAAAGCTGGATCGCATCAGGCGAGATTAAGGATAAGAGCACACTTCTGGACTACAGGAAGTTAATTGAAACTCAAATGGAAAGGTTCAAAGTCGTGGAGAGAGAAACGAAAACAAAGGCTTACTCGAAGGAGGGTTTGGGCGCTGCGCAAAAACTAGATCCTGCCCAAAAGGAAAGGGAAGAAGTTAGCAATTGGCTTGCGAGTTCCATAGACGCGTTAAACCTTCAGATGGATACGTTTGAGTCCGAGATTGAGTCGTTACTCGTGGGAAAAAAGAAGAGGTTAGACAAGGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Diodontus_minutus|scaffold11064-687
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGTGTGGAAACGTTTGAGGATATTTGGCAGAAAGTTCATAATGCCACAAACAGCAATCAGAAGGAAAAGTATGAAGCGGATCTTAAGAAGGAAATCAAAAAACTGCAAAGGTTACGCGATCAGATCAAAAGCTGGATCGCGTCAGGCGAGATTAAGGATAAAACTACGCTTCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAAAGGTTTAAAGTTGTGGAGAGAGAAACGAAAACAAAGGCTTACTCGAAGGAGGGTTTAGGGGCAGCTCAAAAGCTCGATCCAGCTCAGAAAGAGAGAGAGGAAGTTAGTAATTGGCTCGCAAATTCCATAGACGCTTTAAATATACAGCTGGATACATTTGAATCCGAGATAGAATCCTTACTCGCAGGAAAGAAAAAAAGGTTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Trypoxylon_figulus|scaffold8972-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAAGGTGTGGAGACGTTCGAGGATATTTGGCAGAAAGTTCATAATGCTACTAATAGCAATCAGAAGGAGAAGTATGAAGCAGATCTCAAGAAGGAAATCAAAAAGCTTCAAAGGTTACGCGACCAGATCAAAAGCTGGATCGCGTCAGGAGAGATTAAGGATAAGAGCACTCTCCTTGACTACAGGAAGTTAATTGAAACTCAAATGGAGAGGTTTAAAGTTGTGGAGAGGGAGACAAAAACAAAAGCATATTCGAAGGAAGGTTTAGGTGCAGCTCAGAAGCTAGATCCAGCTCAAAAGGAGAGAGAAGAAGTGAGCAATTGGCTTGCAAACTCCATAGATGGTTTAAATCTTCAGATGGATACATTTGAATCCGAGATTGAGTCGTTACTCGCAGGGAAAAAGAAAAAATTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Nysson_niger|scaffold3457-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGTGTGGAGACGTTTGAGGATATTTGGCAAAAGGTTCATAATGCCACAAACAGTAATCAGAAGGAAAAGTATGAAGCAGATCTTAAAAAGGAAATCAAAAAACTCCAGAGGTTACGCGATCAGATTAAAAGCTGGATTGCGTCTGGTGAAATTAAGGATAAAAGTACACTTCTTGATTATAGAAAGCTAATAGAAACTCAAATGGAAAGGTTTAAAGTTGTGGAGAGAGAAACAAAAACAAAGGCTTACTCGAAGGAGGGCTTAGGTGCAGCTCAAAAGCTTGATCCAGCTCAAAAAGAAAGGGAAGAAGTTAGCAATTGGCTGGCGACTTCCATAGATGCTTTAAATCTTCAGCTGGATACATTTGAATCCGAGATAGAATCGTTACTCGCGGGAAAGAAAAAGAGGTTAGATAAAGATAAGCAGGATAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Bembix_rostrata|scaffold12970-684
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACGGAGGGAGTGGAGACATTTGAGGATATTTGGCAGAAAGTTCATAATGCCACAAACAGTAATCAGAAGGAGAAATATGAGGCGGATCTTAAGAAGGAAATCAAAAAGCTCCAGAGGTTACGCGATCAAATCAAAAGTTGGATTGCGTCAGGCGAAATTAAGGATAAGAGTACGCTTCTTGACTACAGGAAGTTAATCGAAACTCAAATGGAAAGGTTTAAAGTTGTGGAGAGAGAAACGAAAACAAAGGCTTACTCGAAGGAGGGTTTGGGGGCAGCTCAGAAGCTTGATCCGGCCCAAAAAGAGAGAGAGGAAGTTAGTAATTGGCTGGCGAGTTCCATAGACGCTTTAAATATTCAGCTGGATACGTTTGAATCCGAGATAGAATCGTTACTCGCAGGAAAGAAAAAAAAGTTAGATAGAGATAAGCAGGACAGG [...]
+>EOG5DV4JW|AMELL_prerelease2|Tachysphex_fulvitarsis|scaffold9009-683
+ATGGCTGCGACGAGAAAGTTGCAAGGTGAAATAGATCGGTGCCTTAAAAAAGTAACAGAAGGAGTGGAAACATTTGAAGATATTTGGCAGAAAGTTCATAATGCTACCAACAGCAATCAAAAGGAAAAATATGAAGCAGATCTCAAGAAGGAAATCAAAAAGCTTCAAAGGTTACGCGATCAGATCAAGAGCTGGATCGCATCAGGAGAGATTAAGGATAAGAGTACCCTTCTTGATTACAGAAAGTTAATTGAAACTCAAATGGAAAGGTTTAAAGTTGTAGAAAGGGAAACAAAAACAAAAGCTTATTCAAAGGAAGGTTTGGGGGCAGCTCAGAAGCTTGATCCAGCTCAAAAGGAAAGGGAAGAAGTTAGCAATTGGCTTGCAAATTCCATAGATGCTTTAAATTTACAGCTGGATACATTTGAATCCGAGATAGAGTCGTTACTCGCAGGGAAAAAGAAAAAATTAGATAAAGATAAGCAGGATAGA [...]
diff --git a/Example/Example-without-alignment-cutting/parameter.txt b/Example/Example-without-alignment-cutting/parameter.txt
new file mode 100644
index 0000000..13c8d8a
--- /dev/null
+++ b/Example/Example-without-alignment-cutting/parameter.txt
@@ -0,0 +1,43 @@
+### This is the parameter file of the BaitFisher program.
+#   In order to start BaitFisher with the set of parameters specified in this file
+#   navigate on the command line into the folder in which you want to start BaitFischer.
+#   Then type "BaitFischer parameterfile.txt" on the command line.
+
+#################################################################################################################################################
+# General parameters that are required:
+#################################################################################################################################################
+directory-transcript-files       	alignments
+bait-length                      	120 
+cluster-threshold                	0.15
+bait-offset                      	20
+bait-number			 	            7
+output-directory    		 	    BaitFisher-results 
+
+#################################################################################################################################################
+# General parameters that are optional:
+#################################################################################################################################################
+remove-reference-sequence		no  # yes/no
+alignment-cutting		        no  # yes/no
+
+
+# The required-taxonomic-groups-file parameter specifies the .....
+required-taxonomic-groups-string 
+
+#Optional, since default values are assumed if not specified by user:
+sequence-name-field-delimiter 		|    # Default: "|". Must be a single character
+sequence-name-taxon-field_number	2    # Default: 2		
+sequence-name-geneID-field_number	3    # Default: 3
+
+#################################################################################################################################################
+# If alignment-splitting is set to yes, the following program parameters have to be specified:
+#################################################################################################################################################
+#gff-file-reference-genome		
+#reference-genome-file           
+#reference-genome-name		 	
+
+#Optional, since default values are assumed if not specified by user:
+#gff-feature-name                        CDS        # Default: CDS
+#gff-record-attribute-name-for-geneID    Parent
+centroid-computation-mode               heuristic  # Default: heuristic
+verbosity								5          # Default: 5
+#################################################################################################################################################
diff --git a/Example/Example-without-alignment-cutting/run-command b/Example/Example-without-alignment-cutting/run-command
new file mode 100755
index 0000000..d537f3e
--- /dev/null
+++ b/Example/Example-without-alignment-cutting/run-command
@@ -0,0 +1 @@
+../../BaitFisher-v1.2.7 parameter.txt 1> console_output 2> console_error_output 
diff --git a/GFF-class.h b/GFF-class.h
new file mode 100644
index 0000000..beb4c97
--- /dev/null
+++ b/GFF-class.h
@@ -0,0 +1,633 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef GFF_RECORD_H
+#define GFF_RECORD_H
+
+#include "easystring.h"
+#include <vector>
+#include "range_functions.h"
+#include "cstdio"               // for FILE
+#include "CSequence_Mol2_1.h"
+
+//***********************************************************************************
+// In the long run, we intend to follow the conventions specified in: http://www.bioperl.org/wiki/GFF3
+// In particular the handling of special characters does not conform to this standard yet.
+
+// Convention: fstart and fend are the direct gff field entries 4 and 5. Minimum value is 1. The end value is the last position in the feature.
+//             This convention is not identical to the convention in CgenomeFeature class, where all values are 0 based.
+//             In this class the philisoph is to be as close as possible to the value in the file.
+//             Example: First three bases of seq.: 1,3 
+//
+//             Convention has been checked.
+//***********************************************************************************
+
+using namespace std;
+
+static const easystring empty_easy_string;
+
+// Forward declaration of friend functions of the classes in this file. This avoids the friend-injection problem:
+class GFF_record;
+bool position_lessThan_GFF_record(GFF_record &, GFF_record &);
+bool position_lessThan_GFF_record_pointer(GFF_record *, GFF_record *);
+
+
+class GFF_record {
+
+ private:
+  easystring                   parse_error;
+
+  easystring                   seqname;     // gff field 1
+  easystring                   source;      // gff field 2
+  easystring                   feature;     // gff field 3
+  unsigned                     fstart;      // gff field 4
+  unsigned                     fend;        // gff field 5 // According to the gff file conventions this is an inclusive end.
+  easystring                   score;       // gff field 6
+  char                         strand;      // gff field 7
+  char                         phase;       // gff field 8
+  std::vector<easystring>      att_names;
+  std::vector<easystring>      att_names_lower_case;
+  std::vector<easystring>      att_values;
+
+
+ public:
+  GFF_record (const std::string &str)
+  {
+    parse_string(str);
+  }
+
+  GFF_record (const easystring &str)
+  {
+    parse_string(str);
+  }
+
+  GFF_record (easystring &p_seqname,
+	      easystring &p_source,
+	      easystring &p_feature,
+	      unsigned   p_fstart,
+	      unsigned   p_fend,
+	      easystring &p_score,
+	      char       p_strand,
+              char       p_phase,
+	      easystring &p_att
+	      ):
+  seqname(p_seqname), source(p_source), feature(p_feature), fstart(p_fstart),
+    fend(p_fend), score(p_score), strand(p_strand), phase(p_phase)
+  {
+    parse_attributes(p_att);
+  }
+
+
+  unsigned good() const
+  {
+    return parse_error.empty();
+  }
+
+  std::string getErrorReason() const
+  {
+    return parse_error;
+  }
+
+
+ private:
+
+  bool parse_attributes(const easystring &tmp_att)
+  {
+    int i, att_num;
+    std::vector<std::easystring> sv;
+
+    att_num = split_respect(sv, tmp_att, ";");
+    
+    //    std::cerr << "+++ Number of attributes found: " << att_num << std::endl;
+
+    easystring   key;
+    easystring   val;
+    std::size_t  index;
+    //    unsigned     num_quotes1, num_quotes2;
+
+    for (i=0; i<att_num; ++i)
+    {
+      sv[i].removeSpacesFront();
+      sv[i].removeSpacesBack();
+      
+      index = sv[i].find_first_of(" =");
+      if (index == std::string::npos)
+      {
+	parse_error = "Unrecognized attribute: \"" + sv[i] + "\"";
+	return false;
+      }
+      key = easystring(sv[i].begin(),     sv[i].begin()+index);
+      //      cerr << "new key: " << key << endl;
+      while (index < sv[i].size() &&
+	     (sv[i][index] == ' ' || sv[i][index] == '=') )
+	++index;
+      if (index == sv[i].size() )
+      {
+	parse_error = "Unrecognized attribute: \"" + sv[i] + "\"";
+	return false;	
+      }
+      val = easystring(sv[i].begin()+index, sv[i].end() );
+      //      cerr << "new val: " << val << endl;
+
+      // Drop the following checks since quotes can occur as singletons:
+      // Example: "3' UTR"
+/*       // More error checks concerning val could be useful */
+/*       num_quotes1 = val.countChar('\"'); */
+/*       num_quotes2 = val.countChar('\''); */
+
+/*       if (num_quotes1 % 2 != 0 || num_quotes2 % 2 != 0) */
+/*       { */
+/* 	parse_error = "unmatched quotes on in attribute field. Attribute: " + key;  */
+/* 	return false;	 */
+/*       } */
+      att_names.push_back(key);
+      key.ToLower();
+      att_names_lower_case.push_back(key);
+      att_values.push_back(val);
+    }
+    return true;
+  }
+
+  bool parse_string(const easystring &str)
+  {
+    std::vector<std::easystring> sv;
+    easystring                   tmp_att;
+    int                          i, split_num;
+
+    // We use split_strict since successive tabs are not allowed
+    split_num = split_strict(sv, str, "\t");
+    
+    if (split_num != 9)
+    {
+      parse_error = "wrong number of tab deliminated fields";
+      return false;
+    }
+
+    for (i=0; i<9; ++i)
+    {
+      sv[i].removeSpacesFront();
+      sv[i].removeSpacesBack();
+
+      if ( sv[i].empty() )
+      {
+	parse_error = "on the tab deliminated line the field with position" + easystring(char(i+49)) + " is empty";
+	return false;
+      }
+    }
+
+    seqname = sv[0];
+    source  = sv[1];
+    feature = sv[2];
+    fstart  = sv[3].ToUnsigned();
+    fend    = sv[4].ToUnsigned();
+    score   = sv[5];
+    strand  = sv[6][0];          // Result must be checked.
+    phase   = sv[7][0];          // Result must be checked.
+    tmp_att = sv[8];
+
+    if (fstart > fend)
+    {
+      parse_error = "start > end";
+      return false;
+    }
+    
+    if (strchr("+-?.0",strand) ==  NULL)
+    {
+      parse_error = easystring("wrong strand symbol \"") + strand + "\". Must be one of \"+-?.0\"";
+      return false;
+    }
+    
+    if (strchr("012+-.", phase) ==  NULL)
+    {
+      parse_error = easystring("wrong phase symbol \"")  + phase + "\". Must be one of \"012+-.\"";
+      return false;
+    }
+
+    return parse_attributes(tmp_att);
+  }
+
+ public:
+
+  easystring         getSeqid   () { return seqname; }
+  easystring         getSource  () { return source;  }
+  easystring         getFeature () { return feature; }
+  unsigned           getStart   () { return fstart;  }
+  unsigned           getEnd     () { return fend;    }
+
+  unsigned           getStartIndex   () { return fstart-1;  }  // Lowest index is 0
+  unsigned           getEndIndex     () { return fend;      }  // Is index after last index that lies in the feature.
+                                                               // This is equal to the last position in feature. fend has lowest value 1.
+                                                               // Example: Start codon at beginning of sequence: gff positions 1,3. Sequence indices: 0,3
+
+  easystring         getScoreAsString() { return score; }
+
+/*   std::pair<bool, double> getScore()  */
+/*   { */
+/*     if (score.size() == 1 && score[0] == '.') */
+/*       return make_pair(false, 0); */
+/*     else */
+/*       return make_pair(true, score.ToDouble());  */
+/*   } */
+
+  char               getStrand () { return strand; }
+  char               getPhase  () { return phase;  }
+
+  unsigned           length()     { return fend-fstart; }
+
+  const vector<easystring>& getAttributeNames()
+  {
+    return att_names;
+  }
+
+  const vector<easystring>& getAttributeNamesLowerCase()
+  {
+    return att_names_lower_case;
+  }
+
+  int getIndexOfAttribute(const easystring &s, bool lower_case_comparison = false)
+  {
+    int i = 0, n = att_names.size();
+
+    if (!lower_case_comparison)
+      while (i < n && att_names[i] != s)
+      {
+	++i;
+      }
+    else
+      while (i < n && att_names_lower_case[i] != s)
+      {
+	++i;
+      }
+
+    if (i==n)
+      return -1;
+    else
+      return i;
+  }
+
+
+  unsigned countValuesOfAttribute(const easystring &s, bool lower_case_comparison = false)
+  {
+    int i = getIndexOfAttribute(s, lower_case_comparison);
+
+    if (i == -1)
+      return 0;
+    else
+      return att_values[i].countChar(',')+1;
+  }
+
+  unsigned countValuesOfAttribute(unsigned i)
+  {
+    if (i >= att_names.size())
+      return 0;
+    else
+      return att_values[i].countChar(',')+1;
+  }
+
+  const easystring &getValueOfAttribute(const easystring &s, bool lower_case_comparison = false)
+  {
+    int i = getIndexOfAttribute(s, lower_case_comparison);
+
+    if (i == -1)
+      return empty_easy_string;
+    else
+      return att_values[i];
+  }
+
+  const easystring &getValueOfAttribute(unsigned i)
+  {
+    if (i >= att_names.size())
+      return empty_easy_string;
+    else
+      return att_values[i];
+  }
+
+  bool isFeature(const easystring &str)
+  {
+    return (str == feature);
+  }
+
+
+  void print(ostream &os, int flag=0)
+  {
+    unsigned i;
+
+    if ( !good() )
+    {
+      os << "Invalid gff recored." << endl;
+      os << "Reason: " << parse_error << endl;
+      return;
+    }
+    if (flag == 0) // gff output format
+    {
+      os << seqname << "\t"
+	 << source  << "\t"
+	 << feature << "\t"
+	 << fstart  << "\t"
+	 << fend    << "\t"
+	 << score   << "\t"
+	 << strand  << "\t"
+	 << phase   << "\t";
+
+      for (i=0; i < att_names.size()-1; ++i)
+      {
+	os << att_names[i] << "=" << getValueOfAttribute(att_names[i]) << "; ";
+      }
+      os << att_names[i] << "=" << getValueOfAttribute(att_names[i]);
+    }
+    else if (flag == 1) // long multiline format
+    {
+      os << "seqname: " << seqname << endl
+	 << "source:  " << source  << endl
+	 << "feature: " << feature << endl
+	 << "start:   " << fstart  << endl
+	 << "end:     " << fend    << endl
+	 << "score:   " << score   << endl
+	 << "strand:  " << strand  << endl
+	 << "phase:   " << phase   << endl;
+
+      
+      for (i=0; i < att_names.size(); ++i)
+      {
+	os << "attribute: (" << att_names[i]
+	   << ") number of values: " << countValuesOfAttribute(att_names[i])
+	   << ", value: " << getValueOfAttribute(att_names[i]) << endl;
+      }
+    }
+  }
+
+/*   bool is_in_range(unsigned a, unsigned e) */
+/*   { */
+/*     return is_r2_Subrange_of_r1(a, e, fstart, fend); */
+/*   } */
+
+/*   unsigned overlap_with_range(unsigned a, unsigned e) */
+/*   { */
+/*     return overlap(a, e, fstart, fend); */
+/*   } */
+
+/*   void union_with_range(unsigned a, unsigned e, unsigned &c1, unsigned &c2) */
+/*   { */
+/*     range_union(a, e, fstart, fend, c1, c2); */
+/*   } */
+
+/*   void intersection_with_range(unsigned a, unsigned e, unsigned &c1, unsigned &c2) */
+/*   { */
+/*     range_intersection(a, e, fstart, fend, c1, c2); */
+/*   } */
+
+  bool print_sequence(FILE *of, easystring format, CSequence_Mol &seq, int char_per_line,
+		      bool ref_comp_if_neg_direction = true )
+  {
+    // the name of the sequence we print:
+    easystring  seq_name;
+    string      strand_desc;
+    unsigned    i;
+
+    if (seq.getName() != seqname)
+      return false;
+
+    // %I  seqID
+    // %S  source
+    // %F  feature
+    // %b  begin
+    // %e  end
+    // %s  score
+    // %d  strand (Direction) short
+    // %D  strand (Direction) long
+    // %p  phase
+    // %A  attribute 0
+
+    if ( format.empty() )
+    {
+      format = "%I#%S#%F#%b-%e#%p#%A%D";
+    }
+
+    unsigned N = format.size();
+
+    for (i=0; i < N; ++i)
+    {
+      if (format[i] == '\\' )
+      {
+	++i;
+	if (i == N)
+	  break;
+	seq_name += format[i];
+      }
+      else if (format[i] == '%')
+      {
+	++i;
+	if (i == N)
+	  break;
+	switch(format[i])
+	{
+	case 'I': seq_name += seqname;              break;
+	case 'S': seq_name += source;               break;
+	case 'F': seq_name += feature;              break;
+	case 'b': seq_name += easystring(fstart);   break;
+	case 'e': seq_name += easystring(fend);      break;
+	case 's': seq_name += score;                break;
+	case 'd': seq_name += strand;               break;
+	case 'D':
+	  if ( strand == '+') {
+	    strand_desc = "on+strand_is+strand";
+	  }
+	  else if ( strand == '-' ) {
+	    if (ref_comp_if_neg_direction) {
+	      seq_name += "on-strand_is-strand";
+	    }
+	    else {
+	      seq_name += "on-strand_is+strand";
+	    }
+	  }
+	  else {
+	    seq_name += "not-stranded";
+	  }
+	  break;
+
+	case 'p': seq_name += easystring( phase );               break;
+	case 'A': seq_name += getValueOfAttribute(0);            break;
+	default:  seq_name += easystring(format[i]);             break;
+	}
+      }
+      else
+	seq_name += easystring(format[i]);
+    }
+
+/*     seq_name = */
+/*       seqname + */
+/*       string("|") + */
+/*       source + */
+/*       string("|") + */
+/*       feature + */
+/*       string("|") + */
+/*       easystring( fstart ) + */
+/*       string(":") + */
+/*       easystring( fend ) + */
+/*       string("|") + */
+/*       score + */
+/*       string("|") + */
+/*       easystring( strand ) + */
+/*       string("|") + */
+/*       easystring( phase ) + */
+/*       string("|") + */
+/*       getValueOfAttribute(0) + */
+/*       string("|") + */
+/*       strand_desc; */
+
+      bool revComp = ref_comp_if_neg_direction && strand == '-';
+
+      // fend is position at which feature ends.
+      // The following write function expects 0 based indizes, 
+      // Example: print first three bases, pass 0 and 3 in both cases, we have 1 and 3
+
+      if (revComp)
+	seq.writeSequence_revComp(of, fstart-1, fend, seq_name.c_str(), char_per_line);
+      else
+ 	seq.writeSequence(of, fstart-1, fend, seq_name.c_str(), char_per_line);
+      return true;
+  }
+
+
+  // friend functions:
+
+  friend unsigned overlap(GFF_record &a, GFF_record &b)
+  {
+    if (a.seqname != b.seqname)
+      return 0;
+    return overlap(a.fstart, a.fend, b.fstart, b.fend);
+  }
+
+  friend unsigned overlap_in_same_direction(GFF_record &a, GFF_record &b)
+  {
+    if (a.strand != b.strand)
+      return 0;
+
+    if (a.seqname != b.seqname)
+      return 0;
+
+    return overlap(a.fstart, a.fend, b.fstart, b.fend);
+  }
+
+  friend bool position_lessThan_GFF_record(GFF_record &a, GFF_record &b)
+  {
+    if (a.seqname != b.seqname)
+      return a.seqname < b.seqname;
+
+    if (a.fstart < b.fstart)
+      return true;
+
+    if (a.fstart > b.fstart)
+      return false;
+
+    // We have a.fstart == b.fstart now!!!
+    if ( equalRange(a, b) )
+    {
+      if ( a.feature == "exon" )
+	return true;
+      else
+	return false;
+    }
+
+    if ( b.fend < a.fend )
+      return true;
+    else
+      return false;
+  }
+
+  friend bool position_lessThan_GFF_record_pointer(GFF_record *a, GFF_record *b)
+  {
+    if (a->seqname != b->seqname)
+      return a->seqname < b->seqname;
+
+    if (a->fstart < b->fstart)
+      return true;
+
+    if (a->fstart > b->fstart)
+      return false;
+
+    // We have a.fstart == b.fstart now!!!
+    if ( equalRange(*a, *b) )
+    {
+      if ( a->feature == "exon" )
+	return true;
+      else
+	return false;
+    }
+
+    if ( b->fend < a->fend )
+      return true;
+    else
+      return false;
+  }
+
+
+
+  friend bool operator==(GFF_record &a, GFF_record &b)
+  {
+    if (a.fstart  != b.fstart || a.fend != b.fend)
+      return false;
+    if (a.feature != b.feature)
+      return false;
+    if (a.seqname != b.seqname)
+      return false;
+    if (a.source  != b.source)
+      return false;
+
+    if (a.score   != b.score)
+      return false;
+    if (a.strand  != b.strand)
+      return false;
+    if (a.phase   != b.phase)
+      return false;
+
+    if (a.att_names != b.att_names)
+      return false;
+    if (a.att_values != b.att_values)
+      return false;
+
+    return true;
+  }
+
+  friend bool equalRange(GFF_record &a, GFF_record &b)
+  {
+    return equalRange(a.fstart, a.fend, b.fstart, b.fend);
+  }
+
+  friend bool isSubfeature_Arg2_of_Arg1(GFF_record &a, GFF_record &b)
+  {
+    return is_r2_Subrange_of_r1(a.fstart, a.fend, b.fstart, b.fend);
+  }
+
+
+  
+
+};
+
+
+
+
+#endif
diff --git a/GFF-collection.h b/GFF-collection.h
new file mode 100644
index 0000000..ae15ed0
--- /dev/null
+++ b/GFF-collection.h
@@ -0,0 +1,1307 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef GFF_COLLECTION_H
+#define GFF_COLLECTION_H
+
+#include "cstdio"
+#include "easystring.h"
+#include <vector>
+#include <list>
+#include <set>
+#include <map>
+#include "range_functions.h"
+#include "GFF-class.h"
+
+
+using namespace std;
+
+static int ____verbosity = 1;
+
+
+// Currently, GFF_record_list has no destructor.
+// This can lead to memory leaks, since this class stores
+// pointers to GFF_record, which will never be destructed explicitly.
+// TODO!!!!
+
+class GFF_record_list : public list<GFF_record*>
+{
+ public:
+  void add(GFF_record *pf)
+  {
+    //    cout << "Adding: ";  pf->print(cout); cout << endl; 
+    push_back(pf);
+  }
+
+  // Keep only entries with a feature value f.
+  void filter_by_feature(easystring &f)
+  {
+     list<GFF_record*>::iterator it, it_end;
+     it     = begin();
+     it_end = end();
+
+     while (it != it_end)
+     {
+       if ((**it).getFeature() != f )
+	 it = erase(it);
+       else
+	 ++it;
+     }
+  }
+
+  // Find all attribute values for a given set of attribute names:
+  set<easystring> getSetOfAttributeValues(vector<easystring> att_name_vec, bool case_sensitive = true)
+  {
+    set<easystring> s;
+/*     list<GFF_record*>::iterator it, it_end; */
+
+/*     it     = begin(); */
+/*     it_end = end(); */
+
+/*     while (it != it_end) */
+/*     { */
+/*       s.insert((**it).getGeneName()); */
+/*       ++it; */
+/*     } */
+    return s;
+  }
+
+  void getListOfGeneLocations(GFF_record_list &logl)
+  {
+/*     list<GeneLocation*>  logl; */
+/*     GeneLocation         *gl; */
+/*     set<string> s = getSetOfGeneNames(); */
+/*     set<string>::iterator  s_it     = s.begin(); */
+/*     set<string>::iterator  s_it_end = s.end(); */
+/*     string    geneName; */
+/*     CfeatureList::iterator l_it; */
+/*     CfeatureList::iterator l_it_end; */
+/*     unsigned range_start, range_end; */
+/*     int      direction = 0; */
+/*     bool     found; */
+
+/*     while(s_it != s_it_end) */
+/*     { */
+/*       geneName = *s_it; */
+/*       l_it     = begin(); */
+/*       l_it_end = end(); */
+/*       found = false; */
+
+/*       // Find first occurence: */
+/*       while(l_it != l_it_end) */
+/*       { */
+/* 	if ((**l_it).getGeneName() == geneName) */
+/* 	{ */
+/* 	  range_start = (**l_it).getStart(); */
+/* 	  range_end   = (**l_it).getEnd(); */
+/* 	  direction   = (**l_it).getDirection(); */
+/* 	  found = true; */
+/* 	  break; */
+/* 	} */
+/* 	++l_it; */
+/*       } */
+
+/*       // Find other occurences: */
+/*       while(l_it != l_it_end) */
+/*       { */
+/* 	if ((**l_it).getGeneName() == geneName) */
+/* 	{ */
+/* 	  range_union( range_start,          range_end, */
+/* 		       (**l_it).getStart(),  (**l_it).getEnd(), */
+/* 		       range_start,          range_end); */
+/* 	} */
+/* 	++l_it; */
+/*       } */
+
+/*       if (!found) */
+/*       { */
+/* 	cerr << "Fatal error in element function getListOfGeneLocations. Gene with name " */
+/* 	     << geneName << " not found." << endl; */
+/* 	exit(0); */
+/*       } */
+
+/*       gl = new GeneLocation(geneName, range_start, range_end, direction); */
+/*       logl.push_back(gl); */
+/*       ++s_it; */
+/*     } */
+/*     return logl; */
+  }
+
+
+
+  void getVectorOfFeatures_withGivenName(const easystring &the_geneName,
+					 vector<GFF_record*>  &vogffr )
+  {
+/*     CfeatureList::iterator it, it_end; */
+
+/*     vogf.clear(); */
+
+/*     it     = begin(); */
+/*     it_end = end(); */
+
+/*     while (it != it_end) */
+/*     { */
+/*       if ( (**it).getGeneName() == the_geneName ) */
+/*       { */
+/* 	vogf.push_back(*it); */
+/* 	//	list_of_features.push_back(*it); */
+/*       } */
+/*       ++it; */
+/*     } */
+/*     stable_sort(vogf.begin(), vogf.end(), lessThan_genomeFeature); */
+  }
+
+/*   CfeatureList::iterator find_equal_feature(CgenomeFeature &gf) */
+/*   { */
+/*     CfeatureList::iterator  it      = begin(); */
+/*     CfeatureList::iterator  it_end  = end(); */
+
+/*     it     = lower_bound(it, it_end, &gf, lessThan_genomeFeature); */
+/*     it_end = upper_bound(it, it_end, &gf, lessThan_genomeFeature); */
+
+/*     while (it != it_end) */
+/*     { */
+/*       if ( **it == gf ) */
+/* 	return it; */
+/*       ++it; */
+/*     } */
+/*     return end(); */
+/*   } */
+
+  void print(ostream &os, int flag = 0)
+  {
+    list<GFF_record*>::iterator it, it_end;
+    
+    it     = begin();
+    it_end = end();
+
+    while (it != it_end)
+    {
+      (**it).print(os, flag);
+      os << endl;
+      ++it;
+    }
+  }
+
+  unsigned print_sequences(FILE *of, easystring &format, CSequence_Mol &seq, int char_per_line,
+			   bool ref_comp_if_neg_direction = true)
+  {
+    GFF_record_list::iterator  it, it_end;
+    easystring                 seq_name = seq.getName();
+    unsigned                   count    = 0;
+
+    it     = begin();
+    it_end = end();
+
+    while (it != it_end)
+    {
+      //      if (it->getSeqid == seq_name) // This is also checked in the print_sequence member function of the GFF_record.
+      {
+	if ( (**it).print_sequence(of, format, seq, char_per_line, ref_comp_if_neg_direction) )
+	  ++count;
+      }
+      ++it;
+    }
+    return count;
+  }
+
+}; // End class GFF_record_list : public list<GFF_record*>
+
+
+
+
+
+
+
+class GFF_collection
+{
+  map<easystring, int>   sequences;  // counts the GFF-records associated to sequences
+  map<easystring, int>   features;   // counts the GFF-records associated to features
+  unsigned               total_number;
+  unsigned               max_seq_name_length;
+
+  // Type reminder: class GFF_record_list : public list<GFF_record*>
+
+  GFF_record_list        gff_record_list;  // not inherited since then we can lose control
+                                           // over features added to the list.
+  
+ public:
+ GFF_collection(int v=0):total_number(0), max_seq_name_length(0)
+  {}
+
+  void reset()
+  {
+    sequences.clear();
+    features.clear();
+    gff_record_list.clear();
+
+    total_number = 0;
+    max_seq_name_length = 0;
+  }
+
+
+  void add(GFF_record* a)
+  {
+    map<easystring, int>::iterator  it;
+
+    easystring sid = a->getSeqid();
+    easystring fea = a->getFeature();
+
+    ++total_number;
+    if ( max_seq_name_length < sid.length() )
+      max_seq_name_length = sid.length();
+
+    // Search for sequnece name in map
+    it  = sequences.find(sid);
+    if (it != sequences.end() )
+    {
+      ++(it->second);  // Count the feature for this list
+    }
+    else // Add seq to map and set counter to 1 
+    {
+      sequences[sid] = 1;
+    }
+
+    // Search for feature name in map
+    it  = features.find(fea);
+    if (it != features.end() )
+    {
+      ++(it->second);  // Count the feature for this list
+    }
+    else // Add seq to map and set counter to 1 
+    {
+      features[fea] = 1;
+    }
+
+    gff_record_list.add(a);
+  }
+
+  unsigned size()
+  {
+    return gff_record_list.size();
+  }
+
+
+  void add(GFF_collection &col)
+  {
+    GFF_record_list::iterator it, it_end;
+    
+    it     = col.gff_record_list.begin();
+    it_end = col.gff_record_list.end();
+    
+    while (it != it_end)
+    {
+      add(*it);
+      ++it;
+    }
+
+  }
+
+  static void set_verbosity(int v)
+  {
+    ____verbosity = v;
+  }
+
+
+  const GFF_record_list& getGFFrecordList()
+  {
+    return gff_record_list;
+  }
+
+  unsigned getNumGFFrecords()
+  {
+    return total_number;
+  }
+
+  unsigned getMaxSeqidLength()
+  {
+    return max_seq_name_length;
+  }
+
+  void print(ostream &os, int flag = 0)
+  {
+    gff_record_list.print(os, flag);
+  }
+
+  void sort()
+  { 
+    gff_record_list.sort(position_lessThan_GFF_record_pointer);
+  }
+
+  void get_List_of_gff_records_of_a_sequence(const easystring  &seq,
+					     GFF_record_list   &list_of_records)
+  {
+    GFF_record_list::iterator it, it_end;
+
+    it     = gff_record_list.begin();
+    it_end = gff_record_list.end();
+
+    while (it != it_end)
+    {
+      if ( (**it).getSeqid() == seq )
+      {
+	list_of_records.push_back(*it);
+      }
+      ++it;
+    }
+  }
+
+
+  // Worries: Perfomrance.
+  // Note: attribute_key must be lower case, since we only do a lower case comparison.
+  void get_List_of_gff_records_for_attribute(const easystring  &attribute_key,
+					     const easystring  &attribute_value,
+					     GFF_record_list   &list_of_records)
+  {
+    GFF_record_list::iterator it, it_end;
+
+    it     = gff_record_list.begin();
+    it_end = gff_record_list.end();
+
+    list_of_records.clear();
+
+    while (it != it_end)
+    {
+      easystring val = (**it).getValueOfAttribute(attribute_key, true);
+
+      if ( val == attribute_value )
+      {
+	list_of_records.push_back(*it);
+      }
+      ++it;
+    }
+  }
+
+
+  vector<easystring> getVectorOfSeqid()
+  {
+    vector<easystring>  v;
+    map<easystring, int>::iterator it, it_end;
+
+    it     = sequences.begin();
+    it_end = sequences.end();
+    while (it != it_end)
+    {
+      v.push_back( it->first );
+      ++it;
+    }
+    return v;
+  }
+
+  void get_min_max_number_of_features_for_Seqid(int &mi, int &ma)
+  {
+    mi = ma = 0; // Only used when collection is empty
+    map<easystring, int>::iterator it, it_end;
+
+    it     = sequences.begin();
+    it_end = sequences.end();
+
+    if (it != it_end)
+      mi = ma = it->second;
+    while (it != it_end)
+    {
+      if (it->second > ma)
+	ma = it->second;
+      if (it->second < mi)
+	mi = it->second;
+      ++it;
+    }
+  }
+
+
+  void addSeqidsToSet(set<easystring> &s)
+  {
+    map<easystring, int>::iterator it, it_end;
+
+    it     = sequences.begin();
+    it_end = sequences.end();
+
+    while (it != it_end)
+    {
+      s.insert( it->first );
+      ++it;
+    }
+  }
+
+  
+  void readGFFfile(easystring filename,
+		   unsigned   &good_lines,
+		   unsigned   &bad_lines,
+		   bool       &file_error )
+  {
+    ifstream    is(filename.c_str() );
+    easystring  line;
+    GFF_record  *gffr;
+    bool        match_OK;
+
+    file_error = false;
+    good_lines = 0;
+    bad_lines  = 0;
+    
+    if ( is.fail() )
+    {
+      file_error = true;
+      return;
+    }
+
+    getline(is, line);
+    while (is)
+    {
+      line.removeSpacesBack();
+      if (line[0] == '#' || line.empty() )
+      {
+	getline(is, line);
+	continue;
+      }
+
+      gffr     = new GFF_record(line);
+      match_OK = gffr->good();
+
+      if (match_OK)
+      {
+	add(gffr);
+	++good_lines;
+      }
+      else
+      {
+	++bad_lines;
+	std::cerr << endl << "Problematic line: " << line << endl; 
+	std::cerr << "Reason for error: " << gffr->getErrorReason() << endl; 
+	delete gffr;
+      }
+      getline(is, line);
+    }
+    is.close();
+
+    //    gff_record_list.sort(lessThan_genomeFeature);
+  }
+
+  void print_sequences_all_features(FILE *of, easystring &format, CFile *seq_file, int char_per_line,
+				    bool ref_comp_if_neg_direction,
+				    unsigned &count_seq, unsigned &count_printed_features)
+  {
+    // Variables to read sequence file:
+    CSequence_Mol   seq(CSequence_Mol::dna);
+
+    count_seq=0;
+    count_printed_features=0;
+
+    //std::ios::sync_with_stdio(false); 
+
+      // For each sequence: analyse the features
+    while (!seq_file->eof())
+    {
+      seq.readRawFastaSequence(*seq_file);
+      ++count_seq;
+
+      //      cerr << count_seq << " " << seq.getName() << endl;
+
+      count_printed_features += gff_record_list.print_sequences(of, format, seq, char_per_line, ref_comp_if_neg_direction);
+    }
+  }
+
+
+  void getVectorOfFeatures(vector<easystring> &the_features)
+  {
+    map<easystring, int>::iterator it, it_end;
+    it     = features.begin(); 
+    it_end = features.end(); 
+
+    the_features.clear();
+
+    while (it != it_end)
+    {
+      the_features.push_back(it->first);
+      ++it;
+    }
+  }
+
+
+  void getRangeList(CRangeList &rl, const easystring &seq)
+  {
+    GFF_record_list::iterator  it, it_end;
+    it     = gff_record_list.begin();
+    it_end = gff_record_list.end();
+
+    rl.clear();
+
+    while (it != it_end)
+    {
+      if ( (**it).getSeqid() == seq )
+      {
+	// Remember: Ranges should be 0 based and the end should be the point after the last element in the range.
+	// Coordinates in the gff file are 1 based. 
+	rl.add( (**it).getStart(),
+		(**it).getEnd()+1);  // the range class expects
+      }
+      ++it;
+    }
+  }
+
+
+  void getConsolidatedRangeListOfGFFCollection_for_Sequence(CRangeList &crl, easystring &seq)
+  {
+    CRangeList rl;
+    getRangeList(rl, seq);
+    rl.get_consolidated_range_list(crl);
+  }
+
+
+  unsigned get_coverage_loop(std::ostream &os_error)
+  {
+    map<easystring, int>::iterator it, it_end;
+
+    it     = sequences.begin();
+    it_end = sequences.end();
+
+    unsigned all_len=0;
+    unsigned n;
+
+    while (it != it_end)
+    {
+      // Do something with it->first:
+
+      os_error << "Analysing sequence coverage:" << it->first << endl;
+      CRangeList rl1;
+
+      getRangeList(rl1, it->first);
+      os_error << "Elements: " << rl1.size() << endl;
+      rl1.sort();
+      n = rl1.coverage_len_loop();
+      os_error << "Contribution: " << n << endl;
+      all_len += n;
+      ++it;
+    }
+    return all_len;
+  }
+
+
+  unsigned get_coverage(std::ostream &os_error)
+  {
+    map<easystring, int>::iterator it, it_end;
+
+    it     = sequences.begin();
+    it_end = sequences.end();
+
+    unsigned all_len=0;
+    unsigned n;
+
+    while (it != it_end)
+    {
+      // Do something with it->first:
+
+      //   os_error << "Analysing sequence coverage:" << it->first << endl;
+      CRangeList rl1;
+      getRangeList(rl1, it->first);
+      //   os_error << "Elements: " << rl1.size() << endl;
+      n = rl1.coverage_len();
+      //   os_error << "Contribution: " << n << endl;
+      all_len += n;
+      ++it;
+    }
+    return all_len;
+  }
+
+
+
+  friend void get_coverage_info_loop(GFF_collection &gff1, GFF_collection &gff2,
+				     unsigned &len_gff1,  unsigned &len_gff2,
+				     unsigned &len_union, unsigned &len_intersection,
+				     unsigned &only_gff1, unsigned &only_gff2)
+  {
+    set<easystring> s;
+
+    gff1.addSeqidsToSet(s);
+    gff2.addSeqidsToSet(s);
+
+    Crange limit(0, -1u);
+    bool   err1, err2;
+    CRangeList rl1;
+    CRangeList rl2;
+
+    unsigned len_gff1_this_seq;
+    unsigned len_gff2_this_seq;
+    unsigned len_union_this_seq;
+    unsigned len_intersection_this_seq;
+    unsigned limit_len_dummy;
+
+    len_gff1         = 0;
+    len_gff2         = 0;
+    len_union        = 0;
+    len_intersection = 0;
+    only_gff1        = 0;
+    only_gff2        = 0;
+
+    set<easystring>::iterator it, it_end;
+    map<easystring, int>::iterator it_find;
+
+    it     = s.begin();
+    it_end = s.end();
+
+    while (it != it_end)
+    {
+      err1 = false;
+      err2 = false;
+
+      it_find = gff1.sequences.find(*it);
+      if (it_find == gff1.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 2 but not in file 1." << endl;
+	}
+	err1 = true;
+      }
+      it_find = gff2.sequences.find(*it);
+      if (it_find == gff2.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 1 but not in file 2." << endl;
+	}
+	err2 = true;
+      }
+
+      if (!(err1 || err2))
+      {
+	if (____verbosity > 0)
+	{
+	  cerr << "Analysing sequence " << *it << endl;
+	}
+
+	gff1.getRangeList(rl1, *it);
+	gff2.getRangeList(rl2, *it);
+
+	Crange b1 = rl1.bounds();
+	Crange b2 = rl2.bounds();
+
+	Crange limit = range_span(b1, b2);
+
+	rl1.sort();
+	rl2.sort();
+	coverage_values_loop(limit, rl1, rl2, limit_len_dummy,
+			     len_gff1_this_seq,
+			     len_gff2_this_seq,
+			     len_union_this_seq,
+			     len_intersection_this_seq);
+	
+	//	cerr << len_gff1_this_seq         << endl;
+	//	cerr << len_gff2_this_seq         << endl;
+	//	cerr << len_union_this_seq        << endl;
+	//	cerr << len_intersection_this_seq << endl;
+
+	len_gff1         += len_gff1_this_seq;
+	len_gff2         += len_gff2_this_seq;
+	len_union        += len_union_this_seq;
+	len_intersection += len_intersection_this_seq;
+      }
+      else // we still want to update the individual lengths as well as the union length:
+      {
+	if (!err1)
+	{
+	  gff1.getRangeList(rl1, *it);
+	  rl1.sort();
+	  unsigned n = rl1.coverage_len_loop();
+	  len_gff1  += n;
+	  len_union += n;
+	  ++only_gff1;
+	}
+	if (!err2)
+	{
+	  gff2.getRangeList(rl2, *it);
+	  rl2.sort();
+	  unsigned n = rl2.coverage_len_loop();
+	  len_gff2  += n;
+	  len_union += n;
+	  ++only_gff2;
+	}
+      }
+      ++it;
+    }
+  }
+
+
+  friend void get_coverage_info(GFF_collection &gff1, GFF_collection &gff2,
+				unsigned &len_gff1,  unsigned &len_gff2,
+				unsigned &len_union, unsigned &len_intersection,
+				unsigned &only_gff1, unsigned &only_gff2)
+  {
+    set<easystring> s;
+
+    gff1.addSeqidsToSet(s);
+    gff2.addSeqidsToSet(s);
+
+    Crange limit(0, -1u);
+    bool   err1, err2;
+    CRangeList rl1;
+    CRangeList rl2;
+
+    unsigned len_gff1_this_seq;
+    unsigned len_gff2_this_seq;
+    unsigned len_union_this_seq;
+    unsigned len_intersection_this_seq;
+    unsigned limit_len_dummy;
+
+    len_gff1         = 0;
+    len_gff2         = 0;
+    len_union        = 0;
+    len_intersection = 0;
+    only_gff1        = 0;
+    only_gff2        = 0;
+
+    set<easystring>::iterator it, it_end;
+    map<easystring, int>::iterator it_find;
+
+    it     = s.begin();
+    it_end = s.end();
+
+    while (it != it_end)
+    {
+      err1 = false;
+      err2 = false;
+      it_find = gff1.sequences.find(*it);
+      if (it_find == gff1.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 1 but not in file 2." << endl;
+	}
+	err1 = true;
+      }
+      it_find = gff2.sequences.find(*it);
+      if (it_find == gff2.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 2 but not in file 1." << endl;
+	}
+	err2 = true;
+      }
+      
+      if (!( err1 || err2 ))
+      {
+	if (____verbosity > 0)
+	{
+	  cerr << "Analysing sequence " << *it << endl;
+	}
+
+	gff1.getRangeList(rl1, *it);
+	gff2.getRangeList(rl2, *it);
+
+	Crange b1 = rl1.bounds();
+	Crange b2 = rl2.bounds();
+
+	Crange limit = range_span(b1, b2);
+
+	rl1.sort();
+	rl2.sort();
+	coverage_values_loop(limit, rl1, rl2, limit_len_dummy,
+			     len_gff1_this_seq,
+			     len_gff2_this_seq,
+			     len_union_this_seq,
+			     len_intersection_this_seq);
+	
+	//	cerr << len_gff1_this_seq         << endl;
+	//	cerr << len_gff2_this_seq         << endl;
+	//	cerr << len_union_this_seq        << endl;
+	//	cerr << len_intersection_this_seq << endl;
+
+	len_gff1         += len_gff1_this_seq;
+	len_gff2         += len_gff2_this_seq;
+	len_union        += len_union_this_seq;
+	len_intersection += len_intersection_this_seq;
+      }
+      else // we still want to update the individual lengths as well as the union length:
+      {
+	if (!err1)
+	{
+	  gff1.getRangeList(rl1, *it);
+	  unsigned n = rl1.coverage_len();
+	  len_gff1  += n;
+	  len_union += n;
+	  ++only_gff1;
+	}
+	if (!err2)
+	{
+	  gff2.getRangeList(rl2, *it);
+	  unsigned n = rl2.coverage_len();
+	  len_gff2  += n;
+	  len_union += n;
+	  ++only_gff2;
+	}
+      }
+      ++it;
+    } // while
+  } // END   friend void get_coverage_info
+
+
+  // Main purpose: Find in1in2not3not4 = (1^2)\(3 U 4)
+  friend void get_coverage_info_in1in2not3no4_loop
+    (GFF_collection &gff1,     GFF_collection &gff2,
+     GFF_collection &gff3,     GFF_collection &gff4,
+     unsigned &len_gff1,       unsigned &len_gff2,
+     unsigned &len_gff3,       unsigned &len_gff4,
+     unsigned &in1not3not4,    unsigned &in2not3not4,
+     unsigned &in1in2not3not4, unsigned &in3in4not1not2
+     )
+  {
+    len_gff1       = 0;
+    len_gff2       = 0;
+    len_gff3       = 0;
+    len_gff4       = 0;
+    in1not3not4    = 0;
+    in2not3not4    = 0;
+    in1in2not3not4 = 0;
+    in3in4not1not2 = 0;
+
+    set<easystring> s;
+
+    gff1.addSeqidsToSet(s);
+    gff2.addSeqidsToSet(s);
+    gff3.addSeqidsToSet(s);
+    gff4.addSeqidsToSet(s);
+
+    //    bool   noseq1, noseq2, noseq3, noseq4;
+    CRangeList rl1;
+    CRangeList rl2;
+    CRangeList rl3;
+    CRangeList rl4;
+
+    unsigned len_gff1_this_seq;
+    unsigned len_gff2_this_seq;
+    unsigned len_gff3_this_seq;
+    unsigned len_gff4_this_seq;
+    unsigned in1not3not4_this_seq;
+    unsigned in2not3not4_this_seq;
+    unsigned in1in2not3not4_this_seq;
+    unsigned in3in4not1not2_this_seq;
+
+    set<easystring>::iterator it, it_end;
+    map<easystring, int>::iterator it_find;
+
+    it     = s.begin();
+    it_end = s.end();
+
+    while (it != it_end)
+    {
+      if (____verbosity > 0)
+      {
+	cerr << "Analysing sequence: " << *it << endl;
+      }
+/*       noseq1 = false; */
+/*       noseq2 = false; */
+/*       noseq3 = false; */
+/*       noseq4 = false; */
+
+      it_find = gff1.sequences.find(*it);
+      if (it_find == gff1.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is not present in gff file 1." << endl;
+	}
+	//	noseq1 = true;
+	rl1 = CRangeList();
+      }
+      else
+      {
+	gff1.getRangeList(rl1, *it);
+      }
+
+      it_find = gff2.sequences.find(*it);
+      if (it_find == gff2.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is not present in gff file 2." << endl;
+	}
+	//	noseq2 = true;
+	rl2 = CRangeList();
+      }
+      else
+      {
+	gff2.getRangeList(rl2, *it);
+      }
+
+      it_find = gff3.sequences.find(*it);
+      if (it_find == gff3.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is not present in gff file 3." << endl;
+	}
+	//	noseq3 = true;
+	rl3 = CRangeList();
+      }
+      else
+      {
+	gff3.getRangeList(rl3, *it);
+      }
+
+      it_find = gff4.sequences.find(*it);
+      if (it_find == gff4.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is not present in gff file 4." << endl;
+	}
+	//	noseq4 = true;
+	rl4 = CRangeList();
+      }
+      else
+      {
+	gff4.getRangeList(rl4, *it);
+      }
+
+
+	
+      Crange b1 = rl1.bounds();
+      Crange b2 = rl2.bounds();
+      Crange b3 = rl2.bounds();
+      Crange b4 = rl2.bounds();
+
+      Crange limit = range_span(b1, b2);
+             limit = range_span(limit, b3);
+             limit = range_span(limit, b4);
+
+      rl1.sort();
+      rl2.sort();
+      rl3.sort();
+      rl4.sort();
+
+      coverage_values_loop(limit,
+			   rl1, rl2, rl3, rl4,
+			   len_gff1_this_seq,
+			   len_gff2_this_seq,
+			   len_gff3_this_seq,
+			   len_gff4_this_seq,
+			   in1not3not4_this_seq,
+			   in2not3not4_this_seq,
+			   in1in2not3not4_this_seq,
+			   in3in4not1not2_this_seq
+			   );
+
+/*       cerr << 	"len1: " << len_gff1_this_seq         << endl; */
+/*       cerr << 	"len2: " << len_gff2_this_seq         << endl; */
+/*       cerr << 	"len3: " << len_gff3_this_seq         << endl; */
+/*       cerr << 	"len4: " << len_gff4_this_seq         << endl; */
+
+/*       cerr << 	"in1n34: " << in1not3not4_this_seq      << endl; */
+/*       cerr << 	"in2n34: " << in2not3not4_this_seq      << endl; */
+/*       cerr << 	"in12n34: " << in1in2not3not4_this_seq   << endl; */
+/*       cerr << 	"in34n12: " << in3in4not1not2_this_seq   << endl; */
+
+      len_gff1 += len_gff1_this_seq;
+      len_gff2 += len_gff2_this_seq;
+      len_gff3 += len_gff3_this_seq;
+      len_gff4 += len_gff4_this_seq;
+
+/*       cerr << 	"int-res: len1: " << len_gff1         << endl; */
+/*       cerr << 	"int-res: len2: " << len_gff2         << endl; */
+/*       cerr << 	"int-res: len3: " << len_gff3         << endl; */
+/*       cerr << 	"int-res: len4: " << len_gff4         << endl; */
+
+
+      in1not3not4 += in1not3not4_this_seq;
+      in2not3not4 += in2not3not4_this_seq;
+      in1in2not3not4 += in1in2not3not4_this_seq;
+      in3in4not1not2 += in3in4not1not2_this_seq;
+
+      ++it;
+    }
+  } // END friend void get_coverage_info_in1in2not3no4_loop
+
+
+  void set_to_complement_in_universe(GFF_collection &universe, GFF_collection &gff,
+				    easystring creator, easystring feature)
+  {
+    int mi, ma;
+    universe.get_min_max_number_of_features_for_Seqid(mi, ma);
+
+    if (mi != 1 || ma != 1)
+    {
+      std::cerr << "Error in set_to_complement_in_inverse: In the universe collection each sequence id can only occurr once."
+		<< std::endl;
+      return;
+    }
+
+    vector<easystring> vec_seqIds = universe.getVectorOfSeqid();
+
+    unsigned    i, N=vec_seqIds.size();
+    CRangeList  rl1, rl2, rl2res;
+    Crange      limit;
+    GFF_record  *p;
+    easystring  name;
+
+    for (i=0; i<N; ++i)
+    {
+      std::cerr << "Compute complement in " << vec_seqIds[i] << endl;
+      universe.getRangeList(rl1, vec_seqIds[i]);
+      gff.getRangeList(rl2, vec_seqIds[i]);
+      limit = *(rl1.begin());
+
+      rl2res.set_to_complement_of(rl2, limit);
+
+      //      std::cerr << "SIZE: " << rl2res.size() << endl;
+
+      CRangeList::CRangeList_iterator_const rl_it, rl_it_end;
+
+      rl_it     = rl2res.begin();
+      rl_it_end = rl2res.end();
+
+      easystring n100 = ".";
+
+      while (rl_it != rl_it_end)
+      {
+	// Remember the conventions here:
+	// The ranges in rl2res are non inclusive for the end of the range.
+	// But GFF_records store ranges such that the end coordinate is
+	// the last coordinate in the range. So we have to subract 1.
+	name = easystring("name=") + vec_seqIds[i] + "_" + easystring(rl_it->begin()) + "_" + easystring(rl_it->end()-1); 
+	p = new GFF_record(vec_seqIds[i], creator, feature,
+			   rl_it->begin(),  rl_it->end()-1, n100, '.', '.', name);
+	add(p);
+
+	//	p->print(cout);
+	//	std::cout << endl;
+
+	//	delete p;
+
+	++rl_it;
+      }
+
+    }
+  }
+
+
+  void set_to_union_of(GFF_collection &gff1, GFF_collection &gff2,
+		       easystring creator, easystring feature)
+  {
+    // Determine set of all Seqids:
+    set<easystring> s;
+
+    gff1.addSeqidsToSet(s);
+    gff2.addSeqidsToSet(s);
+
+    set<easystring>::iterator it, it_end;
+    map<easystring, int>::iterator it_find;
+
+    it     = s.begin();
+    it_end = s.end();
+
+    //    bool present1, present2;
+
+    CRangeList rl1;
+    CRangeList rl2;
+    CRangeList rlres;
+
+    easystring  name;
+
+    // For all Seqids 
+    while (it != it_end)
+    {
+/*       present1 = false; */
+/*       present2 = false; */
+      rl1.clear();
+      rl2.clear();
+      rlres.clear();
+ 
+      it_find = gff1.sequences.find(*it);
+      if (it_find == gff1.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 2 but not in file 1." << endl;
+	}
+      }
+      else
+      {
+	//	present1 = true;
+	gff1.getRangeList(rl1, *it);
+      }
+      
+      it_find = gff2.sequences.find(*it);
+      if (it_find == gff2.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 1 but not in file 2." << endl;
+	}
+      }
+      else
+      {
+	//	present2 = true;
+	gff2.getRangeList(rl2, *it);
+      }
+
+      rlres.set_to_range_list_union(rl1, rl2);
+
+      easystring n100 = ".";
+      easystring seq_name = *it;
+      GFF_record  *p;
+ 
+      CRangeList::CRangeList_iterator_const rl_it, rl_it_end;
+      rl_it     = rlres.begin();
+      rl_it_end = rlres.end();
+    
+      while (rl_it != rl_it_end)
+      {
+	// Remember the conventions here:
+	// The ranges in rlres are non inclusive for the end of the range.
+	// But GFF_records store ranges such that the end coordinate is
+	// the last coordinate in the range. So we have to subract 1.
+	name = easystring("name=") + seq_name + "_" + easystring(rl_it->begin()) + "_" + easystring(rl_it->end()-1); 
+	p = new GFF_record(seq_name, creator, feature,
+			   rl_it->begin(),  rl_it->end()-1, n100, '.', '.', name);
+	add(p);
+	//	p->print(cout);
+	//	std::cout << endl;
+	//	delete p;
+	++rl_it;
+      } // while (rl_it != rl_it_end)
+      ++it;
+    } // while (it != it_end) 
+    
+  }
+
+  void set_to_intersection_of(GFF_collection &gff1, GFF_collection &gff2,
+			      easystring creator, easystring feature)
+  {
+    // Determine set of all Seqids:
+    set<easystring> s;
+
+    gff1.addSeqidsToSet(s);
+    gff2.addSeqidsToSet(s);
+
+    set<easystring>::iterator it, it_end;
+    map<easystring, int>::iterator it_find;
+
+    it     = s.begin();
+    it_end = s.end();
+
+    //    bool present1, present2;
+
+    CRangeList rl1;
+    CRangeList rl2;
+    CRangeList rlres;
+
+    easystring  name;
+
+    // For all Seqids 
+    while (it != it_end)
+    {
+      //      present1 = false;
+      //      present2 = false;
+      rl1.clear();
+      rl2.clear();
+      rlres.clear();
+ 
+      it_find = gff1.sequences.find(*it);
+      if (it_find == gff1.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 2 but not in file 1." << endl;
+	}
+      }
+      else
+      {
+	//	present1 = true;
+	gff1.getRangeList(rl1, *it);
+      }
+      
+      it_find = gff2.sequences.find(*it);
+      if (it_find == gff2.sequences.end() )
+      {
+	if (____verbosity > 1)
+	{
+	  cerr << "Note: Sequence " << *it
+	       << " is present in gff file 1 but not in file 2." << endl;
+	}
+      }
+      else
+      {
+	//	present2 = true;
+	gff2.getRangeList(rl2, *it);
+      }
+
+      rlres.set_to_range_list_intersection(rl1, rl2);
+
+      //            std::cerr << "rl1" << endl;
+      //            rl1. print_bracketed_list(std::cerr);
+      //            std::cerr << "rl2" << endl;
+      //            rl2. print_bracketed_list(std::cerr);
+      //            std::cerr << "rlres" << endl;
+      //            rlres. print_bracketed_list(std::cerr);
+
+      easystring n100 = ".";
+      easystring seq_name = *it;
+      GFF_record  *p;
+ 
+      CRangeList::CRangeList_iterator_const rl_it, rl_it_end;
+      rl_it     = rlres.begin();
+      rl_it_end = rlres.end();
+    
+      while (rl_it != rl_it_end)
+      {
+	// Remember the conventions here:
+	// The ranges in rlres are non inclusive for the end of the range.
+	// But GFF_records store ranges such that the end coordinate is
+	// the last coordinate in the range. So we have to subract 1.
+	name = easystring("name=") + seq_name + "_" + easystring(rl_it->begin()) + "_" + easystring(rl_it->end()-1); 
+	p = new GFF_record(seq_name, creator, feature,
+			   rl_it->begin(),  rl_it->end()-1, n100, '.', '.', name);
+	add(p);
+	//	p->print(cout);
+	//	std::cout << endl;
+	//	delete p;
+	++rl_it;
+      } // while (rl_it != rl_it_end)
+      ++it;
+    } // while (it != it_end) 
+
+  }
+
+
+
+
+
+}; // End class GFF_collection
+
+
+
+#endif
diff --git a/LICENSE.GPLv3.txt b/LICENSE.GPLv3.txt
new file mode 100644
index 0000000..18f0a54
--- /dev/null
+++ b/LICENSE.GPLv3.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..9cecc1d
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    {one line to give the program's name and a brief idea of what it does.}
+    Copyright (C) {year}  {name of author}
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    {project}  Copyright (C) {year}  {fullname}
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE_AND_COPYRIGHT_as_found_in_each_source_file b/LICENSE_AND_COPYRIGHT_as_found_in_each_source_file
new file mode 100644
index 0000000..b47c12f
--- /dev/null
+++ b/LICENSE_AND_COPYRIGHT_as_found_in_each_source_file
@@ -0,0 +1,26 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1181eb6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,64 @@
+BaitFisher-package: Design DNA hybrid enrichment baits
+======================================================
+
+
+About the BaitFisher package
+----------------------------
+The BaitFisher package consists of two programs: BaitFisher and BaitFilter. 
+
+BaitFisher was been designed to construct hybrid enrichment baits from multiple sequence alignments (MSAs) or annotated features in MSAs. The main goal of BaitFisher is to avoid redundancy in the construction of baits by designing fewer baits in conserved regions of the MSAs and designing more baits in variable regions. This makes use of the fact that hybrid enrichment baits can differ to some extends from the target region, which they should capture in the enrichment procedure. By speci [...]
+
+BaitFilter was designed (i) to determine whether baits bind unspecifically to a reference genome, (ii) to filter baits that only have partial length matches to a reference genome, (iii) to determine the optimal bait region in a MSA and to convert baits to a format that can be uploaded at a bait constructing company. The optimal bait region can be the most conserved region in the MSA or the region with the highest number of sequences without gaps or ambiguous nucleotides.
+
+Since performance was one of the major design goals, the BaitFisher and BaitFilter programs are both written in C++. 
+
+**Software development:**   
+Christoph Mayer, 
+Forschungsmuseum Alexander Koenig, 
+53113 Bonn, 
+Germany
+
+**Main contributors:**
+The main contributors to the development of the BaitFisher software are:  
+Christoph Mayer (\*), Oliver Niehuis (\*), Manuela Sann (\*,\*\*)  
+(\*): Forschungsmuseum Alexander Koenig, 53113 Bonn, Germany  
+(\*\*): Museum für Naturkunde, Berlin, Germnay.  
+
+
+**When using BaitFisher please cite:**   
+Mayer, C., Sann, M., Donath, A., Meixner, M., Podsiadlowski, L., Peters, R.S., Petersen, M., Meusemann, K., Liere, K., Wägele, J.-W., Misof, B., Bleidorn, C., Ohl, M., Niehuis, O., 2016. BaitFisher: A Software Package for Multispecies Target DNA Enrichment Probe Design. Mol. Biol. Evol. doi:10.1093/molbev/msw056
+
+Documentation
+-------------
+
+A full manual for the BaitFisher package as PDF can be found in the "Documentation" folder.
+Furthermore, example analyses can be found in the Example folder.
+
+Online help for the BaitFisher and BaitFilter programs can be obtained by called he programs
+as follows:
+
+PATH/BaitFisher -h  
+PATH/BaitFileter -h
+
+
+
+Compiling and installing BaitFisher and BaitFilter
+--------------------------------------------------
+### System requirements:
+
+BaitFisher can be compiled on all platforms, which provide a C++ compiler that includes the following system header files: unistd.h, sys/stat.h, sys/types.h, dirent.h. These header files are standard header files on all unix systems such as Linux and Mac Os X. I also managed to compile BaitFisher and BaitFilter on Windows using the Mingw compiler (www.mingw.org).
+
+### Compiling BaitFisher and BaitFilter:
+
+Please, unpack the BaitFisher archive you downloaded. 
+
+On the command line enter the BaitFisher-package-master directory. Now type make on the command line. This compiles the BaitFisher as well as the BaitFilter program. The executables of these to programs care called: BaitFisher-v1.2.7 and BaitFilter-v1.0.5. They can be copied on your computer to any place you like. To use these executables they have to be addressed with its full path, or they have to be placed somewhere where in your system path.
+
+
+Quickstart
+----------
+More content will me added soon.
+For details please see the manual in the "Documentation" folder.
+
+>Last updated: July 14th, 2016 by Christoph Mayer
+
diff --git a/bait-filter.cpp b/bait-filter.cpp
new file mode 100644
index 0000000..e0ad13c
--- /dev/null
+++ b/bait-filter.cpp
@@ -0,0 +1,633 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include <iostream>
+#include <fstream>
+#include "global-types-and-parameters.h"
+#include "CBaitRecord.h"
+#include "faststring2.h"
+#include "CBlastParser.h"
+#include "print_container.h"
+#include "Ctriple.h"
+
+#include <ctime>
+
+using namespace std;
+
+
+bool skip_blast = false;
+unsigned start_time=0;
+unsigned blast_time=0;
+
+
+// Verbosity rules:                                                                                                                  
+//      verbosity 0 -> only error messages that lead to exit()                                                                       
+//      verbosity 1 -> only warnings
+//      verbosity 2 -> information on baits, time used
+//      verbosity 3 -> progress                                                                                                      
+//      verbosity 4 -> more progress                                                                                                 
+
+
+// The very first version of this program was called filter-double-hits.cpp.
+//  double max_e               = 1.0/1000000.0;
+//  double factor_max_increase = 1000;
+
+//  faststring blast_db_name = "/Volumes/Mac2/Daten2/Bait-Fisher-Tests/05-2015/Baitfishing_Vespidae/Apis_mellifera_genome/Amel_4.5_scaffolds.fa";
+
+void welcome(std::ostream &os)
+{
+  os << endl << endl;
+  os << "Welcome to " << PROGNAME << ", version " << VERSION << "."
+     << endl << endl << endl;
+}
+
+void good_bye(std::ostream &os)
+{
+  os << "Your BaitFilter analysis finished successfully." << endl; 
+}
+
+
+void get_hours_minutes_seconds(unsigned secs, unsigned &h, unsigned &m, unsigned &s)
+{
+  h     =  secs/3600;
+  secs  %= 3600;
+  m     =  secs/60;
+  s     =  secs%60;
+}
+
+void print_time(unsigned secs, ostream &os)
+{
+  unsigned h, m, s;
+  get_hours_minutes_seconds(secs, h, m, s);
+  os << h << ":" << m << ":" << s;
+}
+
+void print_stats(const CBaitLoci_collection &blc, const char * header= NULL)
+{
+  if (global_verbosity >= 2)
+  {
+    CBaitRegionSelectorSets brss;
+    if (header)
+      cout << header << endl;
+    blc.fill_locus_selector(brss);
+    brss.print_num_genes_num_features(cout, "  ");
+    
+    unsigned NumSeqs, NumBaits;
+    blc.get_seqs_baits_count(NumSeqs, NumBaits);
+
+    cout << endl;
+    cout << "  Total number of baits:             " << NumBaits << endl;
+    cout << "  Total number of sequences at loci: " << NumSeqs  << endl;
+    cout << "  Proportion of baits saved:         " << (1.0 -(double)NumBaits/NumSeqs)*100 << "%" << endl;
+
+    cout.precision(6);
+    cout << "  Mean maximum distance of baits to MSAs:    " << blc.get_max_dist_mean() << endl;
+    cout << "  Overall maximum distance of bait to MSA:   " << blc.get_overall_max_dist() << endl;
+    cout.precision(2);
+    cout << "  Mean CG content of baits:               " << blc.get_CG_mean() << endl;
+  }
+
+}
+
+
+void extract_loci_information(const faststring &header, faststring &alignment_name, faststring &gene_name, unsigned &feature_num, unsigned &start)
+{
+  faststring rest1;
+  faststring rest2;
+  faststring tmp;
+
+  header.divide_at('|', alignment_name, rest1);
+
+  rest1.divide_at('|',  gene_name,      rest2);
+
+  rest2.divide_at('|',  tmp,            rest1);
+
+  if (!tmp.isAnUnsigned())
+  {
+    cerr << "Error: Header does not follow formating conventions: " << header << endl;
+    cerr << "The third field (separator \"|\") should be an unsigned integer number, but found \""  << tmp << "\" instead." << endl;
+    exit(-3);
+  }
+  feature_num = tmp.ToUnsigned();
+
+  rest1.divide_at('|',  tmp,            rest2);
+
+  if (!tmp.isAnUnsigned())
+  {
+    cerr << "Error: Header does not follow formating conventions: " << header << endl;
+    cerr << "The fourth field (separator \"|\") should be an unsigned integer number, but found \"" << tmp << "\" instead." << endl;
+    exit(-3);
+  }
+  start = tmp.ToUnsigned();
+
+//   rest2.divide_at('|', tmp, rest1);
+
+//   if (!tmp.isAnUnsigned())
+//   {
+//     cerr << "Error: Header does not follow formating conventions: " << header << endl;
+//     cerr << "The fifth field (separator \"|\") should be an unsigned integer number, but found \""  << tmp << "\" instead." << endl;
+//     exit(-3);
+//   }
+
+//   if (!rest1.isAnUnsigned())
+//   {
+//     cerr << "Error: Header does not follow formating conventions: " << header << endl;
+//     cerr << "The sixth field (separator \"|\") should be an unsigned integer number, but found \""  << rest1 << "\" instead." << endl;
+//     exit(-3);
+//   }
+
+//   tiling_index = tmp.ToUnsigned();
+//   counter      = rest1.ToUnsigned();
+
+}
+
+
+
+
+int main(int argc, char ** argv)
+{
+
+  start_time = time(NULL);
+
+#ifdef SKIPBLAST
+skip_blast = true;
+#endif
+
+  cout.setf(ios::fixed);
+  cout.precision(2);
+
+  if (global_verbosity >= 2)
+  {
+    welcome(cout);
+  }
+  read_and_init_parameters(argc, argv);
+
+  if (global_verbosity >= 2)
+  {
+    putc('\n', stderr);
+    print_parameters(stderr,"");
+    putc('\n', stderr);
+  }
+
+  // Parameter tests:
+  if (0)
+  {
+    faststring cmd = global_blast_exe + " -version";
+    cout << "Blast exe test: " << cmd << endl;
+    int err = system(cmd.c_str());
+
+    cout << err << endl;
+
+    exit(0);
+  }
+
+
+  ifstream is;
+  ofstream os;
+
+  is.open(global_bait_filename.c_str());
+
+  if (is.fail())
+  {
+    cerr << "Error: Input file: " << global_bait_filename << " could not be opened. I guess it does not exist." << endl;
+    exit(-1);
+  }
+
+  if (global_mode != 'S')
+  {
+    os.open(global_output_filename.c_str());
+    if (os.fail())
+    {
+      cerr << endl;
+      cerr << "Error: Failed to open or create output file. " << global_output_filename << endl;
+      cerr << "Exiting." << endl;
+      exit(-1);
+    }
+  }
+
+  if (global_verbosity >= 3)
+  { 
+    cout << "PROGRESS: Parsing bait file: ... " << flush;
+  }
+  CBaitLoci_collection blc(is);
+  is.close();
+
+  if (global_verbosity >= 3)
+  {
+    cout << "Done. Time used since start in seconds: " << (time(NULL)-start_time) << endl;
+  }
+
+  // Note: Bait loci are sorted in the constructor. Usually, they should be sorted in the bait file,
+  //       if the user has not edited the file.
+
+  //  DEBUG code:
+  //  blc.print_stats(cout);
+  //  blc.print_all(cout, 's');
+  //  blc.print_all(cout, 'f');
+  //  exit(0);
+
+
+  if (global_mode == 'S')
+  {
+    faststring msg = "Stats for input file";
+
+
+    if (global_mode < 3)
+      global_verbosity = 3; // Minimum value required by print_stats() to print something. Could be handled with a parameter!
+    print_stats(blc, msg.c_str());
+    exit(0);
+  }
+
+
+  if (global_mode == 'a')
+  {
+    if (global_verbosity >= 3)
+    {
+      cout << endl << endl;
+      cout << "PROGRESS: Determining: Best bait region in each alignment/gene with criterion minimum number of baits" << endl;
+    }
+    CBaitLoci_collection blc_best_baitRegions_in_genes_crit_numBaits(blc, 'g', 'b');
+    blc_best_baitRegions_in_genes_crit_numBaits.print_all(os, 's');
+    if (global_verbosity >= 2)
+    {
+      cout << "After determining the best bait region per alignment/gene under the criterion to minimize the number of baits we have" 
+	   << endl;
+      print_stats(blc_best_baitRegions_in_genes_crit_numBaits);
+      cout << endl;
+    }
+  }
+  else if (global_mode == 'A')
+  {
+    if (global_verbosity >= 3)
+    {
+      cerr << endl << endl;
+      cerr << "PROGRESS: Determining: Best bait region in each gene with criterion maximum number of sequences." << endl;
+    }
+    CBaitLoci_collection blc_best_baitRegions_in_genes_crit_numSeqs(blc, 'g', 's');
+    blc_best_baitRegions_in_genes_crit_numSeqs.print_all(os, 's');
+    if (global_verbosity >= 2)
+    {
+      cout << "After determining the best bait region per alignment/gene under the criterion to maximize the number of sequences we have" 
+	   << endl;
+      print_stats(blc_best_baitRegions_in_genes_crit_numSeqs);
+      cout << endl;
+    }
+  }
+  else if (global_mode == 'f')
+  {
+    if (global_verbosity >= 3)
+    {
+      cerr << endl << endl;
+      cerr << "PROGRESS: Determining: Best bait region in each feature with criterion minimum number of baits" << endl;
+    }
+    CBaitLoci_collection blc_best_baitRegions_in_features_crit_numBaits(blc, 'f', 'b');
+    blc_best_baitRegions_in_features_crit_numBaits.print_all(os, 's');
+    if (global_verbosity >= 2)
+    {
+      cout << "After determining the best bait region per feature under the criterion to minimize the number of baits we have" 
+	   << endl;
+      print_stats(blc_best_baitRegions_in_features_crit_numBaits);
+      cout << endl;
+    }
+  }
+  else if (global_mode == 'F')
+  {
+    if (global_verbosity >= 3)
+    {
+      cerr << endl << endl;
+      cerr << "PROGRESS: Determining: Best bait region in each feature with criterion maximum number of sequences." << endl;
+    }
+    CBaitLoci_collection blc_best_baitRegions_in_features_crit_numSeqs(blc, 'f', 's');
+    blc_best_baitRegions_in_features_crit_numSeqs.print_all(os, 's');
+    if (global_verbosity >= 2)
+    {
+      cout << "After determining the best bait region per feature under the criterion to maximize the number of sequences we have"
+	   << endl;
+      print_stats(blc_best_baitRegions_in_features_crit_numSeqs);
+      cout << endl;
+    }
+  }
+  else if (global_mode == 't' || global_mode == 'T')
+  {
+    unsigned  sum_seqs, sum_baits;
+    
+    unsigned  start_count = 0;
+    unsigned  best_index  = 1;
+    unsigned  best_num    = 0; // This initialistion is only done to silence the compiler warning for using an unitialized variable.
+
+    // This is essential output: Restrict it by verbostiy??
+    if (global_verbosity >= 2)
+    {
+      cout << "Running thinning mode:" << endl;
+      cout << "\nThe columns are: starting offset, sum of sequences the result is baised on, number of required baits." << endl;
+    }
+    // Run thinning mode:
+    while (start_count < global_thinning_step_width)
+    {
+      blc.count_seqs_baits_for_start_and_offset(start_count, global_thinning_step_width, sum_seqs, sum_baits);
+      ++start_count;
+
+      if (start_count == 1)  // In this block we will surely initialize best_num:
+      {
+	if (global_mode == 't')
+	  best_num = sum_baits;
+	else
+	  best_num = sum_seqs;
+      }
+
+      if (global_mode == 't')
+      {
+	if (best_num > sum_baits)
+	{
+	  best_index = start_count;
+	  best_num = sum_baits;
+	}
+      }
+      else
+      {
+	if (best_num < sum_seqs)
+	{
+	  best_index = start_count;
+	  best_num = sum_seqs;
+	}
+      }
+      if (global_verbosity >= 2)
+      {
+	cout << start_count << " " << sum_seqs << " " << sum_baits << endl;
+      }
+    }
+    
+    cout << "Best starting offset: " << best_index << endl;
+    cout << "A bait file that has been thinned out is written to the output file: " << global_output_filename << endl;
+    cout << "This file contains each " << global_thinning_step_width << "th bait region starting with bait-region " << best_index << " of the input bait file." << endl; 
+    cout << "Numbers correspond to the line numbers in the input file +1, since all bait files have a headline." << endl;
+
+    blc.print_with_start_stepwidth(os, 's', best_index, global_thinning_step_width);
+  }
+  else if (global_mode == 'b' || global_mode == 'B' || global_mode == 'x' )
+  {
+    faststring blastfilename = "blast_result.txt";
+
+    if (!skip_blast)
+    {
+      // Write baits to fasta file:
+      ofstream os_tmp("tmp_baits.txt");
+      blc.print_all(os_tmp, 'f');
+      os_tmp.close();
+
+      // Conduct a blast of the baits sequences against a reference genome:
+
+      // In the blast call we use an evalue threshold of:
+      //     global_blast_max_second_hit_evalue*2
+      //     This will report all relevant hits.
+
+      faststring e_value_command;
+
+      if (!global_blast_evalue_commandline.empty())
+      {
+	double tmp = global_blast_evalue_commandline.ToDouble();
+	if (tmp <= 10 && tmp > 0)
+	{
+	  e_value_command = faststring(tmp, 15, true);
+	}
+	else
+	{
+	  e_value_command = faststring(global_blast_max_second_hit_evalue*2, 15, true); 
+	  cerr << "Warning: The Evalue that can be specified with the blast-evalue-cutoff option has to be greater than 0 and smaller or equal to 10."
+	       << " The evalue that has been specified is not in this range."
+	       << " Therefore we are falling back to the default value: " << e_value_command << endl;
+	}
+      }
+      else
+      {
+	  e_value_command = faststring(global_blast_max_second_hit_evalue*2, 15, true); 
+      }
+      faststring blastcommand  = "blastn -outfmt 6 -task blastn -query tmp_baits.txt -db " + global_blast_db + " -out " + blastfilename + " -evalue " + e_value_command;
+
+      if (!global_blast_extra_commandline.empty())
+      {
+	blastcommand += " " + global_blast_extra_commandline;
+      }
+
+      if (global_verbosity > 50)
+      {
+	cout << "Running blast with command: " << endl;
+	cout << blastcommand << endl;
+      }
+
+      blast_time = time(NULL);
+
+      //    cerr << "Please press return to continue." << endl;
+      //  cin.get();
+
+      int blast_command_error;
+      blast_command_error = system(blastcommand.c_str());
+      
+      if (blast_command_error != 0)
+      {
+	cerr << "ERROR: The blast command returned with non-zero error status. This indicates that blast encountered an error. The status blast returned via the system command was: " << blast_command_error << endl;
+	cerr << "I suggest to run blast command manually: " << endl;
+	cerr << blastcommand << endl;
+	cerr << "Exiting." << endl;
+	exit(-1);
+      }
+
+      blast_time = time(NULL)-blast_time;
+    }
+
+    if (global_verbosity > 50)
+      cout << "PROGRESS: Reading the blast result file: " << blastfilename << " ..." << flush;
+    CBlast_parser bp(blastfilename.c_str());
+    if (global_verbosity > 50)
+      cout << " Done." << endl;
+
+    // How to use the CBalstParser to filter hits:
+    // Mode 0:
+    // Filter gene if first hit is below global_blast_max_first_hit_evalue and if second hit is below best_e_value_this_query*factor_max_increase
+    // Mode 1:
+    // Filter gene if first hit is below global_blast_max_first_hit_evalue and if second hit is below global_blast_max_second_hit_evalue 
+
+    // double_hits contain only one of the 2 good hits that have been found.
+    // In case more than 2 good hits are found, it contains all but the first good hit, which is more than what we need.
+    // But this redudancy is removed when we add the bait information to the locus_selector data structure.
+    // 
+    CBlast_parser double_hits; 
+    bp.detect_2_good_hits_per_query(global_blast_max_first_hit_evalue, global_blast_max_second_hit_evalue, double_hits, 1);
+
+    set<faststring> set_of_names;
+    double_hits.set_of_query_names(set_of_names);
+
+    // The locus_selector contains information about 
+    CBaitRegionSelectorSets locus_selector;
+
+    set<faststring>::iterator it, it_end;
+    it      = set_of_names.begin();
+    it_end  = set_of_names.end();
+
+    //    cout << "Start Time: " << time(NULL) << endl;
+
+    while (it != it_end)
+    {
+      faststring alignment_name;
+      faststring gene_name;
+      unsigned   feature_num;
+      unsigned   start;
+//       unsigned   tiling_index;  // Just dummy, will not be used.
+//       unsigned   counter;       // Just dummy, will not be used.
+
+      extract_loci_information(*it, alignment_name, gene_name, feature_num, start);
+
+      if (0)
+      {
+	if (!locus_selector.exists(alignment_name) )
+	  cout << "New alignmentname:                        " << alignment_name << endl;
+	else
+	  cout << "Existing alignmentname:                   " << alignment_name << endl;
+
+	if (!locus_selector.exists(alignment_name, feature_num) )
+	  cout << "New alignmentname feature_num:            " << alignment_name << " " << feature_num << endl;
+	else
+	  cout << "Existing alignmentname feature_num:       " << alignment_name << " " << feature_num << endl;
+
+	if (!locus_selector.exists(alignment_name, feature_num, start) )
+	  cout << "New alignmentname feature_num start:      " << alignment_name << " " << feature_num << " " << start << endl;
+	else
+	  cout << "Existing alignmentname feature_num start: " << alignment_name << " " << feature_num << " " << start << endl;
+      }
+
+      locus_selector.add(alignment_name, feature_num, start);
+      ++it;
+    }
+
+    if (0)
+    {
+      cout << endl;
+      cout << "Print locus selectors:" << endl;
+      locus_selector.print_all(cout);
+      cout << endl;
+    }
+
+    //    cout << "End Time: " << time(NULL) << endl;
+
+    // Filter bait loci according to double_hits:
+    
+    if (global_verbosity >= 100)
+    {
+      cout << "START: List of double hits:" << endl;
+      double_hits.print_all(cout);
+      cout << "END: List of double hits:" << endl;
+      cout << endl;
+    }
+
+    if (global_verbosity >= 2)
+    {
+      cout << "Number of bait regions before searching/filtering for baits with multiple blast hits: " << blc.get_number_of_loci() << endl;
+      cout << "Before filtering: ";
+      print_stats(blc);
+      cout << endl;
+    }
+
+    CBaitLoci_collection filtered_blc(blc, locus_selector, global_mode);
+
+    if (global_verbosity >= 2)
+    {
+      cout << "Number of bait regions after searching/filtering for baits with multiple blast hits:  " << filtered_blc.get_number_of_loci() << endl;
+    }
+
+    if (global_blast_min_hit_coverage_of_bait > 0)
+    {
+    // Now filter bait regions to ensure minimum coverage of hits:
+      CBaitLoci_collection coverage_filter(filtered_blc, bp, global_blast_min_hit_coverage_of_bait);
+      if (global_verbosity >= 2)
+      {
+	cout << "Number of bait regions after hit coverage filtering:  " << coverage_filter.get_number_of_loci() << endl;
+      }
+      coverage_filter.print_all(os, 's');
+    }
+    else
+    {
+      // Report what we have found:
+      filtered_blc.print_all(os, 's');
+    }
+    
+    // Print collectively for all modes (global_mode == 'b' || global_mode == 'B' || global_mode == 'x'  ):
+    if (global_verbosity >= 2)
+    {
+      cout << "Bait statistics after filtering: ";
+      print_stats(filtered_blc);
+      cout << endl;
+    }
+
+  } // END if (global_mode == 'b' || global_mode == 'B' || global_mode == 'x'  )
+  else if (global_mode == 'c')
+  {
+    if (global_conversion_mode == 1)
+    {
+      // Write baits to file in Agilent-Germany format
+      blc.print_all(os, 'A', global_ProbeID_prefix.c_str());
+
+      if (global_verbosity >= 2)
+      {
+	cout << "Bait statistics for the converted bait file:" << endl;
+	print_stats(blc);
+	cout << endl;
+      }
+    }
+    else
+    {
+      cerr << "INTERNAL ERROR: Unknown converson mode : " << global_conversion_mode << endl;
+      cerr << "Please report this problem to the developer." << endl;
+      exit(-13);     
+    }
+  } // END if (global_mode == 'c')
+  else
+  {
+    cerr << "INTERNAL ERROR: Unknown internal mode: " << global_mode << endl;
+    cerr << "Please report this problem to the developer." << endl;
+    exit(-13);
+  }
+
+  unsigned total_seconds = time(NULL)-start_time;
+  if (global_verbosity >= 2)
+  {
+    cout << "Total time used: ";
+    print_time(total_seconds, cout);
+    cout << endl;
+  }
+
+  if (global_mode == 'b' || global_mode == 'B' || global_mode == 'x' )
+  {
+    if (global_verbosity >= 2)
+    {
+      cout << "Time used excluding the Blast search: ";
+      print_time(total_seconds-blast_time, cout);
+      cout << endl;
+    }
+  }
+
+  os.close();
+  good_bye(cout);
+}
diff --git a/bait-fisher-helper.cpp b/bait-fisher-helper.cpp
new file mode 100644
index 0000000..0860712
--- /dev/null
+++ b/bait-fisher-helper.cpp
@@ -0,0 +1,193 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include "faststring2.h"
+#include <iostream>
+#include <list>
+
+#include "CFile/CFile2_1.h"
+#include "CSequences2.h"
+#include "CSequence_Mol2_1.h"
+
+#include "bait-fisher-helper.h"
+
+using namespace std;
+
+// Extract species (taxon) name from transcript name:
+faststring extract_taxon_name(faststring sequence_name, char delim, unsigned short field_num)
+{
+  list<faststring> container;  char             delim_cstring[2];
+  
+  delim_cstring[0] = delim;
+  delim_cstring[1] = '\0';
+
+  split(container, sequence_name, delim_cstring);
+
+  // If the field number (0 based) is not smaller the number of fields, we have a problem.
+  if (!(field_num < container.size() ) )
+  {
+    cerr << "ERROR: In extract_taxon_name: Found unexpected number of fields in a sequence name: " << sequence_name << endl;
+    cerr << "I tried to extract field number " << field_num << " as specified in the parameter file or given as default value." << endl;
+    cerr << "But this field does not exist." << endl;
+    exit(-3);
+  }
+
+  list<faststring>::iterator it = container.begin();
+  unsigned short i;
+  
+  for (i=0; i<field_num; ++i)
+    ++it;
+
+  return *it;
+}
+
+
+// Extract gene name from transcript name:
+faststring extract_gene_name(faststring sequence_name, char delim, unsigned short field_num)
+{
+  list<faststring> container;
+  char             delim_cstring[2];
+  
+  
+
+  delim_cstring[0] = delim;
+  delim_cstring[1] = '\0';
+
+  split(container, sequence_name, delim_cstring);
+
+  // If the field number (0 based) is not smaller the number of fields, we have a problem.
+  if (!(field_num < container.size() ) )
+  {
+    cerr << "ERROR: In extract_gene_name: Found unexpected number of fields in a sequence name: " << sequence_name << endl;
+    cerr << "I tried to extract field number " << field_num << " as specified in the parameter file or given as default value." << endl;
+    cerr << "But this field does not exist." << endl;
+    exit(-3);
+  }
+
+  list<faststring>::iterator it = container.begin();
+  unsigned short i;
+  
+  for (i=0; i<field_num; ++i)
+    ++it;
+  
+#ifdef SHORTEN_GENENAME_AFTER_MINUS
+    faststring pre, post;
+    it->backwards_search_divide_at_break_at('-', delim, pre, post);
+    return pre;
+#else
+    return *it;
+#endif
+}
+
+// (1) Read alignment.
+// (2) Provide pointer to specific sequence (the one for which the name is specified, see (3)) as well as to the full alignment.
+// (3) If species_name_query is not empty, find the sequence with this name.
+//     If species_name_query is an empty string, assign NULL to pseq.
+// (4) Important: The CSequence_Mol and CSequences2 objects need to be deleted by the user of this function when not used any more.
+// Version 2: Read full alignment and return both: full alignment and requested sequence.
+void read_alignment_sequence_of_species2(faststring       alignment_file,
+					 faststring       species_name_query,
+					 CSequence_Mol*&  pseq,
+					 CSequences2*&    pseqs,
+					 unsigned&        pseq_index,
+					 char             delim, 
+					 unsigned short   field_num)
+{
+  CFile           infile;
+  //  unsigned        count_seq=0;
+  CSequences2*    tmp_pseqs;
+
+
+//   fputs("Reading alignment file: ", stderr);
+//   fputs(alignment_file.c_str(), stderr);
+//   fputs(".\n", stderr);
+
+  infile.ffopen(alignment_file.c_str());
+  if ( infile.fail() )
+  {
+    fprintf(stderr, "Sorry! The input file \n   \"%s\"\ncould not be opened. I guess it does not exist.\n",
+	    alignment_file.c_str());
+    exit(-1);
+  }
+
+  CSequence_Mol::processing_flag pflag = CSequence_Mol::processing_flag(0);
+  // Convert all nucleotides to upper case letters and ambig to Ns.
+  pflag = CSequence_Mol::processing_flag(pflag | CSequence_Mol::convert_toupper | CSequence_Mol::convert_ambig2N);
+  tmp_pseqs = new CSequences2(CSequence_Mol::dna);
+
+  ++DEBUG_COUNT_NEW_ALIGNMENT_FROM_FILE;
+
+  tmp_pseqs->read_from_Fasta_File(infile, pflag, 0, -1, false);
+  infile.ffclose();
+
+
+//   fputsf("Alignment file has been read successfully.\n", stderr);
+
+  pseqs = tmp_pseqs;
+
+
+  if (species_name_query.empty() )
+  {
+    pseq = NULL;
+    pseq_index = -1u;    
+  }
+  else
+  {
+    // Find sequence with taxon name equal to species_name_query
+    unsigned i, N;
+    N = pseqs->GetTaxaNum();
+  
+    for (i=0; i<N; ++i)
+    {
+      const char*  seq_name = pseqs->get_Seq_Name(i);
+    
+      if (seq_name == NULL)
+      {
+	cerr << "INTERNAL ERROR: Could not retriev sequence name for sequence of index: " 
+	     << i << " in read_transcript_sequence_of_species2." << endl;
+	exit(-5);
+      }
+
+      faststring species_name = extract_taxon_name(seq_name, delim, field_num);
+
+      //     cout << "Index: " << i << " " << N << endl;
+      //     cout << "Comapring: " << species_name << " " << species_name_query << endl;
+
+      if (species_name == species_name_query)
+	break;
+    }
+    if (i == N) // There is no sequence with species name equal to the one we search for.
+    {
+      pseq = NULL;
+      pseq_index = -1u;
+    }
+    else
+    {
+      pseq = pseqs->get_seq_by_index(i);
+      pseq_index = i;
+    }
+  }
+}
diff --git a/bait-fisher-helper.h b/bait-fisher-helper.h
new file mode 100644
index 0000000..535153f
--- /dev/null
+++ b/bait-fisher-helper.h
@@ -0,0 +1,51 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include "faststring2.h"
+#include "CSequences2.h"
+#include "CSequence_Mol2_1.h"
+
+
+
+faststring extract_taxon_name(faststring, char, unsigned short);
+faststring extract_gene_name(faststring, char, unsigned short);
+void read_alignment_sequence_of_species2(faststring, faststring,
+					 CSequence_Mol*&, CSequences2*&,
+					 unsigned&, char, unsigned short);
+
+extern int DEBUG_COUNT_NEW_CALLS_FEATURE_ALIGNMENT;
+extern int DEBUG_COUNT_NEW_CALLS_CBAIT_REGION_INFORMATION;
+extern int DEBUG_COUNT_NEW_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION;
+extern int DEBUG_COUNT_NEW_CALLS_MSA;
+extern int DEBUG_COUNT_NEW_ALIGNMENT_FROM_FILE;
+
+extern int DEBUG_COUNT_DELETE_CALLS_FEATURE_ALIGNMENT;
+extern int DEBUG_COUNT_DELETE_CALLS_CBAIT_REGION_INFORMATION;
+extern int DEBUG_COUNT_DELETE_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION;
+extern int DEBUG_COUNT_DELETE_CALLS_MSA;
+extern int DEBUG_COUNT_DELETE_ALIGNMENT_FROM_FILE;
+
+
diff --git a/bait-fisher.cpp b/bait-fisher.cpp
new file mode 100644
index 0000000..62e61a9
--- /dev/null
+++ b/bait-fisher.cpp
@@ -0,0 +1,2199 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#define  NODEBUG
+#include "faststring2.h"
+#include <iostream>
+#include "GFF-class.h"
+#include "GFF-collection.h"
+#include "mydir-unix.h"
+#include <list>
+#include "CFile/CFile2_1.h"
+#include "CSequences2.h"
+#include "CSequence_Mol2_1.h"
+#include "CDnaString2.h"
+#include <climits>
+#include <ctime>
+
+#include "CAligner/CAligner.h"
+#include "scoring-matrices/CScoreMatrix.h"
+#include "basic-DNA-RNA-AA-routines.h"
+
+#include "CDistance_matrix.h"
+#include "CSeqNameList.h"
+#include "CTaxonNamesDictionary.h"
+#include "CRequiredTaxon.h"
+
+//#include "pipeline-step3.h"
+#include "Csequence_cluster_and_center_sequence.h"
+#include "DEBUG_STUFF.h"
+
+
+#define PROGNAME  "BaitFisher"
+#define VERSION   "1.2.7"
+
+
+using namespace std;
+
+#include "bait-fisher-helper.h"
+
+// Verbosity rules:
+//      verbosity 0 -> only error messages that lead to exit() (goes to cerr)
+//      verbosity 1 -> warnings, ALERT (goes to cerr)
+//      verboisty 2 -> more warinings, e.g. skipping features
+//      verbosity 3 -> progress (goes to cout)
+//      verbosity 4 -> more progress (goes to cout)
+//      verbosity 6 -> per alignment/feautre success NOTES
+//      verbosity 8 -> per coordinate success NOTES
+//      verbosity >=20: DEGUB
+// Default: 5
+
+unsigned global_VERBOSITY = 0; // Will be initialized in parse_parameter_file. This value will never be used.
+
+
+
+
+// Goal of this program:
+//
+
+
+int DEBUG_COUNT_NEW_CALLS_FEATURE_ALIGNMENT = 0;
+int DEBUG_COUNT_NEW_CALLS_CBAIT_REGION_INFORMATION = 0;
+int DEBUG_COUNT_NEW_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION = 0;
+int DEBUG_COUNT_NEW_CALLS_MSA = 0;
+int DEBUG_COUNT_NEW_ALIGNMENT_FROM_FILE = 0;
+
+int DEBUG_COUNT_DELETE_CALLS_FEATURE_ALIGNMENT = 0;
+int DEBUG_COUNT_DELETE_CALLS_CBAIT_REGION_INFORMATION = 0;
+int DEBUG_COUNT_DELETE_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION = 0;
+int DEBUG_COUNT_DELETE_CALLS_MSA = 0;
+int DEBUG_COUNT_DELETE_ALIGNMENT_FROM_FILE = 0;
+
+void print_DEBUG_COUNT (ostream &os, const char * comment)
+{
+  os << "DEBUG: NEW/DELETE COUNTs:              " << comment << endl;
+  os << "DEBUG: NUMBER OF ALIGNMENTS CREATED/DELETED:  " << DEBUG_COUNT_NEW_ALIGNMENT_FROM_FILE                     << "/" <<  DEBUG_COUNT_DELETE_ALIGNMENT_FROM_FILE << endl;
+  os << "DEBUG: NUMBER OF FEATUREALIGNMENT C/D:        " << DEBUG_COUNT_NEW_CALLS_FEATURE_ALIGNMENT                 << "/" <<  DEBUG_COUNT_DELETE_CALLS_FEATURE_ALIGNMENT << endl;
+  os << "DEBUG: MSA  CREATED/DELETED                   " << DEBUG_COUNT_NEW_CALLS_MSA                               << "/" <<  DEBUG_COUNT_DELETE_CALLS_MSA << endl;
+  os << "DEBUG: CSEQUENCE_LOCI_CLUSTER_COLLECTION C/D: " << DEBUG_COUNT_NEW_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION << "/" <<  DEBUG_COUNT_DELETE_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION << endl;
+  os << "DEBUG: CBAIT_REGION_INFORMATION C/D:          " << DEBUG_COUNT_NEW_CALLS_CBAIT_REGION_INFORMATION          << "/" <<  DEBUG_COUNT_DELETE_CALLS_CBAIT_REGION_INFORMATION << endl;
+}
+
+void get_time_string(faststring &str)
+{
+  time_t      rawtime;
+  struct tm   *timeinfo;
+  static char buffer[80];
+
+  std::time (&rawtime);
+  timeinfo = std::localtime(&rawtime);
+  std::strftime (buffer,80,"%F %T",timeinfo);
+  str = faststring(buffer);
+}
+
+template<class T>
+int delete_pointers_in_vector(vector<T> &v)
+{
+  int i, N, count=0;
+  N = v.size();
+
+  for (i=0; i<N; ++i)
+  {
+    if (v[i])
+    {
+      ++count;
+      delete v[i];
+    }
+  }
+  v.clear();
+  return count;
+}
+
+
+
+// Add more checks!! Currently we do not check whether parameters occur twice, etc.
+void parse_parameter_file(faststring      & fname_parameter_file,
+			  faststring      & fname_gff,
+			  faststring      & fname_genome,
+			  faststring      & string_required_taxa,
+			  faststring      & dname_alignments,
+			  faststring      & genome_name,
+			  unsigned short  & bait_length,
+			  double          & cluster_threshold,
+			  faststring      & output_directory,
+			  unsigned short  & bait_offset,
+			  unsigned short  & bait_number,
+			  bool            & remove_reference_species_from_alignments,
+			  bool            & alignment_cutting,
+			  faststring      & gff_feature_name,
+			  faststring      & gff_record_attribute_name_for_geneID,
+			  char            & sequence_name_field_delimiter,
+			  unsigned short  & sequence_name_taxon_field_number,
+			  unsigned short  & sequence_name_geneID_field_number,
+			  bool            & sequence_name_tokenizer_overwritten,
+			  char            & center_computation_mode,
+			  unsigned        & verbosity
+			 )
+{
+  fname_gff.clear();
+  fname_genome.clear();
+  string_required_taxa.clear();
+  dname_alignments.clear();
+  genome_name.clear();
+  bait_length                              = 0;
+  cluster_threshold                        = -1;
+  output_directory.clear();
+  bait_offset                              = USHRT_MAX;
+  bait_number                              = USHRT_MAX;
+  remove_reference_species_from_alignments = false;
+  alignment_cutting                        = false;
+
+  sequence_name_field_delimiter            = '|';
+  sequence_name_taxon_field_number         = 2;
+  sequence_name_geneID_field_number        = 3;
+  sequence_name_tokenizer_overwritten      = false;
+
+  center_computation_mode                = 1; // 0:exhaustive, 1:heuristic, 3: special comparison
+  verbosity                              = 5;
+
+  faststring line, pre, post;
+
+  ifstream is;
+  is.open(fname_parameter_file.c_str());
+  if (is.fail() )
+  {
+    cerr << "Error: Parameter file \""  << fname_parameter_file << "\" could not be opened. I guess it does not exist." << endl;
+    exit(-1);
+  }
+
+  getline(is, line);
+
+  while (!is.fail() )
+  {
+    line.shorten_to_first_occurrence_of('#');
+    line.removeSpacesBack();
+    line.removeSpacesFront();
+
+    if ( line.empty() )
+    {
+      getline(is, line);
+      continue;
+    }
+
+    if(line.divide_at_first_of(" \t",pre, post))
+    {
+      pre.removeSpacesBack();
+      post.removeSpacesFront();
+    }
+    else
+    {
+      pre = line;
+      post.clear();
+    }
+
+    if (pre == "gff-file-reference-genome")
+    {
+      fname_gff = post;
+    }
+    else if (pre == "reference-genome-file")
+    {
+      fname_genome = post;
+    }
+    else if (pre == "required-taxonomic-groups-string")
+    {
+      string_required_taxa = post;
+    }
+    else if (pre == "directory-transcript-files")
+    {
+      dname_alignments = post;
+    }
+    else if (pre == "reference-genome-name")
+    {
+      genome_name = post;
+    }
+    else if (pre == "bait-length")
+    {
+      bait_length = post.ToUnsigned();
+    }
+    else if (pre == "bait-offset")
+    {
+      bait_offset = post.ToUnsigned();
+    }
+    else if (pre == "bait-number")
+    {
+      bait_number = post.ToUnsigned();
+    }
+    else if (pre == "cluster-threshold")
+    {
+      cluster_threshold = post.ToDouble();
+    }
+    else if (pre == "output-directory")
+    {
+      output_directory = post;
+    }
+    else if (pre == "remove-reference-sequence")
+    {
+      post.ToLower();
+      if (post == "yes")
+	remove_reference_species_from_alignments = true;
+      else if (post == "no")
+	remove_reference_species_from_alignments = false;
+      else
+      {
+	cerr << "Error: Unknown option " << post << " for parameter " << pre << endl;
+	cerr << "The " << pre << " parameter will be ignored." << endl;
+	exit(-7);
+      }
+    }
+    else if (pre == "alignment-cutting")
+    {
+      post.ToLower();
+      if (post == "yes")
+	alignment_cutting = true;
+      else if (post == "no")
+	alignment_cutting = false;
+      else
+      {
+	cerr << "Error: Unknown option " << post << " for parameter " << pre << endl;
+	cerr << "The " << pre << " parameter will be ignored." << endl;
+	exit(-7);
+      }
+    }
+    else if (pre == "gff-feature-name")
+    {
+      gff_feature_name = post;
+    }
+    else if (pre == "gff-record-attribute-name-for-geneID")
+    {
+      gff_record_attribute_name_for_geneID = post;
+    }
+    else if (pre == "sequence-name-field-delimiter")
+    {
+      if (post.size()!=1)
+      {
+	cerr << "ERROR when parsing the parameter file: sequence-name-field-delimiter must be a single character, but I found "
+	     << sequence_name_field_delimiter << "." << endl;
+	exit(-1);
+      }
+      sequence_name_field_delimiter = post[0];
+    }
+    else if (pre == "sequence-name-taxon-field_number")
+    {
+      sequence_name_taxon_field_number = post.ToUnsigned();
+    }
+    else if (pre == "sequence-name-geneID-field_number")
+    {
+      sequence_name_geneID_field_number = post.ToUnsigned();
+    }
+    else if (pre == "verbosity")
+    {
+      verbosity = post.ToUnsigned();
+    }
+    else if (pre == "Hamming-center-sequence-computation-mode" || pre == "centroid-computation-mode")
+    {
+      if (post == "exhaustive")
+      {
+	center_computation_mode = 0;
+      }
+      else if (post == "heuristic")
+      {
+	center_computation_mode = 1;
+      }
+      else if (post == "comparison")
+      {
+	center_computation_mode = 3;
+      }
+      else
+      {
+	cerr << "Unknown option for parameter \"center-computation-mode\" in parameter file. Allowed options are: \"exhaustive\" and \"heuristic\"." << endl;
+	exit(-1);
+      }
+    }
+    else
+    {
+      cerr << "Error: Unknown parameter in parameter file: \"" << pre << "\"."<< endl;
+      exit(-1);
+    }
+    getline(is, line);
+  } // END while (!is.fail() )
+
+  // Basic consitency checking of parameters.
+  // Are all required parameters supplied?
+
+  if (alignment_cutting) // Then we require some parameters:
+  {
+    if (fname_gff.empty())
+    {
+      cerr << "Error: The parameter \"gff-file\" is required if alignment_cutting is set to yes. This parameter must be specified in the parameter file." << endl;
+      exit(-4);
+    }
+
+    if (fname_genome.empty() )
+    {
+      cerr << "Error: The parameter \"genome-file\" is required if alignment_cutting is set to yes. This parameter must be specified in the parameter file." << endl;
+      exit(-4);
+    }
+
+    if (genome_name.empty() )
+    {
+      cerr << "Error: The parameter \"genome-name\" is required if alignment_cutting is set to yes. This parameter must be specified in the parameter file." << endl;
+      exit(-4);
+    }
+    // Parameters with default values:
+    if (gff_feature_name.empty() )
+      gff_feature_name                         = "CDS";
+    if (gff_record_attribute_name_for_geneID.empty() )
+      gff_record_attribute_name_for_geneID     = "Parent";
+  }
+  else // No alignment cutting
+  {
+    if (!fname_gff.empty())
+    {
+      cerr << "Error: The parameter \"gff-file\" is specified even though alignment_cutting is set to no. Please remove this parameter from the parameter file." << endl;
+      exit(-4);
+    }
+
+    if (!fname_genome.empty() )
+    {
+      cerr << "Error: The parameter \"genome-file\" is specified even though alignment_cutting is set to no. Please remove this parameter from the parameter file." << endl;
+      exit(-4);
+    }
+
+    if (!genome_name.empty() )
+    {
+      cerr << "Error: The parameter \"genome-name\" is specified even though alignment_cutting is set to no. Please remove this parameter from the parameter file." << endl;
+      exit(-4);
+    }
+    if (!gff_feature_name.empty() )
+    {
+      cerr << "Error: The parameter \"gff-feature-name\" is specified even though alignment_cutting is set to no. Please remove this parameter from the parameter file." << endl;
+      exit(-4);
+    }
+    if (!gff_record_attribute_name_for_geneID.empty() )
+    {
+      cerr << "Error: The parameter \"gff-record-attribute-name-for-geneID\" is specified even though alignment_cutting is set to no. Please remove this parameter from the parameter file." << endl;
+      exit(-4);
+    }
+  }
+
+//   if (string_required_taxa.empty() )
+//   {
+//     cerr << "Error: The required parameter \"required-taxonomic-groups-string\" is not specified in the parameter file." << endl;
+//     exit(-4);
+//   }
+  if (dname_alignments.empty() )
+  {
+    cerr << "Error: The required parameter \"directory-transcript-files\" is not specified in the parameter file." << endl;
+    exit(-4);
+  }
+  if (bait_length == 0)
+  {
+    cerr << "Error: Required parameter \"bait-length\" is not specified in the parameter file." << endl;
+    exit(-4);
+  }
+  if (cluster_threshold == -1)
+  {
+    cerr << "Error: Required parameter \"cluster-threshold\" is not specified in the parameter file." << endl;
+    exit(-4);
+  }
+  if (  output_directory.empty() )
+  {
+    cerr << "Error: Required parameter \"output-directory\" is not specified in the parameter file." << endl;
+    exit(-4);
+  }
+  if (bait_number == SHRT_MAX)
+  {
+    cerr << "Error: Required parameter \"bait-number\" is not specified in the parameter file." << endl;
+    exit(-4);
+  }
+  if (bait_number == 0)
+  {
+    cerr << "Error: Parameter \"bait-number\" has been set to 0 in the parameter file, which is not a valid value." << endl;
+    exit(-4);
+  }
+  if (bait_offset == USHRT_MAX)
+  {
+    cerr << "Error: Required parameter \"bait-offset\" is not specified in the parameter file." << endl;
+    exit(-4);
+  }
+  if (bait_offset == 0 && bait_number > 1)
+  {
+    cerr << "Error: The parameter \"bait-offset\" has been set to 0 in the parameter file, while the bait number is larger than 1. This does not make sense." << endl;
+    cerr << "Please specify a valid tiling design with bait number equal to 1 and bait offset equal to 0, or bait number larger than 1 and offset larger than 0." << endl;
+    exit(-4);
+  }
+
+  if (!alignment_cutting && string_required_taxa.empty() ) // In this case, sequence names do not need to contain the taxon name.
+  {
+    sequence_name_field_delimiter    = '\0';
+    sequence_name_taxon_field_number = 1;
+    sequence_name_geneID_field_number = 1;
+    sequence_name_tokenizer_overwritten = true;
+  }
+
+  // The field numbers are stored 0-based. In the user interaction, numbers are 1-based.
+  --sequence_name_geneID_field_number;
+  --sequence_name_taxon_field_number;
+}
+
+
+void print_parameters(ostream         & os,
+		      faststring      & fname_gff,
+		      faststring      & fname_genome,
+		      faststring      & string_required_taxa,
+		      faststring      & dname_alignments,
+		      faststring      & genome_name,
+		      unsigned short    bait_length,
+		      double            cluster_threshold,
+		      faststring      & output_directory,
+		      unsigned short    bait_offset,
+		      unsigned short    bait_number,
+		      bool              remove_reference_species_from_alignments,
+		      bool              alignment_cutting,
+		      faststring      & gff_feature_name,
+		      faststring      & gff_record_attribute_name_for_geneID,
+		      char            sequence_name_field_delimiter,
+		      unsigned short  sequence_name_taxon_field_number,
+		      unsigned short  sequence_name_geneID_field_number,
+		      bool            sequence_name_tokenizer_overwritten,
+		      char            center_computation_mode,
+		      unsigned        verbosity
+		     )
+{
+  os << "Welcome to the " << PROGNAME << " program, version " << VERSION << endl << endl
+     << "This software and any of its components are copyright protected by the authors" << endl
+     << "Christoph Mayer and Oliver Niehuis, Zoologisches Forschungsmuseum Alexander" << endl
+     << "Koenig, Bonn, Germany. Copyright 2014." << endl
+     << "This software is distributed as working material within a workshop given by" << endl
+     << "Manuela Sann and Oliver Niehuis at the Australian National University, Canberra." << endl
+     << "As long as it is not published, the software may only be used for the purposes of" << endl
+     << "the workshop or with explicit permission of one of the authors." << endl;
+  os << "Redistribution as source code in part or in whole or in binary form is not permitted." << endl;
+  os << "The software comes without warranty of any kind." << endl << endl;
+
+  os << "PROGRAM has been started with the following parameters:"                << endl;
+  os << "Alignment cutting                             " << (alignment_cutting ? "yes" : "no");
+  os << endl;
+
+  if (alignment_cutting)
+  {
+    os << "Name of gff file:                             " << fname_gff             << endl;
+    os << "Name of genome file:                          " << fname_genome          << endl;
+    os << "Name of genome:                               " << genome_name           << endl;
+    os << "GFF feature to be excised from sequences:     " << gff_feature_name      << endl;
+    os << "GFF record attribute name for geneID:         " << gff_record_attribute_name_for_geneID << endl;
+  }
+
+  if (string_required_taxa.empty())
+    os << "String with required taxonomic groups:        " << "no taxa specified" << endl;
+  else
+    os << "String with required taxonomic groups:        " << string_required_taxa  << endl;
+
+  os << "Name of directory with transcriptome files:   " << dname_alignments      << endl;
+  os << "Cluster threshold:                            " << cluster_threshold     << endl;
+  os << "Bait length:                                  " << bait_length           << endl;
+  os << "Bait offset (for multiple baits in region):   " << bait_offset           << endl;
+  os << "Bait number (for multiple baits in region):   " << bait_number           << endl;
+  os << "Output directory:                             " << output_directory      << endl;
+  os << "Remove refernce species from alignment:       " << (remove_reference_species_from_alignments ? "yes": "no") << endl;
+  if (sequence_name_tokenizer_overwritten)
+  {
+    os << "sequence_name_field_delimiter (default \"|\") " << "Not used since no required taxa specified and no aligment cutting." << endl;
+    // The field numbers are stored 0-based. In the user interaction, numbers are 1-based.
+    os << "Number of taxon field in sequence name:       " << "Not used since no required taxa specified and no aligment cutting." << endl;
+    os << "Number of geneID field in sequence name:      " << "Not used since no required taxa specified and no aligment cutting." << endl;
+  }
+  else
+  {
+    os << "sequence_name_field_delimiter (default \"|\") " << sequence_name_field_delimiter << endl;
+    // The field numbers are stored 0-based. In the user interaction, numbers are 1-based.
+    os << "Number of taxon field in sequence name:       " << sequence_name_taxon_field_number+1  << endl;
+    os << "Number of geneID field in sequence name:      " << sequence_name_geneID_field_number+1 << endl;
+  }
+  if (center_computation_mode == 0)
+    os << "Center computation mode:                      " << "exhaustive" << endl;
+  else if (center_computation_mode == 1)
+    os << "Center computation mode:                      " << "heuristic" << endl;
+ else
+    os << "Center computation mode:                      " << "comparison mode" << endl;
+  os <<   "Verbosity:                                    " << verbosity << endl;
+  os << endl;
+}
+
+
+
+
+
+// Computes alignment and determines some characteristics:
+//  - alignment_score, alignment_length,
+//  - s1ins2s: starting pos of s1 in s2. If negative it is outside of s2 by the negative number (0 based)
+//    s1ins2e: position after last symbol of s1 in s2. If negative it is outside of s2 by the negative number (0 based)
+//    s2ins1s: similar to s1ins2s
+//    s2ins1e: similar to s2ins2e
+inline void respective_sequence_positions(CScoreMatrix &DNAmat, faststring &s1, faststring &s2,
+					  int &s1ins2s,
+					  int &s1ins2e,
+					  int &s2ins1s,
+					  int &s2ins1e,
+					  int &alignment_score,
+					  int &alignment_length,
+					  int verbosity)
+{
+  //  CScoreMatrix DNAmat("simpledna.mat"); // It is not efficient to open this file for many million short alignments.
+  short mode = 1; // local - free end gaps
+
+  std::ofstream log;
+  log.open("CAligner.log");
+
+  CAligner CA(s1.c_str(), s1.length(), s2.c_str(), s2.length(), DNAmat, mode, log);
+
+  faststring al;
+  align_coord a, e;
+  faststring l1, l2, l3;
+
+  CA.align();
+  alignment_score = CA.traceback(al, a, e);
+
+  CA.alignment_strings(l1, l2, l3, al);
+
+  if (verbosity >= 50)
+  {
+    cout << "Alignment score: " << alignment_score << endl;
+    cout << "Alignment:" << endl;
+    cout << l1 << endl;
+    cout << l3 << endl;
+    cout << l2 << endl;
+  }
+
+  CA.get_respective_start_end_coordinates(s2ins1s,
+					  s2ins1e,
+					  s1ins2s,
+					  s1ins2e,
+					  a,e,
+					  s1.length(),
+					  s2.length(),
+					  al);
+
+  if (verbosity > 50)
+  {
+    std::cout << al << std::endl;
+    std::cout << "Score: " << alignment_score << std::endl;
+    std::cout << "Internal representation of start: "; a.print(std::cout); std::cout << std::endl;
+    std::cout << "Internal representation of end:   "; e.print(std::cout); std::cout << std::endl;
+
+    //    pretty_print_alignment_base0(stdout, l1, l2, l3, 100);
+    //    pretty_print_alignment(stdout, l1, l2, l3, 100);
+
+    //    std::cout << l1 << std::endl;
+    //    std::cout << l3 << std::endl;
+    //    std::cout << l2 << std::endl;
+
+    //   std::cout << "Start: "; a.print(std::cout); std::cout << std::endl;
+    //   std::cout << "End:   "; e.print(std::cout); std::cout << std::endl;
+
+    std::cout << "Respective start/end (internal representation): "
+	 << "s2ins1s " << s2ins1s << " "
+	 << "s2ins1e " << s2ins1e << " "
+	 << "s1ins2s " << s1ins2s << " "
+	 << "s1ins2e " << s1ins2e << std::endl;
+
+    std::cout << "len s1 " << s1.length() << std::endl;
+    std::cout << "len s2 " << s2.length() << std::endl;
+    std::cout << "len al " << al.length() << std::endl;
+  }
+
+
+  alignment_length = al.length();
+}
+
+
+void find_coords(CScoreMatrix &DNAmat, CDnaString &s1, CDnaString &s2,
+		 int &s1ins2s_best,
+		 int &s1ins2e_best,
+		 int &s2ins1s_best,
+		 int &s2ins1e_best,
+		 int &alignment_score_best,
+		 int &alignment_length_best,
+		 int verbosity)
+{
+  // Coordinates in alignment, in px_y: x is first and second part, y is linker index.
+
+  char  better;
+
+  int s1ins2s_tmp1;
+  int s1ins2e_tmp1;
+  int s2ins1s_tmp1;
+  int s2ins1e_tmp1;
+  int alignment_score_tmp1;
+  int alignment_length_tmp1;
+
+  int s1ins2s_tmp2;
+  int s1ins2e_tmp2;
+  int s2ins1s_tmp2;
+  int s2ins1e_tmp2;
+  int alignment_score_tmp2;
+  int alignment_length_tmp2;
+
+  // Try both: feature sequence and its reverse complement
+  respective_sequence_positions(DNAmat, s1, s2,
+				s1ins2s_tmp1, s1ins2e_tmp1, s2ins1s_tmp1, s2ins1e_tmp1, alignment_score_tmp1, alignment_length_tmp1,
+				verbosity);
+
+  CDnaString revcomp_s2;
+
+  revcomp_s2.setToReverseComplementOf(s2);
+
+  respective_sequence_positions(DNAmat, s1, revcomp_s2,
+				s1ins2s_tmp2, s1ins2e_tmp2, s2ins1s_tmp2, s2ins1e_tmp2, alignment_score_tmp2, alignment_length_tmp2,
+				verbosity);
+
+  if (alignment_score_tmp1 > alignment_score_tmp2)
+  {
+    s1ins2s_best          = s1ins2s_tmp1;
+    s1ins2e_best          = s1ins2e_tmp1;
+    s2ins1s_best          = s2ins1s_tmp1;
+    s2ins1e_best          = s2ins1e_tmp1;
+    alignment_score_best  = alignment_score_tmp1;
+    alignment_length_best = alignment_length_tmp1;
+    better = 1;
+  }
+  else
+  {
+    s1ins2s_best          = s1ins2s_tmp2;
+    s1ins2e_best          = s1ins2e_tmp2;
+    s2ins1s_best          = s2ins1s_tmp2;
+    s2ins1e_best          = s2ins1e_tmp2;
+    alignment_score_best  = alignment_score_tmp2;
+    alignment_length_best = alignment_length_tmp2;
+    better = 2;
+  }
+
+  if (verbosity >5)
+  {
+    cout << "Best alignment:" << endl;
+    cout << "Score:     " <<  alignment_score_best << endl;
+    cout << "Direction: " <<  (better==1 ? "Same" : "RevComp") << endl;
+  }
+
+}
+
+
+bool check_full_coverage_and_required_taxa_in_range(CSequences2 *seqs, unsigned pos1, unsigned pos2,
+						    const vector<unsigned> &unique_taxon_ids,
+						    const CRequiredTaxa    &required_groups_of_taxa)
+{
+  unsigned N = seqs->GetTaxaNum();
+  unsigned i;
+
+  CSequence_Mol*      seq;
+  set<unsigned>       set_of_taxon_ids;
+  faststring          taxon_name;
+
+  // Determine set of complete sequences (taxa) of this range.
+
+  // For each sequence in this range we check that it does not contains gaps or Ns.
+  // In the set_of_taxon_ids we store the unique taxon ID, not the sequence number.
+  for (i=0; i<N; ++i)
+  {
+    seq = seqs->get_seq_by_index(i);
+
+    // Has no gaps, Ns in range?
+    if (! seq->range_contains_gaps_or_Ns(pos1, pos2) )
+    {
+      // *seq is a good sequence in this range. (No gaps or Ns.)
+      set_of_taxon_ids.insert(unique_taxon_ids[i]);
+    }
+  }
+
+  // Checks whether there is any sequence left. In case of an empty required_taxa string
+  // this is an important check. Otherwise gap only regions could pass this test.
+  if (set_of_taxon_ids.empty())
+  {
+    if (global_VERBOSITY >= VERBOSITY_COORDINATES)
+    {
+      cout << "NOTE: Not a good bait window. No complete sequences in this range: " << pos1+1 << "-" << pos2
+	   << " Num seqs: " << set_of_taxon_ids.size() << endl;
+    }
+    return false;
+  }
+
+  if (required_groups_of_taxa.is_empty() )
+  {
+    if (global_VERBOSITY >= VERBOSITY_COORDINATES)
+    {
+      cout << "NOTE: Good bait window. Valid sequence range (no required taxa specified): " << pos1+1 << "-" << pos2 << " Num seqs: " << set_of_taxon_ids.size() << endl;
+    }
+    return true;
+  }
+
+  // Check that all required taxonomic groups are present in this feature:
+  if (required_groups_of_taxa.check_precense_of_all_groups_of_taxa(set_of_taxon_ids) )
+  {
+    if (global_VERBOSITY >= VERBOSITY_COORDINATES)
+    {
+      cout << "NOTE: Good bait window. All required taxonomic groups present in this range: " << pos1+1 << "-" << pos2  << " Num seqs: " << set_of_taxon_ids.size() << endl;
+    }
+    return true;
+  }
+  else
+  {
+    if (global_VERBOSITY >= VERBOSITY_COORDINATES)
+    {
+      cout << "NOTE: Not a good bait windows. NOT all required taxonomic groups present in this range." << pos1+1 << "-" << pos2  << " Num seqs: " << set_of_taxon_ids.size() << endl;
+    }
+    return false;
+  }
+} // END check_full_coverage_and_required_taxa_in_range(...)
+
+
+// Return true if at least one good bait region was found, otherwise it returns false.
+bool handle_this_alignment(CSequences2           *alignment,
+			   CTaxonNamesDictionary &taxonNamesDict,
+			   CRequiredTaxa         &required_groups_of_taxa,
+			   unsigned short        bait_length,
+			   unsigned short        number_of_baits_in_region,
+			   unsigned short        bait_offset,
+			   faststring            name,     // gene name
+			   unsigned short        running_number,
+			   unsigned short        running_number_maximum,
+			   double                cluster_threshold,
+			   ostream               &os_result_file,
+			   char                  delim,
+			   unsigned short        field_num,
+			   char                  center_computation_mode,
+			   const faststring      &filename)
+{
+  unsigned alignment_length = alignment->GetPosNum();
+  int      region_length    = (number_of_baits_in_region-1)*bait_offset+bait_length;
+
+  vector<unsigned>      seqNum_to_unique_taxonID_this_alignment; // Used to translate the sequnce number in the current file to the unique taxon number.
+  vector<faststring>    full_names_this_alignment;
+  vector<faststring>    taxon_names_this_alignment;
+  set<faststring>       taxon_set_this_alignment;
+
+  //DEBUG BREAK POINT - allows us to catch certain gene names for debugging purposes.
+//   {
+//     //    os_result_file << "name: " << name << " " << running_number << endl;
+//
+//     if (name == "NV18435" && running_number == 4)
+//     {
+//       cerr << "Found name: " << name << " " << running_number << endl;
+//     }
+//
+//   }
+
+
+  //************************************************
+  // The following four arrays belong together.
+  //************************************************
+  // For each site in this msa is_valid_bait_window stores the information
+  // whether the site represents a good starting point and whether
+  // for the window starting here we need to do the clustering and determine
+  // the center sequence.
+  // For each site in the msa is_valid_bait_region stores the information
+  // whether we have a good bait region starting at this point.
+  // For each site cluster_loci_this_alignment stores the information about
+  // clusters and center sequences for the bait window starting at this point.
+  // If the window does not need to be computed, the pointer in this array is NULL.
+  faststring is_valid_bait_window;
+  faststring is_valid_bait_region;
+  vector<Csequence_loci_cluster_collection *> cluster_loci_this_alignment(alignment_length, NULL);
+  vector<CBait_region_information *> bait_region_info(alignment_length, NULL);
+
+  // TODO: currently, the is_valid_bait_window and is_valid_bait_region are filled up to the end.
+  //       Last valid/possible index for is_valid_bait_window: alignment_length - bait_length
+  //       Last valid/possible index for is_valid_bait_region: alignment_length - region_length
+
+  // Initialize is_valid_bait_window with fail character '-':
+  is_valid_bait_window.clear();
+  is_valid_bait_window.assign(alignment_length, '-');
+
+  is_valid_bait_region.clear();
+  is_valid_bait_region.assign(alignment_length, '-');
+
+  unsigned i;
+  for (i=alignment_length - bait_length+1; i< alignment_length; ++i)
+    is_valid_bait_window[i] = 'e';  // Indicates that this region extends beyond the end.
+
+  for (i=alignment_length - region_length+1; i< alignment_length; ++i)
+    is_valid_bait_region[i] = 'e';     // Indicates that this region extends beyond the end.
+
+//   cout << is_valid_bait_window.size() << endl;
+//   cout << is_valid_bait_window << endl;
+
+//   cout << is_valid_bait_region.size() << endl;
+//   cout << is_valid_bait_region << endl;
+
+  // Determine translation table: seqNum_to_unique_taxonID_this_alignment
+  // Clear the data for this alignment:
+  seqNum_to_unique_taxonID_this_alignment.clear();
+  full_names_this_alignment.clear();
+  //	      taxon_names_this_alignment.clear();
+  //	      taxon_set_this_alignment.clear();
+
+  alignment->get_sequence_names(full_names_this_alignment);
+
+  unsigned j;
+  faststring tmp_name;
+
+  // Determine vector that translates sequence number to unique_taxonIDs
+  for (j=0; j < full_names_this_alignment.size(); ++j)
+  {
+    tmp_name = extract_taxon_name(full_names_this_alignment[j], delim, field_num);
+    //		taxon_names_this_alignment.push_back(sequence_to_taxon_name(full_names_this_alignment[j]));
+    //		taxon_set_this_alignment.insert(taxon_names_this_alignment[j]);
+    //		cout << taxon_names_this_alignment[j] << endl;
+
+    seqNum_to_unique_taxonID_this_alignment.push_back(taxonNamesDict.dictionary_get_index_of_taxonname(tmp_name));
+    //		cout << j << "-->" << tmp_name << "->" << taxonNamesDict.dictionary_get_index_of_taxonname(tmp_name) << endl;
+  }
+
+  // Move through alignment sequence alignment and determine those parts which have a sufficient data coverage:
+  {
+    unsigned pos1, pos2;
+    bool     is_valid_range;
+
+    pos1 = 0; // 0 based
+    pos2 = pos1 + bait_length;
+
+    // pos2 is the index after the last nucleotide in the bait.
+    // Thus pos2 is allowed to be equal to alignment_length, which specifies the index after
+    // the last nucleotide in the sequence.
+    while (pos2 <= alignment_length)
+    {
+      is_valid_range = check_full_coverage_and_required_taxa_in_range(alignment,
+								      pos1, pos2,
+								      seqNum_to_unique_taxonID_this_alignment,
+								      required_groups_of_taxa);
+      if (is_valid_range)
+	is_valid_bait_window[pos1] = 'x';  // Indicates a valid bait window.
+
+      ++pos1;
+      ++pos2;
+    }
+    //    cout << "Valid bait windows in alignment: " << endl << is_valid_bait_window << endl;
+  } // END Move through alignment sequence alignment
+
+//   cout << "Valid bait windows: " << endl;
+//   cout << is_valid_bait_window << endl;
+
+  unsigned num_good_regions=0;
+
+  // Determine good bait regions, i.e. with requested number of baits and starting points separated by an offset of bait_offset
+  {
+    // for all starting point of a bait region:
+    unsigned i, j, pos;
+    bool     is_good_region;
+
+    // i is the start index of the current range.
+    for (i=0; i < alignment_length; ++i)
+    {
+      if (is_valid_bait_region[i] != 'e')
+      {
+	//	cout << "Starting good: " << i << endl;
+	is_good_region = true;
+	// For all number_of_baits_in_region baits in one region with offset bait_offset
+	for (j=0, pos=i; j < number_of_baits_in_region; ++j, pos += bait_offset)
+	{
+	  // Allowed values for  is_valid_bait_window[pos] are 'c' and 'x'. Not allowed are: '-' and 'e'
+	  // Some checks are redundant here: E.g. pos >= alignment_length and is_valid_bait_window[pos]=='e'
+	  // should not be possilbe, since we check is_valid_bait_region[i] != 'e' before we get here.
+	  // Doing these checks is more secure.
+	  // TODO: In future versions check whether pos >= alignment_length and is_valid_bait_window[pos]=='e'
+	  //       are necessary.
+	  if (pos >= alignment_length || is_valid_bait_window[pos] == '-' || is_valid_bait_window[pos]=='e')
+	  {
+	    //	    cout << "Not a good bait region: " << i << " " << pos << " " <<   is_valid_bait_window[pos] << endl;
+	    is_good_region = false;
+	    break; // This region is at best incomplete, so we mark it as bad.
+	  }
+	}
+	if (is_good_region)
+	{
+	  //	  cout << "Mark as good: " << i << endl;
+	  ++num_good_regions;
+	  // Mark good region.
+	  is_valid_bait_region[i] = 'x';
+
+	  //	  cout << "Interm. " << i << is_valid_bait_region << endl;
+	  
+	  // For all good bait regions we also allocate memory for the final colletion of the data:
+	  bait_region_info[i] = new CBait_region_information(name, running_number, running_number_maximum, i, // bait_length, bait_offset,
+							     number_of_baits_in_region);
+	  //		    cout << "Intermediate is_valid_bait_region: " << endl << is_valid_bait_region << endl;
+	  // For this valid bait region, we mark all windows as "need to be computed".
+
+	  ++DEBUG_COUNT_NEW_CALLS_CBAIT_REGION_INFORMATION;
+	  
+	  for (j=0, pos=i; j < number_of_baits_in_region; ++j, pos += bait_offset)
+	  {
+	    if (pos >= alignment_length)
+	      break;
+	    is_valid_bait_window[pos] = 'c';
+	  }
+	  //		    cout << "Intermediate is_valid_bait_window: " << endl << is_valid_bait_window << endl;
+	  if (global_VERBOSITY >= VERBOSITY_COORDINATES)
+	  {
+	    cout << "NOTE: Good bait region: " << i+1 << " " << i+1+region_length << endl;
+	  }
+	}
+	else
+	{
+	  if (global_VERBOSITY >= VERBOSITY_COORDINATES)
+	  {
+	    cout << "NOTE: Not a good bait region: " << i+1  << " " << i+1+region_length << endl;
+	  }
+	}
+      } // END if (is_valid_bait_region[i] != 'e')
+    } // END for (i=0; i < alignment_length; ++i)
+    //          cout << "Valid bait regions in feature: " << endl << is_valid_bait_region << endl;
+    //          cout << "Bait windows that need to be computed" << endl << is_valid_bait_window << endl;
+  }   // END Determine baits with requested number_of_baits_in_region good baits separated by an offset of bait_offset
+
+  // If we come here we have the following information:
+  //	      is_valid_bait_window contains a 'c' in all bait window starting indices that need to be looked at.
+  //              is_valid_bait_region contains a 'x' in all bait region starting indices that we will explore,
+  //                                    i.e. for which we have the necesarry successive bait windows.
+
+  // If this file has one or more regions that should be looked at:
+  // Cluster loci which need to be clustered.
+  // Compute center sequences.
+
+  if (num_good_regions > 0)
+  {
+    // OK - Where are we?
+    // We have extracted an feature. We determined the loci of possible
+    // bait regions in this feature. This number > 0.
+    // For all bait windows in this feature that belong to good bait regions,
+    // we cluster the sequences and compute an artificial center sequence for 
+    // each cluster.
+
+    unsigned i;
+    unsigned num_taxa    = alignment->GetTaxaNum();
+
+    // We need a recoded msa in order to compute artificial center sequences.
+    // We could do this for each window, but since the windows overlap, we
+    // do a lot of redudant work. Doing this per window we would only be on the positive
+    // side if there would be only very few windows in a long alignment.
+    // I do not see this as the general case.
+    // The recoded msa is used for the complete file and only needs to be created once.
+
+    // The vector of faststrings allocates the memory for msa:
+    std::vector<faststring>  msa_faststring;
+    char** msa;
+    msa = new char* [num_taxa];  // remember to delete this dynamic array
+    msa_faststring.clear();
+    ++DEBUG_COUNT_NEW_CALLS_MSA;
+
+    // Copy the sequence data to the msa_faststring
+    // The data is stored in the alignment (type CSequences2) object.
+    alignment->get_alignment_as_copy(msa_faststring);
+
+    for (i=0; i < num_taxa; ++i)
+    {
+      // Important: Even though they are initially 0 terminated cstrings,
+      //            this does not provide much advantage since the sequences
+      //            will be recoded anyway. In the recoded form, the bit code 0
+      //            is used. So recoded sequences cannot be interpreted as cstrings.
+      msa[i]  = msa_faststring[i].data();
+    }
+
+    // Recode the msa:
+    // IMPORTANT: Recoding is possible also for ambiguous characters.
+    //            Gaps are also recoded.
+    recode_MSA(msa, num_taxa, alignment_length);
+
+    unsigned num_valid_bait_windows   = 0;
+    unsigned count_valid_bait_windows = 0;
+    unsigned report_interval          = 0;
+
+    for (i=0; i < alignment_length; ++i)
+    {
+      if (is_valid_bait_window[i] == 'c')
+      {
+	++num_valid_bait_windows;
+      }
+    }
+
+    report_interval = num_valid_bait_windows/10;
+    if (report_interval == 0)
+      report_interval = 1;
+
+    // For all loci:
+    for (i=0; i < alignment_length; ++i)
+    {
+      // Do we have to compute cluster and center sequence for this loci?
+      if (is_valid_bait_window[i] == 'c')
+      {
+	++count_valid_bait_windows;
+
+	if (global_VERBOSITY > VERBOSITY_MOREPROGRESS)  // Report progress
+	{
+	  if (count_valid_bait_windows % report_interval == 0)
+	  {
+	    int p = count_valid_bait_windows*100 /  num_valid_bait_windows;
+	    faststring t;
+	    get_time_string(t);
+	    cout << "PROGRESS: " << t << " Percent done this alignment or gene: " << p << "%."
+		 << endl << flush;
+	  }
+	}
+
+	// This constructor again determins the valid sequences and their number in this range
+	Csequence_loci_cluster_collection* tmp_collection = new Csequence_loci_cluster_collection(i, i+bait_length,
+												  alignment,
+												  // taxonNamesDict,
+												  cluster_threshold, msa );
+	++DEBUG_COUNT_NEW_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION;
+	cluster_loci_this_alignment[i] = tmp_collection;
+	// Compute what we can compute now for this locus.
+	tmp_collection->cluster_locus(name, filename);
+	tmp_collection->compute_center_for_all_clusters(center_computation_mode);
+
+	// Debug output:
+// 	cout << "*******************" << endl;
+// 	tmp_collection->print_msa_backrecoded_all(cout, 1);
+// 	cout << "*******************" << endl;
+      }
+    } // END for all loci
+
+    // Now we can transfer the clustering and center sequence data to the bait_region_info vector.
+
+    unsigned short tmp_num_sequences;
+    unsigned short tmp_num_clusters;
+
+    // For all possible starting positions of bait regions.
+    for (i=0; i < alignment_length; ++i)
+    {
+      if (is_valid_bait_region[i] == 'x')
+      {
+	// Collect the informaiton for all number_of_baits_in_region baits in this bait region.
+	for (j=0; j < number_of_baits_in_region; ++j)
+	{
+	  if (cluster_loci_this_alignment[i+j*bait_offset] != NULL)
+	  {
+	    if (bait_region_info[i] == NULL)
+	    {
+	      cerr << "INTERNAL ERROR: bait_region_info["<< i << "]==NULL" << endl;
+	      exit(-4);
+	    }
+	    cluster_loci_this_alignment[i+j*bait_offset]->get_numbers_of_valid_sequences_number_of_clusters(tmp_num_sequences, tmp_num_clusters);
+	    bait_region_info[i]->add_info__cluster_locus(cluster_loci_this_alignment[i+j*bait_offset],
+							 tmp_num_sequences, tmp_num_clusters);
+	  }
+	  else
+	  {
+	    cerr << "INTERNAL ERROR: The cluster_loci_this_alignment is unexpectedly NULL at position: "
+		 << i+j*bait_offset << endl;
+	    exit(-5);
+	  }
+	}
+      }
+    }
+
+    for (i=0; i< alignment_length; ++i)
+    {
+      if (is_valid_bait_region[i]=='x')
+      {
+	bait_region_info[i]->print_baits_result(os_result_file, filename);
+      }
+    }
+
+
+    // The msa array is not needed any more, so we delete it.
+    // The acutual sequences are stored in the msa_faststring
+    // vector and they will be deleted automatically when this block will be left.
+    delete [] msa;
+    ++DEBUG_COUNT_DELETE_CALLS_MSA;
+  } // END if (num_good_regions > 0) // Compute cluster and center sequence for loci.
+  else
+  {
+    if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+    {
+      if (running_number > 0) // In non cutting mode this 0, otherwise > 0
+      {
+	cerr << "ALERT: No valid bait regions found for feature: ";
+	cerr << name << " " << running_number << "/" << running_number_maximum;
+	cerr << endl;
+      }
+      else
+      {
+	cerr << "ALERT: No valid bait region found for alignment: " << name << endl;
+      }
+    }
+  }
+
+
+  // Remember to release all memory allocated in this block:
+
+  DEBUG_COUNT_DELETE_CALLS_CBAIT_REGION_INFORMATION          += delete_pointers_in_vector(bait_region_info);
+  DEBUG_COUNT_DELETE_CALLS_CSEQUENCE_LOCI_CLUSTER_COLLECTION += delete_pointers_in_vector(cluster_loci_this_alignment);
+
+  if (num_good_regions > 0)
+    return true;
+  else
+    return false;
+
+} // END handle_this_alignment()
+
+// Only used in special mode to test gff file integrety:
+void gff_file_test(faststring gff_file_name)
+{
+  GFF_collection gff_col;
+
+  unsigned good_lines;
+  unsigned bad_lines;
+  bool     file_error;
+
+  if (global_VERBOSITY >= VERBOSITY_MOREPROGRESS)
+  {
+    cout << "Parsing the gff file ..." << flush;
+  }
+
+  gff_col.readGFFfile(gff_file_name.c_str(), good_lines, bad_lines, file_error);
+
+  if (global_VERBOSITY >= VERBOSITY_DEBUG)
+  {
+    cout << " Done." << endl;
+    cout << "Good lines: " << good_lines << endl;
+    cout << "Bad lines:  " << bad_lines  << endl;
+    cout << "File error: " << file_error << endl;
+    cout << endl;
+    cout << endl;
+  }
+
+  if (file_error)
+  {
+    cerr << "ERROR: The specified gff-file could not be opened. It seems it does not exist." << endl;
+    cerr << "Exiting." << endl;
+    exit(-3);
+  }
+
+  gff_col.print(cout, 1);
+}
+
+
+int main(int argc, char **argv)
+{
+  faststring      fname_parameter_file;
+
+  faststring      fname_gff;
+  faststring      fname_genome;
+  faststring      string_required_taxa;
+  faststring      dname_alignments;
+  faststring      genome_name;
+
+  unsigned short  bait_length;
+  double          cluster_threshold;
+  faststring      output_directory;
+
+  unsigned  short bait_offset;
+  unsigned  short number_of_baits_in_region;
+
+  bool            remove_reference_species_from_alignments;
+  bool            alignment_cutting;
+
+  faststring      gff_feature_name;
+  faststring      gff_record_attribute_name_for_geneID;
+
+  char            sequence_name_field_delimiter;
+  unsigned short  sequence_name_taxon_field_number;    // Used to find reference species and test for required taxa.
+  unsigned short  sequence_name_geneID_field_number;   // Only used if extracting with the aid of a gff file.
+  bool            sequence_name_tokenizer_overwritten;
+
+
+  char            center_computation_mode;
+  int             special_mode = 0; // 0: normal, 1: gff-test
+
+
+  if (argc == 2)
+  {
+    fname_parameter_file = argv[1];
+    parse_parameter_file(fname_parameter_file,
+			 fname_gff,
+			 fname_genome,
+			 string_required_taxa,
+			 dname_alignments,
+			 genome_name,
+			 bait_length,
+			 cluster_threshold,
+			 output_directory,
+			 bait_offset,
+			 number_of_baits_in_region,
+			 remove_reference_species_from_alignments,
+			 alignment_cutting,
+			 gff_feature_name,
+			 gff_record_attribute_name_for_geneID,
+			 sequence_name_field_delimiter,
+			 sequence_name_taxon_field_number,
+			 sequence_name_geneID_field_number,
+			 sequence_name_tokenizer_overwritten,
+			 center_computation_mode,
+			 global_VERBOSITY
+			 );
+  }
+  else if (argc == 3)
+  {
+    if (faststring(argv[2])=="gffFileTest")
+    {
+      special_mode = 1;
+    }
+    else
+    {
+      cerr << "Welcome to the " << PROGNAME << " program, version " << VERSION << endl << endl;
+      cerr << "Usage: " << argv[0] << " parameter-file [gffFileTest]" << endl;
+      //    cerr << "OR" << endl;
+      //    cerr << "Usage: " << argv[0] << " gff-file genome-file transcriptome-folder required_taxa_file probe-length cluster-threshold output-directory" << endl;
+      exit(-3);
+    }
+
+    fname_parameter_file = argv[1];
+    parse_parameter_file(fname_parameter_file,
+			 fname_gff,
+			 fname_genome,
+			 string_required_taxa,
+			 dname_alignments,
+			 genome_name,
+			 bait_length,
+			 cluster_threshold,
+			 output_directory,
+			 bait_offset,
+			 number_of_baits_in_region,
+			 remove_reference_species_from_alignments,
+			 alignment_cutting,
+			 gff_feature_name,
+			 gff_record_attribute_name_for_geneID,
+			 sequence_name_field_delimiter,
+			 sequence_name_taxon_field_number,
+			 sequence_name_geneID_field_number,
+			 sequence_name_tokenizer_overwritten,
+			 center_computation_mode,
+			 global_VERBOSITY
+			 );
+
+  }
+//   else if (argc == 8)
+//   {
+//     fname_gff           = argv[1];
+//     fname_genome        = argv[2];
+//     fname_required_taxa = argv[3];
+//     dname_alignments = argv[4];
+//     genome_name         = "Nasonia_vitripennis";
+
+//     bait_length        = faststring(argv[5]).ToInt();
+//     cluster_threshold   = faststring(argv[6]).ToDouble();
+//     output_directory    = argv[7];
+//   }
+  else
+  {
+    cerr << "Welcome to the " << PROGNAME << " program, version " << VERSION << endl << endl;
+    cerr << "Usage: " << argv[0] << " parameter-file [gffFileTest]" << endl;
+    //    cerr << "OR" << endl;
+    //    cerr << "Usage: " << argv[0] << " gff-file genome-file transcriptome-folder required_taxa_file probe-length cluster-threshold output-directory" << endl;
+    exit(-3);
+  }
+
+
+  print_parameters(cout,
+		   fname_gff,
+		   fname_genome,
+		   string_required_taxa,
+		   dname_alignments,
+		   genome_name,
+		   bait_length,
+		   cluster_threshold,
+		   output_directory,
+		   bait_offset,
+		   number_of_baits_in_region,
+		   remove_reference_species_from_alignments,
+		   alignment_cutting,
+		   gff_feature_name,
+		   gff_record_attribute_name_for_geneID,
+		   sequence_name_field_delimiter,
+		   sequence_name_taxon_field_number,
+		   sequence_name_geneID_field_number,
+		   sequence_name_tokenizer_overwritten,
+		   center_computation_mode,
+		   global_VERBOSITY
+		  );
+
+
+  if (special_mode == 1)
+  {
+    gff_file_test(fname_gff);
+    exit(0);
+  }
+  //  exit(-111);
+
+
+  unsigned short   min_alignment_length     = bait_length + (number_of_baits_in_region-1)*bait_offset;
+  CScoreMatrix DNAmat("simpledna_N0.mat");
+
+  // Do some initial checks.
+
+
+//   if (!file_exists(fname_required_taxa.c_str()))
+//   {
+//     cerr << "I could not open required taxa file: " << fname_required_taxa << endl;
+//     cerr << "I guess it does not exist. Exiting." << endl;
+//     exit(-1);
+//   }
+
+
+  if (cluster_threshold <= 0 || cluster_threshold >= 1)
+  {
+    cerr << "The cluster threshold must be greater than 0 and smaller than 1." << endl;
+    exit(-1);
+  }
+
+  if (bait_length < 1)
+  {
+    cerr << "Probe length cannot be 0 or smaller." << endl;
+    exit(-1);
+  }
+
+  if (!file_or_dir_exists(dname_alignments.c_str()))
+  {
+    cerr << "I could not read the transcriptome directory: " << dname_alignments << endl;
+    cerr << "I guess it does not exist. Exiting." << endl;
+    exit(-1);
+  }
+
+  if (!file_or_dir_exists(output_directory.c_str()))
+  {
+    cerr << "The output-directory " << output_directory << endl;
+    cerr << "could not be opened. I guess it does not exist. Please make sure this directory exists. Exiting." << endl;
+    exit(-1);
+  }
+
+  // Open file for output:
+  faststring result_filename = output_directory + "/loci_baits.txt";
+  ofstream   os_result_file(result_filename.c_str());
+
+  if (alignment_cutting)
+    os_result_file << "# Corresponding sequence name\tGene-name\tfeature-number\tnumber-of-features-of-specified-type-for-this-gene-in-gff-file\tstart-coordinate-of-bait-region-in-alignment\tnumber-of-sequences-in-region-the-baits-are-based-on\tnumber-of-baits-constructed-for-this-bait-region\tList of baits - each bait is followed by CG content and the maximum distance to the sequences in the alignment." << endl;
+  else
+    os_result_file << "# Corresponding sequence name\tGene-name\tn.a.\tn.a.\tstart-coordinate-of-bait-region-in-alignment\t number-of-sequences-in-region-the-baits-are-based-on\tnumber-of-baits-constructed-for-this-bait-region\tList of baits - each bait is followed by CG content and the maximum distance to the sequences in the alignment." << endl;
+
+  // Read names of alignment files:
+  list<faststring> fasta_names;
+  list<faststring> filter_names;
+
+  // If we use the Qt library:
+  //   filter_names.push_back("*.fas");
+  //   filter_names.push_back("*.fa");
+  //   filter_names.push_back("*.fasta");
+
+  filter_names.push_back("fas");
+  filter_names.push_back("fa");
+  filter_names.push_back("fasta");
+
+  get_file_names_in_dir(fasta_names, dname_alignments, filter_names);
+
+
+
+  //****************************************************************
+  // BEGIN Alignment cutting mode
+  //****************************************************************
+  if (alignment_cutting)
+  {
+    if (!file_exists(fname_gff.c_str()))
+    {
+      cerr << "I could not open the gff file: " << fname_gff << endl;
+      cerr << "I think it does not exist. Exiting." << endl;
+      exit(-1);
+    }
+
+    if (!file_exists(fname_genome.c_str()))
+    {
+      cerr << "I could not open the genome file: " << fname_genome << endl;
+      cerr << "I think it does not exist. Exiting." << endl;
+      exit(-1);
+    }
+
+
+    // Read gff file:
+
+    unsigned good_lines;
+    unsigned bad_lines;
+    bool     file_error;
+
+    GFF_collection gff_col;
+
+    if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+    {
+      cout << "Parsing the gff file ... " << flush;
+    }
+    gff_col.readGFFfile(fname_gff.c_str(), good_lines, bad_lines, file_error);
+    if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+    {
+      cout << "Done." << endl;
+    }
+
+    if (good_lines == 0 || bad_lines > 0 || file_error)
+    {
+      cerr << "A problem occured while reading the first gff file." << endl;
+      cerr << "Good lines: " << good_lines << endl;
+      cerr << "Bad lines:  " << bad_lines  << endl;
+      cerr << "File error: " << file_error << endl;
+
+      if (file_error)
+      {
+	cerr << "The specified gff-file could not be opened. It seems it does not exist." << endl;
+      }
+      cerr << "Exiting." << endl;
+      exit(-3);
+    }
+
+    //  gff_col.print(cout, 0);
+
+    // Read genome file:
+
+    if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+      cout << "Reading the genome file ..." << flush;
+
+    CSequences2 genome_seqs(CSequence_Mol::dna);
+    CSequence_Mol::processing_flag pflag = CSequence_Mol::processing_flag(0);
+
+    pflag = CSequence_Mol::processing_flag(pflag | CSequence_Mol::convert_toupper);
+    //  pflag = CSequence_Mol::processing_flag(pflag | CSequence_Mol::convert_ambig2N);
+
+    if (global_VERBOSITY >= 50)
+    {
+      cout << "with processing flag: " << pflag << "..." << endl;
+    }
+
+    CFile file;
+    file.ffopen(fname_genome.c_str());
+    if (genome_seqs.read_from_Fasta_File(file, pflag, 0, -1, false) < 0)
+    {
+      cerr << "ERROR while reading the fasta file: " << fname_genome << endl;
+      cerr << "Please check the line indicated above since this line prevented me" << endl
+	   << "from parsing the fasta file." << endl;
+      exit(-2);
+    }
+    file.ffclose();
+
+    if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+    {
+      cout << "Done." << endl;
+
+      if (global_VERBOSITY >= VERBOSITY_FILEINFO)
+      {
+	cout << "NOTE: Found this number of sequences in genome file: " << genome_seqs.GetTaxaNum()  << endl;
+	cout << "NOTE: Found this number of positions in genome file: " << genome_seqs.GetPosNum()   << endl;
+      }
+      faststring t;
+      get_time_string(t);
+      cout << "PROGRESS: " << t << " Genome file has been read." << endl << flush; 
+    }
+
+    // Read fasta sequnces one by one:
+    list<faststring>::iterator it, it_end;
+    it     = fasta_names.begin();
+    it_end = fasta_names.end();
+
+    unsigned        Num_transcripts   = fasta_names.size();
+    unsigned        count_transcripts = 0;
+    unsigned        count_transcripts_no_gff_entries = 0;
+    unsigned        count_transcripts_no_gff_entries_for_feature = 0;
+
+    CSequence_Mol   *transcript_seq;
+    unsigned        transcript_seq_index;
+    faststring      full_alignment_file_name;
+    faststring      sequence_header_target;
+    faststring      gene_name;
+    GFF_record_list gene_record_list;
+    faststring      genomic_seq_name;
+    //  unsigned        overall_counter  = 0;
+    //  double          mean_match_score = DNAmat.get_mean_matchscore_of_first_N_symbols(4);
+
+    CSequences2     *feature_transcript_alignment = NULL, *transcript_alignment = NULL;
+    CSequences2     *feature_transcript_alignment_rmgo = NULL;
+
+    unsigned        feature_number;
+    unsigned        features_this_gene;
+    bool            no_gff_entries_warning;
+
+
+    //  cout << "Mean match score: " << DNAmat.get_mean_matchscore_of_first_N_symbols(4) << endl;
+
+    // We have to keep a list of all taxon names that we deal with in this analysis.
+    // We give the constructor the name of the directory that contains all fasta files.
+    // It will read all fasta files, determine the taxon names from the sequence names and add them
+    // to the list of taxon names. Furthermore, this object will keep a map that maps taxon names
+    // to a unique taxon index in this analysis. Internally it is important to have such a unique index.
+
+    // The unique taxon indeces are used:
+    // -  when checking for all required taxa.
+    //    The required taxa are stored as sets of unique taxon ids.
+    //    To check that there is at least one representative for each required set,
+    //    we determine the unique IDs for the taxa that are present.
+    //    Comparing intersections of sets then tells us whether all required taxonomic groups are present.
+
+    CTaxonNamesDictionary taxonNamesDict(dname_alignments, fasta_names, sequence_name_taxon_field_number, sequence_name_field_delimiter);
+    //  Print dictionary:
+    //  taxonNamesDict.print(os_result_file);
+
+    // Read required groups of taxa:
+    int error_required_taxa;
+    CRequiredTaxa required_groups_of_taxa(string_required_taxa.c_str(), taxonNamesDict, error_required_taxa);
+
+    { // Debug output:
+      if (global_VERBOSITY > 1000)
+      {
+	cout << endl;
+	taxonNamesDict.print_taxon_names_to_index(cout);
+	cout << "Required groups: From each of the following sets of taxa, we require at least one to be present in the data set." << endl;
+	required_groups_of_taxa.print(cout, 1);
+	cout << endl;
+      }
+    }
+
+    // For all transcript files:
+    // We extract the gene name and use the gene name and feature name to extract all gff records corresponding to these two.
+    // For each gff record we cut out the region from the alignment file that corresponds to the genomic region in the genome
+    // file depicted by the gff-record. In this sub alignment we search for baits.
+
+    // For all transcript files:
+    while (it != it_end)
+    {
+      no_gff_entries_warning = false;
+      ++ count_transcripts;
+      full_alignment_file_name = dname_alignments + "/" + *it;
+
+      if (get_file_size(full_alignment_file_name) > 0)
+      {
+	// Here is the main action: We handle this gene:
+
+	// For this gene file, read the transcript for the genome we are concerned with
+
+	if (global_VERBOSITY >= VERBOSITY_PROGRESS) // Report progress
+	{
+	  faststring t;
+	  get_time_string(t);
+	  cout << "PROGRESS: " << t << " Reading alignemnt file ("
+	       << count_transcripts << "/" << Num_transcripts << "): "
+	       << full_alignment_file_name << endl << flush; 
+	}
+	  
+	read_alignment_sequence_of_species2(full_alignment_file_name,
+					    genome_name,
+					    transcript_seq,
+					    transcript_alignment,
+					    transcript_seq_index,
+					    sequence_name_field_delimiter,
+					    sequence_name_taxon_field_number);
+
+	if (transcript_alignment == NULL)
+	{
+	  cerr << "ERROR: Could not read transcript file: "
+	       << full_alignment_file_name << endl;
+	  exit(-4);
+	}
+
+	if (transcript_seq == NULL) // This is rather common. But in this case we have to skip this alignment.
+	{
+	  if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+	  {
+	    cerr << "WARNING: Requested species " << genome_name << " not found in sequence: "
+		 << full_alignment_file_name << endl;
+	    cerr << "         This means that we have to skip this alignment, since it cannot be handled in this mode." << endl;
+	  }
+	}
+	else
+	{
+	  sequence_header_target = transcript_seq->getFullName();
+	  gene_name = extract_gene_name(sequence_header_target, sequence_name_field_delimiter, sequence_name_geneID_field_number);
+
+	  if (global_VERBOSITY >= VERBOSITY_DEBUG)
+	  {
+	    cout << "INFO: Name of sequence containing the reference species: " << sequence_header_target << endl;
+	    cout << "INFO: Gene name:                                         " << gene_name << endl;
+
+	    transcript_seq->writeSequence(cout, 100);
+	  }
+
+	  gff_record_attribute_name_for_geneID.ToLower();
+
+	  // Determine coordinates of this gene in genome file using the gff file:
+	  gff_col.get_List_of_gff_records_for_attribute(gff_record_attribute_name_for_geneID.c_str(), gene_name.c_str(), gene_record_list);
+
+	  if (gene_record_list.size() == 0 && global_VERBOSITY >= VERBOSITY_WARNINGS)
+	  {
+	    cerr << "WARNING: For gene \"" << gene_name << "\" no entries where found in the gff file.\n"
+	            "         While this is possible, in most cases the reason is either a wrong attribute name for the\n"
+	            "         gene-name-field in the gff-file or the gene name specified in the sequence\n"
+	            "         name of the transcript alignment is incompatible to the gene names in the gff file.\n"
+		 << "         It is recommended to check whether gene name \"" << gene_name << "\" occurs in the\n"
+	            "         gff file under the attribute name \"" << gff_record_attribute_name_for_geneID << "\".\n";
+	    cerr << "         Note that the gene name as specified in the sequence name and the gene name in\n"
+	            "         the gff file have to match exactly. The attribute name specified in the parameter\n"
+	            "         file must be an exact (case insensitive) match to the attribute name in the gff file." << endl << endl;
+	    ++count_transcripts_no_gff_entries;
+	    no_gff_entries_warning = true;
+	  }
+
+	  easystring filter_feature = gff_feature_name.c_str();
+	  gene_record_list.filter_by_feature(filter_feature);
+
+	  // TODO: Check empty list.
+	  //	  if (gene_record_list)
+
+
+	  if (global_VERBOSITY > VERBOSITY_FILEINFO)
+	  {
+	    // Print gff information:
+	    cout << "Features with this gene name: " << endl;
+	    cout << "----" << endl;
+	    gene_record_list.print(cout);
+	    cout << "----" << endl;
+	  }
+
+	  // Foreach feature in this gene:
+	  list<GFF_record*>::iterator gl_it, gl_it_end;
+
+	  gl_it     = gene_record_list.begin();
+	  gl_it_end = gene_record_list.end();
+
+	  // NOTE: We count all genes, not only the once that have a sufficient length.
+	  // TODO: Check that we really want to count all genes, not only the once that are long enought.
+
+	  features_this_gene = gene_record_list.size();
+
+	  if (features_this_gene == 0)
+	  {
+	    if (no_gff_entries_warning == false && global_VERBOSITY >= VERBOSITY_WARNINGS)
+	    {
+	      cerr << "WARNING: For gene \"" << gene_name << "\" no entries where found in the gff file that matched the specified feature name.\n"
+	           << "         Since entries for this gene name have been found, but with different feature names, the problem could be the feature name\n"
+		   << "         or the fact that features exist for this gene." << endl; 
+	    }
+	    ++count_transcripts_no_gff_entries_for_feature;
+	  }
+
+	  // For the gene in the transcript file we are working on we found exi
+	  // in the gff file. I.e. the gene is annotated in the genome.
+	  // The genomic sequences of the exi will be extracted and aligned
+	  // to the sequence in the transcript file. This determines the coordinates
+	  // of the exi in the transcript file.
+
+	  CDnaString     feature_sequence;
+	  CDnaString     transcript_sequence;
+
+	  CSequence_Mol* genome_seq_with_feature;
+
+	  faststring     seqid_feature_in_genome;
+	  unsigned       start_of_feature_in_genome;
+	  unsigned       end_of_feature_in_genome;    // Remember: This is an inclusive end
+
+	  transcript_sequence = transcript_seq->getSeqStr();
+
+	  // The transcript sequence can contain gaps. These cause problems when aligning features against the transcripts.
+	  // Removing gaps is not an option, since we need to preserver the original coordiantes.
+	  // Converting gaps to Ns will preserve coordinates. It will do no harm, since Ns will nicely align to the features and the sequence will
+	  // not be used for anything except aligning features to it.
+
+	  transcript_sequence.replace_char('-','N');
+
+	  /*
+	    vector<unsigned>      seqNum_to_unique_taxonID_this_feature; // Used to translate the sequnce number in the current file to the unique taxon number.
+	    vector<faststring>    full_names_this_feature;
+	    vector<faststring>    taxon_names_this_feature;
+	    set<faststring>       taxon_set_this_feature;
+
+	    unsigned   feature_transcript_alignment_length;
+	  */
+
+	  unsigned features_with_at_least_one_bait_regions = 0;
+	  feature_number = 0;
+	  // For each feature of the gene under consideration:  #foreach feature
+	  while (gl_it != gl_it_end)
+	  {
+	    ++feature_number;
+
+	    // The following coordinates are 0 based and the End lies outside of the range.
+
+	    // Indices are stored 0 based and non inclusive of the end.
+	    seqid_feature_in_genome    = (**gl_it).getSeqid().c_str();
+	    start_of_feature_in_genome = (**gl_it).getStartIndex(); // 0-based.
+	    end_of_feature_in_genome   = (**gl_it).getEndIndex();   // 0-based, exclusive end
+
+	    if (global_VERBOSITY >= VERBOSITY_PROGRESS)  // Report progress
+	    {
+	      faststring t;
+	      get_time_string(t);
+	      cout << "PROGRESS: "
+		   << " Working with gene: " << gene_name  << " " 
+		                             << feature_number << "/" << features_this_gene
+		   << " found in genome at "
+		   << seqid_feature_in_genome << " "
+		// This function gives the 0 based index. We want to print the 1 based index.
+		   << start_of_feature_in_genome+1 << " " << end_of_feature_in_genome 
+		   << endl << flush;
+	    }
+
+	    // Find sequence with short_name equal to seqid_feature_in_genome.
+	    genome_seq_with_feature = genome_seqs.get_seq_by_name(seqid_feature_in_genome);
+	    if (genome_seq_with_feature == NULL)
+	    {
+	      cerr << "ERROR: gff and genome file are not compatible: Sequence name: \""
+		   << seqid_feature_in_genome
+		   << "\" does not exist in the genome file."  << endl;
+
+	      cerr << "It could be that some pipeline renamed the sequences in your genome file." << endl;
+
+	      exit(-2);
+	    }
+	    else
+	    {
+	      // getPartialSeq: Takes 0 based start and length:
+	      feature_sequence = genome_seq_with_feature->getPartialSeq(start_of_feature_in_genome, end_of_feature_in_genome - start_of_feature_in_genome);
+
+	      if (global_VERBOSITY >= VERBOSITY_DEBUG)
+	      {
+		cout << "Pair:" << endl;
+		cout << ">T" << endl;
+		cout << transcript_sequence << endl;
+		cout << ">GE" << endl;
+		cout << feature_sequence << endl;
+	      }
+	    }
+
+	    if ((int)feature_sequence.length() < min_alignment_length)
+	    {
+	      faststring tmp;
+
+	      // Notice:
+	      if (alignment_cutting)
+		tmp = gff_feature_name + " feature alignment";
+	      else
+		tmp = "alignment";
+
+	      if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+	      {
+		cerr << "NOTICE: Skipping " << tmp << " in " << gene_name  << " with number " << feature_number << "/" << features_this_gene << " in " << gene_name
+		     << " since it is too short. Alignment length: "  << feature_sequence.length() << ". Minimum length: " << min_alignment_length << endl;
+	      }
+	    }
+	    else
+	    {
+	      // Determine feature range in transcriptome MSA:
+
+	      // 	  transcript_sequence = "AACGTGTCGTAA";
+	      // 	  feature_sequence       =   "CGTCGTCGT";
+	      // 	  transcript_sequence =   "CGTCGTCGT";
+	      // 	  feature_sequence       = "AACGTGTCGTAA";
+
+	      int s1ins2s_best;
+	      int s1ins2e_best;
+	      int s2ins1s_best;
+	      int s2ins1e_best;
+	      int alignment_score_best;
+	      int alignment_length_best;
+
+	      find_coords(DNAmat, transcript_sequence, feature_sequence,
+			  s1ins2s_best, s1ins2e_best, s2ins1s_best, s2ins1e_best,
+			  alignment_score_best, alignment_length_best, global_VERBOSITY);
+
+	      //**********************************************************
+	      // Coordinates are 0 based, end is non inclusive.
+	      //**********************************************************
+
+	      // Start coordinate in transcriptome alignment in which the feature starts (0 based).
+	      // If the number is negative, then the feature starts before the transcript starts.
+	      // Basically, part of the transcript is missing. The effective starting point in our
+	      // transcript is: 0.  +++
+	      int in_transcript_start = macromax2(s2ins1s_best, 0);
+
+	      // End coordinate in transcript alignment in which the feature starts. End is non inclusive.
+	      int in_transcript_end   = s2ins1e_best;
+	      if (in_transcript_end <= 0)
+	      {
+		//
+		in_transcript_end = (int) transcript_sequence.size();
+	      }
+
+	      int feature_in_transcript_length = in_transcript_end - in_transcript_start;
+
+	      if (global_VERBOSITY >= VERBOSITY_DEBUG)
+	      {
+		cout << "in_transcript_start:               " << in_transcript_start+1 << endl;
+		cout << "in_transcript_end:                 " << in_transcript_end     << endl;
+		cout << "feature length:                    " <<  feature_sequence.size()      << endl;
+		cout << "feature_in_transcript_length:      " <<  feature_in_transcript_length << endl;
+		cout << "Score:                             " <<  alignment_score_best      << endl;
+		cout << "Score/feature-length               " << (double)alignment_score_best/feature_sequence.size()      << endl;
+		cout << "Score/feature_in_transcript_length " << (double)alignment_score_best/feature_in_transcript_length << endl;
+	      }
+
+	      if ( (int)feature_sequence.size() > feature_in_transcript_length)
+	      {
+		if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+		  cerr << " ALERT: Length of excised genomic feature is longer than the transcipt, i.e. it looks as if the transcipt is incomplete.\n"
+		          " This can happen. Gene name:      " << gene_name
+		       << " Feature number: "                  << feature_number   
+		       << " Lengths are:    "                  << feature_in_transcript_length << "/" << feature_sequence.size()
+		       << endl;
+	      }
+
+	      if ( feature_in_transcript_length < min_alignment_length)
+	      {
+		// Notice:
+		if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+		{
+		  cerr << "ALERT: Skipping " << gff_feature_name << " feature since its overlap with the transcript is too short. Length of overlap: "
+		       << feature_in_transcript_length << " Minimum: " << min_alignment_length << endl;
+		}
+	      }
+	      else // We will now deal with this feature here:  ####
+		// This is the block in which a lot of memory is allocated (with new) that needs to be freed when leaving the block.
+	      {
+		// We extract the sequence alignment in the range: in_transcript_start, in_transcript_end
+		feature_transcript_alignment = new CSequences2(*transcript_alignment,
+							       in_transcript_start,
+							       in_transcript_end );
+		if (transcript_seq_index != -1u && remove_reference_species_from_alignments)
+		  feature_transcript_alignment->remove(transcript_seq_index);
+
+		//	      feature_transcript_alignment_length = feature_transcript_alignment->GetPosNum();
+		++DEBUG_COUNT_NEW_CALLS_FEATURE_ALIGNMENT;
+
+		// Remove gap only positions:
+		feature_transcript_alignment_rmgo = new CSequences2(CSequence_Mol::dna, feature_transcript_alignment->get_ambiguity_character());
+		feature_transcript_alignment->alignment_without_gap_only_positions(*feature_transcript_alignment_rmgo);
+		feature_transcript_alignment_rmgo->remove_gap_or_ambig_only_sequences();
+
+		int feature_in_transcript_length_rmgo = feature_transcript_alignment_rmgo->GetPosNum();
+
+		if (feature_in_transcript_length_rmgo < min_alignment_length)
+		{
+		  // Notice:
+		  if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+		  {
+		    cerr << "ALERT: Skipping " << gff_feature_name << " feature since the alignment is tool short after removing gap only positions. Length of overlap: "
+			 << feature_in_transcript_length_rmgo << " Minimum: " << min_alignment_length << endl;
+		  }
+		}
+		else
+		{
+		  ///////////////
+		  // Exporting transcript alignment before removing lines containig gaps and Ns.
+		  ///////////////
+		  if (true) // if export is requested
+		  {
+		    faststring output_file_name = output_directory + "/" + gene_name + "_" + faststring(feature_number) + "_" + faststring(features_this_gene) + "_all.fas";
+
+		    ofstream os(output_file_name.c_str());
+		    if (os.fail())
+		    {
+		      cerr << "ERROR: Could not open file " << output_file_name << " for writing." << endl;
+		      exit(-9);
+		    }
+		    feature_transcript_alignment_rmgo->ExportSequences(os, 'f', 100000000);
+		    os.close();
+		  }
+
+		  // Debug output:
+		  //	      feature_transcript_alignment_rmgo->ExportSequences(cout, 'f', 10000);
+
+		  /// We have an alignment which we can work with:
+		
+		  bool found_bait_region;
+		
+		  found_bait_region = handle_this_alignment(feature_transcript_alignment_rmgo,
+							    taxonNamesDict,
+							    required_groups_of_taxa,
+							    bait_length,
+							    number_of_baits_in_region,
+							    bait_offset,
+							    gene_name,
+							    feature_number,
+							    features_this_gene,
+							    cluster_threshold,
+							    os_result_file,
+							    sequence_name_field_delimiter,
+							    sequence_name_taxon_field_number,
+							    center_computation_mode, *it);
+
+		  if (found_bait_region)
+		    ++features_with_at_least_one_bait_regions;
+
+		  if (feature_transcript_alignment)
+		  {
+		    delete feature_transcript_alignment;
+		    ++DEBUG_COUNT_DELETE_CALLS_FEATURE_ALIGNMENT;
+		    feature_transcript_alignment = NULL;
+		  }
+		  if (feature_transcript_alignment_rmgo)
+		  {
+		    delete feature_transcript_alignment_rmgo;
+		    feature_transcript_alignment_rmgo = NULL;
+		  }
+		} // END ELSE if (feature_in_transcript_length_rmgo < min_alignment_length)
+	      } // END ELSE if ( feature_in_transcript_length < min_alignment_length)
+	    } // END ELSE: if ((int)feature_sequence.length() < min_alignment_length)    
+	    ++gl_it;
+	  }   // END while (gl_it != gl_it_end)  - For each feature in gene
+
+	  // Check whether we have found something:
+	  if (features_with_at_least_one_bait_regions)
+	  {
+	    if (global_VERBOSITY >= VERBOSITY_MOREPROGRESS)
+	    {
+	      cout << "NOTE: Alignment contains " << features_this_gene << " features, of which " << features_with_at_least_one_bait_regions
+		   << " have at least one valid bait region." << endl;
+	    }
+	  }
+	  else
+	  {
+	    if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+	    {
+	      cerr << "ALERT: Alignment contains " << features_this_gene << " features but no single valid bait region. (Details: see above.)" 
+		   << endl;
+	    }
+	  }
+
+	  // Do not delete the transcript_seq pointer, since it is part of transcript_alignment.
+	} // ELSE of if (transcript_seq == NULL)
+      } // END  if (get_file_size(full_alignment_file_name) > 0)
+      else
+      {
+	if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+	  cerr << "WARNING: Skipping file due to zero file size: " << full_alignment_file_name << endl;
+      }
+
+      // Delete alignment file:
+      delete transcript_alignment;
+      transcript_alignment = NULL;
+
+      ++DEBUG_COUNT_DELETE_ALIGNMENT_FROM_FILE;
+      if (global_VERBOSITY >= 1000)
+      {
+	print_DEBUG_COUNT(cout, "After calling all deletes of this transcript file:");
+      }
+      ++it;
+    } // END while (it != it_end) -- For all transcript files
+
+    if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+      cout << "PROGRESS: Bait-Fisher handled " << count_transcripts << " alignment files." << endl;
+
+    if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+    {
+      if (count_transcripts_no_gff_entries > 0)
+      {
+	cerr << "WARNING: For some alignment files the gene name could not be found in the gff file. These alignments had to be skipped.\n";
+	cerr << "         Number of alignments affected: " << count_transcripts_no_gff_entries << ". See warnings above."  << endl;
+      }
+      if ((count_transcripts_no_gff_entries_for_feature-count_transcripts_no_gff_entries) > 0)
+      {
+	cerr << "WARNING: For some alignment files we found entries for the specified gene name in the gff file. But after filtering for the specified\n"
+	        "         feature name no features where left. These alignment files had to be skipped.\n";
+	cerr << "         Number of alignments affected: " << count_transcripts_no_gff_entries_for_feature-count_transcripts_no_gff_entries << ". See warnings above."  << endl;
+      }
+    }
+  } // END if (alignment_cutting)
+
+    //****************************************************************
+    // END Alignment cutting mode
+    //****************************************************************
+
+  else // No alignment cutting
+  {
+    // Read fasta sequnces one by one:
+    list<faststring>::iterator it, it_end;
+    it     = fasta_names.begin();
+    it_end = fasta_names.end();
+
+    unsigned        Num_alignments    = fasta_names.size();
+    unsigned        count_alignments = 0;
+
+    CSequence_Mol   *alignment_seq_dummy;      // Only used as parameter. Not used in this case.
+    unsigned        alignment_seq_index_dummy; // Only used as parameter. Not used in this case.
+    faststring      full_alignment_file_name;
+    faststring      sequence_header_target;
+    //    faststring      alignment_name;
+
+    faststring      genomic_seq_name;
+
+    //  unsigned        overall_counter  = 0;
+    //  double          mean_match_score = DNAmat.get_mean_matchscore_of_first_N_symbols(4);
+
+    CSequences2     *alignment_from_file = NULL;
+
+    CTaxonNamesDictionary taxonNamesDict(dname_alignments, fasta_names, sequence_name_taxon_field_number, sequence_name_field_delimiter);
+
+    int error_required_taxa;
+    CRequiredTaxa required_groups_of_taxa(string_required_taxa.c_str(), taxonNamesDict, error_required_taxa);
+
+    if (error_required_taxa > 0)
+    {
+      if (error_required_taxa == 3)
+      {
+	cerr << "ERROR: When parsing the required taxa string. At least one of the taxon names did not occur in any of the sequence files that are analysed. Please look for earlier warning messages." << endl;
+	cerr << "Exiting." << endl;
+	exit(-3);
+      }
+    }
+
+    { // Debug output:
+      if (global_VERBOSITY > 1000)
+      {
+	cout << endl;
+
+	taxonNamesDict.print_taxon_names_to_index(cout);
+
+	cout << "Required groups: From each of the following sets of taxa, we require at least one to be present in the data set." << endl;
+	required_groups_of_taxa.print(cout, 1);
+	cout << endl;
+      }
+    }
+
+    // For all alignment files:
+    while (it != it_end)
+    {
+      ++count_alignments;
+      full_alignment_file_name = dname_alignments + "/" + *it;
+
+      if (get_file_size(full_alignment_file_name) > 0)
+      {
+	// Here is the main action: We handle this gene:
+
+	// For this gene file, read the alignment for the genome we are concerned with
+	if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+	{
+	  faststring t;
+	  get_time_string(t);
+	  cout << "PROGRESS: " << t << " Reading alignment file: ("
+	       << count_alignments << "/" << Num_alignments
+	       << ") " << full_alignment_file_name << endl;
+	}
+
+	read_alignment_sequence_of_species2(full_alignment_file_name,
+					    faststring(),
+					    alignment_seq_dummy,
+					    alignment_from_file,
+					    alignment_seq_index_dummy,
+					    sequence_name_field_delimiter,
+					    sequence_name_taxon_field_number);
+
+	if (alignment_from_file == NULL)
+	{
+	  cerr << "ERROR: Could not read alignment file: "
+	       << full_alignment_file_name << endl;
+	  exit(-4);
+	}
+
+	int alignment_length = alignment_from_file->GetPosNum();
+
+	if (alignment_length < min_alignment_length)
+	{
+	  // Notice:
+	  if (global_VERBOSITY >= VERBOSITY_WARNINGS)
+	  {
+	    cerr << "NOTICE: Skipping alignment since it is too short. Alignment length: "
+		 << alignment_length << " Minimum: " << min_alignment_length << endl;
+	  }
+	}
+	else
+	{
+	  // We will now deal with this alignment here:  ####
+	  // This is the block in which a lot of memory is allocated (with new) that needs to be freed when leaving the block.
+	    /// We have an alignment which we can work with:
+
+	  bool found_bait_region;
+
+	  found_bait_region = handle_this_alignment(alignment_from_file,
+				  taxonNamesDict,
+				  required_groups_of_taxa,
+				  bait_length,
+				  number_of_baits_in_region,
+				  bait_offset,
+				  *it,  // alignment name
+				  0,
+				  0,
+				  cluster_threshold,
+				  os_result_file,
+				  sequence_name_field_delimiter,
+				  sequence_name_taxon_field_number,
+				  center_computation_mode, *it);
+
+
+	} // END ELSE if ( alignment_length < min_alignment_length)
+
+	// Do not delete the alignment_seq pointer, since it is part of alignment_from_file.
+      } // END (get_file_size(full_alignment_file_name) > 0)
+      else
+      {
+	if (global_VERBOSITY >= VERBOSITY_WARNINGS) 
+	  cerr << "WARNING: Skipping file due to zero file size: " << full_alignment_file_name << endl;
+	  //	cout << "WARNING: Skipping file due to zero file size: " << full_alignment_file_name << endl;
+      }
+
+      // Delete alignment file:
+      delete alignment_from_file;
+      alignment_from_file = NULL;
+
+      ++DEBUG_COUNT_DELETE_ALIGNMENT_FROM_FILE;
+
+      if (global_VERBOSITY > 1000)
+      {
+	print_DEBUG_COUNT(cout, "After calling all deletes of this alignment file.:");
+      }
+      ++it;
+    } // END while (it != it_end) -- For all alignment files
+
+    if (global_VERBOSITY >= VERBOSITY_PROGRESS)
+      cout << "Bait-Fisher handled " << count_alignments << " alignment files." << endl;
+  } // END else // No alignment cutting
+
+  os_result_file.close();
+
+  cout << "Bait-Fisher finished without errors." << endl;
+
+} // END main(int argc, char **argv)
+
+
+// Memory leek detection:
+//
+// The function read_transcript_sequence_of_species2 reserves memory for:
+// - transcript alignment. This is variable "transcript_alignment" in the main function.
+//   This memory is released at the end of the while loop over all transcripts that are read.
+//
+// In the loop over all features we reserve memory for the
+// - "feature_transcript_alignment"
+//   This memory is released at the the end of the block that handles features that are sufficienlty long
+//   for designing baits.
+//
+//
+//
+//
+//
+//
+//
+//
+//
+
diff --git a/basic-DNA-RNA-AA-routines.h b/basic-DNA-RNA-AA-routines.h
new file mode 100644
index 0000000..72c0163
--- /dev/null
+++ b/basic-DNA-RNA-AA-routines.h
@@ -0,0 +1,451 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef DNA_ROUTINES_H
+#define DNA_ROUTINES_H
+
+/* Todo:  count DNA bases, guess data type, is AA, etc.  */
+
+#include <cstring>
+#include <cctype>
+
+static const char DNARNA_symbols[]   = "aAcCgGtTuU";
+/////////static const faststring aa_symbols     = "aArRnNdDbBcCeEqQzZgGhHiIlLkKmMfFpPsStTwWyYvVxX";
+static const char aa_symbols[]       = "aArRnNdDcCeEqQzZgGhHiIlLkKmMfFpPsStTwWyYvVxX";
+
+static const char aa_symbols_ext[]       = "aArRnNdDcCeEqQzZgGhHiIlLkKmMfFpPsStTwWyYvVxXUuOo*";
+
+static const char non_aa_in_ABC [] = "BJOUZbjouz";
+
+static const char DNARNA_iupac_symbols [] = "aAcCgGtTuURYSWryswKMBDkmbdHVNhvn";
+static const char phylip_DNARNA_allowed_symbols [] = "?-nNaAcCgGtTuURYSWryswKMBDkmbdHVhvoOxX";
+
+static const char phylip_neither_aa_dna_symbol [] = "jJzZ";
+static const char allowed_non_ABC [] = "-?*";
+
+// O and U are special amino acids that are usually not in the models.
+// Chars that are not an aa symbol: B, J, O, U, Z
+// X is the amibuity code
+
+
+inline bool is_DNA_base_upper(char c)
+{ 
+  if (c == 'A' || c == 'C' || c == 'G' || c == 'T' )
+    return true;
+  return false;
+}
+
+inline bool is_DNA_base_lower(char c)
+{ 
+  if (c == 'a' || c == 'c' || c == 'g' || c == 't' )
+    return true;
+  return false;
+}
+
+inline bool is_DNA_base(char c)
+{
+  if (c == 'A' || c == 'C' || c == 'G' || c == 'T' || c == 'a' || c == 'c' || c == 'g' || c == 't' )
+    return true;
+  return false;
+}
+
+inline bool is_DNA_or_RNA_base(char c)
+{
+  if (c == 'A' || c == 'C' || c == 'G' || c == 'T' || 
+      c == 'a' || c == 'c' || c == 'g' || c == 't' || c == 'U' || c == 'u')
+    return true;
+  return false;
+}
+
+inline bool is_allowed_non_ABC(char c)
+{
+  if (c == '-' || c == '?' || c == '*')
+    return true;
+  else
+    return false;
+}
+
+inline bool is_phylip_aa_dna_symbol(char c) // Does not include -? or similar
+{
+  if (c >='a' && c <= 'z')
+  {  
+      return true;
+  }
+  else if (c >='A' && c <= 'Z')
+  {
+      return true;
+  }
+  return false;
+}
+
+
+inline bool is_DNA_iupac_ambig(char c)
+{
+  if (c == 'N'  ||  c == '?'  || c == 'n' ||
+      c == 'R'  ||  c == 'Y'  || c == 'S' || c == 'W' ||
+      c == 'r'  ||  c == 'y'  || c == 's' || c == 'w' ||
+      c == 'K'  ||  c == 'M'  || c == 'B' || c == 'D' ||
+      c == 'k'  ||  c == 'm'  || c == 'b' || c == 'd' ||
+      c == 'H'  ||  c == 'V'  ||
+      c == 'h'  ||  c == 'v')
+    return true;
+  else
+    return false;
+}
+
+inline bool is_DNA_iupac_ambig_upper(char c)
+{
+  if (c == 'N'  ||  c == '?'  ||
+      c == 'R'  ||  c == 'Y'  || c == 'S' || c == 'W' ||
+      c == 'K'  ||  c == 'M'  || c == 'B' || c == 'D' ||
+      c == 'H'  ||  c == 'V')
+    return true;
+  else
+    return false;
+}
+
+inline int is_aa_ambig(char c)
+{
+  if (c == 'b' || c == 'B' || c == '?' || c == 'x' || c == 'X' || 
+      c == 'j' || c == 'J' || c == 'z' || c == 'Z')
+    return true;
+  else
+    return false;
+}
+
+
+
+inline int is_aa_or_aa_ambig(char c) // includes '?' and  B, Z, J, X
+{
+  if (c >='a' && c <= 'z')
+  {
+    if (c != 'o' && c != 'u') // ou
+      return true;
+  }
+  else if (c >='A' && c <= 'Z')
+  {
+    if (c != 'O' && c != 'U') // OU
+      return true;
+  }
+
+  if (c == '?' || c == '*')
+    return true;
+
+  return false;
+  //  return (strchr(aa_symbols, c) != NULL);
+}
+
+inline int is_aa_or_aa_ambig_extended(char c) // O and U are allowed  // includes '?' and  B, Z, J, X
+{
+  if (c >='a' && c <= 'z')
+  {
+      return true;
+  }
+  else if (c >='A' && c <= 'Z')
+  {
+      return true;
+  }
+
+  if (c == '?' || c == '*')
+    return true;
+
+  return false;
+  //  return (strchr(aa_symbols, c) != NULL);
+}
+
+
+inline char complementBase_of_upper(char c)
+{
+  switch (c) {
+  case 'A':  c = 'T'; break;
+  case 'T':  c = 'A'; break;
+  case 'G':  c = 'C'; break;
+  case 'C':  c = 'G'; break;
+    
+  case 'R':  c = 'Y'; break;
+  case 'Y':  c = 'R'; break;
+
+  case 'M':  c = 'K'; break;
+  case 'K':  c = 'M'; break;
+
+  case 'B':  c = 'V'; break;
+  case 'V':  c = 'B'; break;
+
+  case 'D':  c = 'H'; break;
+  case 'H':  c = 'D'; break;
+
+  case 'N':  c = 'N'; break;
+  case '?':  c = '?'; break;
+  case '-':  c = '-'; break;
+
+  default:
+    c = '*';
+    break;
+  }
+  return c;
+}
+
+inline char complementBase_of_lower(char c)
+{
+  switch (c) {
+  case 'a':  c = 't'; break;
+  case 't':  c = 'a'; break;
+  case 'g':  c = 'c'; break;
+  case 'c':  c = 'g'; break;
+    
+  case 'r':  c = 'y'; break;
+  case 'y':  c = 'r'; break;
+
+  case 'm':  c = 'k'; break;
+  case 'k':  c = 'm'; break;
+
+  case 'b':  c = 'v'; break;
+  case 'v':  c = 'b'; break;
+
+  case 'd':  c = 'h'; break;
+  case 'h':  c = 'd'; break;
+
+  case 'n':  c = 'n'; break;
+  case '?':  c = '?'; break;
+  case '-':  c = '-'; break;
+
+  default:
+    c = '*';
+    break;
+  }
+  return c;
+}
+
+inline char complementBase(char c)
+{
+  if ( isupper(c) )
+    return complementBase_of_upper(c);
+  else
+    return complementBase_of_lower(c);
+}
+
+
+inline void CG_AT_content_in_region(const char *beg, const char *end, unsigned &AT, unsigned &CG)
+{
+  AT = 0;
+  CG = 0;
+
+  char c;
+
+  while (beg != end)
+  {
+    c = *beg;
+    if (c == 'C' || c == 'c' || c == 'G' || c == 'g')
+      ++CG;
+    else if (c == 'A' || c == 'a' || c == 'T' || c == 't')
+      ++AT;
+
+    ++beg;
+  }
+}
+
+inline void content_in_region_DNA(const char *beg, const char *end, unsigned &AT, unsigned &CG, unsigned &gap, unsigned &ambig, unsigned &unknown)
+{
+  AT      = 0;
+  CG      = 0;
+  gap     = 0;
+  ambig   = 0;
+  unknown = 0;
+
+  char c;
+
+  while (beg != end)
+  {
+    c = *beg;
+    if (c == 'C' || c == 'c' || c == 'G' || c == 'g')
+      ++CG;
+    else if (c == 'A' || c == 'a' || c == 'T' || c == 't')
+      ++AT;
+    else if (c == '-')
+      ++gap;
+    else if (is_DNA_iupac_ambig(c) )
+      ++ambig;
+    else
+      ++unknown;
+
+    ++beg;
+  }
+}
+
+
+
+
+// Recoding symbols:
+// A char can hold 8 bits, enough for 8 characters to be "in or out",
+// to be switched on or off. Thus a char can be used to hold
+// all bases including ambiguities as follows:
+// Say A, C, G, T are the bits 1,2,3,4,
+// the ambiguity {A,C} is 1+2 = 3
+
+// A:       65, 97  -> 1
+// C:       67, 99  -> 2
+// G:       71,103  -> 4
+// T:       84,116  -> 8
+// R(AG):   82,114  -> 5
+// Y(CT):   89,121  -> 10
+// S(CG):   83,115  -> 6
+// W(TA):   87,119  -> 9
+// K(TG):   75,107  -> 12
+// M(CA):   77,109  -> 3
+// B(CTG):  66,98   -> 14
+// D(ATG):  68,100  -> 13
+// H(ATC):  72,104  -> 11
+// V(ACG):  86,118  -> 7
+// N(ACGT): 78,110  -> 15
+// -        45      -> 0
+// ?        63      -> 15
+
+const char ascii2recode_DNA[128] = {
+  0,0,0,0,0,0,0,0,0,0, //  0- 9
+  0,0,0,0,0,0,0,0,0,0, // 10-19
+  0,0,0,0,0,0,0,0,0,0, // 20-29
+  0,0,0,0,0,0,0,0,0,0, // 30-39
+  0,0,0,0,0,0,0,0,0,0, // 40-49
+  0,0,0,0,0,0,0,0,0,0, // 50-59
+  0,0,0,15,0,1,14,2,13,0, // 60-69
+  0,4,11,0,0,12,0,3,15,0, // 70-79
+  0,0,5,6,8,0,7,9,0,10, // 80-89
+  0,0,0,0,0,0,0,1,14,2, // 90-99
+  13,0,0,4,11,0,0,0,0,0, //100-109
+  0,0,0,0,5,0,8,0,7,9, //110-119
+  0,10,0,0,0,0,0,0 //120-127
+};
+
+const char recode2ascii_DNA[128] = {
+  45,65,67,77,71,82,83,86,84,87, //  0- 9
+  89,72,75,68,66,78,0,0,0,0, // 10-19
+  0,0,0,0,0,0,0,0,0,0, // 20-29
+  0,0,0,0,0,0,0,0,0,0, // 30-39
+  0,0,0,0,0,0,0,0,0,0, // 40-49
+  0,0,0,0,0,0,0,0,0,0, // 50-59
+  0,0,0,0,0,0,0,0,0,0, // 60-69
+  0,0,0,0,0,0,0,0,0,0, // 70-79
+  0,0,0,0,0,0,0,0,0,0, // 80-89
+  0,0,0,0,0,0,0,0,0,0, // 90-99
+  0,0,0,0,0,0,0,0,0,0, //100-109
+  0,0,0,0,0,0,0,0,0,0, //110-119
+  0,0,0,0,0,0,0,0 //120-127
+};
+
+const char recodeISDNAamig[128] = {
+  0,0,0,1,0,1,1,1,0,1, //  0- 9
+  1,1,1,1,1,1,0,0,0,0, // 10-19
+  0,0,0,0,0,0,0,0,0,0, // 20-29
+  0,0,0,0,0,0,0,0,0,0, // 30-39
+  0,0,0,0,0,0,0,0,0,0, // 40-49
+  0,0,0,0,0,0,0,0,0,0, // 50-59
+  0,0,0,0,0,0,0,0,0,0, // 60-69
+  0,0,0,0,0,0,0,0,0,0, // 70-79
+  0,0,0,0,0,0,0,0,0,0, // 80-89
+  0,0,0,0,0,0,0,0,0,0, // 90-99
+  0,0,0,0,0,0,0,0,0,0, //100-109
+  0,0,0,0,0,0,0,0,0,0, //110-119
+  0,0,0,0,0,0,0,0 //120-127
+};
+
+inline unsigned char recode_DNA(unsigned char c)
+{
+  return ascii2recode_DNA[c];
+}
+
+inline unsigned char backrecode_DNA(unsigned char c)
+{
+  return recode2ascii_DNA[c];
+}
+
+inline unsigned char recode_is_DNA_ambig(unsigned char c)
+{
+  return recodeISDNAamig[c];
+}
+
+inline bool is_base_in_recode(unsigned char recode, unsigned char base)
+{
+  return recode & recode_DNA(base);
+}
+
+inline bool is_valid_recode_DNA(unsigned char c)
+{
+  if (c > 15)
+    return false;
+  else
+    return true;
+}
+
+inline bool is_recode_gap(unsigned char c)
+{
+  return (c == 0);
+}
+
+
+
+// A	Ala	Alanine         01   65
+// R	Arg	Arginine        02   82
+// N	Asn	Asparagine      03   78
+// D	Asp	Aspartic acid   08   68
+// C	Cys	Cysteine        16   67
+// Q	Gln	Glutamine       32   81
+// E	Glu	Glutamic acid   64   69
+// G	Gly	Glycine        128   71
+// H	His	Histidine      256   72
+// I	Ile	Isoleucine     512   73
+// L	Leu	Leucine       1024   76
+// K	Lys	Lysine        2048   75 
+// M	Met	Methionine    4096   77
+// F	Phe	Phenylalanine 8192   70
+// P	Pro	Proline      16384   80
+// S	Ser	Serine       32768   83
+// T	Thr	Threonine    65536   84
+// W	Trp	Tryptophan  131072   87
+// Y	Tyr	Tyrosine    262144   89
+// V	Val	Valine      524288   86
+// -        45      -> 0
+// ?        63      -> 1048575
+// X        88      -> 1048575
+
+const int ascii2recode_aa[128] = {
+  0,0,0,0,0,0,0,0,0,0, //  0- 9
+  0,0,0,0,0,0,0,0,0,0, // 10-19
+  0,0,0,0,0,0,0,0,0,0, // 20-29
+  0,0,0,0,0,0,0,0,0,0, // 30-39
+  0,0,0,0,0,64,0,0,0,0, // 40-49
+  0,0,0,0,0,0,0,0,0,0, // 50-59
+  0,0,0,15,0,1,14,2,13,0, // 60-69
+  0,4,11,0,0,12,0,3,15,0, // 70-79
+  0,0,5,6,8,0,7,9,0,10, // 80-89
+  0,0,0,0,0,0,0,1,14,2, // 90-99
+  13,0,0,4,11,0,0,0,0,0, //100-109
+  0,0,0,0,5,0,8,0,7,9, //110-119
+  0,10,0,0,0,0,0,0 //120-127
+};
+
+
+#endif
+
diff --git a/easystring.h b/easystring.h
new file mode 100644
index 0000000..edd2822
--- /dev/null
+++ b/easystring.h
@@ -0,0 +1,511 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+
+#ifndef EASYSTRING_H
+#define EASYSTRING_H
+
+#include <iostream>
+#include <string>
+#include <cstring>    // for strchr
+#include <cstdlib>
+#include <fstream>
+
+// A usefull global function split:
+//(Code copied from the stringtok.h file on the gnu libstdc++ page.
+
+
+
+namespace {
+    inline bool
+    isws(char c, const char* wstr="\r\n\t\v\f ")
+    {
+        return (strchr(wstr,c) != NULL);
+    }
+}
+
+namespace {
+  //
+  // Reads through a string. If braces are encountered we do not tokenize inside but try to read them.
+  //
+  inline void
+    skip_until_ws_respect(const std::string &s, std::string::size_type &pos, char const * const ws = "\r\n\t\v\f ")
+    {
+      char c;
+
+      unsigned count_parent = 0;
+      unsigned count_brace  = 0;
+      unsigned count_curly  = 0;
+      unsigned count_sq     = 0;
+      unsigned count_dq     = 0;
+
+      std::string::size_type size = s.size();
+
+      while (pos < size)
+      {
+	c = s[pos];
+	     if (c == '(')   { ++count_parent; }
+	else if (c == ')')   { --count_parent; }
+	else if (c == '[')   { ++count_brace;  }
+	else if (c == ']')   { --count_brace;  }
+	else if (c == '{')   { ++count_curly;  }
+	else if (c == '}')   { --count_curly;  }
+	else if (c == '\'')  { count_sq = (count_sq+1)%2;   }
+	else if (c == '\"')  { count_dq = (count_dq+1)%2;   }
+
+	if (isws(c, ws) && count_parent==0 && count_brace==0 && count_curly==0 && count_sq==0 && count_dq==0)
+	  return;
+
+	++pos;
+      }
+    }
+}
+
+namespace std
+{
+
+/*****************************************************************
+ * Simplistic and quite Standard, but a bit slow.  This should be
+ * templatized on basic_string instead, or on a more generic StringT
+ * that just happens to support ::size_type, .substr(), and so on.
+ * I had hoped that "whitespace" would be a trait, but it isn't, so
+ * the user must supply it.  Enh, this lets them break up strings on
+ * different things easier than traits would anyhow.
+*/
+template <typename Container>
+int
+split (Container &l, string const &s, char const * const ws = "\r\n\t\v\f ")
+{
+  l.clear();
+    const string::size_type  S = s.size();
+          string::size_type  i = 0;
+
+    while (i < S) {
+        // eat leading whitespace
+        while ((i < S) && (isws(s[i],ws)))  ++i;
+        if (i == S)  return l.size();  // nothing left but WS
+
+        // find end of word
+        string::size_type  j = i+1;
+        while ((j < S) && (!isws(s[j],ws)))  ++j;
+
+        // add word
+        l.push_back(s.substr(i,j-i));
+
+        // set up for next loop
+        i = j+1;
+    }
+    return l.size();
+}
+
+//
+// Tokenizer which does not split braces.
+//
+template <typename Container>
+int
+split_respect (Container &l, string const &s, char const * const ws = "\r\n\t\v\f ")
+{
+  l.clear();
+    const string::size_type  S = s.size();
+          string::size_type  i = 0;
+
+    while (i < S) {
+        // eat leading whitespace
+        while ((i < S) && (isws(s[i],ws)))  ++i;
+        if (i == S)  return l.size();  // nothing left but WS
+
+        // find end of word
+        string::size_type  j = i;  // We can't skip the first char which can be a brace.
+	skip_until_ws_respect(s, j, ws);
+
+        // add word
+        l.push_back(s.substr(i,j-i));
+
+        // set up for next loop
+        i = j+1;
+    }
+    return l.size();
+}
+
+// Multiple successive deliminators result in multiple hits.
+template <typename Container>
+int
+split_strict (Container &l, string const &s, char const * const ws = " \t\n")
+{
+  l.clear();
+  const string::size_type  S = s.size();
+        string::size_type  i = 0;
+
+  while (i < S) {
+    // find end of word
+    string::size_type  j = i;
+    while ((j < S) && (!isws(s[j],ws)))  ++j;
+
+    // add word
+    l.push_back(s.substr(i,j-i));
+
+    // set up for next loop
+    i = j+1;
+
+    if (i==S)  // Only true of last string is empty since otherwise i==S+1
+    {
+      l.push_back("");
+    }
+  }
+  return l.size();
+}
+
+
+
+ class easystring: public string
+ {
+ public:
+   // Default constructor:
+   easystring():string(){};
+
+   // Copy constructor:
+   easystring(const string& s):string(s){}
+   easystring(const string& s, size_type pos, size_type n):string(s,pos,n){}
+
+   // Other constructors:
+   easystring(const char* s, size_type n):string(s,n){}
+   easystring(size_type n, char c):string(n,c){}
+   template <class InputIterator>
+     easystring(InputIterator first, InputIterator last):string(first, last){}
+
+   // Type conversion constructors:
+   easystring(const char* s):string(s){}
+   easystring(const char c):string(1,c){}
+   easystring(const int i):string()
+   {
+     //     std::cout << "Hallo" << std::endl;
+     char tmp[21];   // Sufficient for 64 bit numbers + sign
+     sprintf(tmp, "%d", i);
+     append(tmp);
+   }
+   easystring(const long i):string()
+   {
+     //     std::cout << "Hallo" << std::endl;
+     char tmp[21];   // Sufficient for 64 bit numbers + sign
+     sprintf(tmp, "%ld", i);
+     append(tmp);
+   }
+   easystring(const unsigned i):string()
+   {
+     //     std::cout << "Hallo" << std::endl;
+     char tmp[21];   // Sufficient for 64 bit numbers
+     sprintf(tmp, "%u", i);
+     append(tmp);
+   }
+   easystring(const unsigned long i):string()
+   {
+     //     std::cout << "Hallo" << std::endl;
+     char tmp[21];   // Sufficient for 64 bit numbers
+     sprintf(tmp, "%lu", i);
+     append(tmp);
+   }
+   easystring(const double x, int pres):string()
+   {
+     //     std::cout << "Hallo" << std::endl;
+     char tmp[25];   // Sufficient for 64 bit numbers
+     sprintf(tmp, "%.*f", pres, x);
+     append(tmp);
+   }
+
+
+   void                         removeSpacesFront(const char* delims="\r\n\t\v\f ")
+   {
+           string::size_type  i;
+     const string::size_type  n = size();
+
+     for (i=0; i < n && isws((*this)[i], delims); ++i);
+     erase(0,i);
+   }
+
+
+   void                         removeSpacesBack(const char* delims="\r\n\t\v\f ")
+   {
+     unsigned i;
+     unsigned n = size();
+
+     if (n > 0)
+     {
+       for (i=n-1; i != 0 && isws((*this)[i], delims); --i);
+
+       if (i == 0 && isws((*this)[0], delims))
+	 erase();
+       else
+	 erase(i+1);
+     }
+   }
+
+
+   void                         ToUpper()
+   {
+     iterator it, it_end;
+
+     it     = begin();
+     it_end = end();
+
+     while (it != it_end)
+     {
+       *it = toupper(*it);
+       ++it;
+     }
+   }
+
+   void                         ToLower()
+   {
+     string::iterator it, it_end;
+
+     it     = begin();
+     it_end = end();
+
+     while (it != it_end)
+     {
+       *it = tolower(*it);
+       ++it;
+     }
+   }
+
+   // Convert to unsigned long
+   unsigned			ToUnsigned() const
+   {
+     char *end;
+     return strtoul(c_str(), &end, 0);
+   }
+
+   // Convert to unsigned long
+   unsigned long 		ToUnsignedLong() const
+   {
+     char *end;
+     return strtoul(c_str(), &end, 0);
+   }
+
+   // Convert to int
+   int				ToInt() const
+   {
+     char *end;
+     return strtol(c_str(), &end, 0);
+
+   }
+
+
+   // Convert to long
+   long				ToLong() const
+   {
+     char *end;
+     return strtol(c_str(), &end, 0);
+   }
+
+   long				ToLong(string::size_type  beg_pos,
+				       string::size_type& end_pos) const
+   {
+     const char   *beg = c_str()+beg_pos;
+           char   *end;
+           long   result;
+
+     result  = strtol(beg, &end, 0);
+     end_pos = end-c_str();
+     return result;
+   }
+
+   unsigned			ToUnsigned(string::size_type  beg_pos,
+					   string::size_type& end_pos) const
+   {
+     const char   *beg = c_str()+beg_pos;
+           char   *end;
+           long   result;
+
+     result  = strtoul(beg, &end, 0);
+     end_pos = end-c_str();
+     return result;
+   }
+
+
+   // Convert to double
+   double			ToDouble() const
+   {
+     char *end;
+     return strtod(c_str(), &end);
+   }
+
+   double			ToDouble(string::size_type  beg_pos,
+					 string::size_type& end_pos) const
+   {
+     const char   *beg = c_str()+beg_pos;
+           char   *end;
+           double result;
+
+     result  = strtod(beg, &end);
+     end_pos = end-c_str();
+     return result;
+   }
+
+   // not tested
+   unsigned countChar(char c)
+   {
+     unsigned          n = 0;
+     string::iterator  b = begin();
+     string::iterator  e = end();
+
+     while (b<e)
+     {
+       if (*b == c)
+	 ++n;
+       ++b;
+     }
+     return n;
+   }
+
+   // not tested
+   void unquote()
+   {
+     removeSpacesBack();
+     removeSpacesFront();
+     if (*begin() == '"' && *(end()-1) == '"' )
+     {
+       this->erase(begin());
+       this->erase(end()-1);
+     }
+     else if (*begin() == '\'' && *(end()-1) == '\'' )
+     {
+       this->erase(begin());
+       this->erase(end()-1);
+     }
+   }
+
+   // not tested
+   void unquote(char s, char e)
+   {
+     removeSpacesBack();
+     removeSpacesFront();
+     if (*begin() == s && *(end()-1) == e )
+     {
+       this->erase(begin());
+       this->erase(end()-1);
+     }
+   }
+
+   // get the next token and remove it from the called object.
+   easystring& get_next_token(easystring &str, const char * ws = "\r\n\t\v\f ")
+   {
+     const string::size_type  n = size();
+           string::size_type  i = 0;
+
+     str.clear();
+
+     // eat leading whitespace/deliminators -- this sould be more efficient than
+     // calling removeSpacesFront since we only need to erase in the front of the string once. 
+     while ( (i < n) && ( isws( (*this)[i], ws)) ) ++i;
+
+     if (i == n)   // nothing left so re remove alle spaces and the string will be empty
+     {
+       erase();
+     }
+     else
+     {
+       // find end of word
+       string::size_type  j = i+1;
+       while ( (j < n) && (!isws( (*this)[j], ws)) ) ++j;
+
+       str = string(*this, i, j);   // the next token
+       erase(0, j);                 // remove token from called object 
+     }
+
+     return *this;
+   }
+
+
+   // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+   // Be careful with keywords containing punctuations since they do not
+   // count as upper case chars. The upper case loop stops there.
+   
+   // Possible bug: I think "I" abbreviates "INPUT" which is not OK.
+   
+   // Use !isalpha() to as equivalent to "isupper() so we prolong the upper region.
+   
+   bool is_CAPITALIZED_abbreviation_of(const easystring &keyword)
+   {
+     unsigned i   = 0;
+     unsigned max = size();
+
+     // max cannot be greater than keyword.size()
+     if ( max > keyword.size() )
+       return false;
+     
+     // We start comparrison in upper case region. Lets see how far we can go.
+     while (i < max && toupper( (*this)[i] ) == keyword[i] )
+     {
+       ++i;
+     }
+
+     // First we check whether both strings have the same length and we matched all chars.
+     // This means that we matched exactly the upper case region of keyword, which is the
+     // complete keyword.
+     if ( i == max && max == keyword.size() )
+       return true;
+
+     // If we get here, i must be smaller than keyword.size() since we can only have
+     // * i == max and i == keyword.size(): Not possible after previous if 
+     // * i <  max and i == keyword.size(): Not possible since max <= keyword.size()
+     // * i == max and i < keyword.size(): 
+     // * i <  max and i < keyword.size(): 
+
+     // Thus, keyword[i] is valid and we use it to check whether we are in the upper case region
+     // (were all !alpha() should also be considered as upper case chars in this context!!). 
+     // We simply check whether we are in the !islower() region.
+
+     if ( !islower( keyword[i]) )    // We are still in non-lower case region
+       return false;
+
+     // If we get here, we are in the in the lower-case region
+     // There are two possibilities:
+     // - i == max, 
+     if (i==max)
+       return true;
+     // - our string is longer than the upper case region, so we have to continue
+     //   our comparison.
+
+     // Let us move through lower case region
+     while (i < max && ((*this)[i] == keyword[i] || tolower((*this)[i]) == keyword[i]) )
+       ++i;
+
+     // Could we match all letters in str?
+     if (i==max)
+       return true;
+     else
+       return false;
+   }
+   
+
+ };
+
+
+}
+
+
+#endif
diff --git a/fast-dynamic-bitset/.DS_Store b/fast-dynamic-bitset/.DS_Store
new file mode 100644
index 0000000..b44baac
Binary files /dev/null and b/fast-dynamic-bitset/.DS_Store differ
diff --git a/fast-dynamic-bitset/fast-dynamic-bitset.h b/fast-dynamic-bitset/fast-dynamic-bitset.h
new file mode 100644
index 0000000..4d8ce2a
--- /dev/null
+++ b/fast-dynamic-bitset/fast-dynamic-bitset.h
@@ -0,0 +1,518 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef FAST_DYNAMIC_BITSET_H
+#define FAST_DYNAMIC_BITSET_H
+
+// 23.7.2014: Since unsigned long has 64 bits on some computers unsinged long cannot be used as
+//            the word data type without having to change large parts of the code.
+
+#include <iostream>
+#include <fstream>
+#include <cstring>
+#include <string>
+
+//#define __num_bits_in_word      (( unsigned long)8*sizeof(unsigned long))
+//#define __get_word_index(i)     (( unsigned long)i/(__num_bits_in_word))
+//#define __get_num_words(size)   (((unsigned long)size+__num_bits_in_word-1ul)/(__num_bits_in_word))
+//#define __get_empty_mask(size,numWords)  ( 0xFFFFFFFF >> numWords*__num_bits_in_word - size  )
+//#define __get_num_byte(words)   ( words*sizeof(unsigned long))
+
+#define __num_bits_in_word                32
+#define __get_word_index(i)               (i >> 5)
+#define __get_word_offset(i)              (i & 31)
+#define __get_num_words(size)             ((size + 31) >> 5)
+#define __get_num_byte(words)             ( words*4 )
+
+// Must be a 32 bit integer type:
+//typedef unsigned   bitset_word_type;
+typedef unsigned   my_uint_32;
+
+const unsigned char  __num_bits_table[256] =
+     {
+       0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+       1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+       1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+       2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+       1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+       2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+       2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+       3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
+     };
+
+const my_uint_32 __mask_table[32] =
+{
+  0x00000001, 0x00000002, 0x00000004, 0x00000008,
+  0x00000010, 0x00000020, 0x00000040, 0x00000080,
+  0x00000100, 0x00000200, 0x00000400, 0x00000800,
+  0x00001000, 0x00002000, 0x00004000, 0x00008000,
+
+  0x00010000, 0x00020000, 0x00040000, 0x00080000,
+  0x00100000, 0x00200000, 0x00400000, 0x00800000,
+  0x01000000, 0x02000000, 0x04000000, 0x08000000,
+  0x10000000, 0x20000000, 0x40000000, 0x80000000
+};
+
+
+const my_uint_32 __empty_mask_table[32] =
+{
+  0xFFFFFFFF, 0x7FFFFFFF, 0x3FFFFFFF, 0x1FFFFFFF,
+  0x0FFFFFFF, 0x07FFFFFF, 0x03FFFFFF, 0x01FFFFFF,
+  0x00FFFFFF, 0x007FFFFF, 0x003FFFFF, 0x001FFFFF,
+  0x000FFFFF, 0x0007FFFF, 0x0003FFFF, 0x0001FFFF,
+
+  0x0000FFFF, 0x00007FFF, 0x00003FFF, 0x00001FFF,
+  0x00000FFF, 0x000007FF, 0x000003FF, 0x000001FF,
+  0x000000FF, 0x0000007F, 0x0000003F, 0x0000001F,
+  0x0000000F, 0x00000007, 0x00000003, 0x00000001
+};
+
+
+class fast_dynamic_bitset
+{
+ public:
+  class exception {};
+  class outOfRange          : public exception {};
+  class zeroSizeBitset      : public exception {};
+  class UnequalSizedBitsets : public exception {};
+
+ private:
+  my_uint_32        *__data;
+  my_uint_32         __size;
+  my_uint_32         __numWords;
+  //  my_uint_32  __empty_mask;
+
+ public:
+  fast_dynamic_bitset(my_uint_32 size=0):__size(size),__numWords(__get_num_words(size))
+  {
+    //    if (size == 0)
+    //     throw zeroSizeBitset();
+
+    //    __size     = size;
+    __data = new my_uint_32 [__numWords];
+    //    __empty_mask = __empty_mask_table[__numWords * __num_bits_in_word - size];
+      // 0xFFFFFFFF >> (__numWords * __num_bits_in_word - size);
+  }
+
+  fast_dynamic_bitset(const fast_dynamic_bitset &a)
+  {
+    memcpy((void*)this, (void*) &a, sizeof(fast_dynamic_bitset) );
+    __data = new my_uint_32 [__numWords];
+    memcpy((void*)__data,(void*)a.__data, __get_num_byte(__numWords) );
+  }
+
+  ~fast_dynamic_bitset() {
+    delete [] __data;
+    //    std::cout << "Dest" << std::endl;
+  }
+
+  my_uint_32 size()
+  {
+    return __size;
+  }
+
+  fast_dynamic_bitset& operator=(const fast_dynamic_bitset &a)
+  {
+    if ( __size != a.__size )
+    {
+      delete [] __data;
+      memcpy((void*)this, (void*) &a, sizeof(fast_dynamic_bitset) );
+      __data = new my_uint_32 [__numWords];
+      memcpy((void*)__data,(void*)a.__data, __get_num_byte(__numWords) );
+    }
+    else
+    {
+      memcpy((void*)__data,(void*)a.__data, __get_num_byte(__numWords) );
+    }
+    return *this;
+  }
+
+
+  void reset()
+  {
+    memset((void*)__data, 0, __get_num_byte(__numWords));
+  }
+
+  void clear()
+  {
+    reset();
+  }
+
+  void set()
+  {
+    for(my_uint_32 index=0; index < __numWords-1; ++index)
+      __data[index] = ~static_cast<my_uint_32>(0);
+    __data[__numWords-1] = __empty_mask_table[__numWords * __num_bits_in_word - __size];
+  }
+
+  void flip()
+  {
+    for(my_uint_32 index=0; index < __numWords; ++index)
+      __data[index] = ~__data[index];
+    __data[__numWords-1] &= __empty_mask_table[__numWords * __num_bits_in_word - __size];
+  }
+
+
+  void unchecked_set(my_uint_32 i)
+  {
+    __data[__get_word_index(i)] |= __mask_table[__get_word_offset(i)];
+  }
+
+  void set(my_uint_32 i)
+  {
+    if (i >= __size)
+      throw outOfRange();
+
+    __data[__get_word_index(i)] |= __mask_table[__get_word_offset(i)];
+  }
+
+  void unchecked_reset(my_uint_32 i)
+  {
+    __data[__get_word_index(i)] ^= __mask_table[__get_word_offset(i)];
+  }
+
+  void reset(my_uint_32 i)
+  {
+    if (i >= __size)
+      throw outOfRange();
+
+    __data[__get_word_index(i)] ^= __mask_table[__get_word_offset(i)];
+  }
+
+  void unchecked_set(my_uint_32 i, my_uint_32 x)
+  {
+    if (x==0)
+      unchecked_reset(i);
+    else
+      unchecked_set(i);
+  }
+
+  void set(my_uint_32 i, my_uint_32 x)
+  {
+    if (x==0)
+      reset(i);
+    else
+      set(i);
+  }
+
+  bool unchecked_test(my_uint_32 i) const
+  {
+    return (__data[__get_word_index(i)] & __mask_table[__get_word_offset(i)]);
+  }
+
+  bool test(my_uint_32 i) const
+  {
+    //    if (i >= __size)
+    //      throw outOfRange();
+
+    return (__data[__get_word_index(i)] & __mask_table[__get_word_offset(i)]);
+  }
+
+  void unchecked_flip(my_uint_32 i)
+  {
+    __data[__get_word_index(i)] ^= __mask_table[__get_word_offset(i)];
+  }
+
+  void flip(my_uint_32 i)
+  {
+    //    if (i >= __size)
+    //      throw outOfRange();
+
+    __data[__get_word_index(i)] ^= __mask_table[__get_word_offset(i)];
+  }
+
+  void operator&=(const fast_dynamic_bitset &a)
+  {
+    //    if ( a.__numWords != __numWords )
+    //      throw UnequalSizedBitsets();
+
+    for(my_uint_32 index=0; index < __numWords; ++index)
+      __data[index] &= a.__data[index];
+  }
+
+  void operator|=(const fast_dynamic_bitset &a)
+  {
+    //    if ( a.__numWords != __numWords )
+    //     throw UnequalSizedBitsets();
+
+    for(my_uint_32 index=0; index < __numWords; ++index)
+      __data[index] |= a.__data[index];
+  }
+
+  void operator^=(const fast_dynamic_bitset &a)
+  {
+    //    if ( a.__numWords != __numWords )
+    //      throw UnequalSizedBitsets();
+
+    for(my_uint_32 index=0; index < __numWords; ++index)
+      __data[index] ^= a.__data[index];
+  }
+
+  fast_dynamic_bitset operator~()
+  {
+    fast_dynamic_bitset a=*this;
+    a.flip();
+    return a;
+  }
+
+  std::string as_string_highBitsFirst() const
+  {
+    std::string str;
+
+/*     // Print overhead-empty bit in bitset: */
+/*     //------------------------------------- */
+/*     my_uint_32 k = __numWords * __num_bits_in_word; */
+/*     while (k != __size) */
+/*     { */
+/*       --k; */
+/*       if (unchecked_test(k)) */
+/* 	str.push_back('1'); */
+/*       else */
+/* 	str.push_back('0'); */
+/*     } */
+/*     //    os << "|"; */
+
+    // Print bitset with high bits first
+    //-----------------------------------
+    my_uint_32 i = __size;
+
+    while (i != 0)
+    {
+      --i;
+      if (unchecked_test(i))
+	str.push_back('1');
+      else
+	str.push_back('0');
+    }
+    return str;
+  }
+
+  std::string as_string_lowBitsFirst() const
+  {
+    std::string str;
+
+    // Print bitset with low bits first
+    //----------------------------------
+    my_uint_32 i = 0;
+
+    while (i < __size )
+    {
+      if (unchecked_test(i))
+	str.push_back('1');
+      else
+	str.push_back('0');
+      ++i;
+    }
+    return str;
+  }
+
+
+  std::ostream& print_lowBitsFirst(std::ostream& os) const
+  {
+    // Print bitset with low bits first
+    //----------------------------------
+    my_uint_32 i = 0;
+
+    while (i < __size )
+    {
+      if (unchecked_test(i))
+	os << "1";
+      else
+	os << "0";
+      ++i;
+    }
+
+/*     // Print overhead-empty bit in bitset: */
+/*     //------------------------------------- */
+/*     os << "|"; */
+/*     while ( i < __numWords * __num_bits_in_word) */
+/*     { */
+/*       if (unchecked_test(i)) */
+/* 	os << "1"; */
+/*       else */
+/* 	os << "0"; */
+/*       ++i; */
+/*     } */
+    return os;
+  }
+
+  void binary_out(std::ostream& os)
+  {
+    os.write((char*)__data,__numWords*sizeof(my_uint_32));
+  }
+
+  void binary_in(std::istream& is)
+  {
+    is.read((char*) __data,__numWords*sizeof(my_uint_32));
+  }
+
+
+  my_uint_32 count() const
+  {
+    my_uint_32 sum = 0;
+    unsigned char *ptr     = (unsigned char*) __data;
+    unsigned char *ptr_end = ptr + __get_num_byte(__numWords);
+
+    while ( ptr != ptr_end )
+    {
+      sum += __num_bits_table[*ptr];
+      ++ptr;
+    }
+    return sum;
+  }
+
+  bool any() const
+  {
+    for(my_uint_32 i=0; i < __numWords; ++i)
+    {
+      if (__data[i])
+	return true;
+    }
+    return false;
+  }
+
+  bool none() const
+  {
+    return !any();
+  }
+
+  void operator++()
+  {
+    my_uint_32 i=0;
+
+    while ( i < __numWords )
+    {
+      ++__data[i];
+      if (__data[i]) // if __data[i] == 0 we have to carry a bit otherwise we are done.
+	break;
+      ++i;
+    }
+  }
+
+  friend bool operator!=(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+  {
+    //    if ( a.__numWords != b.__numWords )
+    //      throw UnequalSizedBitsets();
+
+    for (my_uint_32 i = 0; i < a.__numWords; --i)
+    {
+      if ( a.__data[i] != b.__data[i] )
+	return true;
+    }
+    return false;
+  }
+
+  friend bool operator==(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+  {
+    return !(a != b);
+  }
+
+  friend bool operator<(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+  {
+    //    if ( a.__numWords != b.__numWords )
+    //      throw UnequalSizedBitsets();
+
+    for (my_uint_32 i=a.__numWords-1; i > 0; --i)
+    {
+      if ( a.__data[i] < b.__data[i] )
+	return true;
+      else if (a.__data[i] > b.__data[i])
+	return false;
+    }
+    if ( a.__data[0] < b.__data[0] )
+      return true;
+    else
+      return false;
+  }
+
+  friend bool operator>(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+  {
+    //    if ( a.__numWords != b.__numWords )
+    //      throw UnequalSizedBitsets();
+
+    for (my_uint_32 i=a.__numWords-1; i > 0; --i)
+    {
+      if ( a.__data[i] != b.__data[i] )
+	return a.__data[i] > b.__data[i];
+    }
+    return a.__data[0] > b.__data[0];
+  }
+
+  friend bool operator<=(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+  {
+    return !(a>b);
+  }
+
+  friend bool operator>=(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+  {
+    return !(a<b);
+  }
+
+
+};
+
+
+
+// Global functions for fast_dynamic_bitsets
+
+inline fast_dynamic_bitset operator&(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+{
+  fast_dynamic_bitset c(a);
+  c &= b;
+  return c;
+}
+
+inline fast_dynamic_bitset operator|(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+{
+  fast_dynamic_bitset c(a);
+  c |= b;
+  return c;
+}
+
+inline fast_dynamic_bitset operator^(const fast_dynamic_bitset &a, const fast_dynamic_bitset &b)
+{
+  fast_dynamic_bitset c(a);
+  c ^= b;
+  return c;
+}
+
+inline  std::ostream& operator<<(std::ostream& os, const fast_dynamic_bitset& b)
+{
+  b.print_lowBitsFirst(os);
+  return os;
+}
+
+
+
+
+
+
+// To do:
+// shift left
+// shift right
+// readFromString
+
+#endif
diff --git a/fast-realloc-vector.h b/fast-realloc-vector.h
new file mode 100644
index 0000000..bb9be1d
--- /dev/null
+++ b/fast-realloc-vector.h
@@ -0,0 +1,355 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+//-----------------------------------------------------------------------------
+// Author:    Christoph Mayer
+//            Gropiusweg 13
+//            44801 Bochum
+//
+// Copyright: Christoph Mayer
+//
+// Description:
+//      A fast vector class for objects which do not require their constructors
+//         or destructors to be called.
+//      This class uses malloc, realloc and free to allocate and
+//         free dynamic memory for the "vector". Especially the efficient
+//         realloc has no C++ equivalent - the major drawback of new and
+//         delete.
+//      Disadvantage: No constructors and destructors are called for
+//         objects in the vector. This limits is applicability.
+//         The fastvector-nd.h uses new and delete and does not use
+//         memcpy. It is therefore well suited for all classes.
+//         Unfortunately, its less efficient.
+//
+
+
+
+#ifndef FASTVECTOR_H
+#define FASTVECTOR_H
+
+#include <iostream>
+#include <cstdlib>
+#include <cstring>
+#include <cctype>
+// #include <iomanip>
+
+#define _MINBUFFER_CAPACITY 4
+
+template<typename T>
+class fastvector
+{
+  // Possibly even more efficient:
+  //    Use pointer _end, _capacity_end instead of _len, _capacity
+
+
+ private:
+  T           *_buf;
+  unsigned    _len;
+  unsigned    _capacity;   // Capacity of container, i.e number of bytes availible
+                           // for writing. If a capacity is requested by the user,
+                           // an additional byte is reserved in order to be able to append
+                           // the additional \0 which is appended by some function calls.
+                           // Consequently, the capacity reported to user is _capacity-1.
+ protected:
+
+
+ public:
+  ~fastvector ()
+  {
+    if (_buf)
+      //      delete [] _buf;
+      std::free(_buf);
+  }
+
+  fastvector ():_buf(NULL),  _len(0), _capacity(0)
+  {
+  }
+
+  fastvector (const T *v, unsigned len)
+  {
+    //    std::cout << "New fastvector 2" << std::endl;
+    _len      = len;
+    _capacity = len;
+
+    if (len)
+    {
+      _buf      = (T *) malloc(_capacity*sizeof(T)); 
+      //_buf      = new T [_capacity]; 
+      memcpy(_buf, v, len*sizeof(T));
+    }
+    else
+    {
+      _buf = NULL;
+    }
+  }
+
+  fastvector (const T *v_begin, const T *v_end)
+  {
+    //    std::cout << "New fastvector 3" << std::endl;
+    _len      = (v_end - v_begin);
+    _capacity = _len;
+
+    if (_len)
+    {
+      _buf      = (T *)malloc(_capacity*sizeof(T)); 
+      // _buf      = new T [_capacity]; 
+      memcpy(_buf, v_begin, _len*sizeof(T));
+    }
+    else
+    {
+      _buf = NULL;
+    }
+  }
+
+  fastvector (const fastvector &a):_len(a._len),_capacity(a._len)
+  {
+    if (_len)
+    {
+      _buf = (T *)malloc(_capacity*sizeof(T));
+      memcpy(_buf, a._buf, _len*sizeof(T));
+    }
+    else
+    {
+      _buf = NULL;
+    }      
+  }
+
+
+  void push_back(const T &c)
+  {
+    if (_capacity == _len)
+    {
+      if (_buf == NULL)
+      {
+	_capacity = _MINBUFFER_CAPACITY;
+	_buf = (T *)malloc(_capacity*sizeof(T));
+      }
+      else
+      {
+	T *tmp;
+
+	_capacity <<= 1;
+	tmp = (T *)realloc(_buf, _capacity*sizeof(T));
+
+	if (tmp == NULL)
+	{
+	  std::cout << "Program aborded due to failed realloc!" << std::endl; 
+	  exit(0);
+	}
+	_buf = tmp;
+      }
+    }
+    _buf[_len] = c;
+    ++_len;
+  }
+
+
+  T *begin() const
+  {
+    return _buf;
+  }
+
+
+  T *end() const
+  {
+    return _buf+_len;
+  }
+
+
+  T *rbegin() const
+  {
+    return _buf + (_len - 1);
+  }
+
+
+  T *rend() const
+  {
+    return _buf - 1;
+  }
+
+
+  void assign(const T *v, int len)
+  {
+    _len = len;
+    reserve(len);
+    memcpy(_buf, v, len*sizeof(T));
+  }
+
+
+  void assign(const T *v_begin, const T *v_end)
+  {
+    _len = v_end - v_begin;
+    reserve(_len);
+    memcpy(_buf, v_begin, _len*sizeof(T));
+  }
+
+  void assign(const fastvector &a)
+  {
+    _len = a._len;
+    reserve(_len);
+    memcpy(_buf, a._buf, _len*sizeof(T));
+  }
+
+
+  void reserve(unsigned s)
+  {
+    //    std::cout << "reserve" << std::endl;
+    if (_capacity < s)
+    {
+      if (_buf == NULL)
+      {
+	//_buf = new T [s];
+	_buf = (T *)malloc(s*sizeof(T));
+      }
+      else
+      {
+	T *tmp;
+
+	tmp = (T *)realloc(_buf, s*sizeof(T));
+	if (tmp == NULL)
+	{
+	  std::cout << "Program aborded due to failed realloc!" << std::endl; 
+	  exit(0);
+	}
+	_buf = tmp;
+      }
+      _capacity = s;
+    }
+  }
+
+  bool empty() const
+  {
+    return _len == 0;
+  }
+
+
+  unsigned size() const
+  {
+    return _len;
+  }
+
+
+  unsigned capacity() const
+  {
+    return _capacity; // One char is reserved for the \0 at end of string
+  }
+
+
+  void clear()
+  {
+    //        std::cout << "clear" << std::endl;
+    _len = 0;
+  }
+
+
+  void reset()
+  {
+    //    std::cout << "reset" << std::endl;
+    if (_buf)
+    {
+      // delete [] _buf;
+      free(_buf);
+      _buf = NULL;
+      _capacity = 0;
+      _len = 0;
+    }
+  }
+
+
+  bool check_pos(unsigned pos)
+  {
+    return (pos < _len);
+  }
+
+
+  void set_unckecked(unsigned pos, const T &c)
+  {
+    _buf[pos] = c;
+  }
+
+
+  bool set(unsigned pos, const T &c)
+  {
+    if ( check_pos(pos) )
+    {
+      _buf[pos] = c;
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+
+  void get_unckecked(unsigned pos, T &c)
+  {
+    c = _buf[pos];
+  }
+
+
+  T get_unckecked(unsigned pos)
+  {
+    return _buf[pos];
+  }
+
+
+
+  bool get(unsigned pos, T &c)
+  {
+    if ( check_pos(pos) )
+    {
+      c = _buf[pos];
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+  fastvector &operator=(const fastvector &a)
+    {
+      _len = a._len;
+      if (_len)
+      {
+	reserve(_len);
+	memcpy(_buf, a._buf, _len*sizeof(T));
+      }
+      return *this;
+    }
+
+  void swap(fastvector &a)
+  {
+    T         *_tmpbuf      = _buf;             _buf = a._buf;           a._buf = _tmpbuf; 
+    unsigned   _tmplen      = _len;             _len = a._len;           a._len = _tmplen; 
+    unsigned   _tmpcapacity = _capacity;   _capacity = a._capacity; a._capacity = _tmpcapacity;     
+  }
+
+};
+
+
+#endif
diff --git a/faststring2.h b/faststring2.h
new file mode 100644
index 0000000..ec79c95
--- /dev/null
+++ b/faststring2.h
@@ -0,0 +1,3438 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef FASTSTRING_H
+#define FASTSTRING_H
+
+#include <iostream>
+#include <fstream>
+#include <cstdlib>
+#include <cstring>
+#include <cctype>
+#include <climits>
+#include <stdarg.h>
+#include <vector>
+#include <cmath>
+#include <cerrno>
+#include <list>
+#include <cfloat>
+
+#define _MINBUFFER_CAPACITY 4
+
+#define macromin(x,y) ((x)<(y) ? (x) : (y))
+//#define macromax(x,y) ((x)>(y) ? (x) : (y))
+
+class faststring;
+
+template <typename Container>
+int
+split (Container &l, const faststring &s, char const * const ws = "\r\n\t\v\f ");
+
+template <typename Container>
+int
+split_at (Container &l, const faststring &s, const faststring &delim);
+
+template <typename Container>
+int
+split_respect (Container &l, const faststring &s, char const * const ws = "\r\n\t\v\f ");
+
+template <typename Container>
+int
+split_strict (Container &l, const faststring &s, char const * const ws = " \t\n");
+
+
+
+namespace {
+  inline bool is_in_symbol_list__(char c, const char* wstr="\r\n\t\v\f ")
+  {
+    return (strchr(wstr,c) != NULL);
+  }
+
+  inline bool is_in_symbol_list__(char c, const char* wstr, size_t n)
+  {
+    return (memchr(wstr,c,n) != NULL);
+  }
+
+  const char * find_fundamental ( const char *b1, const char *e1,
+				  const char *b2, const char *e2)
+  {
+    for (; b1 < e1 ; ++b1)
+    {
+      const char * tb1 = b1;
+      const char * tb2 = b2;
+      for (; tb2 < e2 && tb1 < e1; ++tb2, ++tb1)
+      {
+	if (*tb1 != *tb2)
+	  break;
+      }
+      if (tb2 == e2) // we have a match
+      {
+	return b1;
+      }
+    }
+    return NULL;
+  }
+
+  const char * rfind_fundamental ( const char *rb1, const char *re1,
+				   const char *rb2, const char *re2)
+  {
+    for (; rb1 > re1 ; --rb1)
+    {
+      const char * trb1 = rb1;
+      const char * trb2 = rb2;
+      for (; trb2 > re2 && trb1 > re1; --trb2, --trb1)
+      {
+	if (*trb1 != *trb2)
+	  break;
+      }
+      if (trb2 == re2) // we have a match
+      {
+	return trb1+1;
+      }
+    }
+    return NULL;
+  }
+
+
+} // End namespace
+
+
+
+
+class faststring
+{
+ public:
+  // Shadow the "global" size_t typedef for this class.
+  typedef unsigned long size_t;
+
+  static const size_t npos = -1;
+
+  // Possibly even more efficient:
+  //    Use pointer _end, _capacity_end instead of _len, _capacity
+
+
+ private:
+  char       *_buf;
+  size_t     _len;
+  size_t     _capacity;   // Capacity of container, i.e number of bytes availible
+                           // for writing. If a capacity is requested by the user,
+                           // an additional byte is reserved in order to be able to append
+                           // the additional \0 which is appended by some function calls.
+                           // Consequently, the capacity reported to user is _capacity-1.
+ 
+protected:
+
+ public:
+  ~faststring ()
+  {
+    if (_buf)
+      std::free(_buf);
+  }
+
+  faststring ():_buf(NULL),  _len(0), _capacity(0) // :_len(0), _capacity(a)
+  {
+    //    _buf = NULL(char *)malloc(_MINBUFFER_CAPACITY);
+  }
+
+  faststring (const char *str)
+  {
+    _len      = strlen(str);
+    _capacity = _len+1;
+    _buf      = (char *)malloc(_capacity); 
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    memcpy(_buf, str, _len);
+    
+  }
+
+  faststring (const char *str_begin, const char *str_end)
+  {
+    if (str_end > str_begin)
+    {
+      _len      = str_end - str_begin;
+      _capacity = _len + 1;
+      _buf      = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    } 
+      memcpy(_buf, str_begin, _len);
+    }
+    else
+    {
+      _buf = NULL;
+      _len = _capacity = 0;
+    }
+  }
+
+  faststring (const faststring &a):_len(a._len),_capacity(a._len+1)
+  {
+    if (a._buf == NULL)
+    {
+      _buf = 0;
+      _len = 0;
+      _capacity = 0;
+      return;
+    }
+
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    memcpy(_buf, a._buf, _len);
+  }
+
+ faststring(char c, size_t n=1):_len(n),_capacity(n+1)
+  {
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    size_t i;
+    for (i=0; i<n; ++i)
+      _buf[i] = c;
+  }
+
+ faststring(int i)
+  {
+    _capacity = (size_t)(sizeof(i)*8*.31+3);   // bits * 1/log_2(10) + 3 for ciel and sign and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%d", i);
+    _len = strlen(_buf);
+    //    std::cout << "Capacity: " << _capacity << std::endl;
+  }
+
+ faststring(unsigned i)
+  {
+    _capacity = (size_t)(sizeof(i)*8*.31+3);   // bits * 1/log_2(10) + 3 for ciel and sign and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%u", i);
+    _len = strlen(_buf);
+    //    std::cout << "Capacity: " << _capacity << std::endl;
+  }
+
+ // Prints the unsigned i into the string. The number appears right-justified.
+ // len is the minimum length of the field. If the number needs more digits it well get them.
+ // If the number need less than len digits they will be left padded with the fill char.
+ // Example: Calling constructor with 999, '#', 5 will result in the string "##999", for 999, '#', 2 we get "999". 
+ faststring(unsigned i, char fill, int len)
+  {
+    int num_digits = (i>0) ? ((int) std::log10 ((double)i))+1 : 1; // We take care not to pass 0 to log10  
+
+    _capacity = num_digits+1;
+    if (len >= num_digits)
+      _capacity = len+1;
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%0*u", len, i); // left padded with zeros (0)
+    // Replace left padded zeros with fill char
+
+    size_t pos = 0;
+    size_t e   = _capacity-2;
+    while (pos < e && _buf[pos]=='0')
+    {
+      _buf[pos] = fill;
+      ++pos;
+    }
+    ++e;
+    while (pos < e && _buf[pos] )
+      ++pos;
+    _len = pos;
+    //    std::cout << "Capacity: " << _capacity << std::endl;
+  }
+
+  faststring(long i)
+  {
+    _capacity = (size_t)(sizeof(i)*8*.31+3);   // bits * 1/log_2(10) + 3 for ciel and sign and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%ld", i);
+    _len = strlen(_buf);
+  }
+
+  faststring(unsigned long i)
+  {
+    _capacity = (size_t)(sizeof(i)*8*.31+3);   // bits * 1/log_2(10) + 3 for ciel and sign and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%lu", i);
+    _len = strlen(_buf);
+  }
+
+  faststring(float f, int pres=6)
+  {
+    _capacity = FLT_MAX_10_EXP + pres + 3; // +3 sign, decimal point and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%.*f", pres, f);
+    _len = strlen(_buf);
+  }
+
+  faststring(double f, int pres=14)
+  {
+    _capacity = DBL_MAX_10_EXP + pres + 3; // +3 sign, decimal point and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%.*f", pres, f);
+    _len = strlen(_buf);
+  }
+
+  // In the following function, the parameter bool b is not used directly. It has been introduced to distinguish this variant of the constructor
+  // from the variants declared above.
+  faststring(double f, int pres, bool b)
+  {
+    (void) b;
+
+    _capacity = DBL_MAX_10_EXP + pres + 5; // +5 sign, decimal point, E, sign and \0
+    _buf = (char *)malloc(_capacity);
+    if (_buf == 0)
+    {
+      std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring constructor." << std::endl;
+      exit(-1);
+    }
+    sprintf(_buf, "%.*g", pres, f);
+    _len = strlen(_buf);
+
+    //    std::cerr << "faststring len: " << _len << std::endl;
+  }
+
+  faststring &operator+=(const faststring &s)
+  {
+    this->append(s);
+    return *this;
+  }
+
+  void push_back(char c)
+  {
+    if (_capacity == _len)
+    {
+      if (_buf == 0)
+      {
+	_capacity = _MINBUFFER_CAPACITY;
+	_buf = (char *)malloc(_capacity);
+	if (_buf == 0)
+	{
+	  std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring push_back." << std::endl;
+	  exit(-1);
+	}
+      }
+      else
+      {
+	_capacity <<= 1;
+	_buf = (char *)realloc(_buf, _capacity);
+	if (_buf == 0)
+	{
+	  std::cerr << "Critical error: realloc failed when requesting " << _capacity << " bytes in faststring push_back." << std::endl;
+	  exit(-1);
+	}
+      }
+    }
+    _buf[_len] = c;
+    ++_len;
+  }
+
+
+
+  void pop_back()
+  {
+    if (_len >0)
+      --_len;
+  }
+
+  char get_last()
+  {
+    if (_len >0)
+      return _buf[_len-1];
+    else
+      return '\0';
+  }
+
+  char get_last_and_pop()
+  {
+    if (_len >0)
+    {
+      --_len;
+      return _buf[_len];
+    }
+    else
+      return '\0';
+  }
+
+  // Sometimes strings have to end with a certain character.
+  // If this is present, nothing will be done.
+  // If this is not present, the character will be appended.
+  void ensure_string_ends_with(char c)
+  {
+    if (get_last() != c)
+    {
+      push_back(c);
+    }
+  }
+
+  void ensure_string_does_not_end_with(char c)
+  {
+    while (_len > 0 && get_last() == c)
+    {
+      pop_back();
+    }
+  }
+
+  const char *c_str()
+  {
+    if (_capacity == 0) // We reserve 1 byte for the empty cstring.
+    {
+      _capacity = 1;
+      _len = 0;
+      _buf      = (char *)malloc(_capacity);
+      if (_buf == 0)
+      {
+	std::cerr << "Critical error: malloc failed when requesting " << _capacity << " bytes in faststring c_str()." << std::endl;
+	exit(-1);
+      }
+      *_buf = '\0';
+      return _buf;
+    }
+
+    if (_capacity == _len)
+    {
+      ++_capacity;
+      _buf = (char *)realloc(_buf, _capacity);
+    }
+
+    //  if (_buf[_len] == '\0')
+    //    return _buf;
+
+    _buf[_len] = '\0';
+    return _buf;
+  }
+
+
+  char *begin() const
+  {
+    return _buf;
+  }
+
+  char *begin_str() const
+  {
+    return _buf;
+  }
+
+  char *data() const
+  {
+    return _buf;
+  }
+
+  char *end() const
+  {
+    return _buf+_len;
+  }
+
+  char *end_str() const
+  {
+    return _buf+_len;
+  }
+
+  char *rbegin() const
+  {
+    return _buf+_len-1;
+  }
+
+
+  char *rend() const
+  {
+    return _buf-1;
+  }
+
+  bool empty() const
+  {
+    return (_len == 0);
+  }
+
+  void reverse()
+  {
+    char *i1, *i2;
+    char c;
+
+    i1 = begin();
+    i2 = rbegin();
+
+    while (i1<i2)
+    {
+      c = *i1;
+      *i1 = *i2;
+      *i2 = c;
+      ++i1;
+      --i2;
+    }
+  }
+
+
+  //=================================================
+  // assign family:
+  //=================================================
+  // string& assign ( const string& str );
+  // string& assign ( const string& str, size_t pos, size_t n );
+  // string& assign ( const char* s, size_t n );
+  // string& assign ( const char* s );
+  // string& assign ( size_t n, char c );
+  // template <class InputIterator>
+  //   string& assign ( InputIterator first, InputIterator last );
+
+  faststring& assign(const char *str)
+  {
+    _len = strlen(str);
+    reserve(_len);
+    memcpy(_buf, str, _len);
+    return *this;
+  }
+
+  // n is the maximum number of chars that will be assigned.
+  faststring& assign(const char *str, size_t n)
+  {
+    _len = n;
+    size_t ll = strlen(str);
+    if (_len > ll)  // if n > ll, we have to reduce _len to ll
+      _len = ll;
+    reserve(_len);
+    memcpy(_buf, str, _len);
+    return *this;
+  }
+
+  faststring& assign(const char *str_begin, const char *str_end)
+  {
+    if (str_end > str_begin)
+    {
+      _len = str_end - str_begin;
+      reserve(_len);
+      memcpy(_buf, str_begin, _len);
+    }
+    else
+    {
+      clear();
+    }
+    return *this;
+  }
+
+  faststring& assign(const faststring &str)
+  {
+    _len = str._len;
+    reserve(_len);
+    memcpy(_buf, str._buf, _len);
+    return *this;
+  }
+
+  faststring& assign(const faststring &str, size_t pos, size_t n=npos )
+  {
+    if (n == npos || n+pos > str._len)
+      n = str._len-pos;
+    _len = n;
+    reserve(_len+1);
+    memcpy(_buf, str._buf+pos, n);
+    return *this;
+  }
+
+  // Could be made more efficient. TODO
+  faststring& assign( size_t n, char c )
+  {
+    erase();
+    reserve(n);
+    size_t i;
+    for (i=0; i<n; ++i)
+      push_back(c);
+    return *this;  
+  }
+  
+
+
+
+   //=================================================
+   // The family of append functions:
+   //=================================================
+  // basic_string& append(const basic_string& s)	basic_string	 Append s to *this.
+  // basic_string& append(const basic_string& s, 
+  //                      size_type pos, size_type n)
+  // basic_string	 Append a substring of s to *this.
+  // basic_string& append(const charT* s)	basic_string	 Append s to *this.
+  // basic_string& append(const charT* s, size_type n)	basic_string	 Append the first n characters of s to *this.
+  // basic_string& append(size_type n, charT c)	basic_string	 Append n copies of c to *this.
+  // template <class InputIterator>
+  // basic_string& append(InputIterator first, InputIterator last)
+  // basic_string	 Append a range to *this.
+
+
+  // step imp-fin
+  faststring& append(const char *s)
+  {
+    int old_len = _len;
+    int s_len   = strlen(s);
+    int new_len = old_len + s_len;
+
+    _len = new_len;
+
+    reserve(new_len);
+    memcpy(_buf+old_len, s, s_len);
+    return *this;
+  }
+
+  // step imp-fin
+  faststring& append(const faststring &s)
+  {
+    int old_len = _len;
+    int s_len   = s._len;
+    int new_len = old_len + s_len;
+
+    _len = new_len;
+
+    reserve(new_len);
+    memcpy(_buf+old_len, s._buf, s_len);
+    return *this;
+  }
+
+  // step imp-fin
+  faststring& append(const faststring& s, size_t pos, size_t n=npos)
+  {
+    if (n==npos || pos+n > s.length() )
+      n = s.length()-pos;
+
+    int old_len = _len;
+    int new_len = old_len + n;
+
+    _len = new_len;
+
+    reserve(new_len);
+    memcpy(_buf+old_len, s._buf+pos, n);
+    return *this;
+  }
+
+  // step imp-fin
+  faststring& append(const char* s, size_t n)
+  {
+    int old_len = _len;
+    int new_len = old_len + n;
+
+    _len = new_len;
+
+    reserve(new_len);
+    memcpy(_buf+old_len, s, n);
+    return *this;
+  }
+
+  // step imp-fin
+  faststring& append(size_t n, char c)
+  {
+    size_t old_len = _len;
+    size_t new_len = old_len + n;
+
+    reserve(new_len);
+    size_t i;
+    for (i=0; i<n; ++i)
+      push_back(c);
+    return *this;  
+  }
+
+  // step imp-fin
+  faststring& append(const char * first_it, const char * end_it)
+  {
+    size_t old_len = _len;
+    size_t n       = end_it-first_it;
+    size_t new_len = old_len + n;
+
+    _len = new_len;
+
+    reserve(new_len);
+    memcpy(_buf+old_len, first_it, n);
+    return *this;  
+  }
+
+
+
+   //---------------------------------------
+   // Side effects:  Invalidates pointers.
+   //---------------------------------------
+  void reserve(size_t s)
+  {
+    if (_capacity >= s)
+      return;
+
+    ++s;   // Reserve one more char in case we have to append a \0 at end of string later.
+           // Well this could be seen as a wast of memory.
+    if (_buf == NULL)
+    {
+      _buf = (char *)malloc(s);
+      if (_buf == 0)
+      {
+	std::cerr << "Critical error: Trying again to malloc " << s << " bytes in faststring reserve()." << std::endl;
+	_buf = (char *)malloc(s);
+      }
+      if (_buf == 0)
+      {
+	std::cerr << "Critical error: malloc failed when requesting " << s << " bytes in faststring reserve()." << std::endl;
+	exit(-1);
+      }
+    }
+    else
+    {
+      _buf = (char *)realloc(_buf, s);
+      if (_buf == 0)
+      {
+	std::cerr << "Critical error: realloc failed when requesting " << s << " bytes in faststring reserve()." << std::endl;
+	exit(-1);
+      }
+    }
+    _capacity = s;
+  }
+
+
+
+  // Returns the part of the string following the last occurence of delim.
+  // If the character does not occur, the full string is returned.
+  // The second parameter can be used to specifiy a minimum number of characters that need to
+  // be found before the extension. fpos_minimum == 1: The extension cannot start at index 0.
+  faststring get_string_extension_or_all(char delim, size_t fpos_minimum = 0)
+  {
+    size_t fpos = this->rfind(delim);
+
+    if (fpos < fpos_minimum)
+      fpos = npos;
+
+    if (fpos == npos)
+      return *this;
+    else
+    {
+      faststring res(this->begin()+fpos+1, this->end());
+      return res;
+    }    
+  }
+
+  // Returns the part of the string following the last occurence of delim.
+  // If the character does not occur, the empty string is returned.
+  // The second parameter can be used to specifiy a minimum number of characters that need to
+  // be found before the extension. fpos_minimum == 1: The extension cannot start at index 0.
+  faststring get_string_extension(char delim, size_t fpos_minimum = 0)
+  {
+    size_t fpos = this->rfind(delim);
+
+    if (fpos < fpos_minimum)
+      fpos = npos;
+
+    if (fpos == npos)
+      return faststring();
+    else
+    {
+      faststring res(this->begin()+fpos+1, this->end());
+      return res;
+    }
+  }
+
+
+  // Returns the part of the string before the last occurence of delim.
+  // If the character does not occur, the empty string is returned.
+  // The second parameter can be used to specifiy a minimum number of characters that need to
+  // be found before the extension. fpos_minimum == 1: The extension cannot start at index 0.
+  faststring get_string_before_extension(char delim, size_t fpos_minimum = 0)
+  {
+    size_t fpos = this->rfind(delim);
+
+    if (fpos < fpos_minimum)
+      fpos = npos;
+
+    if (fpos == npos)
+      return faststring();
+    else
+    {
+      faststring res(this->begin(), this->begin()+fpos);
+      return res;
+    }    
+  }
+
+  // Returns the part of the string before the last occurence of delim.
+  // If the character does not occur, the full string is returned.
+  // The second parameter can be used to specifiy a minimum number of characters that need to
+  // be found before the extension. fpos_minimum == 1: The extension cannot start at index 0.
+  faststring get_string_before_extension_or_all(char delim, size_t fpos_minimum = 0)
+  {
+    size_t fpos = this->rfind(delim);
+
+    if (fpos < fpos_minimum)
+      fpos = npos;
+
+    if (fpos == npos)
+      return *this;
+    else
+    {
+      faststring res(this->begin(), this->begin()+fpos);
+      return res;
+    }    
+  }
+
+
+  // Filename functions:
+  // Depricated: should be removed soon. Wrong name.
+  faststring filename_base()
+  {
+    faststring res(*this);
+    res.shorten(res.rfind('.'));
+    return res;
+  }
+
+  faststring filename_dirname_and_basename()
+  {
+    faststring res = filename_dirname();
+    res += "/";
+    res += filename_basename();
+    return res;
+  }
+
+  // Acts like the linux command does, but accepts only one argument.
+  faststring filename_basename()
+  {
+    if (size() == 0) // If string is empty before removing anything we return ".".
+      return ".";
+
+    faststring tmp = *this;
+    tmp.removeSpacesBack(" /"); // Removes trailing spaces and "/" characters
+
+    if (tmp.size() == 0) // Note: Multiple //// are collapsed to "/"
+      return "/";
+
+    faststring res = tmp.get_string_extension_or_all('/');
+    return res;
+  }
+
+  // Acts like the linux command does, but accepts only one argument.
+  faststring filename_dirname()
+  {
+    if (size() == 0) // If string is empty before removing anything we return ".".
+      return ".";
+
+    faststring tmp = *this;
+    tmp.removeSpacesBack(" /"); // Removes trailing spaces and "/" characters
+
+    if (tmp.size() == 0) // Note: Multiple //// are collapsed to "/"
+      return "/";
+
+    faststring before_delim = tmp.get_string_before_extension('/');
+
+    if (before_delim.empty() )
+    {
+      if (tmp[0] == '/')  // Example: /usr -> dirname must be "/". If the only / is the root, this is the dirname
+	return "/";
+
+      return ".";
+    }
+    return before_delim;
+  }
+
+
+  // Depricated. - Replaced by filename_dirname() which mimics the dirname command in linux much better.
+  faststring filename_path()
+  {
+    faststring res(*this);
+    size_t fpos = res.rfind('/');
+
+    if (fpos == npos)
+      return ".";
+    else
+    {
+      res.shorten(fpos);
+      return res;
+    }
+  }
+
+  faststring filename_basename_without_extension()
+  {
+    faststring tmp  = filename_basename();
+    return tmp.get_string_before_extension_or_all('.',1);
+  }
+
+  faststring filename_dirname_and_basename_without_extension()
+  {
+    faststring tmp  = filename_dirname();
+    tmp += "/";
+    tmp += filename_basename_without_extension();
+    return tmp;
+  }
+
+
+
+  // Returns the last part of the filename, i.e. the part after the last relevant "/".
+  // If this sting contains the basename this is the base name with extension.
+  // If the string ends with a directory, this is the directory.
+  // Some special cases are catched.
+  // Depricated and replaced by the filename_basename function.
+
+/*   faststring filename_FileOrDirName() */
+/*   { */
+/*     unsigned fpos = this->rfind('/'); */
+
+/*     if (fpos == npos) */
+/*       return *this; */
+/*     else */
+/*     { */
+/*       faststring res(this->begin()+fpos+1, this->end()); */
+/*       return res; */
+/*     } */
+/*   } */
+
+  faststring filename_extension()
+  {
+    // If we do not restrict the search to the basename, dots in the path can cause problems
+    // if the file does not have a file extension.
+    faststring tmp = filename_basename();
+    return tmp.get_string_extension('.', 1);
+  }
+
+  // END filename functions
+
+  // Searches the string backwards for delim. Divides the string at delim if delim is found in backward direction
+  // before break_at. So if in forward direction delim occurs only before break_at or if delim does not occur, the 
+  // string cannot be divided in the requested way. In this case pre gets the string und post is empty.
+
+  bool backwards_search_divide_at_break_at(char delim, char break_at, faststring &pre, faststring &post) const
+  {
+    size_t len = length();
+    size_t i = len-1;
+    int    mode = 0;
+
+    while (i > 0)
+    {
+      if (get_unckecked(i) == delim) // Yea, we found delim behind any occurence of break_at
+      {
+	mode = 2;
+	break;
+      }
+      if (get_unckecked(i) == break_at) // We could not find the delim before break_at, so we have to stop.
+      {
+	mode = 1;
+	break;
+      }
+
+      --i;
+    }
+
+    if (mode == 2)
+    {
+      pre  = substr(0, i);
+      post = substr(i+1, npos);
+      return true;
+    }
+    else // if mode == 0 or 1
+    {
+      pre = *this;
+      post = "";
+      return false;
+    }
+  }
+
+  bool divide_at(char delim, faststring &pre, faststring &post) const
+  {
+    size_t pos = find(delim,0);
+    if (pos == npos)
+      return false;
+    post = substr(pos+1, npos);
+    pre  = substr(0, pos);
+    return true;
+  }
+
+  bool divide_at_first_of(const char *delims, faststring &pre, faststring &post) const
+  {
+    size_t pos = find_first_of(delims,0);
+    if (pos == npos)
+      return false;
+    post = substr(pos+1, npos);
+    pre  = substr(0, pos);
+    return true;
+  }
+
+  bool divide_at_last_of(const char *delims, faststring &pre, faststring &post) const
+  {
+    size_t pos = find_last_of(delims);
+    if (pos == npos)
+      return false;
+    post = substr(pos+1, npos);
+    pre  = substr(0, pos);
+    return true;
+  }
+
+  bool divide_at(faststring delim, faststring &pre, faststring &post) const
+  {
+    size_t pos = find(delim,0);
+    if (pos == npos)
+      return false;
+    post = substr(pos+delim.size(), npos);
+    pre  = substr(0, pos);
+    return true;
+  }
+
+  size_t size() const
+  {
+    return _len;
+  }
+
+  size_t length() const
+  {
+    return _len;
+  }
+
+  size_t capacity() const
+  {
+    return _capacity; // One char is reserved for the \0 at end of string
+  }
+
+  void set_unckecked(size_t pos, char c)
+  {
+    _buf[pos] = c;
+  }
+
+  bool check_pos(size_t pos)
+  {
+    return (pos < _len);
+  }
+
+  bool set(size_t pos, char c)
+  {
+    if ( check_pos(pos) )
+    {
+      _buf[pos] = c;
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+
+  void get_unckecked(size_t pos, char &c) const
+  {
+    c = _buf[pos];
+  }
+
+  char get_unckecked(size_t pos) const
+  {
+    return _buf[pos];
+  }
+
+  char & at(size_t pos)
+  {
+    return _buf[pos];
+  }
+
+  bool get(size_t pos, char &c)
+  {
+    if ( check_pos(pos) )
+    {
+      c = _buf[pos];
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+
+  faststring& ToLower()
+  {
+    tolower();
+    return *this;
+  }
+
+  faststring& ToUpper()
+  {
+    toupper();
+    return *this;
+  }
+
+  void toupper()
+  {
+    char *b = begin();
+    char *e = end();
+
+    while (b != e)
+    {
+      *b = std::toupper(*b);
+      ++b;
+    }
+  }
+
+  void erase_front(size_t n)
+  {
+    if (n>0)
+    {
+      if (n > _len)
+      {
+	_len = 0;
+	return;
+      }
+      else
+      {
+	_len -=n;
+      }
+      memmove(_buf, _buf+n, _len);
+    }
+  }
+
+  void erase_back(size_t n)
+  {
+    if (n > _len)
+      _len = 0;
+    else
+      _len -= n;
+  }
+
+  void tolower()
+  {
+    char *b = begin();
+    char *e = end();
+
+    while (b != e)
+    {
+      *b = std::tolower(*b);
+      ++b;
+    }
+  }
+
+  void shorten(size_t new_len)
+  {
+    _len = macromin(_len, new_len);
+  }
+
+  void shorten_to_first_occurrence_of(char c)
+  {
+    size_t pos = find(c,0);
+    shorten(pos);
+  }
+
+  // See also resize for a different version of this function.
+  // Appends multiple characters to fill the string if it is shorter than wanted. 
+   void fill_if_shorter ( size_t n, char c )
+   {
+     if (n <= _len)
+       return;
+     append(n-_len,c);
+   }
+
+  faststring &operator=(const faststring &a)
+  {
+    _len = a._len;
+
+    //    std::cerr << "_len: " << _len << std::endl;
+
+    reserve(_len+1);
+    memcpy(_buf, a._buf, _len);
+    return *this;
+  }
+
+  friend bool operator==(const faststring &a, const faststring &b)
+  {
+    if (a._len != b._len)
+      return false;
+    return (strncmp(a._buf, b._buf, a._len) == 0);
+  }
+
+  friend bool operator!=(const faststring &a, const faststring &b)
+  {
+    if (a._len != b._len)
+      return true;
+    return (strncmp(a._buf, b._buf, a._len) != 0);
+  }
+
+  // Has been corrected in 03.2011
+  friend bool operator<(const faststring &a, const faststring &b)
+  {
+    int l   =  macromin(a._len, b._len );
+    //     int res =  (strncmp(a._buf, b._buf, l) < 0);
+    short res =  strncmp(a._buf, b._buf, l);
+
+    if (res == 0)
+      return (a._len < b._len );
+    //     return res; // Was wrong in ealier versions.
+    return (res < 0);
+  }
+
+  // Caution: strcmp assumes \0 terminated strings.
+  //          Since we do not have \0 terminated strings we
+  //          use strncmp with n such that we do not pass the ends
+  //          of the strings.
+  friend int fstrcmp(const faststring &a, const faststring &b)
+  {
+    int   l   =  macromin(a._len, b._len );
+    short res =  strncmp(a._buf, b._buf, l);
+
+    if (res == 0)  // We only compared the first l chars.
+    {
+      if (a._len < b._len)
+	return -1;
+      if (a._len > b._len)
+	return 1;
+      return 0;
+    }
+    return res;
+  }
+
+  friend int fstrncmp(const faststring &a, const faststring &b, int n)
+  {
+    int   l   = macromin(a._len, b._len );
+    int   m   = macromin(l, n);
+
+    short res =  strncmp(a._buf, b._buf, m);
+
+    // We do not have \0 terminated strings, so we have to restrict the initial
+    // comparisson to the length m.
+
+    // If n is larger than the length of any of the two strings
+    // we need to check the lengths.
+
+    if (n <= l)   // If n is smaller or equal to the shorter string, we have a result.
+      return res; // This can be <,>, ==
+    // else // if n > l
+
+    // In this case, n is larger than one of the two string lengths or larger than both.
+    // Still in this case we could have res!=0 among the first m string positions.
+    // If res!=0, this is the result.
+  
+    if (res != 0)
+      return res;
+
+    // else if res == 0, the two strings are equal among the first m positions
+    // and thus they are equal over the whole length of the shorter string.
+
+    // If n is larger than both strings, the longer string is greater.
+    // If n is larger than only one string, the longer string is greater.
+    // => in all cases the shorter string is less.
+    //    if lengths are equal, we have to return 0
+
+    if (a._len < b._len)
+      return -1;
+    if (a._len > b._len)
+      return 1;
+    return 0;
+  }
+
+
+  // Has been corrected in 03.2011
+  friend bool operator>(const faststring &a, const faststring &b)
+  {
+    int l   =  macromin(a._len, b._len );
+    //    int res =  (strncmp(a._buf, b._buf, l) > 0);
+    short res =  strncmp(a._buf, b._buf, l);
+    
+    if (res == 0)
+      return (a._len > b._len );
+    return (res > 0);
+    //    return res; // Was wrong in ealier versions.
+  }
+
+  void removeSpacesFront(const char* delims="\r\n\t\v\f ")
+   {
+     size_t i;
+
+     for (i=0; i < _len && is_in_symbol_list__(_buf[i], delims); ++i)
+     {}
+     erase_front(i);
+   }
+
+
+   void removeSpacesBack(const char* delims="\r\n\t\v\f ")
+   {
+     size_t i;
+     size_t n_renomve=0;
+
+     if (_len > 0)
+     {
+       for (i=_len-1; is_in_symbol_list__(_buf[i], delims); --i)
+       {
+	 ++n_renomve;
+	 if (i==0)
+	   break;
+       }
+       erase_back(n_renomve);
+     }
+   }
+
+   void removeSpaces(const char* delims="\r\n\t\v\f ")
+   {
+     char *i, *j, *e;
+     e = end();
+     i = begin();
+
+     // Skip symbols we do not remove
+     while (i != e && !is_in_symbol_list__(*i, delims))
+       ++i;
+
+     if (i == e) // Nothing was done.
+       return;
+
+     j = i;
+     ++i;
+
+     while (i != e)
+     {
+       if (is_in_symbol_list__(*i, delims)) // remove this
+       {
+	 ++i;
+       }
+       else
+       {
+	 *j = *i;
+	 ++i;
+	 ++j;
+       }
+     }
+     _len -= i-j;
+   }
+
+
+   void remove_symbol(char c)
+   {
+     char *i, *j, *e;
+     e = end();
+     i = begin();
+
+     // Skip symbols we do not remove
+     while (i != e && *i != c)
+       ++i;
+
+     if (i == e) // Nothing was done.
+       return;
+
+     j = i;
+     ++i;
+
+     while (i != e)
+     {
+       if (*i == c) // remove this
+       {
+	 ++i;
+       }
+       else
+       {
+	 *j = *i;
+	 ++i;
+	 ++j;
+       }
+     }
+     _len -= i-j;
+   }
+
+
+   size_t count_symbol(char sym) const
+   {
+     size_t res=0;
+     const char *pos_it = begin();
+     const char *end_it = end();
+
+     while (pos_it != end_it)
+     {
+       if (*pos_it == sym)
+	 ++res;
+
+       ++pos_it;
+     }
+     return res;
+   }
+
+   void skip_symbols(size_t &pos, const char* delims="\r\n\t\v\f ") const
+   {
+     const char *theend = end();
+     const char *it=begin()+pos;
+
+     while (it != theend && is_in_symbol_list__(*it, delims) )
+       ++it;
+     pos = it-begin();
+   }
+
+
+   void skip_symbol(size_t &pos, char c) const
+   {
+     const char *theend = end();
+     const char *it=begin()+pos;
+
+     while (it != theend && *it == c)
+       ++it;
+     pos = it-begin();
+   }
+  
+
+
+   void skip_spaces(size_t &pos) const
+   {
+     skip_symbols(pos);
+   }
+
+   void replace_char(char origChar, char newChar)
+   {
+           char *pos_it = begin();
+     const char *end_it = end();
+
+     while (pos_it != end_it)
+     {
+       if (*pos_it == origChar)
+	 *pos_it = newChar;
+       ++pos_it;
+     }
+   }
+
+
+/*----------------------------------------------------------------------------------------------------------------------
+|	Shortens stored string to n - 3 characters, setting the last three characters "...". If string is already <=
+|	n characters in length, this function has no effect. This is useful when it is desirable to show some of the
+|	contents of a string, even when the string will not fit in its entirety into the space available for displaying it.
+|*/
+   faststring& ShortenTo(size_t n)
+   {
+     if (n <= 3 || _len <= n )
+       return *this;
+
+     // _len > n && n>3 now:
+     _len = n;
+     _buf[n-1] = '.';
+     _buf[n-2] = '.';
+     _buf[n-3] = '.';
+     return *this;
+   }
+   
+   // TODO: Use pointers to make this more efficient.
+   bool isADouble() const
+   {
+     size_t i=0;
+
+     bool hasDigits    = false;
+     bool hasExp       = false;
+     bool hasExpDigits = false;
+
+     while (i< _len && isspace(_buf[i]))
+       ++i;
+
+     // I am not sure this line makes it more efficient
+     //     if (i >= _len)
+     //       return false;
+
+     if (i < _len && (_buf[i] == '-' || _buf[i] == '+') )
+       ++i;
+
+     while (i < _len && isdigit(_buf[i]) )
+     {
+       ++i;
+       hasDigits = true;
+     }
+
+     if (i < _len && _buf[i] == '.')
+       ++i;
+
+     while (i < _len && isdigit(_buf[i]) )
+     {
+       ++i;
+       hasDigits = true;
+     }
+
+     if ( i < _len && (_buf[i] == 'e' || _buf[i] == 'E') )
+     {
+       hasExp = true;
+       ++i;
+     }
+
+     while (i < _len && isdigit(_buf[i]) )
+     {
+       ++i;
+       hasExpDigits = true;
+     }
+
+     while (i < _len && isspace(_buf[i]) )
+       ++i;
+
+     // We passed all characters that could be interpreted as part of the double number.
+     // If we have not reached the end of the string, the string contains characters that are not
+     // part of a double number. If this is the case we return false.
+     if (i < _len) 
+       return false;
+
+     if (hasDigits)
+     {
+       if (hasExp && hasExpDigits)
+	 return true;
+       if (!hasExp && !hasExpDigits)
+	 return true;
+       return false;
+     }
+     else
+       return false;
+   }
+
+   // TODO: Use pointers to make this more efficient.
+   bool isAnInt() const
+   {
+     size_t i=0;
+     bool hasDigits = false;
+     
+     while (i < _len  && _buf[i] == ' ')
+       ++i;
+
+     if (i < _len && (_buf[i] == '-' || _buf[i] == '+') ) 
+       ++i;
+    
+     while (i < _len && isdigit(_buf[i]))
+     {
+       ++i;
+       hasDigits = true;
+     }
+
+     while (i < _len && _buf[i] == ' ')
+       ++i;
+
+     if (i < _len)
+       return false;
+     else
+       if (hasDigits)
+	 return true;
+       else
+	 return false;
+   }
+
+   bool isAnUnsigned() const
+   {
+     size_t i=0;
+     bool hasDigits = false;
+     
+     while (i < _len && _buf[i] == ' ')
+       ++i;
+
+     if (i < _len && _buf[i] == '+')
+       ++i;
+    
+     while (i < _len && isdigit(_buf[i]))
+     {
+       ++i;
+       hasDigits = true;
+     }
+
+     while (i < _len && _buf[i] == ' ')
+       ++i;
+
+     if (i < _len)
+       return false;
+     else
+       if (hasDigits)
+	 return true;
+       else
+	 return false;
+   }
+   
+   //---------------------------------------
+   // Side effects:  Invalidates pointers.
+   //---------------------------------------
+   faststring &AddQuotes(char quote_char = '\'')
+   {
+     reserve(_len + 2);
+     memmove(_buf+1, _buf, _len);
+     _buf[0]      = quote_char;
+     _buf[_len+1] = quote_char;
+     _len += 2;
+
+     return *this;
+   }
+
+   void consume(faststring &s)
+   {
+     _capacity = s._capacity;
+     _len      = s._len;
+     _buf      = s._buf;
+
+     s._buf = NULL;
+     s._capacity = s._len = 0;
+   }
+
+   void swap(faststring &s)
+   {
+      char       *tmp_buf      = _buf;
+      size_t      tmp_len      = _len;
+      size_t      tmp_capacity = _capacity;
+
+      _buf      = s._buf;
+      _len      = s._len;
+      _capacity = s._capacity;
+
+      s._buf      = tmp_buf;
+      s._len      = tmp_len;
+      s._capacity = tmp_capacity;
+   }
+
+
+   faststring &doubleChar(char c)
+   {
+     faststring tmp;
+     
+     size_t count_c = count_symbol(c);
+
+     if (count_c > 0)
+     {
+       tmp.reserve(_len + count_c);
+       
+       size_t i;
+       size_t j;
+       for (i=0, j=0; i<_len; ++i, ++j)
+       {
+	 if (c == (tmp._buf[j] = _buf[i]) )
+	 {
+	   ++j;
+	   tmp._buf[j] = _buf[i];
+	 }
+       }
+       tmp._len = _len + count_c;
+
+       consume(tmp);
+     }
+     return *this;
+   }
+
+
+   int PrintF(const char *format, ...)
+   {
+     char *tmp;
+
+     // Create and initialize list of optional arguments: 
+     va_list argList;
+
+#ifndef WIN32
+     va_start(argList, format);
+     int N = vasprintf(&tmp, format, argList);
+     va_end(argList);
+#else // In case we are on a WIN32 machine 
+     va_start(argList, format);
+     tmp = new char [5000];
+     int N = vsnprintf(tmp, 5000, format, argList);
+     va_end(argList);
+#endif
+     _buf = tmp;
+     _capacity = N+1;
+     _len = N;
+     return N;
+   }
+
+
+   // Convert to unsigned long
+   unsigned ToUnsigned()
+   {
+     char *end;
+     return strtoul(c_str(), &end, 0);
+   }
+
+   // Make sure you check errno yourself
+   unsigned	ToUnsigned(size_t  beg_pos,
+			   size_t& end_pos)
+   {
+     const char     *beg = c_str()+beg_pos;
+           char     *end;
+           unsigned result;
+
+     //     errno = 0;
+     result  = strtoul(beg, &end, 0);
+     //     if (errno != 0)
+     //     {
+     //       std::cerr << "Parse error in ToUnsigned." << std::endl;
+     //     }
+     end_pos = end-begin_str();
+     return result;
+   }
+
+
+
+   // Convert to unsigned long
+   unsigned long ToUnsignedLong()
+   {
+     char *end;
+     return strtoul(c_str(), &end, 0);
+   }
+
+   // Convert to int
+   int ToInt()
+   {
+     char *end;
+     return strtol(c_str(), &end, 0);
+   }
+
+   // Convert to long
+   long ToLong()
+   {
+     char *end;
+     return strtol(c_str(), &end, 0);
+   }
+
+   long	ToLong(size_t  beg_pos,
+	       size_t& end_pos)
+   {
+     const char   *beg = c_str()+beg_pos;
+           char   *end;
+           long   result;
+
+     result  = strtol(beg, &end, 0);
+     end_pos = end-c_str();
+     return result;
+   }
+
+
+   // Convert to double
+   double ToDouble()
+   {
+     char *end;
+     return strtod(c_str(), &end);
+   }
+
+   double ToDouble(size_t  beg_pos,
+		   size_t& end_pos)
+   {
+     const char   *beg = c_str()+beg_pos;
+           char   *end;
+           double result;
+
+     result  = strtod(beg, &end);
+     end_pos = end-c_str();
+     return result;
+   }
+
+   double ToDouble(size_t pos,
+		   char **end)
+   {
+     double result;
+
+     result  = strtod(_buf+pos, end);
+     return result;
+   }
+
+
+   bool EqualsCaseSensitive(const faststring &s)
+   {
+     if (_len != s._len)
+       return false;
+
+    return (strncmp(_buf, s._buf, _len) == 0);
+   }
+
+   bool EqualsCaseInsensitive(const faststring &s) const
+   {
+     if (_len != s._len)
+       return false;
+
+     faststring a(*this);
+     faststring b(s);
+
+     a.tolower();
+     b.tolower();
+
+    return (strncmp(a._buf, b._buf, _len) == 0);
+   }
+
+   //=================================================
+   // The family of compare functions:
+   //=================================================
+   // int compare ( const string& str ) const;
+   // int compare ( const char* s ) const;
+   // int compare ( size_t pos1, size_t n1, const string& str ) const;
+   // int compare ( size_t pos1, size_t n1, const char* s) const;
+   // int compare ( size_t pos1, size_t n1, const string& str, size_t pos2, size_t n2 ) const;
+   // int compare ( size_t pos1, size_t n1, const char* s, size_t n2) const;
+   // ------------------------------------------------- all implemented
+
+   // Result: >: +1, <: -1, == 0
+   int compare(const faststring &s)
+   {
+     size_t l = macromin(_len, s._len);
+     int    res = strncmp(_buf, s._buf, l);
+
+     if (res != 0)
+       return res;
+
+     if (_len == s._len)
+       return 0;
+     else
+       return (int)(_len > s._len);
+   }
+
+   // Result: >: +1, <: -1, == 0
+   int compare(const char *s)
+   {
+     size_t   s_len = strlen(s);
+     size_t   l     = macromin(_len, s_len);
+     int      res   = strncmp(_buf, s, l);
+
+     if (res != 0)
+       return res;
+
+     if (_len == s_len)
+       return 0;
+     else
+       return (int)(_len > s_len);
+   }
+
+
+   // Result: >: +1, <: -1, == 0
+   int compare(const char *t1, const char*t2, const char *s1, const char *s2)
+   {
+     // Out of range check:
+     if (t1 > t2 || s1 > s2)
+       return -2;
+
+     if (t1 < _buf || t2 > _buf+_len)
+       return -3;
+
+     return compare_unchecked(t1,t2, s1, s2);
+   }
+
+
+   int compare ( size_t pos1, size_t n1, const faststring& str ) const
+   {
+     if (pos1 > _len || pos1 + n1 > _len)
+       return -3;
+
+     return compare_unchecked(_buf+pos1, _buf+pos1+n1, str._buf, str._buf+str._len);
+   }
+
+   int compare ( size_t pos1, size_t n1, const char* s) const
+   {
+    if (pos1 > _len || pos1 + n1 > _len)
+       return -3;
+
+    const char *e = s + strlen(s);
+
+    return compare_unchecked(_buf+pos1, _buf+pos1+n1, s, e);
+   }
+
+   int compare ( size_t pos1, size_t n1, const faststring& str, size_t pos2, size_t n2 ) const
+   {
+     if (pos1 > _len || pos1 + n1 > _len)
+       return -3;
+     if (pos2 > str._len || pos2 + n2 > str._len)
+       return -4;
+
+     return compare_unchecked(_buf+pos1, _buf+pos1+n1, str._buf+pos2, str._buf+pos2+n2);
+   }
+
+   int compare ( size_t pos1, size_t n1, const char* s, size_t n2) const
+   {
+     size_t s_len = strlen(s);
+
+     if (pos1 > _len || pos1 + n1 > _len)
+       return -3;
+     if (n2 > s_len)
+       return -4;
+
+     return compare_unchecked(_buf+pos1, _buf+pos1+n1, s, s+n2);
+   }
+
+
+   // Result: >: +1, <: -1, == 0
+   int compare_unchecked(const char *t1, const char*t2, const char *s1, const char *s2) const
+   {
+     size_t t_len = t2-t1; 
+     size_t s_len = s2-s1; 
+
+     size_t l = macromin(t_len, s_len);
+     int    res = strncmp(t1, s1, l);
+
+     if (res != 0)
+       return res;
+
+     if (t_len == s_len)
+       return 0;
+     else
+       return (int)(t_len > s_len);
+   }
+
+
+   unsigned char * p_str(unsigned char *buffer) const // 
+   {
+     if (_len > 255)
+     {
+       *buffer = '\0';
+       return 0;
+     }
+
+     memcpy(buffer+1, _buf, _len);
+     buffer[0] = _len;
+     return buffer;
+   }
+
+   void AsBinary(unsigned long l)
+   {
+     short bits = sizeof(l)*8;
+     reserve(bits);
+     _len = bits;
+
+     short i;
+     for (i=_len-1; i >= 0; --i)
+     {
+       // is l odd
+       _buf[i] = (char)((char)(l%2)+'0');
+       l/=2;
+     }
+   }
+
+   void AsBinary(unsigned long l, unsigned digits)
+   {
+     reserve(digits);
+     _len = digits;
+
+     short i;
+     for (i=_len-1; i >= 0; --i)
+     {
+       // is l odd
+       _buf[i] = (char)((char)(l%2)+'0');
+       l/=2;
+     }
+   }
+
+
+   void AsHex(unsigned long l)
+   {
+     short hexes = sizeof(l)*2;
+     char remainder;
+
+     reserve(hexes);
+     _len = hexes;
+
+     short i;
+     for (i=_len-1; i >= 0; --i)
+     {
+       remainder = l%16;
+
+       if (remainder < 10)
+	 _buf[i] = remainder+'0';
+       else
+       {
+	 _buf[i] = remainder+55;
+       }
+       l /= 16;
+     }
+   }
+
+   void AsHex(unsigned long l, unsigned digits)
+   {
+     char remainder;
+
+     reserve(digits);
+     _len = digits;
+
+     short i;
+     for (i=_len-1; i >= 0; --i)
+     {
+       remainder = l%16;
+
+       if (remainder < 10)
+	 _buf[i] = remainder+'0';
+       else
+       {
+	 _buf[i] = remainder+55;
+       }
+       l /= 16;
+     }
+   }
+
+   faststring substr(size_t pos, size_t n=npos) const
+   {
+     const char * b = _buf+pos;
+     const char * e = _buf+pos+n;
+
+     if (b > _buf+_len)
+       b = _buf+_len;
+
+     if (n==npos || e > _buf+_len)
+     {
+       e = _buf+_len;
+     }
+     
+     faststring res(b, e);
+     return res;
+   }
+   
+   //=================================================
+   // The family of erase functions:
+   //=================================================
+   // string& erase ( size_t pos = 0, size_t n = npos );
+   // iterator erase ( iterator position );
+   // iterator erase ( iterator first, iterator last );
+   // ------------------------------------------------- all implemented
+
+   faststring &erase ( size_t pos, size_t n = npos )
+   {
+     char *p1 = _buf+pos;
+     char *p2 = _buf+pos+n;
+
+     if (p1 >  _buf+_len)
+       p1 = _buf+_len;
+
+     if (n==npos || p2 > _buf+_len)
+       p2 = _buf+_len;
+     
+     return erase(p1, p2);
+   }
+
+   faststring &erase ( char *p1)
+   {
+     return erase(p1, p1+1);
+   }
+
+   faststring &erase ( char *p1, char *p2 )
+   {
+     char *tmp1 = p1;
+     char *tmp2 = p2;
+     char *e    = _buf + _len;
+
+     if (p1 >= p2)
+       return *this;
+
+     if (p1 < _buf)
+       p1 = _buf;
+
+     if (p2 > e)
+       p2 = e;
+
+     // Copy chars to the left within the string.
+     while (tmp2 < e)
+     {
+       *tmp1 = *tmp2;
+       ++tmp1;
+       ++tmp2;
+     }
+
+     // Reduce length
+     _len -= (p2-p1);
+
+     return *this;
+   }
+
+  void erase()
+  {
+    _len = 0;
+  }
+
+  void reset()
+  {
+    if (_buf)
+    {
+      free(_buf);
+      _buf = NULL;
+      _capacity = 0;
+      _len = 0;
+    }
+  }
+
+  void clear()
+  {
+    _len = 0;
+  }
+
+
+
+
+   //=================================================
+   // The family of insert functions:
+   //=================================================
+   // - string& insert ( size_t pos1, const string& str );
+   // - string& insert ( size_t pos1, const string& str, size_t pos2, size_t n );
+   // - string& insert ( size_t pos1, const char* s, size_t n);
+   // - string& insert ( size_t pos1, const char* s );
+   // - string& insert ( size_t pos1, size_t n, char c );
+   // - iterator insert ( iterator p, char c );
+   // - void insert ( iterator p, size_t n, char c );
+   //=================================================
+
+   //---------------------------------------
+   // Side effects:  Invalidates pointers.
+   //---------------------------------------
+   faststring &insert(size_t pos, const char *p1, const char *p2)
+   {
+     if (pos > _len || p1 >= p2)
+       return *this;
+
+
+     size_t N = p2-p1; // Number of characters to be inserted
+     reserve(_len+N);
+     
+     //     char *b    = _buf;
+     char *e    = _buf+_len; // This is still the old _len. We have reserved new space but we have not used it yet.
+     char *tmp  = e-1;       // Pointer to the last char. We start at the last char which we move first.
+     char *tmpN = tmp+N;
+
+     // Now, after having reserved new memory, we can work with pointers in _buf
+     // again.
+
+     char *p_pos = _buf + pos;
+
+     // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+
+     // Create the space needed:
+     while (tmp >= p_pos )
+     {
+       *tmpN = *tmp;
+       --tmp;
+       --tmpN;
+     }
+     //     *tmpN = *tmp;
+     _len += N;
+
+     replace_intern(p_pos, p1, p2);
+     return *this;
+   }
+
+   faststring &insert(char *p_pos, const char *p1, const char *p2)
+   {
+     return insert(p_pos-_buf, p1, p2); 
+   }
+
+
+   faststring &insert(size_t pos1, const faststring &str)
+   {
+     return insert(pos1, str.begin(), str.end()); 
+   }
+
+   faststring& insert ( size_t pos1, const faststring& str, size_t pos2, size_t n )
+   {
+     char *b = str._buf + pos2;
+     char *e = str._buf + pos2+n;
+
+     if (b > str.end() || e > str.end() )
+       return *this;
+
+     return insert(pos1, b, e); 
+   }
+
+
+   faststring& insert ( size_t pos1, const char* s, size_t n)
+   {
+     size_t s_len = strlen(s);
+     
+     if (s_len < n)
+       return *this;
+     
+     return insert(pos1, s, s+n);
+   }
+
+   faststring& insert( size_t pos1, const char* s)
+   {
+     size_t s_len = strlen(s);
+     
+     return insert(pos1, s, s+s_len);
+   }
+
+   faststring& insert( size_t pos1, size_t n, char c )
+   {
+     faststring str(c, n);
+
+     return insert(pos1, str.begin(), str.end() );
+   }
+
+   faststring& insert( size_t pos1, char c )
+   {
+     return insert(pos1, &c, &c+1 );
+   }
+
+   faststring& insert( char *p, size_t n, char c )
+   {
+     faststring str(c, n);
+
+     return insert(p-_buf, str.begin(), str.end() );
+   }
+
+   char* insert( char *p, char c )
+   {
+     insert(p-_buf, &c, &c+1 );
+     return p;
+   }
+   
+
+   //=================================================
+   // The family of replace functions:
+   //=================================================
+   // - string& replace ( size_t pos1, size_t n1,   const string& str ); 
+   // - string& replace ( iterator i1, iterator i2, const string& str ); 
+   // - string& replace ( size_t pos1, size_t n1, const string& str, size_t pos2, size_t n2 ); 
+   // - string& replace ( size_t pos1, size_t n1,   const char* s, size_t n2 ); 
+   // - string& replace ( iterator i1, iterator i2, const char* s, size_t n2 ); 
+   // - string& replace ( size_t pos1, size_t n1,   const char* s ); 
+   // - string& replace ( iterator i1, iterator i2, const char* s ); 
+   // - string& replace ( size_t pos1, size_t n1,   size_t n2, char c ); 
+   // - string& replace ( iterator i1, iterator i2, size_t n2, char c ); 
+   // - template<class InputIterator> string& replace ( iterator i1, iterator i2, InputIterator j1, InputIterator j2 );
+
+   // replace_intern assumes that ranges have already been checked!!!
+   // This simple version does no error checking and simply overwrites
+   // part of the this object.
+   void replace_intern(char *t1, const char *p1, const char *p2)
+   {
+     while (p1 < p2)
+     {
+       *t1 = *p1;
+       ++t1;
+       ++p1;
+     }
+   }
+
+
+   //TODO: test
+   // Overwrite range must "fit" into target string.
+   // Otherwise, nothing is done.
+   void overwrite(char *t1, char *p1, char *p2)
+   {
+     size_t N = p2-p1;
+
+     if (t1 < _buf || t1+N > _buf+_len)
+       return;
+
+     replace_intern(t1, p1, p2);
+   }
+
+   // erases the range from pos1 to pos1+n1 and then inserts str
+   // if pos1 is not a valid position in the string, nothing will be done.
+
+   faststring& replace ( size_t pos1, size_t n1,   const faststring& str ) 
+   {
+     if (pos1 > _len)
+       return *this;
+
+     // Number of chars we want/can to "remove":
+     size_t real_n1 = macromin(n1, _len-pos1);
+
+     replace_unchecked (_buf+pos1, _buf+pos1 + real_n1, str.begin(), str.length() );
+
+     return *this;
+   }
+
+   faststring& replace ( char *i1, char *i2, const faststring& str )
+   {
+     if (i1 < _buf || i2 > _buf+_len)
+       return *this;
+
+     replace_unchecked(i1, i2, str.begin(), str.length() );
+     return *this;    
+   }
+
+   faststring& replace ( size_t pos1, size_t n1, const faststring& str, size_t pos2, size_t n2 )
+   {
+     if (pos1 >= _len)
+       return *this;
+
+     if (pos2 >= str._len)
+       return *this;
+
+     // Number of chars we can "remove":
+     size_t real_n1 = macromin(n1, _len-pos1);
+
+     // Number of chars we can "insert":
+     size_t real_n2 = macromin(n2, str._len-pos2);
+
+     replace_unchecked(_buf+pos1,_buf+pos1+real_n1, str.begin()+pos2, real_n2);
+
+     return *this;
+   }
+ 
+   faststring& replace ( size_t pos1, size_t n1,   const char* s, size_t n2 )
+   {
+     if (pos1 >= _len)
+       return *this;
+
+     size_t s_len = strlen(s);
+
+     //     if (n2 <= s_len )
+     //      return *this;
+
+     // Number of chars we can "remove":
+     size_t real_n1 = macromin(n1, _len-pos1);
+
+     // Number of chars we can "insert":
+     size_t real_n2 = macromin(n2, s_len);
+
+     replace_unchecked(_buf+pos1,_buf+pos1+real_n1, s, real_n2);
+
+     return *this;   
+   }
+ 
+   faststring& replace ( char *i1, char *i2, const char* s, size_t n2 )
+   {
+     if (i1 < _buf     || i2 > _buf+_len)
+       return *this;
+
+     size_t s_len = strlen(s);
+
+     if (n2 > s_len)
+       n2 = s_len;
+
+     replace_unchecked (i1, i2, s, n2);
+     return *this;
+   }
+
+   faststring& replace(char *i1, char *i2, const char* s1, const char * s2)
+   {
+     if (i1 < _buf     || i2 > _buf+_len || s2 < s1)
+       return *this;
+
+     replace_unchecked (i1, i2, s1, s2-s1);
+     return *this;    
+
+   }
+
+   void replace_unchecked ( char *i1, char *i2, const char* s, size_t n2 )
+   {
+     // Number of chars we want/can to "remove":
+     size_t n_remove = i2-i1;
+     
+     // Number of chars we want to insert:
+     size_t n_insert = n2;
+
+     if (n_remove == n_insert) // simple overwrite:
+     {
+       replace_intern(i1, s, s+n_insert);
+     }
+     else if (n_remove > n_insert) // We have too much space and need to erase some characters.
+     {
+       erase(i1, i1+n_remove - n_insert);
+       replace_intern(i1, s, s+n_insert);
+     }
+     else	   // We have too little space and need to insert some characters.
+     {
+       size_t n_newspace = n_insert-n_remove;
+       
+       insert(i1-_buf, s, s + n_newspace);
+       replace_intern(i1 + n_newspace, s+n_newspace, s+n_insert);
+     }
+   }
+ 
+   faststring& replace ( size_t pos1, size_t n1,   const char* s )
+   {
+     if (pos1 >= _len)
+       return *this;
+
+     size_t s_len = strlen(s);
+
+     //     if (n2 <= s_len )
+     //      return *this;
+
+     // Number of chars we can "remove":
+     size_t real_n1 = macromin(n1, _len-pos1);
+
+     // Number of chars we can "insert":
+     size_t real_n2 = s_len;
+
+     replace_unchecked(_buf+pos1,_buf+pos1+real_n1, s, real_n2);
+
+     return *this;    
+   }
+ 
+   faststring& replace ( char *i1, char *i2, const char* s )
+   {
+     if (i1 < _buf || i2 > _buf+_len)
+       return *this;
+
+     size_t s_len = strlen(s);
+
+     replace_unchecked(i1, i2, s, s_len);
+
+     return *this; 
+   }
+ 
+   faststring& replace ( size_t pos1, size_t n1, size_t n2, char c )
+   {
+     if (pos1 >= _len)
+       return *this;
+
+     size_t real_n1 = macromin(n1, _len-pos1);
+   
+     faststring tmp(c, n2);
+
+     replace_unchecked(_buf+pos1, _buf+pos1+real_n1, tmp.begin(), n2);
+
+     return *this; 
+   }
+ 
+   faststring& replace ( char *i1, char *i2, size_t n2, char c )
+   {
+     if (i1 < _buf || i2 > _buf+_len)
+       return *this;
+     
+     faststring tmp(c, n2);
+
+     replace_unchecked(i1, i2, tmp.begin(), n2);
+     
+     return *this; 
+   } 
+
+   //=================================================
+
+
+   static size_t max_size() {  return npos; }
+
+   // Shorten string to n characters. If its length is less than n, we append c
+   // as often as necessary to get a length of n.
+   void resize ( size_t n, char c )
+   {
+     if (n < _len)
+       shorten(n);
+     else if (n > _len)
+       append(n-_len,c);
+   }
+
+
+   void resize ( size_t n )
+   {
+     resize(n, char());
+   }
+
+   char & operator[](size_t i)
+   {
+     return _buf[i];
+   }
+
+   char operator[](size_t i) const
+   {
+     return _buf[i];
+   }
+
+   size_t copy ( char* s, size_t n, size_t pos = 0) const
+   {
+     if (pos > _len)
+       return -2;
+
+     int l = n;
+     if (n+pos > _len)
+       l = _len-pos;
+
+     memcpy(s, _buf+pos, l);
+     
+     return l;
+   }
+
+//=================================================
+// The family of find functions:
+//=================================================
+// size_t find ( const string& str, size_t pos = 0 ) const;
+// size_t find ( const char* s, size_t pos, size_t n ) const;
+// size_t find ( const char* s, size_t pos = 0 ) const;
+// size_t find ( char c, size_t pos = 0 ) const;
+
+   size_t find ( const faststring& str, size_t pos = 0 ) const
+   {
+     const char *p = find_fundamental(begin()+pos, end(), str.begin(), str.end() );
+     
+     if (p != NULL)
+       return p-begin();
+     else
+       return npos;
+   }
+
+   size_t find ( const char* s, size_t pos, size_t n ) const
+   {
+     const char *p = find_fundamental(begin()+pos, end(), s, s+n );
+     
+     if (p != NULL)
+       return p-begin();
+     else
+       return npos;
+   }
+
+   size_t find ( const char* s, size_t pos=0) const
+   {
+     const char *p = find_fundamental(begin()+pos, end(), s, s+strlen(s) );
+     
+     if (p != NULL)
+       return p-begin();
+     else
+       return npos;
+   }
+
+   // There is one good reason determining the position and not the pointer:
+   // - The position is still valid after a realloc, the pointer is not.
+   size_t find(char c, size_t pos=0) const
+   {
+     char *b = begin()+pos;
+     char *e = end();
+     
+     while (b < e && *b != c)
+       ++b;
+     if (b == e)
+       return npos;
+     else
+       return b-begin();
+   }
+
+/*   size_t find_forward(char c, size_t pos=0) const */
+/*   { */
+/*     char *b = begin()+pos; */
+/*     char *e = end(); */
+
+/*     while (b < e && *b != c) */
+/*       ++b; */
+/*     if (b >= e) */
+/*       return -1u; */
+/*     else */
+/*       return b-begin(); */
+/*   } */
+
+
+//=================================================
+// The family of rfind functions:
+//=================================================
+// size_t rfind ( const string& str, size_t pos = npos ) const;
+// size_t rfind ( const char* s, size_t pos, size_t n ) const;
+// size_t rfind ( const char* s, size_t pos = npos ) const;
+// size_t rfind ( char c, size_t pos = npos ) const;
+
+   size_t rfind ( const faststring& str, size_t pos = npos ) const
+   {
+     if (pos >= _len)
+       pos = _len-1;
+
+     const char *p = rfind_fundamental(begin()+pos,rend(),str.rbegin(),str.rend());
+     
+     if (p != NULL)
+       return p-begin();
+     else
+       return npos;
+   }
+
+   size_t rfind ( const char* s, size_t pos, size_t n ) const
+   {
+     if (pos >= _len)
+       pos = _len-1;
+
+     const char *p = rfind_fundamental(begin()+pos, rend(), s+n-1, s-1 );
+
+     if (p != NULL)
+       return p-begin();
+     else
+       return npos;
+   }
+
+   size_t rfind ( const char* s, size_t pos=npos) const
+   {
+     if (pos >= _len)
+       pos = _len-1;
+
+     const char *p = rfind_fundamental(begin()+pos, rend(), s+strlen(s)-1, s-1 );
+     
+     if (p != NULL)
+       return p-begin();
+     else
+       return npos;
+   }
+
+  size_t rfind(char c, size_t pos=npos) const
+  {
+    if  (pos >= _len)
+      pos = _len-1;
+
+    char *b = begin()+pos;
+    char *e = begin()-1;
+
+    while (b > e && *b != c)
+      --b;
+    if (b == e) // should be == if nothing was found
+      return npos;
+    else       // should be b > e if char was found
+      return b-begin();
+  }
+
+
+//=================================================
+// The family of find_first_of functions:
+//=================================================
+/* size_t find_first_of ( const string& str, size_t pos = 0 ) const; */
+/* size_t find_first_of ( const char* s, size_t pos, size_t n ) const; */
+/* size_t find_first_of ( const char* s, size_t pos = 0 ) const; */
+/* size_t find_first_of ( char c, size_t pos = 0 ) const; */
+
+/* Consider the strcspn function here */
+
+  size_t find_first_of( const faststring& str, size_t pos = 0 ) const
+  {
+    const char *b = begin()+pos;
+    const char *e = end();
+
+    while (b < e)
+    {
+      if (is_in_symbol_list__(*b, str.begin(), str.length() ))
+	return b-begin();
+      ++b;
+    }
+    return npos;
+  }
+
+  size_t find_first_of( const char *str, size_t pos, size_t n ) const
+  {
+    const char *b = begin()+pos;
+    const char *e = end();
+
+    while (b < e)
+    {
+      if (is_in_symbol_list__(*b, str, n))
+	return b-begin();
+      ++b;
+    }
+    return npos;
+  }
+
+  size_t find_first_of( const char *str, size_t pos = 0 ) const
+  {
+    const char *b = begin()+pos;
+    const char *e = end();
+
+    while (b < e)
+    {
+      if (is_in_symbol_list__(*b, str) )
+	return b-begin();
+      ++b;
+    }
+    return npos;
+  }
+
+ size_t find_first_of ( char c, size_t pos = 0 ) const
+ {
+   return find(c, pos);
+ }
+
+//=================================================
+// The family of find_last_of functions:
+//=================================================
+/* size_t find_last_of ( const string& str, size_t pos = npos ) const; */
+/* size_t find_last_of ( const char* s, size_t pos, size_t n ) const; */
+/* size_t find_last_of ( const char* s, size_t pos = npos ) const; */
+/* size_t find_last_of ( char c, size_t pos = npos ) const; */
+
+ size_t find_last_of( const faststring& str, size_t pos = npos ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+   
+   while (b > e)
+   {
+     if (is_in_symbol_list__(*b, str.begin(), str.length() ) )
+       return b-begin();
+     --b;
+   }
+   return npos;
+ }
+
+
+ size_t find_last_of( const char *str, size_t pos, size_t n ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+
+   while (b > e)
+   {
+     if (is_in_symbol_list__(*b, str, n))
+	return b-begin();
+     --b;
+   }
+   return npos;
+ }
+
+
+ size_t find_last_of( const char *str, size_t pos = npos ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+   
+   while (b > e)
+   {
+     if (is_in_symbol_list__(*b, str))
+       return b-begin();
+     --b;
+   }
+   return npos;
+ }
+ 
+ size_t find_last_of ( char c, size_t pos = npos ) const
+ {
+   return rfind(c, pos);
+ }
+
+//=================================================
+// The family of find_first_not_of functions:
+//=================================================
+/* size_t find_first_not_of ( const string& str, size_t pos = 0 ) const; */
+/* size_t find_first_not_of ( const char* s, size_t pos, size_t n ) const; */
+/* size_t find_first_not_of ( const char* s, size_t pos = 0 ) const; */
+/* size_t find_first_not_of ( char c, size_t pos = 0 ) const; */
+
+/* Also consider the strspn function for the implementation !!!!!!!!! */
+
+ size_t find_first_not_of( const faststring& str, size_t pos = 0 ) const
+ {
+   const char *b = begin()+pos;
+   const char *e = end();
+   
+   while (b < e)
+   {
+     if (!is_in_symbol_list__(*b, str.begin(), str.length() ))
+       return b-begin();
+      ++b;
+   }
+   return npos;
+ }
+
+  size_t find_first_not_of( const char *str, size_t pos, size_t n ) const
+  {
+    const char *b = begin()+pos;
+    const char *e = end();
+
+    while (b < e)
+    {
+      if (!is_in_symbol_list__(*b, str, n))
+	return b-begin();
+      ++b;
+    }
+    return npos;
+  }
+
+  size_t find_first_not_of( const char *str, size_t pos = 0 ) const
+  {
+    const char *b = begin()+pos;
+    const char *e = end();
+
+    while (b < e)
+    {
+      if (!is_in_symbol_list__(*b, str))
+	return b-begin();
+      ++b;
+    }
+    return npos;
+  }
+
+ size_t find_first_not_of ( char c, size_t pos = 0 ) const
+ {
+   const char *b = begin()+pos;
+   const char *e = end();
+
+   while (b < e)
+   {
+     if (*b != c)
+       return b-begin();
+      ++b;
+   }
+   return npos;
+ }
+
+//=================================================
+// The family of find_last_not_of functions:
+//=================================================
+/* size_t find_last_not_of ( const string& str, size_t pos = npos ) const; */
+/* size_t find_last_not_of ( const char* s, size_t pos, size_t n ) const; */
+/* size_t find_last_not_of ( const char* s, size_t pos = npos ) const; */
+/* size_t find_last_not_of ( char c, size_t pos = npos ) const; */
+
+ size_t find_last_not_of( const faststring& str, size_t pos = npos ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+   
+   while (b > e)
+   {
+     if (!is_in_symbol_list__(*b, str.begin(), str.length() ))
+       return b-begin();
+     --b;
+   }
+   return npos;
+ }
+
+
+ size_t find_last_not_of( const char *str, size_t pos, size_t n ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+
+   while (b > e)
+   {
+     if (!is_in_symbol_list__(*b, str, n))
+	return b-begin();
+     --b;
+   }
+   return npos;
+ }
+
+
+ size_t find_last_not_of( const char *str, size_t pos = npos ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+   
+   while (b > e)
+   {
+     if (!is_in_symbol_list__(*b, str))
+       return b-begin();
+     --b;
+   }
+   return npos;
+ }
+ 
+ size_t find_last_not_of ( char c, size_t pos = npos ) const
+ {
+   if (pos > _len)
+     pos = _len;
+
+   const char *e = begin()-1;
+   const char *b = begin()+pos-1;
+
+   while (b > e)
+   {
+     if (*b != c)
+       return b-begin();
+      --b;
+   }
+   return npos;
+ }
+
+ void collapse_mono_symbol_repeats(char c)
+ {
+   faststring tmp;
+
+   const char *p1, *p2;
+   p2 = p1 = begin();
+   ++p2;
+
+   while (p2 != end() )
+   {
+     if (*p1 != *p2 || *p1 != c)
+       tmp.push_back(*p1);
+     p1 = p2;
+     ++p2;
+   }
+   // When leaving the loop there is one character remaining that we need to append to tmp:
+   tmp.push_back(*p1);
+   swap(tmp);
+ }
+
+ void unquote()
+ {
+   removeSpacesBack();
+   removeSpacesFront();
+   if (*begin() == '\"' && *(end()-1) == '\"' )
+   {
+     this->erase_front(1);
+     this->erase_back(1);
+
+/*      this->erase(begin()); */
+/*      this->erase(end()-1); */
+   }
+   else if (*begin() == '\'' && *(end()-1) == '\'' )
+   {
+/*        this->erase(begin()); */
+/*        this->erase(end()-1); */
+
+     this->erase_front(1);
+     this->erase_back(1);
+   }
+ }
+
+ // Unquote string with first char s and last char e
+ void unquote(char s, char e)
+ {
+   removeSpacesBack();
+   removeSpacesFront();
+   if (*begin() == s && *(end()-1) == e )
+   {
+     this->erase_front(1);
+     this->erase_back(1);
+   }
+ }
+
+
+
+ bool is_CAPITALIZED_abbreviation_of(const faststring &keyword) const
+ {
+   size_t i   = 0;
+   size_t max = size();
+   
+   // max cannot be greater than keyword.size()
+   if ( max > keyword.size() )
+     return false;
+   
+   // We start comparison in upper case region. Lets see how far we can go.
+   while (i < max && std::toupper( _buf[i] ) == keyword[i] )
+   {
+     ++i;
+   }
+   
+   // First we check whether both strings have the same length and we matched all chars.
+   // This means that we matched exactly the upper case region of keyword, which is the
+   // complete keyword.
+   if ( i == max && max == keyword.size() )
+     return true;
+   
+   // If we get here, i must be smaller than keyword.size() since we can only have
+   // * i == max and i == keyword.size(): Not possible after previous if 
+   // * i <  max and i == keyword.size(): Not possible since max <= keyword.size()
+   // * i == max and i < keyword.size(): 
+   // * i <  max and i < keyword.size(): 
+   
+   // Thus, keyword[i] is valid and we use it to check whether we are in the upper case region
+   // (were all !alpha() should also be considered as upper case chars in this context!!). 
+   // We simply check whether we are in the !islower() region.
+   
+   if ( !islower( keyword[i]) )    // We are still in non-lower case region
+     return false;
+   
+   // If we get here, we are in the in the lower-case region
+   // There are two possibilities:
+   // - i == max, 
+   if (i==max)
+     return true;
+   // - our string is longer than the upper case region, so we have to continue
+   //   our comparison.
+   
+   // Let us move through lower case region
+   while (i < max && ((*this)[i] == keyword[i] || std::tolower(_buf[i]) == keyword[i]) )
+     ++i;
+   
+   // Could we match all letters in str?
+   if (i==max)
+     return true;
+   else
+     return false;
+ }
+
+ // get the next token and remove it from the called object.
+ faststring& get_next_token(faststring &str, const char * ws = "\r\n\t\v\f ")
+ {
+   const size_t  n = size();
+         size_t  i = 0;
+
+     str.clear();
+
+     // eat leading whitespace/deliminators -- this sould be more efficient than
+     // calling removeSpacesFront since we only need to erase in the front of the string once. 
+     while ( (i < n) && ( is_in_symbol_list__( (*this)[i], ws)) ) ++i;
+
+     if (i == n)   // nothing left so re remove alle spaces and the string will be empty
+     {
+       erase();
+     }
+     else
+     {
+       // find end of word
+       size_t  j = i+1;
+       while ( (j < n) && (!is_in_symbol_list__( (*this)[j], ws)) ) ++j;
+
+       str = substr(i, j);   // the next token
+       erase(0, j);                 // remove token from called object 
+     }
+
+     return *this;
+ }
+
+ void set_to_string_with_values(std::vector<double> v, faststring delim= " ", int precision=14)
+ {
+   int i, n=v.size();
+   clear();
+   
+   if (n == 0)
+     return;
+   
+   append(faststring(v[0], precision));
+   removeSpacesBack();
+
+   for (i=1; i<n; ++i)
+   {
+     append(delim);
+     append(faststring(v[i], precision));
+     removeSpacesBack();
+   }
+ }
+
+ void set_to_string_with_values(std::vector<int> v, faststring delim= " ")
+ {
+   int i, n=v.size();
+   clear();
+   
+   if (n == 0)
+     return;
+   
+   append(faststring(v[0]));
+   removeSpacesBack();
+
+   for (i=1; i<n; ++i)
+   {
+     append(delim);
+     append(faststring(v[i]));
+     removeSpacesBack();
+   }
+ }
+
+
+ // Could be made more efficient.
+ // A deliminator could be given as parameter.
+ void get_vector_of_values(std::vector<double> &v)
+ {
+   int i, n;
+   v.clear();
+   
+   std::vector<faststring> vs;
+   split(vs, *this);
+   n = vs.size();
+   for(i=0; i<n; ++i)
+   {
+     v.push_back(vs[i].ToDouble());
+   }
+ } 
+
+ // Funktioniert noch nicht richtig:
+/*  void search_replace_first(faststring s1, faststring s2, unsigned pos=0) */
+/*  { */
+/*    unsigned find_pos = find(s1, pos); */
+
+/*    std::cerr << "find_pos: " << find_pos << std::endl; */
+/*    std::cerr << "s1.length(): " <<  s1.length()  << std::endl; */
+
+
+/*    if (find_pos != npos) */
+/*      replace(find_pos, s1.length(), s2 ); */
+/*  } */
+
+ void search_replace_all(faststring s1, faststring s2)
+ {
+   std::vector<faststring> v;
+   split_at(v, *this, s1);
+
+   size_t i, N=v.size();
+   faststring res;
+   
+   if (N==1)
+     return;  // Just for efficiency. Otherwise we would copy the string v[0] back to this.
+
+   for (i=0; i<(N-1); ++i)
+   {
+     res += v[i];
+     res += s2;
+   }
+   res += v[i];
+
+   *this = res;
+ }
+
+
+
+};
+
+inline std::ostream &operator<<(std::ostream &out, faststring  &str)
+{
+  out << str.c_str();
+  return out;
+}
+
+inline std::ostream &operator<<(std::ostream &out, const faststring  &str)
+{
+  faststring fs = str;
+  out << fs.c_str();
+  return out;
+}
+
+inline faststring operator+(faststring a, faststring b)
+{
+  a += b;
+  return a;
+}
+
+inline std::istream &getline(std::istream &is, faststring &str)
+{
+  int c;
+
+  str.clear();
+
+  c = is.get();
+  if (  c == '\r' )
+  {
+    c = is.get();
+    if ( c != '\n' )
+    {
+      is.putback(c);
+    }
+    c = '\n';
+  }
+  if (c == '\n')
+    return is;
+
+  while (c != EOF)
+  {
+    str.push_back(c);
+    c = is.get();
+    if (  c == '\r' )
+    {
+      c = is.get();
+      if ( c != '\n' )
+      {
+	is.putback(c);
+      }
+      c = '\n';
+      return is;
+    }
+    if (c == '\n')
+    {
+      return is;
+    }
+  }
+  return is;
+}
+
+/* Can be optimized ?? */
+/* Function is declared inline since it is a global function in a header file. It is not declared */
+/* static in order not to get compiler warnings due to unused functions. */
+//
+// A note on efficiency: This is not the most efficient way to read a file.
+// Indeed the many push_back calls can lead to many reallocation events for the string buffer.
+// TODO: Could be made more efficient by measuring the file and by calling reserve.
+inline void readFileIntoString(std::ifstream &is, faststring &str)
+{
+  int c;
+
+  str.clear();
+
+  c = is.get();
+  while (true)
+  {
+    if (  c == '\r' )
+    {
+      str.push_back('\n');
+      c = is.get();
+      if ( c == '\n')
+      {
+	c = is.get();
+      }
+    }
+    else if (c == '\n')
+    {
+      str.push_back('\n');
+      c = is.get();
+    }
+    else
+    {
+      str.push_back(c);
+      c = is.get();
+    }
+    if (c == EOF)
+      return;
+  }
+}
+
+//***********************************************************************
+// Reads the content of a file and APPENDs it to he vector.
+// NOTE: A vector<faststring> can be extemely inefficient.
+//       When expanding the size of the vector, the vector class might
+//       destruct and reconstruct all items, when reallocating them.
+//***********************************************************************
+inline void appendFileToVector(std::ifstream &is, std::vector<faststring> &v)
+{
+  faststring line;
+
+  getline(is, line);
+  while (is)
+  {
+    v.push_back(line);
+    getline(is, line);
+  }
+}
+
+inline void appendFileToList(std::ifstream &is, std::list<faststring> &l)
+{
+  faststring line;
+
+  getline(is, line);
+  while (is)
+  {
+    l.push_back(line);
+    getline(is, line);
+  }
+}
+
+
+
+
+  
+//*************************************************************
+// Tokenizer
+//*************************************************************
+
+// Note on efficiency:
+// vector<faststring> can be inefficient as a container in the split functions.
+// Expanding the vector leads not only to a relocation of the memory but also to
+// the construction of copies and descruction of all existing elements.
+// For many splitting events, a list should be favoured.
+
+
+template <typename Container>
+int
+split (Container &l, const faststring &s, char const * const ws)
+{
+  l.clear();
+    const size_t  S = s.size();
+          size_t  i = 0;
+
+    while (i < S) {
+        // eat leading whitespace
+        while ((i < S) && (is_in_symbol_list__(s[i],ws)))  ++i;
+        if (i == S)  return l.size();  // nothing left but WS
+
+        // find end of word
+        size_t  j = i+1;
+        while ((j < S) && (!is_in_symbol_list__(s[j],ws)))  ++j;
+
+        // add word
+        l.push_back(s.substr(i,j-i));
+
+        // set up for next loop
+        i = j+1;
+    }
+    return l.size();
+}
+
+
+template <typename Container>
+int
+split_at (Container &l, const faststring &s, const faststring &delim)
+{
+  size_t pos1=0;
+  size_t pos2=0;
+
+  while (pos2 != faststring::npos)
+  {
+    pos2 = s.find(delim, pos2); // Start of next deliminator
+
+    if (pos2 >= s.size() )
+      break;
+    l.push_back(s.substr(pos1, pos2-pos1) );
+    pos1 = pos2+delim.size(); // Start of next token
+    pos2 = pos1;              // Start for next search
+  }
+  l.push_back(s.substr(pos1, pos2) );
+  return l.size();
+}
+
+
+//
+// Tokenizer which does not split braces.
+//
+
+inline void
+skip_until_ws_respect(const faststring &s, size_t &pos, char const * const ws = "\r\n\t\v\f ")
+{
+  char c;
+  
+  unsigned count_parent = 0;
+  unsigned count_brace  = 0;
+  unsigned count_curly  = 0;
+  unsigned count_sq     = 0;
+  unsigned count_dq     = 0;
+
+  size_t size = s.size();
+      
+  while (pos < size)
+  {
+    c = s[pos];
+    if (c == '(')   { ++count_parent; }
+    else if (c == ')')   { --count_parent; }
+    else if (c == '[')   { ++count_brace;  }
+    else if (c == ']')   { --count_brace;  }
+    else if (c == '{')   { ++count_curly;  }
+    else if (c == '}')   { --count_curly;  }
+    else if (c == '\'')  { count_sq = (count_sq+1)%2;   }
+    else if (c == '\"')  { count_dq = (count_dq+1)%2;   }
+    
+    if (is_in_symbol_list__(c, ws) && count_parent==0 && count_brace==0 && count_curly==0 && count_sq==0 && count_dq==0)
+      return;
+    
+    ++pos;
+  }
+}
+
+template <typename Container>
+int
+split_respect (Container &l, const faststring &s, char const * const ws)
+
+{
+  l.clear();
+    const size_t  S = s.size();
+          size_t  i = 0;
+
+    while (i < S) {
+        // eat leading whitespace
+        while ((i < S) && (is_in_symbol_list__(s[i],ws)))  ++i;
+        if (i == S)  return l.size();  // nothing left but WS
+
+        // find end of word
+        size_t  j = i;  // We can't skip the first char which can be a brace.
+	skip_until_ws_respect(s, j, ws);
+
+        // add word
+        l.push_back(s.substr(i,j-i));
+
+        // set up for next loop
+        i = j+1;
+    }
+    return l.size();
+}
+
+// Multiple successive deliminators result in multiple hits.
+template <typename Container>
+int
+split_strict (Container &l, const faststring &s, char const * const ws)
+{
+  l.clear();
+  const size_t  S = s.size();
+        size_t  i = 0;
+
+  while (i < S) {
+    // find end of word
+    size_t  j = i;
+    while ((j < S) && (!is_in_symbol_list__(s[j],ws)))  ++j;
+
+    // add word
+    l.push_back(s.substr(i,j-i));
+
+    // set up for next loop
+    i = j+1;
+
+    if (i==S)  // Only true of last string is empty since otherwise i==S+1
+    {
+      l.push_back("");
+    }
+  }
+  return l.size();
+}
+
+template <typename Container>
+int
+split_strict_respect (Container &l, const faststring &s, char const * const ws)
+{
+  l.clear();
+  const size_t  S = s.size();
+        size_t  i = 0;
+
+  while (i < S) {
+    // find end of word
+    size_t  j = i;  // We can't skip the first char which can be a brace.
+    skip_until_ws_respect(s, j, ws);
+
+    // add word
+    l.push_back(s.substr(i,j-i));
+
+    // set up for next loop
+    i = j+1;
+
+    if (i==S)  // Only true of last string is empty since otherwise i==S+1
+    {
+      l.push_back("");
+    }
+  }
+  return l.size();
+}
+
+
+
+inline bool less_than_pointer_to_faststring(const faststring *a, const faststring *b)
+{
+  return *a < *b;
+}
+
+struct less_than_pointer_to_faststring_struct
+{
+  bool operator()(const faststring* s1, const faststring* s2) const
+  {
+    return *s1 < *s2;
+  }
+};
+
+
+
+
+
+
+
+
+
+
+
+#endif
+
+/* String operations: */
+/* I do not know what to do with this function: get_allocator	 Get allocator (public member function) */
+
+
+
+
diff --git a/global-types-and-parameters.cpp b/global-types-and-parameters.cpp
new file mode 100644
index 0000000..3f8506b
--- /dev/null
+++ b/global-types-and-parameters.cpp
@@ -0,0 +1,563 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include "global-types-and-parameters.h"
+#include "tclap/CmdLine.h"
+#include <string>
+#include "faststring2.h"
+
+using namespace TCLAP;
+using namespace std;
+
+faststring                       global_bait_filename;
+char                             global_mode;
+faststring                       global_blast_exe;
+faststring                       global_output_filename;
+
+double                           global_blast_min_hit_coverage_of_bait;
+double                           global_blast_max_first_hit_evalue;
+double                           global_blast_max_second_hit_evalue;
+faststring                       global_blast_db;
+
+faststring                       global_blast_extra_commandline;
+faststring                       global_blast_evalue_commandline;
+
+unsigned                         global_thinning_step_width;
+
+bool                             global_use_GUI;
+bool                             global_stats_mode;
+
+unsigned                         global_conversion_mode;
+
+faststring                       global_ProbeID_prefix;
+
+unsigned                         global_verbosity;
+
+
+bool file_exists(const char* fn)
+{
+  ifstream is;
+  is.open(fn);
+  if (is.fail())
+  {
+    return false;
+  }
+  is.close();
+  return true;
+}
+
+
+bool blast_exe_exists()
+{
+  faststring cmd = global_blast_exe + " -version 1> /dev/null 2> /dev/null";
+  int err = system(cmd.c_str());
+
+  if (err == 0)
+    return true;
+  else
+    return false;
+}
+
+bool blast_db_files_exist(faststring &blast_db_base_name)
+{
+  faststring tmp;
+
+  tmp = blast_db_base_name + ".nhr";
+  if (!file_exists(tmp.c_str()))
+    return false;
+  tmp = blast_db_base_name + ".nin";
+  if (!file_exists(tmp.c_str()))
+    return false;
+  tmp = blast_db_base_name + ".nsq";
+  if (!file_exists(tmp.c_str()))
+    return false;
+  return true;
+}
+
+
+void good_bye_and_exit(FILE *of, int error)
+{
+  if (error == 0)
+    fprintf(of, "#\n#\n## Finished successfully. ##\n");
+  fprintf(stderr, "\n" PROGNAME " says goodbye.\n\n");
+  exit(error);
+}
+
+
+
+void init_param()
+{
+  global_blast_exe                      = "blastn";
+  global_blast_min_hit_coverage_of_bait = 0;
+  global_blast_max_first_hit_evalue     = 0.000001;
+  global_blast_max_second_hit_evalue    = 0.000001;
+  global_thinning_step_width            = 0;
+
+  global_use_GUI         = false;
+  global_stats_mode      = false;
+
+  global_mode            = 0; // 0: Undefined, 'c': conversion, ....
+  global_conversion_mode = 0; // 0: No conversion, 1: Agilent-Germany
+
+  global_verbosity       = 2;
+}
+
+
+
+void read_and_init_parameters(int argc, char** argv)
+{
+  init_param();
+
+  try
+  {
+    CmdLine cmd("This program can be used to produce the final output file for creating baits, or it can be used to filter bait loci obtained from the Bait-Fisher program according "
+                "to different criteria. The bait file produced by BaitFisher computes a tiling desing for each possible starting position. The purpuse of BaitFilter is to determine for each target alignment/gene/feature the optimal bait region. As input it requires the bait file generated by the BaitFisher program or a BaitFile generated by a previous filtering run of BaitFilter. "
+		"This bait file is specified with the -i command line parameter (see below). Furthermore, the user has to specifiy an output file name with the -o parameter and a filter mode with "
+		"the -m parameter.\n"
+		"To convert a file to a customn output format, see the -c option below.\n"
+		"To compute stats of an input file, see the -S option below.\n" 
+		"The different filter modes provided by BaitFilter are the following:\n" 
+		"1a) Retain only the best bait locus per alignment file. Criterion: Minimize number of required baits.\n"
+		"1b) Retain only the best bait locus per alignment file. Criterion: Maximize number of sequenences.\n"
+		"2a) Retain only best bait locus per feature (requires that features were selected in Bait-Fisher). Criterion: Minimize number of required baits.\n"
+		"2b) Retain only best bait locus per feature (requires that features were selected in Bait-Fisher). Criterion: Maximize number of sequenences.\n"
+		"3) Use a blast search of the bait sequences against a reference genome to detect putative non-unique target loci. Non unique target sites will have multiple good hits against the reference genome. "
+		"  Furthermore, a minimum coverage of the best blast hit of bait sequence against the genome can be specified. Note that all blast modes require additional command line parameters!"
+		"  These modes remove bait regions for which multiple blast hits where found. Different versions of this mode are available:\n" 
+		" 3a) If a single bait is not unique, remove all bait regions from the current gene.\n" 
+		" 3b) If a single bait is not unique, remove all bait regions from the current feature (if applicable).\n"
+		" 3c) If a single bait is not unique, remove only the bait region that contains this bait.\n"
+		" 4) Thin out the given bait file: Retain only every Nth bait region, where N has to be specified by the user. Two submodes are available:\n" 
+		" 4a) Thin out bait regions by retaining only every Nth bait region in a bait file. The starting offset will by chosen such that the number of required baits is minimized.\n"
+		" 4b) Thin out bait regions by retaining only every Nth bait region in a bait file. The starting offset will by chosen such that the number of sequences the result is baised on is maximized.\n",
+		' ', VERSION);
+
+    SwitchArg global_stats_Arg("S", "stats", "Compute stats for the input file and report these. This mode is automatically used for all modes specified with -m or the conversion mode specified with -c."
+				   "The purpose of the -S option is to compute stats without having to filter or convert the input file. In particular, the -S mode does not require specifying an output file.\n"
+				   "This option has no effect if combined with the -m or -c modes.\n", false);
+    cmd.add( global_stats_Arg );
+
+
+    ValueArg<unsigned> verbostiy_Arg("", "verbosity",
+				     "The verbosity option controls the amount of information " PROGNAME 
+				     " writes to the console while running. 0: report only error messages that lead to exiting the program. "
+				     "1: report also wanrings, 2: report also progress, 3: report more detailed progress, >10: debug output. 10000: all possible dignostic output.",
+				     false, global_verbosity, "unsigned integer");
+    cmd.add( verbostiy_Arg );
+
+
+    ValueArg<string> conversion_IDprefix_Arg("", "ID-prefix",
+       "In the conversion mode Agilent-Germany each converted file should get a unique ProdeID prefix, since even among multiple files, "
+					     "ProbeIDs are not allowed to be identical. This this option the user is able to specifiy a prefix string to all probe IDs in this file.",
+	false, "", "string");
+    cmd.add( conversion_IDprefix_Arg );
+
+   
+    ValueArg<unsigned> thinning_step_width_Arg("t", "thinning-step-width",
+					      "Thin out the bait file by retaining only every Nth bait region. This option specified the step width N. If one of the moded thin-b," 
+					      " thin-s is active, this option is required, otherwise it is not allowed to set this parameter.",
+					      false, global_thinning_step_width, "positive integer");
+    cmd.add( thinning_step_width_Arg );
+
+    ValueArg<string> blast_exe_Arg("B", "blast-executable",
+       "Name of or path+name to the blast executable. Default: nblast. Minimum version number: Blast+ 2.2.x",
+       false, global_blast_exe.c_str(), "string");
+    cmd.add( blast_exe_Arg );
+
+    ValueArg<string> blast_evalue_extra_Arg("", "blast-evalue-cutoff",
+       "When invoking the blast command, a default value of twice the --<blast-first-hit-evalue is used. This should guarantee that all hits necessary for the blast filter are found. However, for the coverage filtering a smaller threshold might be necessary. This can be specified here.",
+       false, "", "floating point number");
+    cmd.add( blast_evalue_extra_Arg );
+
+    ValueArg<string> blast_extra_commandline_Arg("", "blast-extra-commandline",
+       "When invoking the blast command, extra commandline parameters can be passed to the blast command. As an example with this option it is possible to specifiy the number of threads the blast command should use.",
+       false, "", "string");
+    cmd.add( blast_extra_commandline_Arg );
+
+    ValueArg<string> blast_db_Arg("", "ref-blast-db",
+       "Base name to a blast data base file. This name is passed to the blast command. This is the name of the fasta file of your reference genome."
+       " IMPORTANT: The makeblastdb program has to be called before starting the " PROGNAME " program. makeblastdb takes the fasta file and "
+       " creates data base files out of it.",
+	false, "", "string");
+    cmd.add( blast_db_Arg );
+
+    ValueArg<double> blast_hit_coverage_Arg("", "blast-min-hit-coverage-of-baits-in-tiling-stack",
+       "Specifies a minimum hit coverage for the primary hit which at least one bait has to have in each tiling stack. Otherwise the bait region is discarded. "
+       "If not specified, no hit coverage is checked. This parameter can only be used in conjunction with other filters. Since the order in which the coverage "
+       "filter and the other filters are applied matters, the order is defined as follows: For the mode options: ab, as, fb, fs the coverage is checked before "
+       "determining the optimal bait region. For the mode options: blast-a, blast-f, blast-l the hit coverage is checked after filtering for baits with multiple "
+       "good hits to the reference genome.", false, global_blast_min_hit_coverage_of_bait, "floating point number");
+    cmd.add( blast_hit_coverage_Arg );
+
+    ValueArg<double> blast_primary_hit_evalue_Arg("", "blast-first-hit-evalue",
+						  "Maximum evalue for the first hit. A bait is characterized to bind ambiguously, if we have two good hits. This option is the evalue threshold for the first hit.",
+	false, global_blast_max_first_hit_evalue, "floating point number");
+    cmd.add( blast_primary_hit_evalue_Arg );
+
+    ValueArg<double> blast_secondary_hit_evalue_Arg("", "blast-second-hit-evalue",
+						    "Maximum evalue for the second hit. A bait is characterized to bind ambiguously, if we have two good hits. This option is the evalue threshold for the second hit.",
+	false, global_blast_max_second_hit_evalue, "floating point number");
+    cmd.add( blast_secondary_hit_evalue_Arg );
+
+ 
+    // The most important options must be mentioned first. Not they are specified in (reverse) order:
+
+    // (#4) in option list 
+    ValueArg<string> bait_filter_mode_Arg("m","mode",
+				      "Appart form the input file this is the most essential option. This option specifies which filter mode Bait-Filter uses. (See the user manual for more details):\n"
+				      "\"ab\":      Retain only the best bait locus for each alignemntfile (e.g. gene) when using the optimality criterion"
+				      "             to minimize the total number of required baits.\n"
+				      "\"as\":      Retain only the best bait locus for each alignemntfile (e.g. gene) when using the optimality criterion"
+				      "             to maximize the number of sequences the result is based on.\n"
+				      "\"fb\":      Retain only the best bait locus for each feature (e.g. CDS) when using the optimality criterion"
+				      "             to minimize the total number of required baits. Only applicable if alignment cutting has been used in Bait-Fisher.\n"
+				      "\"fs\":      Retain only the best bait locus for each feature (e.g. CDS) when using the optimality criterion"
+				      "             to maximize the number of sequences the result is based on. Only applicable if alignment cutting has been used in Bait-Fisher. \n"
+				      "\"blast-a\": Remove all bait loci of ALIGNMENTs for which one or more baits have multiple good hits to a reference genome.\n"
+				      "\"blast-f\": Remove all bait loci of FEATUREs for which one or more baits have multiple good hits to a reference genome.\n"
+				      "\"blast-l\": Remove bait LOCI that contain a bait that hos multiple good hits to a reference genome.\n"
+                                      "\"thin-b\":  Thin out a bait file to every Nth bait region, by finding the start position that minimizes the number of baits.\n"
+                                      "\"thin-s\":  Thin out a bait file to every Nth bait region, by finding the start position that maximizes the number of sequences.\n",
+					  false, "","string");
+    cmd.add(bait_filter_mode_Arg);    
+
+    // (#3) in option list 
+    ValueArg<string> conversion_mode_Arg("c", "convert",
+       "Allows the user to produce the final output file for the bait producing company. "
+       "In this mode, BaitFilter reads the input bait file and instead of doing a filtering step, it produces a "
+       "costumn bait file that can be uploaded to the baits producing company. In order to avoid confuction "
+       "a filtering step cannot be done in the same run as the conversion. If you want to filter a bait file and "
+       "convert the output, you will need to call this program twice, first to do the filtering and second to do "
+       " the conversion. Allowed conversion parameters currently are: \"Agilent-Germany\".\n"
+       " New output formats can be added upon request. Please contact the author: Christoph Mayer, Email: Mayer Christoph <c.mayer.zfmk at uni-bonn.de>",
+	false, "", "string");
+    cmd.add( conversion_mode_Arg );
+
+    // (#2) in option list 
+    ValueArg<string> out_filename_Arg("o", "output-bait-file-name",
+       "Name of the output bait file. This is the file the contains the filtered bait loci and the baits.",
+	false, "", "string");
+    cmd.add( out_filename_Arg );
+
+    // (#1) in option list 
+    ValueArg<string> bait_filename_Arg("i", "input-bait-file-name",
+       "Name of the input bait locus file. This is the bait file obtained from the Bait-Fisher program.",
+	true, "", "string");
+    cmd.add( bait_filename_Arg );
+    
+
+
+
+//************************************************
+    cmd.parse( argc, argv );
+//************************************************
+
+    faststring tmp, tmp1;
+
+    // Assigning parameters to variables:
+    global_bait_filename                  = bait_filename_Arg.getValue().c_str();
+    tmp                                   = bait_filter_mode_Arg.getValue().c_str();
+    global_output_filename                = out_filename_Arg.getValue().c_str();
+    global_blast_exe                      = blast_exe_Arg.getValue().c_str();
+    global_blast_db                       = blast_db_Arg.getValue().c_str();
+    global_blast_min_hit_coverage_of_bait = blast_hit_coverage_Arg.getValue();
+    global_blast_max_first_hit_evalue     = blast_primary_hit_evalue_Arg.getValue();
+    global_blast_max_second_hit_evalue    = blast_secondary_hit_evalue_Arg.getValue();
+
+    global_blast_evalue_commandline       = blast_evalue_extra_Arg.getValue().c_str();
+    global_blast_extra_commandline        = blast_extra_commandline_Arg.getValue().c_str();
+    global_thinning_step_width            = thinning_step_width_Arg.getValue();
+    tmp1                                  = conversion_mode_Arg.getValue().c_str();
+    global_ProbeID_prefix                 = conversion_IDprefix_Arg.getValue().c_str();
+    global_verbosity                      = verbostiy_Arg.getValue();
+
+    global_stats_mode                     = global_stats_Arg.getValue();
+
+    if (global_output_filename.empty() && (!tmp.empty() || !tmp1.empty()) )
+    {
+      cerr << "The -o parameter, used to specify an output file, is a required parameter for all modes specified with the -m and -c parameter." << endl; 
+      good_bye_and_exit(stdout, -2);
+    }
+
+    if (tmp.empty() && tmp1.empty() && !global_stats_mode )
+    {
+      cerr << "When using the BaitFisher program you have to specify either the -m (--mode) option, the -c (--convert) option or the -S option." << endl;
+      cerr << "These are the three main running modes. " << endl;
+      cerr << "See the BaitFilter manual for help. ";
+      cerr << "Type " << PROGNAME << " -h for a quick online help." << endl;
+      good_bye_and_exit(stdout, -1);
+    }
+
+    if (!tmp.empty() && !tmp1.empty() )
+    {
+      cerr << "When using the BaitFisher program you have to specify either the -m (--mode) option or the -c (--convert) option." << endl;
+      cerr << "Filtering runs and conversion runs cannot be combined in one run, but have to be done consequtively, by invoking " << PROGNAME << " twice." << endl;
+      cerr << "See the BaitFilter manual for help. ";
+      cerr << "Type " << PROGNAME << " -h for a quick online help." << endl;
+      good_bye_and_exit(stdout, -1);
+    }
+
+    if (global_stats_mode)
+    {
+      global_mode = 'S';
+    }
+    else if (!tmp.empty())
+    {
+      global_conversion_mode = 0;
+
+      if (tmp == "ab")      // Best per alignment, number of baits
+      {
+	global_mode = 'a';
+      }
+      else if (tmp == "as")
+      {
+	global_mode = 'A';
+      }
+      else if (tmp == "fb")
+      {
+	global_mode = 'f';
+      }
+      else if (tmp == "fs")
+      {
+	global_mode = 'F';
+      }
+      else if (tmp == "blast-a")
+      {
+	global_mode = 'b';
+      }
+      else if (tmp == "blast-f")
+      {
+	global_mode = 'B';
+      }
+      else if (tmp == "blast-l")
+      {
+	global_mode = 'x';
+      }
+      else if (tmp == "thin-b")
+      {
+	global_mode = 't';
+	if (global_thinning_step_width == 0)
+	{
+	  cerr << "Error: In \"thin-b\" mode, the --thinning-step-width is a required parameter and the specified value must be greater than 0,\n" << endl;
+	  exit(-11);
+	}
+      }
+      else if (tmp == "thin-s")
+      {
+	global_mode = 'T';
+	if (global_thinning_step_width == 0)
+	{
+	  cerr << "Error: In \"thin-s\" mode, the --thinning-step-width is a required parameter and the specified value must be greater than 0,\n" << endl;
+	  exit(-11);
+	}
+      }
+      else
+      {
+	cerr << "Unknown option for parameter -m <string> : " << tmp << " encountered." << endl;
+	cerr << "Allowed modes can be viewed with: " << PROGNAME << " -h " << endl;
+	exit(-3);
+      }
+    } // END if (!tmp.empty())
+    else // if ( !tmp1.empty() )  // The if is not necessary, since either tmp or tmp1 are ensured to be non-empty.
+    {
+      global_mode = 'c';
+
+      if (tmp1 == "Agilent-Germany")
+      {
+	global_conversion_mode = 1;
+      }
+      else 
+      {
+	cerr << "Unknown option for parameter -c <string> : " << tmp1 << " encountered." << endl;
+	cerr << "Allowed modes can be viewed with: " << PROGNAME << " -h " << endl;
+	exit(-3);  	
+      }
+    }
+  }
+  catch (ArgException &e)
+  {
+    cerr << "Error: " << e.error() << " for arg " << e.argId() << endl;
+    good_bye_and_exit(stdout, -1);
+  }
+
+  // Do some checks here:
+
+  // Check whether the blast executable can be found and can be executed.
+  // Check whether the data base file exists.
+
+  if (global_thinning_step_width > 0 && tolower(global_mode) != 't' ) 
+  {
+    cerr << "Error: The --thinning-step-width option only has an effect in the \"-m thin-b\" or \"-m thin-s\" modes. Specifying this value in other modes is not allowed." << endl;
+    exit(-12);
+  }
+
+  if (global_mode == 'b' || global_mode == 'B' || global_mode == 'x' )
+  {
+    bool good = blast_exe_exists();
+
+    if (!good)
+    {
+      cerr << "Error: You try to run a blast filter, but the blast executable does not seem to work." << endl;
+      cerr << "       I was not able to run the blast program with the following command line option:" << endl;
+      cerr << "       " << global_blast_exe << " -version" << endl;
+      cerr << "       This command should not give an error message, but display the version number of blast." << endl;
+      cerr << "       Exiting." << endl;
+      exit(-1);
+    }
+
+    if (global_blast_db.empty())
+    {
+      cerr << "Error: You try to run a blast filter, but the index files of your reference genome is not specified." << endl;
+      cerr << "       Use the --ref-blast_db option to specifiy a blast data base index file." << endl;
+      exit(-1);
+    }
+
+    good = blast_db_files_exist(global_blast_db);
+
+    if (!good)
+    {
+      cerr << "Error: You try to run a blast filter, but the index files of your reference genome does not exist." << endl;
+      cerr << "       If you only have a fasta file at the moment, you have to use the makeblastdb program which comes with your blast installation." << endl;
+      cerr << "       Creation of the blast index was successful if you created file with the extension: nin, nsq and nhr." << endl;
+      cerr << "       Exiting." << endl;
+      exit(-1);
+    }
+  }
+  else
+  {
+    if (!global_blast_db.empty())
+    {
+      cerr << "Warning: You specified a blast database file but you run " << PROGNAME
+	   << " in a non blast mode. Thus, the specified data base file will not be used." << endl;
+    }
+    
+    
+  }
+}
+
+
+
+void print_parameters(FILE *of, const char *s)
+{
+  fprintf(of,   "%sBaitFilter has been started with the following command line parameters:\n",                      s);
+  fprintf(of,   "%sInput bait file name:   %s\n",   s, global_bait_filename.c_str());
+  fprintf(of,   "%sOutput bait file name:  %s\n",   s, global_output_filename.c_str());
+  if (global_mode == 'a')
+  {
+    fprintf(of, "%sFilter mode:            Retain only the best locus per alignment file; criterion: minimize number of baits.\n", s);
+  }
+  else if (global_mode == 'A')
+  {
+    fprintf(of, "%sFilter mode:            Retain only the best locus per alignment file; criterion: maximize number of sequences in locus.\n", s);
+  }
+  else if (global_mode == 'f')
+  {
+    fprintf(of, "%sFilter mode:            Retain only the best locus per feature; criterion: minimize number of baits.\n", s);
+  }
+  else if (global_mode == 'F')
+  {
+    fprintf(of, "%sFilter mode:            Retain only the best locus per feature; criterion: maximize number of sequences in locus.\n", s);
+  }
+  else if (global_mode == 'b')
+  {
+    fprintf(of, "%sFilter mode:            Blast filter: Remove all bait loci from output that belong to the ALIGNMENT in which one bait had multiple good hits to the reference genome.\n", s);
+  }
+  else if (global_mode == 'B')
+  {
+    fprintf(of, "%sFilter mode:            Blast filter: Remove all bait loci from output that belong to the FEATUE in which one bait had multiple good hits to the reference genome.\n", s);
+  }
+  else if (global_mode == 'x')
+  {
+    fprintf(of, "%sFilter mode:            Blast filter: Remove all bait loci from output that belong to the LOCI in which one bait had multiple good hits to the reference genome.\n", s);
+  }
+  else if (global_mode == 't')
+  {
+    fprintf(of, "%sFilter mode:            Thinning mode: Retain only every %u th bait region. Choose the starting offset such that the number of baits is minimized.\n", s, global_thinning_step_width);    
+  }
+  else if (global_mode == 'T')
+  {
+    fprintf(of, "%sFilter mode:            Thinning mode: Retain only every %u th bait region. Choose the starting offset such that the number of sequences the result is based on is maximized.\n", s, global_thinning_step_width);    
+  }
+  else if (global_mode == 'c')
+  {
+    if (global_conversion_mode == 1)
+    {
+      fprintf(of, "%sConversion mode:        Convert bait file to Agilent-Germany format.\n", s);
+    }
+    else
+    {
+      fprintf(of, "%sERROR: Invalid internal conversion mode: %c.\n", s, global_mode);
+      exit(-99);
+    }
+  }
+  else if (global_mode == 'S')
+  {
+    fprintf(of, "%sMode:                   Prints stats mode.\n", s); 
+  }
+  else
+  {
+    fprintf(of, "%sERROR: Invalid internal mode: %c.\n", s, global_mode);
+    exit(-99);
+  }
+
+
+
+  if (global_mode == 'b' || global_mode == 'B' || global_mode == 'x' )
+  {
+    fprintf(of, "%sBlast search settings and parameters:\n",   s);
+    fprintf(of, "%sBlast executable:                                 %s\n",   s, global_blast_exe.c_str());
+    fprintf(of, "%sBlast data base file name:                        %s\n",  s, global_blast_db.c_str());
+    fprintf(of, "%sBlast minimum hit coverage of bait in first hit:  %lf\n", s, global_blast_min_hit_coverage_of_bait);
+    fprintf(of, "%sBlast maximum evalue of best hit:                 %lf\n", s, global_blast_max_first_hit_evalue);
+    fprintf(of, "%sBlast maximum evalue of second best hit:          %lf\n", s, global_blast_max_second_hit_evalue);
+  }
+
+  if (!global_blast_extra_commandline.empty())
+  {
+    fprintf(of, "%sBlast extra commandline argument:                 %s\n", s, global_blast_extra_commandline.c_str());
+  }
+
+  if (!global_blast_evalue_commandline.empty())
+  {
+    fprintf(of, "%sBlast evalue cut-off:                             %s\n", s, global_blast_evalue_commandline.c_str());
+  }
+
+
+//   fprintf(of, "%s   Sequence range to process:       %d\t-\t",  s, global_sequence_from);
+//   if (global_sequence_to == -1u)
+//     fprintf(of, "last sequence\n");
+//   else
+//     fprintf(of, "%d\n", global_sequence_to);
+}
+
+
+void print_output_creation_message(FILE *of, char *s)
+{
+  fprintf(of, "%sOutput created by " PROGNAME ", version " VERSION "\n", s);
+  fprintf(of, "%s\n", s);
+  print_parameters(of, s);
+  fprintf(of, "%s\n", s);
+}
diff --git a/global-types-and-parameters.h b/global-types-and-parameters.h
new file mode 100644
index 0000000..082f0ee
--- /dev/null
+++ b/global-types-and-parameters.h
@@ -0,0 +1,87 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef GLOBAL_TYPES_AND_PARAMETERS_H
+#define GLOBAL_TYPES_AND_PARAMETERS_H
+
+#include <cstdio>
+#include <iostream>
+#include <vector>
+#include <string>
+#include <cstring>
+#include "faststring2.h"
+#include <climits>
+#include <fstream>
+
+#define DEBUG
+
+#define PROGNAME "Bait-Filter"
+#define VERSION  "1.0.5"
+
+extern faststring                       global_bait_filename;     //
+extern char                             global_mode;              //
+extern faststring                       global_blast_exe;         // 
+extern faststring                       global_output_filename;
+
+extern double                           global_blast_min_hit_coverage_of_bait;
+extern double                           global_blast_max_first_hit_evalue;
+extern double                           global_blast_max_second_hit_evalue;
+extern faststring                       global_blast_db;  //
+
+extern faststring                       global_blast_extra_commandline;
+extern faststring                       global_blast_evalue_commandline;
+
+extern unsigned                         global_thinning_step_width;
+
+extern bool                             global_use_GUI;
+extern unsigned                         global_conversion_mode;
+
+extern faststring                       global_ProbeID_prefix;
+
+extern unsigned                         global_verbosity;
+
+#define macromax(x,y) ((x)<(y) ? (y) : (x))
+#define macromin(x,y) ((x)<(y) ? (x) : (y))
+
+#ifdef  DEBUG
+#define DEBUGOUT1(x)        std::cerr << x                << std::endl;
+#define DEBUGOUT2(x,y)      std::cerr << x << y           << std::endl;
+#define DEBUGOUT3(x,y,z)    std::cerr << x << y << z      << std::endl;
+#define DEBUGOUT4(x,y,z,w)  std::cerr << x << y << z << w << std::endl;
+#else
+#define DEBUGOUT1(x)
+#define DEBUGOUT2(x,y)
+#define DEBUGOUT3(x,y,z)
+#define DEBUGOUT4(x,y,z,w)
+#endif
+
+
+void good_bye_and_exit(FILE *of, int);
+void init_param();
+void read_and_init_parameters(int argc, char** argv);
+void print_parameters(FILE*, const char *s);
+
+#endif
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..609fcd6
--- /dev/null
+++ b/makefile
@@ -0,0 +1,21 @@
+CPP = g++
+CPPFLAGS = -I . -O3
+
+OBJECTS1 = bait-fisher-helper.o bait-fisher.o Csequence_cluster_and_center_sequence.o mydir-unix.o
+OBJECTS2 = bait-filter.o global-types-and-parameters.o
+
+%.o: %.cpp
+	$(CPP) $(CPPFLAGS) -c $< -o $@
+
+default: BaitFisher-v1.2.7 BaitFilter-v1.0.5
+
+BaitFisher-v1.2.7: $(OBJECTS1)
+	$(CPP) $(CPPFLAGS) -lstdc++ $(OBJECTS1) -o $@
+
+BaitFilter-v1.0.5: $(OBJECTS2)
+	$(CPP) $(CPPFLAGS) -lstdc++ $(OBJECTS2) -o $@
+
+clean:
+	rm -f *.o
+	rm -f BaitFisher-v1.2.7
+	rm -f BaitFilter-v1.0.5
diff --git a/makefile_win b/makefile_win
new file mode 100644
index 0000000..9cd3de0
--- /dev/null
+++ b/makefile_win
@@ -0,0 +1,24 @@
+## Requires mingw to be installed".
+
+CPP = g++
+CPPFLAGS = -I . -O3
+
+OBJECTS1 = bait-fisher-helper.o bait-fisher.o Csequence_cluster_and_center_sequence.o mydir-unix.o
+OBJECTS2 = bait-filter.o global-types-and-parameters.o
+
+%.o: %.cpp
+	$(CPP) $(CPPFLAGS) -c $< -o $@
+
+default: BaitFisher-v1.2.7 BaitFilter-v1.0.5
+
+BaitFisher-v1.2.7: $(OBJECTS1)
+	$(CPP) $(CPPFLAGS) -lstdc++ $(OBJECTS1) -o $@
+
+BaitFilter-v1.0.5: $(OBJECTS2)
+	$(CPP) $(CPPFLAGS) -lstdc++ $(OBJECTS2) -o $@
+
+clean:
+	rm -f *.o
+	rm -f BaitFisher-v1.2.7
+	rm -f BaitFilter-v1.0.5
+
diff --git a/mydir-unix.cpp b/mydir-unix.cpp
new file mode 100644
index 0000000..24494de
--- /dev/null
+++ b/mydir-unix.cpp
@@ -0,0 +1,386 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#include <iostream>
+#include <fstream>
+#include <unistd.h>    // Might be available for mingw. I have not verified this. (??)
+#include <sys/stat.h>  // Should be available for mingw. I have not verified this. (??)
+#include <sys/types.h>
+#include "faststring2.h"
+#include <stdio.h>
+#include <dirent.h>
+
+
+#include "mydir-unix.h"
+
+using namespace std;
+
+bool file_exists(const char *fname)
+{
+  std::ifstream is;
+  is.open(fname);
+  if (is.fail())
+  {
+    return false;
+  }
+  is.close();
+  return true;
+}
+
+
+
+bool file_or_dir_exists(const char *fname)
+{
+  struct stat st;
+  if(stat(fname,&st) == 0)
+  {
+    return true;
+  }
+  else
+    return false;
+}
+
+// Determines the file type:
+// 0: does not exist
+// 1: regular file
+// 2: directory
+// 5: other
+
+int file_or_dir_type(const char *fname)
+{
+  struct stat st;
+  if(stat(fname,&st) != 0)
+  {
+    return 0;
+  }
+
+  // Link detection does not seem to work properly on my mac.
+//   if (st.st_mode & S_IFLNK)
+//   {
+//     if (st.st_mode & S_IFREG)
+//       return 3;
+//     if (st.st_mode & S_IFDIR)
+//       return 4;
+//   }
+
+  if (st.st_mode & S_IFREG)
+    return 1;
+  if (st.st_mode & S_IFDIR)
+    return 2;
+
+  return 5;
+}
+
+// bool directory_exists(const char *dname)
+// {
+//   struct stat st;
+//   if(stat(dname,&st) == 0)
+//   {
+//     return true;
+//   }
+//   else
+//     return false;
+// }
+
+
+bool change_dir(const char *dname)
+{
+  return (chdir(dname)==0);
+}
+
+// Remember: This does not work like the mv on linux. The new_name must be complete. It cannot end in an existing directory.
+bool move_file_or_dir(const char* old_name, const char *new_name)
+{
+  int res = rename(old_name, new_name);
+
+  return (res == 0);
+}
+
+
+bool make_directory(const char *dname)
+{
+  return (mkdir(dname, 0700) == 0); // Default: Only user is allowed to use this folder.
+}
+
+void next_file_name_in_series(faststring &str, unsigned *z)
+{
+  faststring fname_without_extension;
+  faststring putative_version;
+
+  str.backwards_search_divide_at_break_at('_','/',fname_without_extension, putative_version);
+
+  unsigned   version = 0;
+  //  cerr << "putative_version: " << putative_version << endl;
+
+  if (!putative_version.empty() && putative_version.isAnUnsigned() )
+  {
+    version = putative_version.ToUnsigned(); 
+    ++version;
+  }
+  str = fname_without_extension + "_" + faststring(version);
+  //  cerr << "next str in series: " << str << endl;
+  if (z != NULL)
+  {
+    *z = version;
+  }
+}
+
+
+//   faststring path = str.get_path();
+//   faststring name = str.get_FileOrDirName();
+//   faststring major_name = name;
+//   unsigned   version = 0;
+//   //  cerr << path << "/" << name << endl;
+//   //  cerr << major_name << endl;
+
+//   unsigned pos_underscore = major_name.rfind('_');
+//   if (pos_underscore != faststring::npos)
+//   {
+//     faststring putative_version(major_name.begin()+pos_underscore+1, major_name.end());
+//     //    cerr << "putative_version: " << putative_version << endl;
+//     if (putative_version.isAnUnsigned())
+//     {
+//       version = putative_version.ToUnsigned();
+//       major_name.shorten(pos_underscore);
+//       //      cerr << major_name << endl;
+//     }
+//     ++version;
+//   }
+//   str = path + "/" + major_name + "_" + faststring(version);
+//   //  cerr << "next str in series: " << str << endl;
+//   if (z != NULL)
+//   {
+//     *z = version;
+//   }
+
+faststring next_unique_file_or_dir_name(faststring str, unsigned *z)
+{
+  faststring fname_without_extension;
+  faststring putative_version;
+
+  str.backwards_search_divide_at_break_at('_','/',fname_without_extension, putative_version);
+
+ 
+  unsigned   version = 0;
+  //  cerr << "putative_version: " << putative_version << endl;
+
+  if (!putative_version.empty() && putative_version.isAnUnsigned() )
+  {
+    version = putative_version.ToUnsigned(); 
+    ++version;
+  }
+  str = fname_without_extension + "_" + faststring(version);
+  //  cerr << "next str in series: " << str << endl;
+  if (z != NULL)
+  {
+    *z = version;
+  }
+
+  while (file_or_dir_exists(str.c_str()))
+  {
+    ++version;
+    str = fname_without_extension + "_" + faststring(version);
+  }
+  return str;
+}
+
+// faststring next_unique_file_or_dir_name(faststring str, unsigned *z)
+// {
+//   faststring path = str.get_path();
+//   faststring name = str.get_FileOrDirName();
+//   faststring major_name = name;
+//   unsigned   version = 0;
+//   //  cerr << path << "/" << name << endl;
+//   //  cerr << major_name << endl;
+
+
+//   unsigned pos_underscore = major_name.rfind('_');
+//   if (pos_underscore != faststring::npos)
+//   {
+//     faststring putative_version(major_name.begin()+pos_underscore+1, major_name.end());
+//     //   cerr << "putative_version: " << putative_version << endl;
+
+//     if (putative_version.isAnUnsigned())
+//     {
+//       version = putative_version.ToUnsigned();
+//       major_name.shorten(pos_underscore);
+//       //      cerr << major_name << endl;
+//     }
+//   }
+//   ++version;
+//   str = path + "/" + major_name + "_" + faststring(version);
+//   //  cerr << "str: " << str << endl;
+
+
+//   while (file_or_dir_exists(str.c_str()))
+//   {
+//     ++version;
+//     str = path + "/" + major_name + "_" + faststring(version);
+//   }
+
+//   if (z != NULL)
+//   {
+//     *z = version;
+//   }
+//   return str;  
+// }
+
+// This version does not seem to work:
+// faststring get_working_directory()
+// {
+//   char buf[400];
+
+//   getcwd(buf, 400);
+//   return faststring(buf);
+// }
+
+// faststring get_working_directory2(char* argv0)
+// {
+// }
+
+
+bool      get_file_names_in_dir(std::list<faststring>& container, faststring &path_name)
+{
+  faststring filepath;
+  DIR *dp;
+  struct dirent *dirp;
+  struct stat filestat;
+
+  path_name.removeSpacesBack(" /");
+
+  dp = opendir( path_name.c_str() );
+  if (dp == NULL)
+  {
+    return false;
+  }
+
+  while ((dirp = readdir( dp )))
+  {
+    filepath = path_name + "/" + dirp->d_name;
+
+    // If the file is a directory (or is in some way invalid) we'll skip it 
+    if (stat( filepath.c_str(), &filestat )) continue;
+    if (S_ISDIR( filestat.st_mode ))         continue;
+
+    container.push_back(dirp->d_name);
+  }
+  closedir( dp );
+
+  return true;
+}
+
+bool     get_file_names_in_dir(std::list<faststring>& container, faststring &path_name, faststring &extension_filter)
+{
+  faststring filepath, extension;
+  DIR *dp;
+  struct dirent *dirp;
+  struct stat filestat;
+
+  path_name.removeSpacesBack(" /");
+
+  dp = opendir( path_name.c_str() );
+  if (dp == NULL)
+  {
+    return false;
+  }
+
+  while ((dirp = readdir( dp )))
+  {
+    filepath = path_name + "/" + dirp->d_name;
+
+    // If the file is a directory (or is in some way invalid) we'll skip it 
+    if (stat( filepath.c_str(), &filestat )) continue;
+    if (S_ISDIR( filestat.st_mode ))         continue;
+
+    extension = filepath.filename_extension();
+
+    if (extension_filter == extension)
+	container.push_back(dirp->d_name);
+  }
+  closedir( dp );
+
+  return true;  
+}
+
+bool     get_file_names_in_dir(std::list<faststring>& container, faststring &path_name, std::list<faststring> &extension_filter)
+{
+  faststring filepath, extension;
+  DIR *dp;
+  struct dirent *dirp;
+  struct stat filestat;
+
+  std::list<faststring>::iterator it, it1 = extension_filter.begin();
+  std::list<faststring>::iterator it2     = extension_filter.end();
+
+  path_name.removeSpacesBack(" /");
+
+  dp = opendir( path_name.c_str() );
+  if (dp == NULL)
+  {
+    return false;
+  }
+
+  while ((dirp = readdir( dp )))
+  {
+    filepath = path_name + "/" + dirp->d_name;
+
+    // If the file is a directory (or is in some way invalid) we'll skip it 
+    if (stat( filepath.c_str(), &filestat )) continue;
+    if (S_ISDIR( filestat.st_mode ))         continue;
+
+    extension = filepath.filename_extension();
+
+    it = it1;
+    while (it != it2)
+    {
+      if (*it == extension)
+	container.push_back(dirp->d_name);
+      ++it;
+    }
+  }
+  closedir( dp );
+
+  return true;  
+}
+
+long long get_file_size(faststring path_name)
+{
+  //  cout << path_name.c_str() << endl;
+  struct stat filestatus;
+  if (stat( path_name.c_str(), &filestatus )==0)
+  {
+    return filestatus.st_size;
+  }
+
+  // This value is returned if no file size could be determined.
+  // E.g. if the file does not exist.
+  return -1;
+}
+
+
+
+
+
diff --git a/mydir-unix.h b/mydir-unix.h
new file mode 100644
index 0000000..4282590
--- /dev/null
+++ b/mydir-unix.h
@@ -0,0 +1,57 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef MYDIR_H
+#define MYDIR_H
+
+#include "faststring2.h"
+
+
+bool file_exists(const char *);
+bool file_or_dir_exists(const char *);
+bool move_file_or_dir(const char*, const char *);
+
+bool make_directory(const char *);
+bool change_dir(const char *);
+
+faststring next_unique_file_or_dir_name(faststring, unsigned *z=NULL);
+void       next_file_name_in_series(faststring &, unsigned *z=NULL);
+
+faststring get_working_directory();
+faststring get_working_directory2(char *);
+
+bool      get_file_names_in_dir(std::list<faststring>&, faststring &path_name);
+bool      get_file_names_in_dir(std::list<faststring>&, faststring &path_name, faststring &extension_filter);
+bool      get_file_names_in_dir(std::list<faststring>&, faststring &path_name, std::list<faststring> &extension_filter);
+
+long long get_file_size(faststring path_name);
+int       file_or_dir_type(const char *fname);
+
+//faststring pwd();
+
+#endif
+
+
diff --git a/primefactors.h b/primefactors.h
new file mode 100644
index 0000000..345211c
--- /dev/null
+++ b/primefactors.h
@@ -0,0 +1,10034 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef PRIMEFACTORS_H
+#define PRIMEFACTORS_H
+
+static int primeFactors[10001][6] =
+  {
+    {  0,  0,  0,  0,  0,  0},   // 0
+    {  0,  0,  0,  0,  0,  0},   // 1
+    {  0,  0,  0,  0,  0,  0},   // 2
+    {  0,  0,  0,  0,  0,  0},   // 3
+    {  2,  0,  0,  0,  0,  0},   // 4
+    {  0,  0,  0,  0,  0,  0},   // 5
+    {  2,  3,  0,  0,  0,  0},   // 6
+    {  0,  0,  0,  0,  0,  0},   // 7
+    {  2,  0,  0,  0,  0,  0},   // 8
+    {  3,  0,  0,  0,  0,  0},   // 9
+    {  2,  5,  0,  0,  0,  0},   // 10
+    {  0,  0,  0,  0,  0,  0},   // 11
+    {  2,  3,  0,  0,  0,  0},   // 12
+    {  0,  0,  0,  0,  0,  0},   // 13
+    {  2,  7,  0,  0,  0,  0},   // 14
+    {  3,  5,  0,  0,  0,  0},   // 15
+    {  2,  0,  0,  0,  0,  0},   // 16
+    {  0,  0,  0,  0,  0,  0},   // 17
+    {  2,  3,  0,  0,  0,  0},   // 18
+    {  0,  0,  0,  0,  0,  0},   // 19
+    {  2,  5,  0,  0,  0,  0},   // 20
+    {  3,  7,  0,  0,  0,  0},   // 21
+    {  2, 11,  0,  0,  0,  0},   // 22
+    {  0,  0,  0,  0,  0,  0},   // 23
+    {  2,  3,  0,  0,  0,  0},   // 24
+    {  5,  0,  0,  0,  0,  0},   // 25
+    {  2, 13,  0,  0,  0,  0},   // 26
+    {  3,  0,  0,  0,  0,  0},   // 27
+    {  2,  7,  0,  0,  0,  0},   // 28
+    {  0,  0,  0,  0,  0,  0},   // 29
+    {  2,  3,  5,  0,  0,  0},   // 30
+    {  0,  0,  0,  0,  0,  0},   // 31
+    {  2,  0,  0,  0,  0,  0},   // 32
+    {  3, 11,  0,  0,  0,  0},   // 33
+    {  2, 17,  0,  0,  0,  0},   // 34
+    {  5,  7,  0,  0,  0,  0},   // 35
+    {  2,  3,  0,  0,  0,  0},   // 36
+    {  0,  0,  0,  0,  0,  0},   // 37
+    {  2, 19,  0,  0,  0,  0},   // 38
+    {  3, 13,  0,  0,  0,  0},   // 39
+    {  2,  5,  0,  0,  0,  0},   // 40
+    {  0,  0,  0,  0,  0,  0},   // 41
+    {  2,  3,  7,  0,  0,  0},   // 42
+    {  0,  0,  0,  0,  0,  0},   // 43
+    {  2, 11,  0,  0,  0,  0},   // 44
+    {  3,  5,  0,  0,  0,  0},   // 45
+    {  2, 23,  0,  0,  0,  0},   // 46
+    {  0,  0,  0,  0,  0,  0},   // 47
+    {  2,  3,  0,  0,  0,  0},   // 48
+    {  7,  0,  0,  0,  0,  0},   // 49
+    {  2,  5,  0,  0,  0,  0},   // 50
+    {  3, 17,  0,  0,  0,  0},   // 51
+    {  2, 13,  0,  0,  0,  0},   // 52
+    {  0,  0,  0,  0,  0,  0},   // 53
+    {  2,  3,  0,  0,  0,  0},   // 54
+    {  5, 11,  0,  0,  0,  0},   // 55
+    {  2,  7,  0,  0,  0,  0},   // 56
+    {  3, 19,  0,  0,  0,  0},   // 57
+    {  2, 29,  0,  0,  0,  0},   // 58
+    {  0,  0,  0,  0,  0,  0},   // 59
+    {  2,  3,  5,  0,  0,  0},   // 60
+    {  0,  0,  0,  0,  0,  0},   // 61
+    {  2, 31,  0,  0,  0,  0},   // 62
+    {  3,  7,  0,  0,  0,  0},   // 63
+    {  2,  0,  0,  0,  0,  0},   // 64
+    {  5, 13,  0,  0,  0,  0},   // 65
+    {  2,  3, 11,  0,  0,  0},   // 66
+    {  0,  0,  0,  0,  0,  0},   // 67
+    {  2, 17,  0,  0,  0,  0},   // 68
+    {  3, 23,  0,  0,  0,  0},   // 69
+    {  2,  5,  7,  0,  0,  0},   // 70
+    {  0,  0,  0,  0,  0,  0},   // 71
+    {  2,  3,  0,  0,  0,  0},   // 72
+    {  0,  0,  0,  0,  0,  0},   // 73
+    {  2, 37,  0,  0,  0,  0},   // 74
+    {  3,  5,  0,  0,  0,  0},   // 75
+    {  2, 19,  0,  0,  0,  0},   // 76
+    {  7, 11,  0,  0,  0,  0},   // 77
+    {  2,  3, 13,  0,  0,  0},   // 78
+    {  0,  0,  0,  0,  0,  0},   // 79
+    {  2,  5,  0,  0,  0,  0},   // 80
+    {  3,  0,  0,  0,  0,  0},   // 81
+    {  2, 41,  0,  0,  0,  0},   // 82
+    {  0,  0,  0,  0,  0,  0},   // 83
+    {  2,  3,  7,  0,  0,  0},   // 84
+    {  5, 17,  0,  0,  0,  0},   // 85
+    {  2, 43,  0,  0,  0,  0},   // 86
+    {  3, 29,  0,  0,  0,  0},   // 87
+    {  2, 11,  0,  0,  0,  0},   // 88
+    {  0,  0,  0,  0,  0,  0},   // 89
+    {  2,  3,  5,  0,  0,  0},   // 90
+    {  7, 13,  0,  0,  0,  0},   // 91
+    {  2, 23,  0,  0,  0,  0},   // 92
+    {  3, 31,  0,  0,  0,  0},   // 93
+    {  2, 47,  0,  0,  0,  0},   // 94
+    {  5, 19,  0,  0,  0,  0},   // 95
+    {  2,  3,  0,  0,  0,  0},   // 96
+    {  0,  0,  0,  0,  0,  0},   // 97
+    {  2,  7,  0,  0,  0,  0},   // 98
+    {  3, 11,  0,  0,  0,  0},   // 99
+    {  2,  5,  0,  0,  0,  0},   // 100
+    {  0,  0,  0,  0,  0,  0},   // 101
+    {  2,  3, 17,  0,  0,  0},   // 102
+    {  0,  0,  0,  0,  0,  0},   // 103
+    {  2, 13,  0,  0,  0,  0},   // 104
+    {  3,  5,  7,  0,  0,  0},   // 105
+    {  2, 53,  0,  0,  0,  0},   // 106
+    {  0,  0,  0,  0,  0,  0},   // 107
+    {  2,  3,  0,  0,  0,  0},   // 108
+    {  0,  0,  0,  0,  0,  0},   // 109
+    {  2,  5, 11,  0,  0,  0},   // 110
+    {  3, 37,  0,  0,  0,  0},   // 111
+    {  2,  7,  0,  0,  0,  0},   // 112
+    {  0,  0,  0,  0,  0,  0},   // 113
+    {  2,  3, 19,  0,  0,  0},   // 114
+    {  5, 23,  0,  0,  0,  0},   // 115
+    {  2, 29,  0,  0,  0,  0},   // 116
+    {  3, 13,  0,  0,  0,  0},   // 117
+    {  2, 59,  0,  0,  0,  0},   // 118
+    {  7, 17,  0,  0,  0,  0},   // 119
+    {  2,  3,  5,  0,  0,  0},   // 120
+    { 11,  0,  0,  0,  0,  0},   // 121
+    {  2, 61,  0,  0,  0,  0},   // 122
+    {  3, 41,  0,  0,  0,  0},   // 123
+    {  2, 31,  0,  0,  0,  0},   // 124
+    {  5,  0,  0,  0,  0,  0},   // 125
+    {  2,  3,  7,  0,  0,  0},   // 126
+    {  0,  0,  0,  0,  0,  0},   // 127
+    {  2,  0,  0,  0,  0,  0},   // 128
+    {  3, 43,  0,  0,  0,  0},   // 129
+    {  2,  5, 13,  0,  0,  0},   // 130
+    {  0,  0,  0,  0,  0,  0},   // 131
+    {  2,  3, 11,  0,  0,  0},   // 132
+    {  7, 19,  0,  0,  0,  0},   // 133
+    {  2, 67,  0,  0,  0,  0},   // 134
+    {  3,  5,  0,  0,  0,  0},   // 135
+    {  2, 17,  0,  0,  0,  0},   // 136
+    {  0,  0,  0,  0,  0,  0},   // 137
+    {  2,  3, 23,  0,  0,  0},   // 138
+    {  0,  0,  0,  0,  0,  0},   // 139
+    {  2,  5,  7,  0,  0,  0},   // 140
+    {  3, 47,  0,  0,  0,  0},   // 141
+    {  2, 71,  0,  0,  0,  0},   // 142
+    { 11, 13,  0,  0,  0,  0},   // 143
+    {  2,  3,  0,  0,  0,  0},   // 144
+    {  5, 29,  0,  0,  0,  0},   // 145
+    {  2, 73,  0,  0,  0,  0},   // 146
+    {  3,  7,  0,  0,  0,  0},   // 147
+    {  2, 37,  0,  0,  0,  0},   // 148
+    {  0,  0,  0,  0,  0,  0},   // 149
+    {  2,  3,  5,  0,  0,  0},   // 150
+    {  0,  0,  0,  0,  0,  0},   // 151
+    {  2, 19,  0,  0,  0,  0},   // 152
+    {  3, 17,  0,  0,  0,  0},   // 153
+    {  2,  7, 11,  0,  0,  0},   // 154
+    {  5, 31,  0,  0,  0,  0},   // 155
+    {  2,  3, 13,  0,  0,  0},   // 156
+    {  0,  0,  0,  0,  0,  0},   // 157
+    {  2, 79,  0,  0,  0,  0},   // 158
+    {  3, 53,  0,  0,  0,  0},   // 159
+    {  2,  5,  0,  0,  0,  0},   // 160
+    {  7, 23,  0,  0,  0,  0},   // 161
+    {  2,  3,  0,  0,  0,  0},   // 162
+    {  0,  0,  0,  0,  0,  0},   // 163
+    {  2, 41,  0,  0,  0,  0},   // 164
+    {  3,  5, 11,  0,  0,  0},   // 165
+    {  2, 83,  0,  0,  0,  0},   // 166
+    {  0,  0,  0,  0,  0,  0},   // 167
+    {  2,  3,  7,  0,  0,  0},   // 168
+    { 13,  0,  0,  0,  0,  0},   // 169
+    {  2,  5, 17,  0,  0,  0},   // 170
+    {  3, 19,  0,  0,  0,  0},   // 171
+    {  2, 43,  0,  0,  0,  0},   // 172
+    {  0,  0,  0,  0,  0,  0},   // 173
+    {  2,  3, 29,  0,  0,  0},   // 174
+    {  5,  7,  0,  0,  0,  0},   // 175
+    {  2, 11,  0,  0,  0,  0},   // 176
+    {  3, 59,  0,  0,  0,  0},   // 177
+    {  2, 89,  0,  0,  0,  0},   // 178
+    {  0,  0,  0,  0,  0,  0},   // 179
+    {  2,  3,  5,  0,  0,  0},   // 180
+    {  0,  0,  0,  0,  0,  0},   // 181
+    {  2,  7, 13,  0,  0,  0},   // 182
+    {  3, 61,  0,  0,  0,  0},   // 183
+    {  2, 23,  0,  0,  0,  0},   // 184
+    {  5, 37,  0,  0,  0,  0},   // 185
+    {  2,  3, 31,  0,  0,  0},   // 186
+    { 11, 17,  0,  0,  0,  0},   // 187
+    {  2, 47,  0,  0,  0,  0},   // 188
+    {  3,  7,  0,  0,  0,  0},   // 189
+    {  2,  5, 19,  0,  0,  0},   // 190
+    {  0,  0,  0,  0,  0,  0},   // 191
+    {  2,  3,  0,  0,  0,  0},   // 192
+    {  0,  0,  0,  0,  0,  0},   // 193
+    {  2, 97,  0,  0,  0,  0},   // 194
+    {  3,  5, 13,  0,  0,  0},   // 195
+    {  2,  7,  0,  0,  0,  0},   // 196
+    {  0,  0,  0,  0,  0,  0},   // 197
+    {  2,  3, 11,  0,  0,  0},   // 198
+    {  0,  0,  0,  0,  0,  0},   // 199
+    {  2,  5,  0,  0,  0,  0},   // 200
+    {  3, 67,  0,  0,  0,  0},   // 201
+    {  2,101,  0,  0,  0,  0},   // 202
+    {  7, 29,  0,  0,  0,  0},   // 203
+    {  2,  3, 17,  0,  0,  0},   // 204
+    {  5, 41,  0,  0,  0,  0},   // 205
+    {  2,103,  0,  0,  0,  0},   // 206
+    {  3, 23,  0,  0,  0,  0},   // 207
+    {  2, 13,  0,  0,  0,  0},   // 208
+    { 11, 19,  0,  0,  0,  0},   // 209
+    {  2,  3,  5,  7,  0,  0},   // 210
+    {  0,  0,  0,  0,  0,  0},   // 211
+    {  2, 53,  0,  0,  0,  0},   // 212
+    {  3, 71,  0,  0,  0,  0},   // 213
+    {  2,107,  0,  0,  0,  0},   // 214
+    {  5, 43,  0,  0,  0,  0},   // 215
+    {  2,  3,  0,  0,  0,  0},   // 216
+    {  7, 31,  0,  0,  0,  0},   // 217
+    {  2,109,  0,  0,  0,  0},   // 218
+    {  3, 73,  0,  0,  0,  0},   // 219
+    {  2,  5, 11,  0,  0,  0},   // 220
+    { 13, 17,  0,  0,  0,  0},   // 221
+    {  2,  3, 37,  0,  0,  0},   // 222
+    {  0,  0,  0,  0,  0,  0},   // 223
+    {  2,  7,  0,  0,  0,  0},   // 224
+    {  3,  5,  0,  0,  0,  0},   // 225
+    {  2,113,  0,  0,  0,  0},   // 226
+    {  0,  0,  0,  0,  0,  0},   // 227
+    {  2,  3, 19,  0,  0,  0},   // 228
+    {  0,  0,  0,  0,  0,  0},   // 229
+    {  2,  5, 23,  0,  0,  0},   // 230
+    {  3,  7, 11,  0,  0,  0},   // 231
+    {  2, 29,  0,  0,  0,  0},   // 232
+    {  0,  0,  0,  0,  0,  0},   // 233
+    {  2,  3, 13,  0,  0,  0},   // 234
+    {  5, 47,  0,  0,  0,  0},   // 235
+    {  2, 59,  0,  0,  0,  0},   // 236
+    {  3, 79,  0,  0,  0,  0},   // 237
+    {  2,  7, 17,  0,  0,  0},   // 238
+    {  0,  0,  0,  0,  0,  0},   // 239
+    {  2,  3,  5,  0,  0,  0},   // 240
+    {  0,  0,  0,  0,  0,  0},   // 241
+    {  2, 11,  0,  0,  0,  0},   // 242
+    {  3,  0,  0,  0,  0,  0},   // 243
+    {  2, 61,  0,  0,  0,  0},   // 244
+    {  5,  7,  0,  0,  0,  0},   // 245
+    {  2,  3, 41,  0,  0,  0},   // 246
+    { 13, 19,  0,  0,  0,  0},   // 247
+    {  2, 31,  0,  0,  0,  0},   // 248
+    {  3, 83,  0,  0,  0,  0},   // 249
+    {  2,  5,  0,  0,  0,  0},   // 250
+    {  0,  0,  0,  0,  0,  0},   // 251
+    {  2,  3,  7,  0,  0,  0},   // 252
+    { 11, 23,  0,  0,  0,  0},   // 253
+    {  2,127,  0,  0,  0,  0},   // 254
+    {  3,  5, 17,  0,  0,  0},   // 255
+    {  2,  0,  0,  0,  0,  0},   // 256
+    {  0,  0,  0,  0,  0,  0},   // 257
+    {  2,  3, 43,  0,  0,  0},   // 258
+    {  7, 37,  0,  0,  0,  0},   // 259
+    {  2,  5, 13,  0,  0,  0},   // 260
+    {  3, 29,  0,  0,  0,  0},   // 261
+    {  2,131,  0,  0,  0,  0},   // 262
+    {  0,  0,  0,  0,  0,  0},   // 263
+    {  2,  3, 11,  0,  0,  0},   // 264
+    {  5, 53,  0,  0,  0,  0},   // 265
+    {  2,  7, 19,  0,  0,  0},   // 266
+    {  3, 89,  0,  0,  0,  0},   // 267
+    {  2, 67,  0,  0,  0,  0},   // 268
+    {  0,  0,  0,  0,  0,  0},   // 269
+    {  2,  3,  5,  0,  0,  0},   // 270
+    {  0,  0,  0,  0,  0,  0},   // 271
+    {  2, 17,  0,  0,  0,  0},   // 272
+    {  3,  7, 13,  0,  0,  0},   // 273
+    {  2,137,  0,  0,  0,  0},   // 274
+    {  5, 11,  0,  0,  0,  0},   // 275
+    {  2,  3, 23,  0,  0,  0},   // 276
+    {  0,  0,  0,  0,  0,  0},   // 277
+    {  2,139,  0,  0,  0,  0},   // 278
+    {  3, 31,  0,  0,  0,  0},   // 279
+    {  2,  5,  7,  0,  0,  0},   // 280
+    {  0,  0,  0,  0,  0,  0},   // 281
+    {  2,  3, 47,  0,  0,  0},   // 282
+    {  0,  0,  0,  0,  0,  0},   // 283
+    {  2, 71,  0,  0,  0,  0},   // 284
+    {  3,  5, 19,  0,  0,  0},   // 285
+    {  2, 11, 13,  0,  0,  0},   // 286
+    {  7, 41,  0,  0,  0,  0},   // 287
+    {  2,  3,  0,  0,  0,  0},   // 288
+    { 17,  0,  0,  0,  0,  0},   // 289
+    {  2,  5, 29,  0,  0,  0},   // 290
+    {  3, 97,  0,  0,  0,  0},   // 291
+    {  2, 73,  0,  0,  0,  0},   // 292
+    {  0,  0,  0,  0,  0,  0},   // 293
+    {  2,  3,  7,  0,  0,  0},   // 294
+    {  5, 59,  0,  0,  0,  0},   // 295
+    {  2, 37,  0,  0,  0,  0},   // 296
+    {  3, 11,  0,  0,  0,  0},   // 297
+    {  2,149,  0,  0,  0,  0},   // 298
+    { 13, 23,  0,  0,  0,  0},   // 299
+    {  2,  3,  5,  0,  0,  0},   // 300
+    {  7, 43,  0,  0,  0,  0},   // 301
+    {  2,151,  0,  0,  0,  0},   // 302
+    {  3,101,  0,  0,  0,  0},   // 303
+    {  2, 19,  0,  0,  0,  0},   // 304
+    {  5, 61,  0,  0,  0,  0},   // 305
+    {  2,  3, 17,  0,  0,  0},   // 306
+    {  0,  0,  0,  0,  0,  0},   // 307
+    {  2,  7, 11,  0,  0,  0},   // 308
+    {  3,103,  0,  0,  0,  0},   // 309
+    {  2,  5, 31,  0,  0,  0},   // 310
+    {  0,  0,  0,  0,  0,  0},   // 311
+    {  2,  3, 13,  0,  0,  0},   // 312
+    {  0,  0,  0,  0,  0,  0},   // 313
+    {  2,157,  0,  0,  0,  0},   // 314
+    {  3,  5,  7,  0,  0,  0},   // 315
+    {  2, 79,  0,  0,  0,  0},   // 316
+    {  0,  0,  0,  0,  0,  0},   // 317
+    {  2,  3, 53,  0,  0,  0},   // 318
+    { 11, 29,  0,  0,  0,  0},   // 319
+    {  2,  5,  0,  0,  0,  0},   // 320
+    {  3,107,  0,  0,  0,  0},   // 321
+    {  2,  7, 23,  0,  0,  0},   // 322
+    { 17, 19,  0,  0,  0,  0},   // 323
+    {  2,  3,  0,  0,  0,  0},   // 324
+    {  5, 13,  0,  0,  0,  0},   // 325
+    {  2,163,  0,  0,  0,  0},   // 326
+    {  3,109,  0,  0,  0,  0},   // 327
+    {  2, 41,  0,  0,  0,  0},   // 328
+    {  7, 47,  0,  0,  0,  0},   // 329
+    {  2,  3,  5, 11,  0,  0},   // 330
+    {  0,  0,  0,  0,  0,  0},   // 331
+    {  2, 83,  0,  0,  0,  0},   // 332
+    {  3, 37,  0,  0,  0,  0},   // 333
+    {  2,167,  0,  0,  0,  0},   // 334
+    {  5, 67,  0,  0,  0,  0},   // 335
+    {  2,  3,  7,  0,  0,  0},   // 336
+    {  0,  0,  0,  0,  0,  0},   // 337
+    {  2, 13,  0,  0,  0,  0},   // 338
+    {  3,113,  0,  0,  0,  0},   // 339
+    {  2,  5, 17,  0,  0,  0},   // 340
+    { 11, 31,  0,  0,  0,  0},   // 341
+    {  2,  3, 19,  0,  0,  0},   // 342
+    {  7,  0,  0,  0,  0,  0},   // 343
+    {  2, 43,  0,  0,  0,  0},   // 344
+    {  3,  5, 23,  0,  0,  0},   // 345
+    {  2,173,  0,  0,  0,  0},   // 346
+    {  0,  0,  0,  0,  0,  0},   // 347
+    {  2,  3, 29,  0,  0,  0},   // 348
+    {  0,  0,  0,  0,  0,  0},   // 349
+    {  2,  5,  7,  0,  0,  0},   // 350
+    {  3, 13,  0,  0,  0,  0},   // 351
+    {  2, 11,  0,  0,  0,  0},   // 352
+    {  0,  0,  0,  0,  0,  0},   // 353
+    {  2,  3, 59,  0,  0,  0},   // 354
+    {  5, 71,  0,  0,  0,  0},   // 355
+    {  2, 89,  0,  0,  0,  0},   // 356
+    {  3,  7, 17,  0,  0,  0},   // 357
+    {  2,179,  0,  0,  0,  0},   // 358
+    {  0,  0,  0,  0,  0,  0},   // 359
+    {  2,  3,  5,  0,  0,  0},   // 360
+    { 19,  0,  0,  0,  0,  0},   // 361
+    {  2,181,  0,  0,  0,  0},   // 362
+    {  3, 11,  0,  0,  0,  0},   // 363
+    {  2,  7, 13,  0,  0,  0},   // 364
+    {  5, 73,  0,  0,  0,  0},   // 365
+    {  2,  3, 61,  0,  0,  0},   // 366
+    {  0,  0,  0,  0,  0,  0},   // 367
+    {  2, 23,  0,  0,  0,  0},   // 368
+    {  3, 41,  0,  0,  0,  0},   // 369
+    {  2,  5, 37,  0,  0,  0},   // 370
+    {  7, 53,  0,  0,  0,  0},   // 371
+    {  2,  3, 31,  0,  0,  0},   // 372
+    {  0,  0,  0,  0,  0,  0},   // 373
+    {  2, 11, 17,  0,  0,  0},   // 374
+    {  3,  5,  0,  0,  0,  0},   // 375
+    {  2, 47,  0,  0,  0,  0},   // 376
+    { 13, 29,  0,  0,  0,  0},   // 377
+    {  2,  3,  7,  0,  0,  0},   // 378
+    {  0,  0,  0,  0,  0,  0},   // 379
+    {  2,  5, 19,  0,  0,  0},   // 380
+    {  3,127,  0,  0,  0,  0},   // 381
+    {  2,191,  0,  0,  0,  0},   // 382
+    {  0,  0,  0,  0,  0,  0},   // 383
+    {  2,  3,  0,  0,  0,  0},   // 384
+    {  5,  7, 11,  0,  0,  0},   // 385
+    {  2,193,  0,  0,  0,  0},   // 386
+    {  3, 43,  0,  0,  0,  0},   // 387
+    {  2, 97,  0,  0,  0,  0},   // 388
+    {  0,  0,  0,  0,  0,  0},   // 389
+    {  2,  3,  5, 13,  0,  0},   // 390
+    { 17, 23,  0,  0,  0,  0},   // 391
+    {  2,  7,  0,  0,  0,  0},   // 392
+    {  3,131,  0,  0,  0,  0},   // 393
+    {  2,197,  0,  0,  0,  0},   // 394
+    {  5, 79,  0,  0,  0,  0},   // 395
+    {  2,  3, 11,  0,  0,  0},   // 396
+    {  0,  0,  0,  0,  0,  0},   // 397
+    {  2,199,  0,  0,  0,  0},   // 398
+    {  3,  7, 19,  0,  0,  0},   // 399
+    {  2,  5,  0,  0,  0,  0},   // 400
+    {  0,  0,  0,  0,  0,  0},   // 401
+    {  2,  3, 67,  0,  0,  0},   // 402
+    { 13, 31,  0,  0,  0,  0},   // 403
+    {  2,101,  0,  0,  0,  0},   // 404
+    {  3,  5,  0,  0,  0,  0},   // 405
+    {  2,  7, 29,  0,  0,  0},   // 406
+    { 11, 37,  0,  0,  0,  0},   // 407
+    {  2,  3, 17,  0,  0,  0},   // 408
+    {  0,  0,  0,  0,  0,  0},   // 409
+    {  2,  5, 41,  0,  0,  0},   // 410
+    {  3,137,  0,  0,  0,  0},   // 411
+    {  2,103,  0,  0,  0,  0},   // 412
+    {  7, 59,  0,  0,  0,  0},   // 413
+    {  2,  3, 23,  0,  0,  0},   // 414
+    {  5, 83,  0,  0,  0,  0},   // 415
+    {  2, 13,  0,  0,  0,  0},   // 416
+    {  3,139,  0,  0,  0,  0},   // 417
+    {  2, 11, 19,  0,  0,  0},   // 418
+    {  0,  0,  0,  0,  0,  0},   // 419
+    {  2,  3,  5,  7,  0,  0},   // 420
+    {  0,  0,  0,  0,  0,  0},   // 421
+    {  2,211,  0,  0,  0,  0},   // 422
+    {  3, 47,  0,  0,  0,  0},   // 423
+    {  2, 53,  0,  0,  0,  0},   // 424
+    {  5, 17,  0,  0,  0,  0},   // 425
+    {  2,  3, 71,  0,  0,  0},   // 426
+    {  7, 61,  0,  0,  0,  0},   // 427
+    {  2,107,  0,  0,  0,  0},   // 428
+    {  3, 11, 13,  0,  0,  0},   // 429
+    {  2,  5, 43,  0,  0,  0},   // 430
+    {  0,  0,  0,  0,  0,  0},   // 431
+    {  2,  3,  0,  0,  0,  0},   // 432
+    {  0,  0,  0,  0,  0,  0},   // 433
+    {  2,  7, 31,  0,  0,  0},   // 434
+    {  3,  5, 29,  0,  0,  0},   // 435
+    {  2,109,  0,  0,  0,  0},   // 436
+    { 19, 23,  0,  0,  0,  0},   // 437
+    {  2,  3, 73,  0,  0,  0},   // 438
+    {  0,  0,  0,  0,  0,  0},   // 439
+    {  2,  5, 11,  0,  0,  0},   // 440
+    {  3,  7,  0,  0,  0,  0},   // 441
+    {  2, 13, 17,  0,  0,  0},   // 442
+    {  0,  0,  0,  0,  0,  0},   // 443
+    {  2,  3, 37,  0,  0,  0},   // 444
+    {  5, 89,  0,  0,  0,  0},   // 445
+    {  2,223,  0,  0,  0,  0},   // 446
+    {  3,149,  0,  0,  0,  0},   // 447
+    {  2,  7,  0,  0,  0,  0},   // 448
+    {  0,  0,  0,  0,  0,  0},   // 449
+    {  2,  3,  5,  0,  0,  0},   // 450
+    { 11, 41,  0,  0,  0,  0},   // 451
+    {  2,113,  0,  0,  0,  0},   // 452
+    {  3,151,  0,  0,  0,  0},   // 453
+    {  2,227,  0,  0,  0,  0},   // 454
+    {  5,  7, 13,  0,  0,  0},   // 455
+    {  2,  3, 19,  0,  0,  0},   // 456
+    {  0,  0,  0,  0,  0,  0},   // 457
+    {  2,229,  0,  0,  0,  0},   // 458
+    {  3, 17,  0,  0,  0,  0},   // 459
+    {  2,  5, 23,  0,  0,  0},   // 460
+    {  0,  0,  0,  0,  0,  0},   // 461
+    {  2,  3,  7, 11,  0,  0},   // 462
+    {  0,  0,  0,  0,  0,  0},   // 463
+    {  2, 29,  0,  0,  0,  0},   // 464
+    {  3,  5, 31,  0,  0,  0},   // 465
+    {  2,233,  0,  0,  0,  0},   // 466
+    {  0,  0,  0,  0,  0,  0},   // 467
+    {  2,  3, 13,  0,  0,  0},   // 468
+    {  7, 67,  0,  0,  0,  0},   // 469
+    {  2,  5, 47,  0,  0,  0},   // 470
+    {  3,157,  0,  0,  0,  0},   // 471
+    {  2, 59,  0,  0,  0,  0},   // 472
+    { 11, 43,  0,  0,  0,  0},   // 473
+    {  2,  3, 79,  0,  0,  0},   // 474
+    {  5, 19,  0,  0,  0,  0},   // 475
+    {  2,  7, 17,  0,  0,  0},   // 476
+    {  3, 53,  0,  0,  0,  0},   // 477
+    {  2,239,  0,  0,  0,  0},   // 478
+    {  0,  0,  0,  0,  0,  0},   // 479
+    {  2,  3,  5,  0,  0,  0},   // 480
+    { 13, 37,  0,  0,  0,  0},   // 481
+    {  2,241,  0,  0,  0,  0},   // 482
+    {  3,  7, 23,  0,  0,  0},   // 483
+    {  2, 11,  0,  0,  0,  0},   // 484
+    {  5, 97,  0,  0,  0,  0},   // 485
+    {  2,  3,  0,  0,  0,  0},   // 486
+    {  0,  0,  0,  0,  0,  0},   // 487
+    {  2, 61,  0,  0,  0,  0},   // 488
+    {  3,163,  0,  0,  0,  0},   // 489
+    {  2,  5,  7,  0,  0,  0},   // 490
+    {  0,  0,  0,  0,  0,  0},   // 491
+    {  2,  3, 41,  0,  0,  0},   // 492
+    { 17, 29,  0,  0,  0,  0},   // 493
+    {  2, 13, 19,  0,  0,  0},   // 494
+    {  3,  5, 11,  0,  0,  0},   // 495
+    {  2, 31,  0,  0,  0,  0},   // 496
+    {  7, 71,  0,  0,  0,  0},   // 497
+    {  2,  3, 83,  0,  0,  0},   // 498
+    {  0,  0,  0,  0,  0,  0},   // 499
+    {  2,  5,  0,  0,  0,  0},   // 500
+    {  3,167,  0,  0,  0,  0},   // 501
+    {  2,251,  0,  0,  0,  0},   // 502
+    {  0,  0,  0,  0,  0,  0},   // 503
+    {  2,  3,  7,  0,  0,  0},   // 504
+    {  5,101,  0,  0,  0,  0},   // 505
+    {  2, 11, 23,  0,  0,  0},   // 506
+    {  3, 13,  0,  0,  0,  0},   // 507
+    {  2,127,  0,  0,  0,  0},   // 508
+    {  0,  0,  0,  0,  0,  0},   // 509
+    {  2,  3,  5, 17,  0,  0},   // 510
+    {  7, 73,  0,  0,  0,  0},   // 511
+    {  2,  0,  0,  0,  0,  0},   // 512
+    {  3, 19,  0,  0,  0,  0},   // 513
+    {  2,257,  0,  0,  0,  0},   // 514
+    {  5,103,  0,  0,  0,  0},   // 515
+    {  2,  3, 43,  0,  0,  0},   // 516
+    { 11, 47,  0,  0,  0,  0},   // 517
+    {  2,  7, 37,  0,  0,  0},   // 518
+    {  3,173,  0,  0,  0,  0},   // 519
+    {  2,  5, 13,  0,  0,  0},   // 520
+    {  0,  0,  0,  0,  0,  0},   // 521
+    {  2,  3, 29,  0,  0,  0},   // 522
+    {  0,  0,  0,  0,  0,  0},   // 523
+    {  2,131,  0,  0,  0,  0},   // 524
+    {  3,  5,  7,  0,  0,  0},   // 525
+    {  2,263,  0,  0,  0,  0},   // 526
+    { 17, 31,  0,  0,  0,  0},   // 527
+    {  2,  3, 11,  0,  0,  0},   // 528
+    { 23,  0,  0,  0,  0,  0},   // 529
+    {  2,  5, 53,  0,  0,  0},   // 530
+    {  3, 59,  0,  0,  0,  0},   // 531
+    {  2,  7, 19,  0,  0,  0},   // 532
+    { 13, 41,  0,  0,  0,  0},   // 533
+    {  2,  3, 89,  0,  0,  0},   // 534
+    {  5,107,  0,  0,  0,  0},   // 535
+    {  2, 67,  0,  0,  0,  0},   // 536
+    {  3,179,  0,  0,  0,  0},   // 537
+    {  2,269,  0,  0,  0,  0},   // 538
+    {  7, 11,  0,  0,  0,  0},   // 539
+    {  2,  3,  5,  0,  0,  0},   // 540
+    {  0,  0,  0,  0,  0,  0},   // 541
+    {  2,271,  0,  0,  0,  0},   // 542
+    {  3,181,  0,  0,  0,  0},   // 543
+    {  2, 17,  0,  0,  0,  0},   // 544
+    {  5,109,  0,  0,  0,  0},   // 545
+    {  2,  3,  7, 13,  0,  0},   // 546
+    {  0,  0,  0,  0,  0,  0},   // 547
+    {  2,137,  0,  0,  0,  0},   // 548
+    {  3, 61,  0,  0,  0,  0},   // 549
+    {  2,  5, 11,  0,  0,  0},   // 550
+    { 19, 29,  0,  0,  0,  0},   // 551
+    {  2,  3, 23,  0,  0,  0},   // 552
+    {  7, 79,  0,  0,  0,  0},   // 553
+    {  2,277,  0,  0,  0,  0},   // 554
+    {  3,  5, 37,  0,  0,  0},   // 555
+    {  2,139,  0,  0,  0,  0},   // 556
+    {  0,  0,  0,  0,  0,  0},   // 557
+    {  2,  3, 31,  0,  0,  0},   // 558
+    { 13, 43,  0,  0,  0,  0},   // 559
+    {  2,  5,  7,  0,  0,  0},   // 560
+    {  3, 11, 17,  0,  0,  0},   // 561
+    {  2,281,  0,  0,  0,  0},   // 562
+    {  0,  0,  0,  0,  0,  0},   // 563
+    {  2,  3, 47,  0,  0,  0},   // 564
+    {  5,113,  0,  0,  0,  0},   // 565
+    {  2,283,  0,  0,  0,  0},   // 566
+    {  3,  7,  0,  0,  0,  0},   // 567
+    {  2, 71,  0,  0,  0,  0},   // 568
+    {  0,  0,  0,  0,  0,  0},   // 569
+    {  2,  3,  5, 19,  0,  0},   // 570
+    {  0,  0,  0,  0,  0,  0},   // 571
+    {  2, 11, 13,  0,  0,  0},   // 572
+    {  3,191,  0,  0,  0,  0},   // 573
+    {  2,  7, 41,  0,  0,  0},   // 574
+    {  5, 23,  0,  0,  0,  0},   // 575
+    {  2,  3,  0,  0,  0,  0},   // 576
+    {  0,  0,  0,  0,  0,  0},   // 577
+    {  2, 17,  0,  0,  0,  0},   // 578
+    {  3,193,  0,  0,  0,  0},   // 579
+    {  2,  5, 29,  0,  0,  0},   // 580
+    {  7, 83,  0,  0,  0,  0},   // 581
+    {  2,  3, 97,  0,  0,  0},   // 582
+    { 11, 53,  0,  0,  0,  0},   // 583
+    {  2, 73,  0,  0,  0,  0},   // 584
+    {  3,  5, 13,  0,  0,  0},   // 585
+    {  2,293,  0,  0,  0,  0},   // 586
+    {  0,  0,  0,  0,  0,  0},   // 587
+    {  2,  3,  7,  0,  0,  0},   // 588
+    { 19, 31,  0,  0,  0,  0},   // 589
+    {  2,  5, 59,  0,  0,  0},   // 590
+    {  3,197,  0,  0,  0,  0},   // 591
+    {  2, 37,  0,  0,  0,  0},   // 592
+    {  0,  0,  0,  0,  0,  0},   // 593
+    {  2,  3, 11,  0,  0,  0},   // 594
+    {  5,  7, 17,  0,  0,  0},   // 595
+    {  2,149,  0,  0,  0,  0},   // 596
+    {  3,199,  0,  0,  0,  0},   // 597
+    {  2, 13, 23,  0,  0,  0},   // 598
+    {  0,  0,  0,  0,  0,  0},   // 599
+    {  2,  3,  5,  0,  0,  0},   // 600
+    {  0,  0,  0,  0,  0,  0},   // 601
+    {  2,  7, 43,  0,  0,  0},   // 602
+    {  3, 67,  0,  0,  0,  0},   // 603
+    {  2,151,  0,  0,  0,  0},   // 604
+    {  5, 11,  0,  0,  0,  0},   // 605
+    {  2,  3,101,  0,  0,  0},   // 606
+    {  0,  0,  0,  0,  0,  0},   // 607
+    {  2, 19,  0,  0,  0,  0},   // 608
+    {  3,  7, 29,  0,  0,  0},   // 609
+    {  2,  5, 61,  0,  0,  0},   // 610
+    { 13, 47,  0,  0,  0,  0},   // 611
+    {  2,  3, 17,  0,  0,  0},   // 612
+    {  0,  0,  0,  0,  0,  0},   // 613
+    {  2,307,  0,  0,  0,  0},   // 614
+    {  3,  5, 41,  0,  0,  0},   // 615
+    {  2,  7, 11,  0,  0,  0},   // 616
+    {  0,  0,  0,  0,  0,  0},   // 617
+    {  2,  3,103,  0,  0,  0},   // 618
+    {  0,  0,  0,  0,  0,  0},   // 619
+    {  2,  5, 31,  0,  0,  0},   // 620
+    {  3, 23,  0,  0,  0,  0},   // 621
+    {  2,311,  0,  0,  0,  0},   // 622
+    {  7, 89,  0,  0,  0,  0},   // 623
+    {  2,  3, 13,  0,  0,  0},   // 624
+    {  5,  0,  0,  0,  0,  0},   // 625
+    {  2,313,  0,  0,  0,  0},   // 626
+    {  3, 11, 19,  0,  0,  0},   // 627
+    {  2,157,  0,  0,  0,  0},   // 628
+    { 17, 37,  0,  0,  0,  0},   // 629
+    {  2,  3,  5,  7,  0,  0},   // 630
+    {  0,  0,  0,  0,  0,  0},   // 631
+    {  2, 79,  0,  0,  0,  0},   // 632
+    {  3,211,  0,  0,  0,  0},   // 633
+    {  2,317,  0,  0,  0,  0},   // 634
+    {  5,127,  0,  0,  0,  0},   // 635
+    {  2,  3, 53,  0,  0,  0},   // 636
+    {  7, 13,  0,  0,  0,  0},   // 637
+    {  2, 11, 29,  0,  0,  0},   // 638
+    {  3, 71,  0,  0,  0,  0},   // 639
+    {  2,  5,  0,  0,  0,  0},   // 640
+    {  0,  0,  0,  0,  0,  0},   // 641
+    {  2,  3,107,  0,  0,  0},   // 642
+    {  0,  0,  0,  0,  0,  0},   // 643
+    {  2,  7, 23,  0,  0,  0},   // 644
+    {  3,  5, 43,  0,  0,  0},   // 645
+    {  2, 17, 19,  0,  0,  0},   // 646
+    {  0,  0,  0,  0,  0,  0},   // 647
+    {  2,  3,  0,  0,  0,  0},   // 648
+    { 11, 59,  0,  0,  0,  0},   // 649
+    {  2,  5, 13,  0,  0,  0},   // 650
+    {  3,  7, 31,  0,  0,  0},   // 651
+    {  2,163,  0,  0,  0,  0},   // 652
+    {  0,  0,  0,  0,  0,  0},   // 653
+    {  2,  3,109,  0,  0,  0},   // 654
+    {  5,131,  0,  0,  0,  0},   // 655
+    {  2, 41,  0,  0,  0,  0},   // 656
+    {  3, 73,  0,  0,  0,  0},   // 657
+    {  2,  7, 47,  0,  0,  0},   // 658
+    {  0,  0,  0,  0,  0,  0},   // 659
+    {  2,  3,  5, 11,  0,  0},   // 660
+    {  0,  0,  0,  0,  0,  0},   // 661
+    {  2,331,  0,  0,  0,  0},   // 662
+    {  3, 13, 17,  0,  0,  0},   // 663
+    {  2, 83,  0,  0,  0,  0},   // 664
+    {  5,  7, 19,  0,  0,  0},   // 665
+    {  2,  3, 37,  0,  0,  0},   // 666
+    { 23, 29,  0,  0,  0,  0},   // 667
+    {  2,167,  0,  0,  0,  0},   // 668
+    {  3,223,  0,  0,  0,  0},   // 669
+    {  2,  5, 67,  0,  0,  0},   // 670
+    { 11, 61,  0,  0,  0,  0},   // 671
+    {  2,  3,  7,  0,  0,  0},   // 672
+    {  0,  0,  0,  0,  0,  0},   // 673
+    {  2,337,  0,  0,  0,  0},   // 674
+    {  3,  5,  0,  0,  0,  0},   // 675
+    {  2, 13,  0,  0,  0,  0},   // 676
+    {  0,  0,  0,  0,  0,  0},   // 677
+    {  2,  3,113,  0,  0,  0},   // 678
+    {  7, 97,  0,  0,  0,  0},   // 679
+    {  2,  5, 17,  0,  0,  0},   // 680
+    {  3,227,  0,  0,  0,  0},   // 681
+    {  2, 11, 31,  0,  0,  0},   // 682
+    {  0,  0,  0,  0,  0,  0},   // 683
+    {  2,  3, 19,  0,  0,  0},   // 684
+    {  5,137,  0,  0,  0,  0},   // 685
+    {  2,  7,  0,  0,  0,  0},   // 686
+    {  3,229,  0,  0,  0,  0},   // 687
+    {  2, 43,  0,  0,  0,  0},   // 688
+    { 13, 53,  0,  0,  0,  0},   // 689
+    {  2,  3,  5, 23,  0,  0},   // 690
+    {  0,  0,  0,  0,  0,  0},   // 691
+    {  2,173,  0,  0,  0,  0},   // 692
+    {  3,  7, 11,  0,  0,  0},   // 693
+    {  2,347,  0,  0,  0,  0},   // 694
+    {  5,139,  0,  0,  0,  0},   // 695
+    {  2,  3, 29,  0,  0,  0},   // 696
+    { 17, 41,  0,  0,  0,  0},   // 697
+    {  2,349,  0,  0,  0,  0},   // 698
+    {  3,233,  0,  0,  0,  0},   // 699
+    {  2,  5,  7,  0,  0,  0},   // 700
+    {  0,  0,  0,  0,  0,  0},   // 701
+    {  2,  3, 13,  0,  0,  0},   // 702
+    { 19, 37,  0,  0,  0,  0},   // 703
+    {  2, 11,  0,  0,  0,  0},   // 704
+    {  3,  5, 47,  0,  0,  0},   // 705
+    {  2,353,  0,  0,  0,  0},   // 706
+    {  7,101,  0,  0,  0,  0},   // 707
+    {  2,  3, 59,  0,  0,  0},   // 708
+    {  0,  0,  0,  0,  0,  0},   // 709
+    {  2,  5, 71,  0,  0,  0},   // 710
+    {  3, 79,  0,  0,  0,  0},   // 711
+    {  2, 89,  0,  0,  0,  0},   // 712
+    { 23, 31,  0,  0,  0,  0},   // 713
+    {  2,  3,  7, 17,  0,  0},   // 714
+    {  5, 11, 13,  0,  0,  0},   // 715
+    {  2,179,  0,  0,  0,  0},   // 716
+    {  3,239,  0,  0,  0,  0},   // 717
+    {  2,359,  0,  0,  0,  0},   // 718
+    {  0,  0,  0,  0,  0,  0},   // 719
+    {  2,  3,  5,  0,  0,  0},   // 720
+    {  7,103,  0,  0,  0,  0},   // 721
+    {  2, 19,  0,  0,  0,  0},   // 722
+    {  3,241,  0,  0,  0,  0},   // 723
+    {  2,181,  0,  0,  0,  0},   // 724
+    {  5, 29,  0,  0,  0,  0},   // 725
+    {  2,  3, 11,  0,  0,  0},   // 726
+    {  0,  0,  0,  0,  0,  0},   // 727
+    {  2,  7, 13,  0,  0,  0},   // 728
+    {  3,  0,  0,  0,  0,  0},   // 729
+    {  2,  5, 73,  0,  0,  0},   // 730
+    { 17, 43,  0,  0,  0,  0},   // 731
+    {  2,  3, 61,  0,  0,  0},   // 732
+    {  0,  0,  0,  0,  0,  0},   // 733
+    {  2,367,  0,  0,  0,  0},   // 734
+    {  3,  5,  7,  0,  0,  0},   // 735
+    {  2, 23,  0,  0,  0,  0},   // 736
+    { 11, 67,  0,  0,  0,  0},   // 737
+    {  2,  3, 41,  0,  0,  0},   // 738
+    {  0,  0,  0,  0,  0,  0},   // 739
+    {  2,  5, 37,  0,  0,  0},   // 740
+    {  3, 13, 19,  0,  0,  0},   // 741
+    {  2,  7, 53,  0,  0,  0},   // 742
+    {  0,  0,  0,  0,  0,  0},   // 743
+    {  2,  3, 31,  0,  0,  0},   // 744
+    {  5,149,  0,  0,  0,  0},   // 745
+    {  2,373,  0,  0,  0,  0},   // 746
+    {  3, 83,  0,  0,  0,  0},   // 747
+    {  2, 11, 17,  0,  0,  0},   // 748
+    {  7,107,  0,  0,  0,  0},   // 749
+    {  2,  3,  5,  0,  0,  0},   // 750
+    {  0,  0,  0,  0,  0,  0},   // 751
+    {  2, 47,  0,  0,  0,  0},   // 752
+    {  3,251,  0,  0,  0,  0},   // 753
+    {  2, 13, 29,  0,  0,  0},   // 754
+    {  5,151,  0,  0,  0,  0},   // 755
+    {  2,  3,  7,  0,  0,  0},   // 756
+    {  0,  0,  0,  0,  0,  0},   // 757
+    {  2,379,  0,  0,  0,  0},   // 758
+    {  3, 11, 23,  0,  0,  0},   // 759
+    {  2,  5, 19,  0,  0,  0},   // 760
+    {  0,  0,  0,  0,  0,  0},   // 761
+    {  2,  3,127,  0,  0,  0},   // 762
+    {  7,109,  0,  0,  0,  0},   // 763
+    {  2,191,  0,  0,  0,  0},   // 764
+    {  3,  5, 17,  0,  0,  0},   // 765
+    {  2,383,  0,  0,  0,  0},   // 766
+    { 13, 59,  0,  0,  0,  0},   // 767
+    {  2,  3,  0,  0,  0,  0},   // 768
+    {  0,  0,  0,  0,  0,  0},   // 769
+    {  2,  5,  7, 11,  0,  0},   // 770
+    {  3,257,  0,  0,  0,  0},   // 771
+    {  2,193,  0,  0,  0,  0},   // 772
+    {  0,  0,  0,  0,  0,  0},   // 773
+    {  2,  3, 43,  0,  0,  0},   // 774
+    {  5, 31,  0,  0,  0,  0},   // 775
+    {  2, 97,  0,  0,  0,  0},   // 776
+    {  3,  7, 37,  0,  0,  0},   // 777
+    {  2,389,  0,  0,  0,  0},   // 778
+    { 19, 41,  0,  0,  0,  0},   // 779
+    {  2,  3,  5, 13,  0,  0},   // 780
+    { 11, 71,  0,  0,  0,  0},   // 781
+    {  2, 17, 23,  0,  0,  0},   // 782
+    {  3, 29,  0,  0,  0,  0},   // 783
+    {  2,  7,  0,  0,  0,  0},   // 784
+    {  5,157,  0,  0,  0,  0},   // 785
+    {  2,  3,131,  0,  0,  0},   // 786
+    {  0,  0,  0,  0,  0,  0},   // 787
+    {  2,197,  0,  0,  0,  0},   // 788
+    {  3,263,  0,  0,  0,  0},   // 789
+    {  2,  5, 79,  0,  0,  0},   // 790
+    {  7,113,  0,  0,  0,  0},   // 791
+    {  2,  3, 11,  0,  0,  0},   // 792
+    { 13, 61,  0,  0,  0,  0},   // 793
+    {  2,397,  0,  0,  0,  0},   // 794
+    {  3,  5, 53,  0,  0,  0},   // 795
+    {  2,199,  0,  0,  0,  0},   // 796
+    {  0,  0,  0,  0,  0,  0},   // 797
+    {  2,  3,  7, 19,  0,  0},   // 798
+    { 17, 47,  0,  0,  0,  0},   // 799
+    {  2,  5,  0,  0,  0,  0},   // 800
+    {  3, 89,  0,  0,  0,  0},   // 801
+    {  2,401,  0,  0,  0,  0},   // 802
+    { 11, 73,  0,  0,  0,  0},   // 803
+    {  2,  3, 67,  0,  0,  0},   // 804
+    {  5,  7, 23,  0,  0,  0},   // 805
+    {  2, 13, 31,  0,  0,  0},   // 806
+    {  3,269,  0,  0,  0,  0},   // 807
+    {  2,101,  0,  0,  0,  0},   // 808
+    {  0,  0,  0,  0,  0,  0},   // 809
+    {  2,  3,  5,  0,  0,  0},   // 810
+    {  0,  0,  0,  0,  0,  0},   // 811
+    {  2,  7, 29,  0,  0,  0},   // 812
+    {  3,271,  0,  0,  0,  0},   // 813
+    {  2, 11, 37,  0,  0,  0},   // 814
+    {  5,163,  0,  0,  0,  0},   // 815
+    {  2,  3, 17,  0,  0,  0},   // 816
+    { 19, 43,  0,  0,  0,  0},   // 817
+    {  2,409,  0,  0,  0,  0},   // 818
+    {  3,  7, 13,  0,  0,  0},   // 819
+    {  2,  5, 41,  0,  0,  0},   // 820
+    {  0,  0,  0,  0,  0,  0},   // 821
+    {  2,  3,137,  0,  0,  0},   // 822
+    {  0,  0,  0,  0,  0,  0},   // 823
+    {  2,103,  0,  0,  0,  0},   // 824
+    {  3,  5, 11,  0,  0,  0},   // 825
+    {  2,  7, 59,  0,  0,  0},   // 826
+    {  0,  0,  0,  0,  0,  0},   // 827
+    {  2,  3, 23,  0,  0,  0},   // 828
+    {  0,  0,  0,  0,  0,  0},   // 829
+    {  2,  5, 83,  0,  0,  0},   // 830
+    {  3,277,  0,  0,  0,  0},   // 831
+    {  2, 13,  0,  0,  0,  0},   // 832
+    {  7, 17,  0,  0,  0,  0},   // 833
+    {  2,  3,139,  0,  0,  0},   // 834
+    {  5,167,  0,  0,  0,  0},   // 835
+    {  2, 11, 19,  0,  0,  0},   // 836
+    {  3, 31,  0,  0,  0,  0},   // 837
+    {  2,419,  0,  0,  0,  0},   // 838
+    {  0,  0,  0,  0,  0,  0},   // 839
+    {  2,  3,  5,  7,  0,  0},   // 840
+    { 29,  0,  0,  0,  0,  0},   // 841
+    {  2,421,  0,  0,  0,  0},   // 842
+    {  3,281,  0,  0,  0,  0},   // 843
+    {  2,211,  0,  0,  0,  0},   // 844
+    {  5, 13,  0,  0,  0,  0},   // 845
+    {  2,  3, 47,  0,  0,  0},   // 846
+    {  7, 11,  0,  0,  0,  0},   // 847
+    {  2, 53,  0,  0,  0,  0},   // 848
+    {  3,283,  0,  0,  0,  0},   // 849
+    {  2,  5, 17,  0,  0,  0},   // 850
+    { 23, 37,  0,  0,  0,  0},   // 851
+    {  2,  3, 71,  0,  0,  0},   // 852
+    {  0,  0,  0,  0,  0,  0},   // 853
+    {  2,  7, 61,  0,  0,  0},   // 854
+    {  3,  5, 19,  0,  0,  0},   // 855
+    {  2,107,  0,  0,  0,  0},   // 856
+    {  0,  0,  0,  0,  0,  0},   // 857
+    {  2,  3, 11, 13,  0,  0},   // 858
+    {  0,  0,  0,  0,  0,  0},   // 859
+    {  2,  5, 43,  0,  0,  0},   // 860
+    {  3,  7, 41,  0,  0,  0},   // 861
+    {  2,431,  0,  0,  0,  0},   // 862
+    {  0,  0,  0,  0,  0,  0},   // 863
+    {  2,  3,  0,  0,  0,  0},   // 864
+    {  5,173,  0,  0,  0,  0},   // 865
+    {  2,433,  0,  0,  0,  0},   // 866
+    {  3, 17,  0,  0,  0,  0},   // 867
+    {  2,  7, 31,  0,  0,  0},   // 868
+    { 11, 79,  0,  0,  0,  0},   // 869
+    {  2,  3,  5, 29,  0,  0},   // 870
+    { 13, 67,  0,  0,  0,  0},   // 871
+    {  2,109,  0,  0,  0,  0},   // 872
+    {  3, 97,  0,  0,  0,  0},   // 873
+    {  2, 19, 23,  0,  0,  0},   // 874
+    {  5,  7,  0,  0,  0,  0},   // 875
+    {  2,  3, 73,  0,  0,  0},   // 876
+    {  0,  0,  0,  0,  0,  0},   // 877
+    {  2,439,  0,  0,  0,  0},   // 878
+    {  3,293,  0,  0,  0,  0},   // 879
+    {  2,  5, 11,  0,  0,  0},   // 880
+    {  0,  0,  0,  0,  0,  0},   // 881
+    {  2,  3,  7,  0,  0,  0},   // 882
+    {  0,  0,  0,  0,  0,  0},   // 883
+    {  2, 13, 17,  0,  0,  0},   // 884
+    {  3,  5, 59,  0,  0,  0},   // 885
+    {  2,443,  0,  0,  0,  0},   // 886
+    {  0,  0,  0,  0,  0,  0},   // 887
+    {  2,  3, 37,  0,  0,  0},   // 888
+    {  7,127,  0,  0,  0,  0},   // 889
+    {  2,  5, 89,  0,  0,  0},   // 890
+    {  3, 11,  0,  0,  0,  0},   // 891
+    {  2,223,  0,  0,  0,  0},   // 892
+    { 19, 47,  0,  0,  0,  0},   // 893
+    {  2,  3,149,  0,  0,  0},   // 894
+    {  5,179,  0,  0,  0,  0},   // 895
+    {  2,  7,  0,  0,  0,  0},   // 896
+    {  3, 13, 23,  0,  0,  0},   // 897
+    {  2,449,  0,  0,  0,  0},   // 898
+    { 29, 31,  0,  0,  0,  0},   // 899
+    {  2,  3,  5,  0,  0,  0},   // 900
+    { 17, 53,  0,  0,  0,  0},   // 901
+    {  2, 11, 41,  0,  0,  0},   // 902
+    {  3,  7, 43,  0,  0,  0},   // 903
+    {  2,113,  0,  0,  0,  0},   // 904
+    {  5,181,  0,  0,  0,  0},   // 905
+    {  2,  3,151,  0,  0,  0},   // 906
+    {  0,  0,  0,  0,  0,  0},   // 907
+    {  2,227,  0,  0,  0,  0},   // 908
+    {  3,101,  0,  0,  0,  0},   // 909
+    {  2,  5,  7, 13,  0,  0},   // 910
+    {  0,  0,  0,  0,  0,  0},   // 911
+    {  2,  3, 19,  0,  0,  0},   // 912
+    { 11, 83,  0,  0,  0,  0},   // 913
+    {  2,457,  0,  0,  0,  0},   // 914
+    {  3,  5, 61,  0,  0,  0},   // 915
+    {  2,229,  0,  0,  0,  0},   // 916
+    {  7,131,  0,  0,  0,  0},   // 917
+    {  2,  3, 17,  0,  0,  0},   // 918
+    {  0,  0,  0,  0,  0,  0},   // 919
+    {  2,  5, 23,  0,  0,  0},   // 920
+    {  3,307,  0,  0,  0,  0},   // 921
+    {  2,461,  0,  0,  0,  0},   // 922
+    { 13, 71,  0,  0,  0,  0},   // 923
+    {  2,  3,  7, 11,  0,  0},   // 924
+    {  5, 37,  0,  0,  0,  0},   // 925
+    {  2,463,  0,  0,  0,  0},   // 926
+    {  3,103,  0,  0,  0,  0},   // 927
+    {  2, 29,  0,  0,  0,  0},   // 928
+    {  0,  0,  0,  0,  0,  0},   // 929
+    {  2,  3,  5, 31,  0,  0},   // 930
+    {  7, 19,  0,  0,  0,  0},   // 931
+    {  2,233,  0,  0,  0,  0},   // 932
+    {  3,311,  0,  0,  0,  0},   // 933
+    {  2,467,  0,  0,  0,  0},   // 934
+    {  5, 11, 17,  0,  0,  0},   // 935
+    {  2,  3, 13,  0,  0,  0},   // 936
+    {  0,  0,  0,  0,  0,  0},   // 937
+    {  2,  7, 67,  0,  0,  0},   // 938
+    {  3,313,  0,  0,  0,  0},   // 939
+    {  2,  5, 47,  0,  0,  0},   // 940
+    {  0,  0,  0,  0,  0,  0},   // 941
+    {  2,  3,157,  0,  0,  0},   // 942
+    { 23, 41,  0,  0,  0,  0},   // 943
+    {  2, 59,  0,  0,  0,  0},   // 944
+    {  3,  5,  7,  0,  0,  0},   // 945
+    {  2, 11, 43,  0,  0,  0},   // 946
+    {  0,  0,  0,  0,  0,  0},   // 947
+    {  2,  3, 79,  0,  0,  0},   // 948
+    { 13, 73,  0,  0,  0,  0},   // 949
+    {  2,  5, 19,  0,  0,  0},   // 950
+    {  3,317,  0,  0,  0,  0},   // 951
+    {  2,  7, 17,  0,  0,  0},   // 952
+    {  0,  0,  0,  0,  0,  0},   // 953
+    {  2,  3, 53,  0,  0,  0},   // 954
+    {  5,191,  0,  0,  0,  0},   // 955
+    {  2,239,  0,  0,  0,  0},   // 956
+    {  3, 11, 29,  0,  0,  0},   // 957
+    {  2,479,  0,  0,  0,  0},   // 958
+    {  7,137,  0,  0,  0,  0},   // 959
+    {  2,  3,  5,  0,  0,  0},   // 960
+    { 31,  0,  0,  0,  0,  0},   // 961
+    {  2, 13, 37,  0,  0,  0},   // 962
+    {  3,107,  0,  0,  0,  0},   // 963
+    {  2,241,  0,  0,  0,  0},   // 964
+    {  5,193,  0,  0,  0,  0},   // 965
+    {  2,  3,  7, 23,  0,  0},   // 966
+    {  0,  0,  0,  0,  0,  0},   // 967
+    {  2, 11,  0,  0,  0,  0},   // 968
+    {  3, 17, 19,  0,  0,  0},   // 969
+    {  2,  5, 97,  0,  0,  0},   // 970
+    {  0,  0,  0,  0,  0,  0},   // 971
+    {  2,  3,  0,  0,  0,  0},   // 972
+    {  7,139,  0,  0,  0,  0},   // 973
+    {  2,487,  0,  0,  0,  0},   // 974
+    {  3,  5, 13,  0,  0,  0},   // 975
+    {  2, 61,  0,  0,  0,  0},   // 976
+    {  0,  0,  0,  0,  0,  0},   // 977
+    {  2,  3,163,  0,  0,  0},   // 978
+    { 11, 89,  0,  0,  0,  0},   // 979
+    {  2,  5,  7,  0,  0,  0},   // 980
+    {  3,109,  0,  0,  0,  0},   // 981
+    {  2,491,  0,  0,  0,  0},   // 982
+    {  0,  0,  0,  0,  0,  0},   // 983
+    {  2,  3, 41,  0,  0,  0},   // 984
+    {  5,197,  0,  0,  0,  0},   // 985
+    {  2, 17, 29,  0,  0,  0},   // 986
+    {  3,  7, 47,  0,  0,  0},   // 987
+    {  2, 13, 19,  0,  0,  0},   // 988
+    { 23, 43,  0,  0,  0,  0},   // 989
+    {  2,  3,  5, 11,  0,  0},   // 990
+    {  0,  0,  0,  0,  0,  0},   // 991
+    {  2, 31,  0,  0,  0,  0},   // 992
+    {  3,331,  0,  0,  0,  0},   // 993
+    {  2,  7, 71,  0,  0,  0},   // 994
+    {  5,199,  0,  0,  0,  0},   // 995
+    {  2,  3, 83,  0,  0,  0},   // 996
+    {  0,  0,  0,  0,  0,  0},   // 997
+    {  2,499,  0,  0,  0,  0},   // 998
+    {  3, 37,  0,  0,  0,  0},   // 999
+    {  2,  5,  0,  0,  0,  0},   // 1000
+    {  7, 11, 13,  0,  0,  0},   // 1001
+    {  2,  3,167,  0,  0,  0},   // 1002
+    { 17, 59,  0,  0,  0,  0},   // 1003
+    {  2,251,  0,  0,  0,  0},   // 1004
+    {  3,  5, 67,  0,  0,  0},   // 1005
+    {  2,503,  0,  0,  0,  0},   // 1006
+    { 19, 53,  0,  0,  0,  0},   // 1007
+    {  2,  3,  7,  0,  0,  0},   // 1008
+    {  0,  0,  0,  0,  0,  0},   // 1009
+    {  2,  5,101,  0,  0,  0},   // 1010
+    {  3,337,  0,  0,  0,  0},   // 1011
+    {  2, 11, 23,  0,  0,  0},   // 1012
+    {  0,  0,  0,  0,  0,  0},   // 1013
+    {  2,  3, 13,  0,  0,  0},   // 1014
+    {  5,  7, 29,  0,  0,  0},   // 1015
+    {  2,127,  0,  0,  0,  0},   // 1016
+    {  3,113,  0,  0,  0,  0},   // 1017
+    {  2,509,  0,  0,  0,  0},   // 1018
+    {  0,  0,  0,  0,  0,  0},   // 1019
+    {  2,  3,  5, 17,  0,  0},   // 1020
+    {  0,  0,  0,  0,  0,  0},   // 1021
+    {  2,  7, 73,  0,  0,  0},   // 1022
+    {  3, 11, 31,  0,  0,  0},   // 1023
+    {  2,  0,  0,  0,  0,  0},   // 1024
+    {  5, 41,  0,  0,  0,  0},   // 1025
+    {  2,  3, 19,  0,  0,  0},   // 1026
+    { 13, 79,  0,  0,  0,  0},   // 1027
+    {  2,257,  0,  0,  0,  0},   // 1028
+    {  3,  7,  0,  0,  0,  0},   // 1029
+    {  2,  5,103,  0,  0,  0},   // 1030
+    {  0,  0,  0,  0,  0,  0},   // 1031
+    {  2,  3, 43,  0,  0,  0},   // 1032
+    {  0,  0,  0,  0,  0,  0},   // 1033
+    {  2, 11, 47,  0,  0,  0},   // 1034
+    {  3,  5, 23,  0,  0,  0},   // 1035
+    {  2,  7, 37,  0,  0,  0},   // 1036
+    { 17, 61,  0,  0,  0,  0},   // 1037
+    {  2,  3,173,  0,  0,  0},   // 1038
+    {  0,  0,  0,  0,  0,  0},   // 1039
+    {  2,  5, 13,  0,  0,  0},   // 1040
+    {  3,347,  0,  0,  0,  0},   // 1041
+    {  2,521,  0,  0,  0,  0},   // 1042
+    {  7,149,  0,  0,  0,  0},   // 1043
+    {  2,  3, 29,  0,  0,  0},   // 1044
+    {  5, 11, 19,  0,  0,  0},   // 1045
+    {  2,523,  0,  0,  0,  0},   // 1046
+    {  3,349,  0,  0,  0,  0},   // 1047
+    {  2,131,  0,  0,  0,  0},   // 1048
+    {  0,  0,  0,  0,  0,  0},   // 1049
+    {  2,  3,  5,  7,  0,  0},   // 1050
+    {  0,  0,  0,  0,  0,  0},   // 1051
+    {  2,263,  0,  0,  0,  0},   // 1052
+    {  3, 13,  0,  0,  0,  0},   // 1053
+    {  2, 17, 31,  0,  0,  0},   // 1054
+    {  5,211,  0,  0,  0,  0},   // 1055
+    {  2,  3, 11,  0,  0,  0},   // 1056
+    {  7,151,  0,  0,  0,  0},   // 1057
+    {  2, 23,  0,  0,  0,  0},   // 1058
+    {  3,353,  0,  0,  0,  0},   // 1059
+    {  2,  5, 53,  0,  0,  0},   // 1060
+    {  0,  0,  0,  0,  0,  0},   // 1061
+    {  2,  3, 59,  0,  0,  0},   // 1062
+    {  0,  0,  0,  0,  0,  0},   // 1063
+    {  2,  7, 19,  0,  0,  0},   // 1064
+    {  3,  5, 71,  0,  0,  0},   // 1065
+    {  2, 13, 41,  0,  0,  0},   // 1066
+    { 11, 97,  0,  0,  0,  0},   // 1067
+    {  2,  3, 89,  0,  0,  0},   // 1068
+    {  0,  0,  0,  0,  0,  0},   // 1069
+    {  2,  5,107,  0,  0,  0},   // 1070
+    {  3,  7, 17,  0,  0,  0},   // 1071
+    {  2, 67,  0,  0,  0,  0},   // 1072
+    { 29, 37,  0,  0,  0,  0},   // 1073
+    {  2,  3,179,  0,  0,  0},   // 1074
+    {  5, 43,  0,  0,  0,  0},   // 1075
+    {  2,269,  0,  0,  0,  0},   // 1076
+    {  3,359,  0,  0,  0,  0},   // 1077
+    {  2,  7, 11,  0,  0,  0},   // 1078
+    { 13, 83,  0,  0,  0,  0},   // 1079
+    {  2,  3,  5,  0,  0,  0},   // 1080
+    { 23, 47,  0,  0,  0,  0},   // 1081
+    {  2,541,  0,  0,  0,  0},   // 1082
+    {  3, 19,  0,  0,  0,  0},   // 1083
+    {  2,271,  0,  0,  0,  0},   // 1084
+    {  5,  7, 31,  0,  0,  0},   // 1085
+    {  2,  3,181,  0,  0,  0},   // 1086
+    {  0,  0,  0,  0,  0,  0},   // 1087
+    {  2, 17,  0,  0,  0,  0},   // 1088
+    {  3, 11,  0,  0,  0,  0},   // 1089
+    {  2,  5,109,  0,  0,  0},   // 1090
+    {  0,  0,  0,  0,  0,  0},   // 1091
+    {  2,  3,  7, 13,  0,  0},   // 1092
+    {  0,  0,  0,  0,  0,  0},   // 1093
+    {  2,547,  0,  0,  0,  0},   // 1094
+    {  3,  5, 73,  0,  0,  0},   // 1095
+    {  2,137,  0,  0,  0,  0},   // 1096
+    {  0,  0,  0,  0,  0,  0},   // 1097
+    {  2,  3, 61,  0,  0,  0},   // 1098
+    {  7,157,  0,  0,  0,  0},   // 1099
+    {  2,  5, 11,  0,  0,  0},   // 1100
+    {  3,367,  0,  0,  0,  0},   // 1101
+    {  2, 19, 29,  0,  0,  0},   // 1102
+    {  0,  0,  0,  0,  0,  0},   // 1103
+    {  2,  3, 23,  0,  0,  0},   // 1104
+    {  5, 13, 17,  0,  0,  0},   // 1105
+    {  2,  7, 79,  0,  0,  0},   // 1106
+    {  3, 41,  0,  0,  0,  0},   // 1107
+    {  2,277,  0,  0,  0,  0},   // 1108
+    {  0,  0,  0,  0,  0,  0},   // 1109
+    {  2,  3,  5, 37,  0,  0},   // 1110
+    { 11,101,  0,  0,  0,  0},   // 1111
+    {  2,139,  0,  0,  0,  0},   // 1112
+    {  3,  7, 53,  0,  0,  0},   // 1113
+    {  2,557,  0,  0,  0,  0},   // 1114
+    {  5,223,  0,  0,  0,  0},   // 1115
+    {  2,  3, 31,  0,  0,  0},   // 1116
+    {  0,  0,  0,  0,  0,  0},   // 1117
+    {  2, 13, 43,  0,  0,  0},   // 1118
+    {  3,373,  0,  0,  0,  0},   // 1119
+    {  2,  5,  7,  0,  0,  0},   // 1120
+    { 19, 59,  0,  0,  0,  0},   // 1121
+    {  2,  3, 11, 17,  0,  0},   // 1122
+    {  0,  0,  0,  0,  0,  0},   // 1123
+    {  2,281,  0,  0,  0,  0},   // 1124
+    {  3,  5,  0,  0,  0,  0},   // 1125
+    {  2,563,  0,  0,  0,  0},   // 1126
+    {  7, 23,  0,  0,  0,  0},   // 1127
+    {  2,  3, 47,  0,  0,  0},   // 1128
+    {  0,  0,  0,  0,  0,  0},   // 1129
+    {  2,  5,113,  0,  0,  0},   // 1130
+    {  3, 13, 29,  0,  0,  0},   // 1131
+    {  2,283,  0,  0,  0,  0},   // 1132
+    { 11,103,  0,  0,  0,  0},   // 1133
+    {  2,  3,  7,  0,  0,  0},   // 1134
+    {  5,227,  0,  0,  0,  0},   // 1135
+    {  2, 71,  0,  0,  0,  0},   // 1136
+    {  3,379,  0,  0,  0,  0},   // 1137
+    {  2,569,  0,  0,  0,  0},   // 1138
+    { 17, 67,  0,  0,  0,  0},   // 1139
+    {  2,  3,  5, 19,  0,  0},   // 1140
+    {  7,163,  0,  0,  0,  0},   // 1141
+    {  2,571,  0,  0,  0,  0},   // 1142
+    {  3,127,  0,  0,  0,  0},   // 1143
+    {  2, 11, 13,  0,  0,  0},   // 1144
+    {  5,229,  0,  0,  0,  0},   // 1145
+    {  2,  3,191,  0,  0,  0},   // 1146
+    { 31, 37,  0,  0,  0,  0},   // 1147
+    {  2,  7, 41,  0,  0,  0},   // 1148
+    {  3,383,  0,  0,  0,  0},   // 1149
+    {  2,  5, 23,  0,  0,  0},   // 1150
+    {  0,  0,  0,  0,  0,  0},   // 1151
+    {  2,  3,  0,  0,  0,  0},   // 1152
+    {  0,  0,  0,  0,  0,  0},   // 1153
+    {  2,577,  0,  0,  0,  0},   // 1154
+    {  3,  5,  7, 11,  0,  0},   // 1155
+    {  2, 17,  0,  0,  0,  0},   // 1156
+    { 13, 89,  0,  0,  0,  0},   // 1157
+    {  2,  3,193,  0,  0,  0},   // 1158
+    { 19, 61,  0,  0,  0,  0},   // 1159
+    {  2,  5, 29,  0,  0,  0},   // 1160
+    {  3, 43,  0,  0,  0,  0},   // 1161
+    {  2,  7, 83,  0,  0,  0},   // 1162
+    {  0,  0,  0,  0,  0,  0},   // 1163
+    {  2,  3, 97,  0,  0,  0},   // 1164
+    {  5,233,  0,  0,  0,  0},   // 1165
+    {  2, 11, 53,  0,  0,  0},   // 1166
+    {  3,389,  0,  0,  0,  0},   // 1167
+    {  2, 73,  0,  0,  0,  0},   // 1168
+    {  7,167,  0,  0,  0,  0},   // 1169
+    {  2,  3,  5, 13,  0,  0},   // 1170
+    {  0,  0,  0,  0,  0,  0},   // 1171
+    {  2,293,  0,  0,  0,  0},   // 1172
+    {  3, 17, 23,  0,  0,  0},   // 1173
+    {  2,587,  0,  0,  0,  0},   // 1174
+    {  5, 47,  0,  0,  0,  0},   // 1175
+    {  2,  3,  7,  0,  0,  0},   // 1176
+    { 11,107,  0,  0,  0,  0},   // 1177
+    {  2, 19, 31,  0,  0,  0},   // 1178
+    {  3,131,  0,  0,  0,  0},   // 1179
+    {  2,  5, 59,  0,  0,  0},   // 1180
+    {  0,  0,  0,  0,  0,  0},   // 1181
+    {  2,  3,197,  0,  0,  0},   // 1182
+    {  7, 13,  0,  0,  0,  0},   // 1183
+    {  2, 37,  0,  0,  0,  0},   // 1184
+    {  3,  5, 79,  0,  0,  0},   // 1185
+    {  2,593,  0,  0,  0,  0},   // 1186
+    {  0,  0,  0,  0,  0,  0},   // 1187
+    {  2,  3, 11,  0,  0,  0},   // 1188
+    { 29, 41,  0,  0,  0,  0},   // 1189
+    {  2,  5,  7, 17,  0,  0},   // 1190
+    {  3,397,  0,  0,  0,  0},   // 1191
+    {  2,149,  0,  0,  0,  0},   // 1192
+    {  0,  0,  0,  0,  0,  0},   // 1193
+    {  2,  3,199,  0,  0,  0},   // 1194
+    {  5,239,  0,  0,  0,  0},   // 1195
+    {  2, 13, 23,  0,  0,  0},   // 1196
+    {  3,  7, 19,  0,  0,  0},   // 1197
+    {  2,599,  0,  0,  0,  0},   // 1198
+    { 11,109,  0,  0,  0,  0},   // 1199
+    {  2,  3,  5,  0,  0,  0},   // 1200
+    {  0,  0,  0,  0,  0,  0},   // 1201
+    {  2,601,  0,  0,  0,  0},   // 1202
+    {  3,401,  0,  0,  0,  0},   // 1203
+    {  2,  7, 43,  0,  0,  0},   // 1204
+    {  5,241,  0,  0,  0,  0},   // 1205
+    {  2,  3, 67,  0,  0,  0},   // 1206
+    { 17, 71,  0,  0,  0,  0},   // 1207
+    {  2,151,  0,  0,  0,  0},   // 1208
+    {  3, 13, 31,  0,  0,  0},   // 1209
+    {  2,  5, 11,  0,  0,  0},   // 1210
+    {  7,173,  0,  0,  0,  0},   // 1211
+    {  2,  3,101,  0,  0,  0},   // 1212
+    {  0,  0,  0,  0,  0,  0},   // 1213
+    {  2,607,  0,  0,  0,  0},   // 1214
+    {  3,  5,  0,  0,  0,  0},   // 1215
+    {  2, 19,  0,  0,  0,  0},   // 1216
+    {  0,  0,  0,  0,  0,  0},   // 1217
+    {  2,  3,  7, 29,  0,  0},   // 1218
+    { 23, 53,  0,  0,  0,  0},   // 1219
+    {  2,  5, 61,  0,  0,  0},   // 1220
+    {  3, 11, 37,  0,  0,  0},   // 1221
+    {  2, 13, 47,  0,  0,  0},   // 1222
+    {  0,  0,  0,  0,  0,  0},   // 1223
+    {  2,  3, 17,  0,  0,  0},   // 1224
+    {  5,  7,  0,  0,  0,  0},   // 1225
+    {  2,613,  0,  0,  0,  0},   // 1226
+    {  3,409,  0,  0,  0,  0},   // 1227
+    {  2,307,  0,  0,  0,  0},   // 1228
+    {  0,  0,  0,  0,  0,  0},   // 1229
+    {  2,  3,  5, 41,  0,  0},   // 1230
+    {  0,  0,  0,  0,  0,  0},   // 1231
+    {  2,  7, 11,  0,  0,  0},   // 1232
+    {  3,137,  0,  0,  0,  0},   // 1233
+    {  2,617,  0,  0,  0,  0},   // 1234
+    {  5, 13, 19,  0,  0,  0},   // 1235
+    {  2,  3,103,  0,  0,  0},   // 1236
+    {  0,  0,  0,  0,  0,  0},   // 1237
+    {  2,619,  0,  0,  0,  0},   // 1238
+    {  3,  7, 59,  0,  0,  0},   // 1239
+    {  2,  5, 31,  0,  0,  0},   // 1240
+    { 17, 73,  0,  0,  0,  0},   // 1241
+    {  2,  3, 23,  0,  0,  0},   // 1242
+    { 11,113,  0,  0,  0,  0},   // 1243
+    {  2,311,  0,  0,  0,  0},   // 1244
+    {  3,  5, 83,  0,  0,  0},   // 1245
+    {  2,  7, 89,  0,  0,  0},   // 1246
+    { 29, 43,  0,  0,  0,  0},   // 1247
+    {  2,  3, 13,  0,  0,  0},   // 1248
+    {  0,  0,  0,  0,  0,  0},   // 1249
+    {  2,  5,  0,  0,  0,  0},   // 1250
+    {  3,139,  0,  0,  0,  0},   // 1251
+    {  2,313,  0,  0,  0,  0},   // 1252
+    {  7,179,  0,  0,  0,  0},   // 1253
+    {  2,  3, 11, 19,  0,  0},   // 1254
+    {  5,251,  0,  0,  0,  0},   // 1255
+    {  2,157,  0,  0,  0,  0},   // 1256
+    {  3,419,  0,  0,  0,  0},   // 1257
+    {  2, 17, 37,  0,  0,  0},   // 1258
+    {  0,  0,  0,  0,  0,  0},   // 1259
+    {  2,  3,  5,  7,  0,  0},   // 1260
+    { 13, 97,  0,  0,  0,  0},   // 1261
+    {  2,631,  0,  0,  0,  0},   // 1262
+    {  3,421,  0,  0,  0,  0},   // 1263
+    {  2, 79,  0,  0,  0,  0},   // 1264
+    {  5, 11, 23,  0,  0,  0},   // 1265
+    {  2,  3,211,  0,  0,  0},   // 1266
+    {  7,181,  0,  0,  0,  0},   // 1267
+    {  2,317,  0,  0,  0,  0},   // 1268
+    {  3, 47,  0,  0,  0,  0},   // 1269
+    {  2,  5,127,  0,  0,  0},   // 1270
+    { 31, 41,  0,  0,  0,  0},   // 1271
+    {  2,  3, 53,  0,  0,  0},   // 1272
+    { 19, 67,  0,  0,  0,  0},   // 1273
+    {  2,  7, 13,  0,  0,  0},   // 1274
+    {  3,  5, 17,  0,  0,  0},   // 1275
+    {  2, 11, 29,  0,  0,  0},   // 1276
+    {  0,  0,  0,  0,  0,  0},   // 1277
+    {  2,  3, 71,  0,  0,  0},   // 1278
+    {  0,  0,  0,  0,  0,  0},   // 1279
+    {  2,  5,  0,  0,  0,  0},   // 1280
+    {  3,  7, 61,  0,  0,  0},   // 1281
+    {  2,641,  0,  0,  0,  0},   // 1282
+    {  0,  0,  0,  0,  0,  0},   // 1283
+    {  2,  3,107,  0,  0,  0},   // 1284
+    {  5,257,  0,  0,  0,  0},   // 1285
+    {  2,643,  0,  0,  0,  0},   // 1286
+    {  3, 11, 13,  0,  0,  0},   // 1287
+    {  2,  7, 23,  0,  0,  0},   // 1288
+    {  0,  0,  0,  0,  0,  0},   // 1289
+    {  2,  3,  5, 43,  0,  0},   // 1290
+    {  0,  0,  0,  0,  0,  0},   // 1291
+    {  2, 17, 19,  0,  0,  0},   // 1292
+    {  3,431,  0,  0,  0,  0},   // 1293
+    {  2,647,  0,  0,  0,  0},   // 1294
+    {  5,  7, 37,  0,  0,  0},   // 1295
+    {  2,  3,  0,  0,  0,  0},   // 1296
+    {  0,  0,  0,  0,  0,  0},   // 1297
+    {  2, 11, 59,  0,  0,  0},   // 1298
+    {  3,433,  0,  0,  0,  0},   // 1299
+    {  2,  5, 13,  0,  0,  0},   // 1300
+    {  0,  0,  0,  0,  0,  0},   // 1301
+    {  2,  3,  7, 31,  0,  0},   // 1302
+    {  0,  0,  0,  0,  0,  0},   // 1303
+    {  2,163,  0,  0,  0,  0},   // 1304
+    {  3,  5, 29,  0,  0,  0},   // 1305
+    {  2,653,  0,  0,  0,  0},   // 1306
+    {  0,  0,  0,  0,  0,  0},   // 1307
+    {  2,  3,109,  0,  0,  0},   // 1308
+    {  7, 11, 17,  0,  0,  0},   // 1309
+    {  2,  5,131,  0,  0,  0},   // 1310
+    {  3, 19, 23,  0,  0,  0},   // 1311
+    {  2, 41,  0,  0,  0,  0},   // 1312
+    { 13,101,  0,  0,  0,  0},   // 1313
+    {  2,  3, 73,  0,  0,  0},   // 1314
+    {  5,263,  0,  0,  0,  0},   // 1315
+    {  2,  7, 47,  0,  0,  0},   // 1316
+    {  3,439,  0,  0,  0,  0},   // 1317
+    {  2,659,  0,  0,  0,  0},   // 1318
+    {  0,  0,  0,  0,  0,  0},   // 1319
+    {  2,  3,  5, 11,  0,  0},   // 1320
+    {  0,  0,  0,  0,  0,  0},   // 1321
+    {  2,661,  0,  0,  0,  0},   // 1322
+    {  3,  7,  0,  0,  0,  0},   // 1323
+    {  2,331,  0,  0,  0,  0},   // 1324
+    {  5, 53,  0,  0,  0,  0},   // 1325
+    {  2,  3, 13, 17,  0,  0},   // 1326
+    {  0,  0,  0,  0,  0,  0},   // 1327
+    {  2, 83,  0,  0,  0,  0},   // 1328
+    {  3,443,  0,  0,  0,  0},   // 1329
+    {  2,  5,  7, 19,  0,  0},   // 1330
+    { 11,  0,  0,  0,  0,  0},   // 1331
+    {  2,  3, 37,  0,  0,  0},   // 1332
+    { 31, 43,  0,  0,  0,  0},   // 1333
+    {  2, 23, 29,  0,  0,  0},   // 1334
+    {  3,  5, 89,  0,  0,  0},   // 1335
+    {  2,167,  0,  0,  0,  0},   // 1336
+    {  7,191,  0,  0,  0,  0},   // 1337
+    {  2,  3,223,  0,  0,  0},   // 1338
+    { 13,103,  0,  0,  0,  0},   // 1339
+    {  2,  5, 67,  0,  0,  0},   // 1340
+    {  3,149,  0,  0,  0,  0},   // 1341
+    {  2, 11, 61,  0,  0,  0},   // 1342
+    { 17, 79,  0,  0,  0,  0},   // 1343
+    {  2,  3,  7,  0,  0,  0},   // 1344
+    {  5,269,  0,  0,  0,  0},   // 1345
+    {  2,673,  0,  0,  0,  0},   // 1346
+    {  3,449,  0,  0,  0,  0},   // 1347
+    {  2,337,  0,  0,  0,  0},   // 1348
+    { 19, 71,  0,  0,  0,  0},   // 1349
+    {  2,  3,  5,  0,  0,  0},   // 1350
+    {  7,193,  0,  0,  0,  0},   // 1351
+    {  2, 13,  0,  0,  0,  0},   // 1352
+    {  3, 11, 41,  0,  0,  0},   // 1353
+    {  2,677,  0,  0,  0,  0},   // 1354
+    {  5,271,  0,  0,  0,  0},   // 1355
+    {  2,  3,113,  0,  0,  0},   // 1356
+    { 23, 59,  0,  0,  0,  0},   // 1357
+    {  2,  7, 97,  0,  0,  0},   // 1358
+    {  3,151,  0,  0,  0,  0},   // 1359
+    {  2,  5, 17,  0,  0,  0},   // 1360
+    {  0,  0,  0,  0,  0,  0},   // 1361
+    {  2,  3,227,  0,  0,  0},   // 1362
+    { 29, 47,  0,  0,  0,  0},   // 1363
+    {  2, 11, 31,  0,  0,  0},   // 1364
+    {  3,  5,  7, 13,  0,  0},   // 1365
+    {  2,683,  0,  0,  0,  0},   // 1366
+    {  0,  0,  0,  0,  0,  0},   // 1367
+    {  2,  3, 19,  0,  0,  0},   // 1368
+    { 37,  0,  0,  0,  0,  0},   // 1369
+    {  2,  5,137,  0,  0,  0},   // 1370
+    {  3,457,  0,  0,  0,  0},   // 1371
+    {  2,  7,  0,  0,  0,  0},   // 1372
+    {  0,  0,  0,  0,  0,  0},   // 1373
+    {  2,  3,229,  0,  0,  0},   // 1374
+    {  5, 11,  0,  0,  0,  0},   // 1375
+    {  2, 43,  0,  0,  0,  0},   // 1376
+    {  3, 17,  0,  0,  0,  0},   // 1377
+    {  2, 13, 53,  0,  0,  0},   // 1378
+    {  7,197,  0,  0,  0,  0},   // 1379
+    {  2,  3,  5, 23,  0,  0},   // 1380
+    {  0,  0,  0,  0,  0,  0},   // 1381
+    {  2,691,  0,  0,  0,  0},   // 1382
+    {  3,461,  0,  0,  0,  0},   // 1383
+    {  2,173,  0,  0,  0,  0},   // 1384
+    {  5,277,  0,  0,  0,  0},   // 1385
+    {  2,  3,  7, 11,  0,  0},   // 1386
+    { 19, 73,  0,  0,  0,  0},   // 1387
+    {  2,347,  0,  0,  0,  0},   // 1388
+    {  3,463,  0,  0,  0,  0},   // 1389
+    {  2,  5,139,  0,  0,  0},   // 1390
+    { 13,107,  0,  0,  0,  0},   // 1391
+    {  2,  3, 29,  0,  0,  0},   // 1392
+    {  7,199,  0,  0,  0,  0},   // 1393
+    {  2, 17, 41,  0,  0,  0},   // 1394
+    {  3,  5, 31,  0,  0,  0},   // 1395
+    {  2,349,  0,  0,  0,  0},   // 1396
+    { 11,127,  0,  0,  0,  0},   // 1397
+    {  2,  3,233,  0,  0,  0},   // 1398
+    {  0,  0,  0,  0,  0,  0},   // 1399
+    {  2,  5,  7,  0,  0,  0},   // 1400
+    {  3,467,  0,  0,  0,  0},   // 1401
+    {  2,701,  0,  0,  0,  0},   // 1402
+    { 23, 61,  0,  0,  0,  0},   // 1403
+    {  2,  3, 13,  0,  0,  0},   // 1404
+    {  5,281,  0,  0,  0,  0},   // 1405
+    {  2, 19, 37,  0,  0,  0},   // 1406
+    {  3,  7, 67,  0,  0,  0},   // 1407
+    {  2, 11,  0,  0,  0,  0},   // 1408
+    {  0,  0,  0,  0,  0,  0},   // 1409
+    {  2,  3,  5, 47,  0,  0},   // 1410
+    { 17, 83,  0,  0,  0,  0},   // 1411
+    {  2,353,  0,  0,  0,  0},   // 1412
+    {  3,157,  0,  0,  0,  0},   // 1413
+    {  2,  7,101,  0,  0,  0},   // 1414
+    {  5,283,  0,  0,  0,  0},   // 1415
+    {  2,  3, 59,  0,  0,  0},   // 1416
+    { 13,109,  0,  0,  0,  0},   // 1417
+    {  2,709,  0,  0,  0,  0},   // 1418
+    {  3, 11, 43,  0,  0,  0},   // 1419
+    {  2,  5, 71,  0,  0,  0},   // 1420
+    {  7, 29,  0,  0,  0,  0},   // 1421
+    {  2,  3, 79,  0,  0,  0},   // 1422
+    {  0,  0,  0,  0,  0,  0},   // 1423
+    {  2, 89,  0,  0,  0,  0},   // 1424
+    {  3,  5, 19,  0,  0,  0},   // 1425
+    {  2, 23, 31,  0,  0,  0},   // 1426
+    {  0,  0,  0,  0,  0,  0},   // 1427
+    {  2,  3,  7, 17,  0,  0},   // 1428
+    {  0,  0,  0,  0,  0,  0},   // 1429
+    {  2,  5, 11, 13,  0,  0},   // 1430
+    {  3, 53,  0,  0,  0,  0},   // 1431
+    {  2,179,  0,  0,  0,  0},   // 1432
+    {  0,  0,  0,  0,  0,  0},   // 1433
+    {  2,  3,239,  0,  0,  0},   // 1434
+    {  5,  7, 41,  0,  0,  0},   // 1435
+    {  2,359,  0,  0,  0,  0},   // 1436
+    {  3,479,  0,  0,  0,  0},   // 1437
+    {  2,719,  0,  0,  0,  0},   // 1438
+    {  0,  0,  0,  0,  0,  0},   // 1439
+    {  2,  3,  5,  0,  0,  0},   // 1440
+    { 11,131,  0,  0,  0,  0},   // 1441
+    {  2,  7,103,  0,  0,  0},   // 1442
+    {  3, 13, 37,  0,  0,  0},   // 1443
+    {  2, 19,  0,  0,  0,  0},   // 1444
+    {  5, 17,  0,  0,  0,  0},   // 1445
+    {  2,  3,241,  0,  0,  0},   // 1446
+    {  0,  0,  0,  0,  0,  0},   // 1447
+    {  2,181,  0,  0,  0,  0},   // 1448
+    {  3,  7, 23,  0,  0,  0},   // 1449
+    {  2,  5, 29,  0,  0,  0},   // 1450
+    {  0,  0,  0,  0,  0,  0},   // 1451
+    {  2,  3, 11,  0,  0,  0},   // 1452
+    {  0,  0,  0,  0,  0,  0},   // 1453
+    {  2,727,  0,  0,  0,  0},   // 1454
+    {  3,  5, 97,  0,  0,  0},   // 1455
+    {  2,  7, 13,  0,  0,  0},   // 1456
+    { 31, 47,  0,  0,  0,  0},   // 1457
+    {  2,  3,  0,  0,  0,  0},   // 1458
+    {  0,  0,  0,  0,  0,  0},   // 1459
+    {  2,  5, 73,  0,  0,  0},   // 1460
+    {  3,487,  0,  0,  0,  0},   // 1461
+    {  2, 17, 43,  0,  0,  0},   // 1462
+    {  7, 11, 19,  0,  0,  0},   // 1463
+    {  2,  3, 61,  0,  0,  0},   // 1464
+    {  5,293,  0,  0,  0,  0},   // 1465
+    {  2,733,  0,  0,  0,  0},   // 1466
+    {  3,163,  0,  0,  0,  0},   // 1467
+    {  2,367,  0,  0,  0,  0},   // 1468
+    { 13,113,  0,  0,  0,  0},   // 1469
+    {  2,  3,  5,  7,  0,  0},   // 1470
+    {  0,  0,  0,  0,  0,  0},   // 1471
+    {  2, 23,  0,  0,  0,  0},   // 1472
+    {  3,491,  0,  0,  0,  0},   // 1473
+    {  2, 11, 67,  0,  0,  0},   // 1474
+    {  5, 59,  0,  0,  0,  0},   // 1475
+    {  2,  3, 41,  0,  0,  0},   // 1476
+    {  7,211,  0,  0,  0,  0},   // 1477
+    {  2,739,  0,  0,  0,  0},   // 1478
+    {  3, 17, 29,  0,  0,  0},   // 1479
+    {  2,  5, 37,  0,  0,  0},   // 1480
+    {  0,  0,  0,  0,  0,  0},   // 1481
+    {  2,  3, 13, 19,  0,  0},   // 1482
+    {  0,  0,  0,  0,  0,  0},   // 1483
+    {  2,  7, 53,  0,  0,  0},   // 1484
+    {  3,  5, 11,  0,  0,  0},   // 1485
+    {  2,743,  0,  0,  0,  0},   // 1486
+    {  0,  0,  0,  0,  0,  0},   // 1487
+    {  2,  3, 31,  0,  0,  0},   // 1488
+    {  0,  0,  0,  0,  0,  0},   // 1489
+    {  2,  5,149,  0,  0,  0},   // 1490
+    {  3,  7, 71,  0,  0,  0},   // 1491
+    {  2,373,  0,  0,  0,  0},   // 1492
+    {  0,  0,  0,  0,  0,  0},   // 1493
+    {  2,  3, 83,  0,  0,  0},   // 1494
+    {  5, 13, 23,  0,  0,  0},   // 1495
+    {  2, 11, 17,  0,  0,  0},   // 1496
+    {  3,499,  0,  0,  0,  0},   // 1497
+    {  2,  7,107,  0,  0,  0},   // 1498
+    {  0,  0,  0,  0,  0,  0},   // 1499
+    {  2,  3,  5,  0,  0,  0},   // 1500
+    { 19, 79,  0,  0,  0,  0},   // 1501
+    {  2,751,  0,  0,  0,  0},   // 1502
+    {  3,167,  0,  0,  0,  0},   // 1503
+    {  2, 47,  0,  0,  0,  0},   // 1504
+    {  5,  7, 43,  0,  0,  0},   // 1505
+    {  2,  3,251,  0,  0,  0},   // 1506
+    { 11,137,  0,  0,  0,  0},   // 1507
+    {  2, 13, 29,  0,  0,  0},   // 1508
+    {  3,503,  0,  0,  0,  0},   // 1509
+    {  2,  5,151,  0,  0,  0},   // 1510
+    {  0,  0,  0,  0,  0,  0},   // 1511
+    {  2,  3,  7,  0,  0,  0},   // 1512
+    { 17, 89,  0,  0,  0,  0},   // 1513
+    {  2,757,  0,  0,  0,  0},   // 1514
+    {  3,  5,101,  0,  0,  0},   // 1515
+    {  2,379,  0,  0,  0,  0},   // 1516
+    { 37, 41,  0,  0,  0,  0},   // 1517
+    {  2,  3, 11, 23,  0,  0},   // 1518
+    {  7, 31,  0,  0,  0,  0},   // 1519
+    {  2,  5, 19,  0,  0,  0},   // 1520
+    {  3, 13,  0,  0,  0,  0},   // 1521
+    {  2,761,  0,  0,  0,  0},   // 1522
+    {  0,  0,  0,  0,  0,  0},   // 1523
+    {  2,  3,127,  0,  0,  0},   // 1524
+    {  5, 61,  0,  0,  0,  0},   // 1525
+    {  2,  7,109,  0,  0,  0},   // 1526
+    {  3,509,  0,  0,  0,  0},   // 1527
+    {  2,191,  0,  0,  0,  0},   // 1528
+    { 11,139,  0,  0,  0,  0},   // 1529
+    {  2,  3,  5, 17,  0,  0},   // 1530
+    {  0,  0,  0,  0,  0,  0},   // 1531
+    {  2,383,  0,  0,  0,  0},   // 1532
+    {  3,  7, 73,  0,  0,  0},   // 1533
+    {  2, 13, 59,  0,  0,  0},   // 1534
+    {  5,307,  0,  0,  0,  0},   // 1535
+    {  2,  3,  0,  0,  0,  0},   // 1536
+    { 29, 53,  0,  0,  0,  0},   // 1537
+    {  2,769,  0,  0,  0,  0},   // 1538
+    {  3, 19,  0,  0,  0,  0},   // 1539
+    {  2,  5,  7, 11,  0,  0},   // 1540
+    { 23, 67,  0,  0,  0,  0},   // 1541
+    {  2,  3,257,  0,  0,  0},   // 1542
+    {  0,  0,  0,  0,  0,  0},   // 1543
+    {  2,193,  0,  0,  0,  0},   // 1544
+    {  3,  5,103,  0,  0,  0},   // 1545
+    {  2,773,  0,  0,  0,  0},   // 1546
+    {  7, 13, 17,  0,  0,  0},   // 1547
+    {  2,  3, 43,  0,  0,  0},   // 1548
+    {  0,  0,  0,  0,  0,  0},   // 1549
+    {  2,  5, 31,  0,  0,  0},   // 1550
+    {  3, 11, 47,  0,  0,  0},   // 1551
+    {  2, 97,  0,  0,  0,  0},   // 1552
+    {  0,  0,  0,  0,  0,  0},   // 1553
+    {  2,  3,  7, 37,  0,  0},   // 1554
+    {  5,311,  0,  0,  0,  0},   // 1555
+    {  2,389,  0,  0,  0,  0},   // 1556
+    {  3,173,  0,  0,  0,  0},   // 1557
+    {  2, 19, 41,  0,  0,  0},   // 1558
+    {  0,  0,  0,  0,  0,  0},   // 1559
+    {  2,  3,  5, 13,  0,  0},   // 1560
+    {  7,223,  0,  0,  0,  0},   // 1561
+    {  2, 11, 71,  0,  0,  0},   // 1562
+    {  3,521,  0,  0,  0,  0},   // 1563
+    {  2, 17, 23,  0,  0,  0},   // 1564
+    {  5,313,  0,  0,  0,  0},   // 1565
+    {  2,  3, 29,  0,  0,  0},   // 1566
+    {  0,  0,  0,  0,  0,  0},   // 1567
+    {  2,  7,  0,  0,  0,  0},   // 1568
+    {  3,523,  0,  0,  0,  0},   // 1569
+    {  2,  5,157,  0,  0,  0},   // 1570
+    {  0,  0,  0,  0,  0,  0},   // 1571
+    {  2,  3,131,  0,  0,  0},   // 1572
+    { 11, 13,  0,  0,  0,  0},   // 1573
+    {  2,787,  0,  0,  0,  0},   // 1574
+    {  3,  5,  7,  0,  0,  0},   // 1575
+    {  2,197,  0,  0,  0,  0},   // 1576
+    { 19, 83,  0,  0,  0,  0},   // 1577
+    {  2,  3,263,  0,  0,  0},   // 1578
+    {  0,  0,  0,  0,  0,  0},   // 1579
+    {  2,  5, 79,  0,  0,  0},   // 1580
+    {  3, 17, 31,  0,  0,  0},   // 1581
+    {  2,  7,113,  0,  0,  0},   // 1582
+    {  0,  0,  0,  0,  0,  0},   // 1583
+    {  2,  3, 11,  0,  0,  0},   // 1584
+    {  5,317,  0,  0,  0,  0},   // 1585
+    {  2, 13, 61,  0,  0,  0},   // 1586
+    {  3, 23,  0,  0,  0,  0},   // 1587
+    {  2,397,  0,  0,  0,  0},   // 1588
+    {  7,227,  0,  0,  0,  0},   // 1589
+    {  2,  3,  5, 53,  0,  0},   // 1590
+    { 37, 43,  0,  0,  0,  0},   // 1591
+    {  2,199,  0,  0,  0,  0},   // 1592
+    {  3, 59,  0,  0,  0,  0},   // 1593
+    {  2,797,  0,  0,  0,  0},   // 1594
+    {  5, 11, 29,  0,  0,  0},   // 1595
+    {  2,  3,  7, 19,  0,  0},   // 1596
+    {  0,  0,  0,  0,  0,  0},   // 1597
+    {  2, 17, 47,  0,  0,  0},   // 1598
+    {  3, 13, 41,  0,  0,  0},   // 1599
+    {  2,  5,  0,  0,  0,  0},   // 1600
+    {  0,  0,  0,  0,  0,  0},   // 1601
+    {  2,  3, 89,  0,  0,  0},   // 1602
+    {  7,229,  0,  0,  0,  0},   // 1603
+    {  2,401,  0,  0,  0,  0},   // 1604
+    {  3,  5,107,  0,  0,  0},   // 1605
+    {  2, 11, 73,  0,  0,  0},   // 1606
+    {  0,  0,  0,  0,  0,  0},   // 1607
+    {  2,  3, 67,  0,  0,  0},   // 1608
+    {  0,  0,  0,  0,  0,  0},   // 1609
+    {  2,  5,  7, 23,  0,  0},   // 1610
+    {  3,179,  0,  0,  0,  0},   // 1611
+    {  2, 13, 31,  0,  0,  0},   // 1612
+    {  0,  0,  0,  0,  0,  0},   // 1613
+    {  2,  3,269,  0,  0,  0},   // 1614
+    {  5, 17, 19,  0,  0,  0},   // 1615
+    {  2,101,  0,  0,  0,  0},   // 1616
+    {  3,  7, 11,  0,  0,  0},   // 1617
+    {  2,809,  0,  0,  0,  0},   // 1618
+    {  0,  0,  0,  0,  0,  0},   // 1619
+    {  2,  3,  5,  0,  0,  0},   // 1620
+    {  0,  0,  0,  0,  0,  0},   // 1621
+    {  2,811,  0,  0,  0,  0},   // 1622
+    {  3,541,  0,  0,  0,  0},   // 1623
+    {  2,  7, 29,  0,  0,  0},   // 1624
+    {  5, 13,  0,  0,  0,  0},   // 1625
+    {  2,  3,271,  0,  0,  0},   // 1626
+    {  0,  0,  0,  0,  0,  0},   // 1627
+    {  2, 11, 37,  0,  0,  0},   // 1628
+    {  3,181,  0,  0,  0,  0},   // 1629
+    {  2,  5,163,  0,  0,  0},   // 1630
+    {  7,233,  0,  0,  0,  0},   // 1631
+    {  2,  3, 17,  0,  0,  0},   // 1632
+    { 23, 71,  0,  0,  0,  0},   // 1633
+    {  2, 19, 43,  0,  0,  0},   // 1634
+    {  3,  5,109,  0,  0,  0},   // 1635
+    {  2,409,  0,  0,  0,  0},   // 1636
+    {  0,  0,  0,  0,  0,  0},   // 1637
+    {  2,  3,  7, 13,  0,  0},   // 1638
+    { 11,149,  0,  0,  0,  0},   // 1639
+    {  2,  5, 41,  0,  0,  0},   // 1640
+    {  3,547,  0,  0,  0,  0},   // 1641
+    {  2,821,  0,  0,  0,  0},   // 1642
+    { 31, 53,  0,  0,  0,  0},   // 1643
+    {  2,  3,137,  0,  0,  0},   // 1644
+    {  5,  7, 47,  0,  0,  0},   // 1645
+    {  2,823,  0,  0,  0,  0},   // 1646
+    {  3, 61,  0,  0,  0,  0},   // 1647
+    {  2,103,  0,  0,  0,  0},   // 1648
+    { 17, 97,  0,  0,  0,  0},   // 1649
+    {  2,  3,  5, 11,  0,  0},   // 1650
+    { 13,127,  0,  0,  0,  0},   // 1651
+    {  2,  7, 59,  0,  0,  0},   // 1652
+    {  3, 19, 29,  0,  0,  0},   // 1653
+    {  2,827,  0,  0,  0,  0},   // 1654
+    {  5,331,  0,  0,  0,  0},   // 1655
+    {  2,  3, 23,  0,  0,  0},   // 1656
+    {  0,  0,  0,  0,  0,  0},   // 1657
+    {  2,829,  0,  0,  0,  0},   // 1658
+    {  3,  7, 79,  0,  0,  0},   // 1659
+    {  2,  5, 83,  0,  0,  0},   // 1660
+    { 11,151,  0,  0,  0,  0},   // 1661
+    {  2,  3,277,  0,  0,  0},   // 1662
+    {  0,  0,  0,  0,  0,  0},   // 1663
+    {  2, 13,  0,  0,  0,  0},   // 1664
+    {  3,  5, 37,  0,  0,  0},   // 1665
+    {  2,  7, 17,  0,  0,  0},   // 1666
+    {  0,  0,  0,  0,  0,  0},   // 1667
+    {  2,  3,139,  0,  0,  0},   // 1668
+    {  0,  0,  0,  0,  0,  0},   // 1669
+    {  2,  5,167,  0,  0,  0},   // 1670
+    {  3,557,  0,  0,  0,  0},   // 1671
+    {  2, 11, 19,  0,  0,  0},   // 1672
+    {  7,239,  0,  0,  0,  0},   // 1673
+    {  2,  3, 31,  0,  0,  0},   // 1674
+    {  5, 67,  0,  0,  0,  0},   // 1675
+    {  2,419,  0,  0,  0,  0},   // 1676
+    {  3, 13, 43,  0,  0,  0},   // 1677
+    {  2,839,  0,  0,  0,  0},   // 1678
+    { 23, 73,  0,  0,  0,  0},   // 1679
+    {  2,  3,  5,  7,  0,  0},   // 1680
+    { 41,  0,  0,  0,  0,  0},   // 1681
+    {  2, 29,  0,  0,  0,  0},   // 1682
+    {  3, 11, 17,  0,  0,  0},   // 1683
+    {  2,421,  0,  0,  0,  0},   // 1684
+    {  5,337,  0,  0,  0,  0},   // 1685
+    {  2,  3,281,  0,  0,  0},   // 1686
+    {  7,241,  0,  0,  0,  0},   // 1687
+    {  2,211,  0,  0,  0,  0},   // 1688
+    {  3,563,  0,  0,  0,  0},   // 1689
+    {  2,  5, 13,  0,  0,  0},   // 1690
+    { 19, 89,  0,  0,  0,  0},   // 1691
+    {  2,  3, 47,  0,  0,  0},   // 1692
+    {  0,  0,  0,  0,  0,  0},   // 1693
+    {  2,  7, 11,  0,  0,  0},   // 1694
+    {  3,  5,113,  0,  0,  0},   // 1695
+    {  2, 53,  0,  0,  0,  0},   // 1696
+    {  0,  0,  0,  0,  0,  0},   // 1697
+    {  2,  3,283,  0,  0,  0},   // 1698
+    {  0,  0,  0,  0,  0,  0},   // 1699
+    {  2,  5, 17,  0,  0,  0},   // 1700
+    {  3,  7,  0,  0,  0,  0},   // 1701
+    {  2, 23, 37,  0,  0,  0},   // 1702
+    { 13,131,  0,  0,  0,  0},   // 1703
+    {  2,  3, 71,  0,  0,  0},   // 1704
+    {  5, 11, 31,  0,  0,  0},   // 1705
+    {  2,853,  0,  0,  0,  0},   // 1706
+    {  3,569,  0,  0,  0,  0},   // 1707
+    {  2,  7, 61,  0,  0,  0},   // 1708
+    {  0,  0,  0,  0,  0,  0},   // 1709
+    {  2,  3,  5, 19,  0,  0},   // 1710
+    { 29, 59,  0,  0,  0,  0},   // 1711
+    {  2,107,  0,  0,  0,  0},   // 1712
+    {  3,571,  0,  0,  0,  0},   // 1713
+    {  2,857,  0,  0,  0,  0},   // 1714
+    {  5,  7,  0,  0,  0,  0},   // 1715
+    {  2,  3, 11, 13,  0,  0},   // 1716
+    { 17,101,  0,  0,  0,  0},   // 1717
+    {  2,859,  0,  0,  0,  0},   // 1718
+    {  3,191,  0,  0,  0,  0},   // 1719
+    {  2,  5, 43,  0,  0,  0},   // 1720
+    {  0,  0,  0,  0,  0,  0},   // 1721
+    {  2,  3,  7, 41,  0,  0},   // 1722
+    {  0,  0,  0,  0,  0,  0},   // 1723
+    {  2,431,  0,  0,  0,  0},   // 1724
+    {  3,  5, 23,  0,  0,  0},   // 1725
+    {  2,863,  0,  0,  0,  0},   // 1726
+    { 11,157,  0,  0,  0,  0},   // 1727
+    {  2,  3,  0,  0,  0,  0},   // 1728
+    {  7, 13, 19,  0,  0,  0},   // 1729
+    {  2,  5,173,  0,  0,  0},   // 1730
+    {  3,577,  0,  0,  0,  0},   // 1731
+    {  2,433,  0,  0,  0,  0},   // 1732
+    {  0,  0,  0,  0,  0,  0},   // 1733
+    {  2,  3, 17,  0,  0,  0},   // 1734
+    {  5,347,  0,  0,  0,  0},   // 1735
+    {  2,  7, 31,  0,  0,  0},   // 1736
+    {  3,193,  0,  0,  0,  0},   // 1737
+    {  2, 11, 79,  0,  0,  0},   // 1738
+    { 37, 47,  0,  0,  0,  0},   // 1739
+    {  2,  3,  5, 29,  0,  0},   // 1740
+    {  0,  0,  0,  0,  0,  0},   // 1741
+    {  2, 13, 67,  0,  0,  0},   // 1742
+    {  3,  7, 83,  0,  0,  0},   // 1743
+    {  2,109,  0,  0,  0,  0},   // 1744
+    {  5,349,  0,  0,  0,  0},   // 1745
+    {  2,  3, 97,  0,  0,  0},   // 1746
+    {  0,  0,  0,  0,  0,  0},   // 1747
+    {  2, 19, 23,  0,  0,  0},   // 1748
+    {  3, 11, 53,  0,  0,  0},   // 1749
+    {  2,  5,  7,  0,  0,  0},   // 1750
+    { 17,103,  0,  0,  0,  0},   // 1751
+    {  2,  3, 73,  0,  0,  0},   // 1752
+    {  0,  0,  0,  0,  0,  0},   // 1753
+    {  2,877,  0,  0,  0,  0},   // 1754
+    {  3,  5, 13,  0,  0,  0},   // 1755
+    {  2,439,  0,  0,  0,  0},   // 1756
+    {  7,251,  0,  0,  0,  0},   // 1757
+    {  2,  3,293,  0,  0,  0},   // 1758
+    {  0,  0,  0,  0,  0,  0},   // 1759
+    {  2,  5, 11,  0,  0,  0},   // 1760
+    {  3,587,  0,  0,  0,  0},   // 1761
+    {  2,881,  0,  0,  0,  0},   // 1762
+    { 41, 43,  0,  0,  0,  0},   // 1763
+    {  2,  3,  7,  0,  0,  0},   // 1764
+    {  5,353,  0,  0,  0,  0},   // 1765
+    {  2,883,  0,  0,  0,  0},   // 1766
+    {  3, 19, 31,  0,  0,  0},   // 1767
+    {  2, 13, 17,  0,  0,  0},   // 1768
+    { 29, 61,  0,  0,  0,  0},   // 1769
+    {  2,  3,  5, 59,  0,  0},   // 1770
+    {  7, 11, 23,  0,  0,  0},   // 1771
+    {  2,443,  0,  0,  0,  0},   // 1772
+    {  3,197,  0,  0,  0,  0},   // 1773
+    {  2,887,  0,  0,  0,  0},   // 1774
+    {  5, 71,  0,  0,  0,  0},   // 1775
+    {  2,  3, 37,  0,  0,  0},   // 1776
+    {  0,  0,  0,  0,  0,  0},   // 1777
+    {  2,  7,127,  0,  0,  0},   // 1778
+    {  3,593,  0,  0,  0,  0},   // 1779
+    {  2,  5, 89,  0,  0,  0},   // 1780
+    { 13,137,  0,  0,  0,  0},   // 1781
+    {  2,  3, 11,  0,  0,  0},   // 1782
+    {  0,  0,  0,  0,  0,  0},   // 1783
+    {  2,223,  0,  0,  0,  0},   // 1784
+    {  3,  5,  7, 17,  0,  0},   // 1785
+    {  2, 19, 47,  0,  0,  0},   // 1786
+    {  0,  0,  0,  0,  0,  0},   // 1787
+    {  2,  3,149,  0,  0,  0},   // 1788
+    {  0,  0,  0,  0,  0,  0},   // 1789
+    {  2,  5,179,  0,  0,  0},   // 1790
+    {  3,199,  0,  0,  0,  0},   // 1791
+    {  2,  7,  0,  0,  0,  0},   // 1792
+    { 11,163,  0,  0,  0,  0},   // 1793
+    {  2,  3, 13, 23,  0,  0},   // 1794
+    {  5,359,  0,  0,  0,  0},   // 1795
+    {  2,449,  0,  0,  0,  0},   // 1796
+    {  3,599,  0,  0,  0,  0},   // 1797
+    {  2, 29, 31,  0,  0,  0},   // 1798
+    {  7,257,  0,  0,  0,  0},   // 1799
+    {  2,  3,  5,  0,  0,  0},   // 1800
+    {  0,  0,  0,  0,  0,  0},   // 1801
+    {  2, 17, 53,  0,  0,  0},   // 1802
+    {  3,601,  0,  0,  0,  0},   // 1803
+    {  2, 11, 41,  0,  0,  0},   // 1804
+    {  5, 19,  0,  0,  0,  0},   // 1805
+    {  2,  3,  7, 43,  0,  0},   // 1806
+    { 13,139,  0,  0,  0,  0},   // 1807
+    {  2,113,  0,  0,  0,  0},   // 1808
+    {  3, 67,  0,  0,  0,  0},   // 1809
+    {  2,  5,181,  0,  0,  0},   // 1810
+    {  0,  0,  0,  0,  0,  0},   // 1811
+    {  2,  3,151,  0,  0,  0},   // 1812
+    {  7, 37,  0,  0,  0,  0},   // 1813
+    {  2,907,  0,  0,  0,  0},   // 1814
+    {  3,  5, 11,  0,  0,  0},   // 1815
+    {  2,227,  0,  0,  0,  0},   // 1816
+    { 23, 79,  0,  0,  0,  0},   // 1817
+    {  2,  3,101,  0,  0,  0},   // 1818
+    { 17,107,  0,  0,  0,  0},   // 1819
+    {  2,  5,  7, 13,  0,  0},   // 1820
+    {  3,607,  0,  0,  0,  0},   // 1821
+    {  2,911,  0,  0,  0,  0},   // 1822
+    {  0,  0,  0,  0,  0,  0},   // 1823
+    {  2,  3, 19,  0,  0,  0},   // 1824
+    {  5, 73,  0,  0,  0,  0},   // 1825
+    {  2, 11, 83,  0,  0,  0},   // 1826
+    {  3,  7, 29,  0,  0,  0},   // 1827
+    {  2,457,  0,  0,  0,  0},   // 1828
+    { 31, 59,  0,  0,  0,  0},   // 1829
+    {  2,  3,  5, 61,  0,  0},   // 1830
+    {  0,  0,  0,  0,  0,  0},   // 1831
+    {  2,229,  0,  0,  0,  0},   // 1832
+    {  3, 13, 47,  0,  0,  0},   // 1833
+    {  2,  7,131,  0,  0,  0},   // 1834
+    {  5,367,  0,  0,  0,  0},   // 1835
+    {  2,  3, 17,  0,  0,  0},   // 1836
+    { 11,167,  0,  0,  0,  0},   // 1837
+    {  2,919,  0,  0,  0,  0},   // 1838
+    {  3,613,  0,  0,  0,  0},   // 1839
+    {  2,  5, 23,  0,  0,  0},   // 1840
+    {  7,263,  0,  0,  0,  0},   // 1841
+    {  2,  3,307,  0,  0,  0},   // 1842
+    { 19, 97,  0,  0,  0,  0},   // 1843
+    {  2,461,  0,  0,  0,  0},   // 1844
+    {  3,  5, 41,  0,  0,  0},   // 1845
+    {  2, 13, 71,  0,  0,  0},   // 1846
+    {  0,  0,  0,  0,  0,  0},   // 1847
+    {  2,  3,  7, 11,  0,  0},   // 1848
+    { 43,  0,  0,  0,  0,  0},   // 1849
+    {  2,  5, 37,  0,  0,  0},   // 1850
+    {  3,617,  0,  0,  0,  0},   // 1851
+    {  2,463,  0,  0,  0,  0},   // 1852
+    { 17,109,  0,  0,  0,  0},   // 1853
+    {  2,  3,103,  0,  0,  0},   // 1854
+    {  5,  7, 53,  0,  0,  0},   // 1855
+    {  2, 29,  0,  0,  0,  0},   // 1856
+    {  3,619,  0,  0,  0,  0},   // 1857
+    {  2,929,  0,  0,  0,  0},   // 1858
+    { 11, 13,  0,  0,  0,  0},   // 1859
+    {  2,  3,  5, 31,  0,  0},   // 1860
+    {  0,  0,  0,  0,  0,  0},   // 1861
+    {  2,  7, 19,  0,  0,  0},   // 1862
+    {  3, 23,  0,  0,  0,  0},   // 1863
+    {  2,233,  0,  0,  0,  0},   // 1864
+    {  5,373,  0,  0,  0,  0},   // 1865
+    {  2,  3,311,  0,  0,  0},   // 1866
+    {  0,  0,  0,  0,  0,  0},   // 1867
+    {  2,467,  0,  0,  0,  0},   // 1868
+    {  3,  7, 89,  0,  0,  0},   // 1869
+    {  2,  5, 11, 17,  0,  0},   // 1870
+    {  0,  0,  0,  0,  0,  0},   // 1871
+    {  2,  3, 13,  0,  0,  0},   // 1872
+    {  0,  0,  0,  0,  0,  0},   // 1873
+    {  2,937,  0,  0,  0,  0},   // 1874
+    {  3,  5,  0,  0,  0,  0},   // 1875
+    {  2,  7, 67,  0,  0,  0},   // 1876
+    {  0,  0,  0,  0,  0,  0},   // 1877
+    {  2,  3,313,  0,  0,  0},   // 1878
+    {  0,  0,  0,  0,  0,  0},   // 1879
+    {  2,  5, 47,  0,  0,  0},   // 1880
+    {  3, 11, 19,  0,  0,  0},   // 1881
+    {  2,941,  0,  0,  0,  0},   // 1882
+    {  7,269,  0,  0,  0,  0},   // 1883
+    {  2,  3,157,  0,  0,  0},   // 1884
+    {  5, 13, 29,  0,  0,  0},   // 1885
+    {  2, 23, 41,  0,  0,  0},   // 1886
+    {  3, 17, 37,  0,  0,  0},   // 1887
+    {  2, 59,  0,  0,  0,  0},   // 1888
+    {  0,  0,  0,  0,  0,  0},   // 1889
+    {  2,  3,  5,  7,  0,  0},   // 1890
+    { 31, 61,  0,  0,  0,  0},   // 1891
+    {  2, 11, 43,  0,  0,  0},   // 1892
+    {  3,631,  0,  0,  0,  0},   // 1893
+    {  2,947,  0,  0,  0,  0},   // 1894
+    {  5,379,  0,  0,  0,  0},   // 1895
+    {  2,  3, 79,  0,  0,  0},   // 1896
+    {  7,271,  0,  0,  0,  0},   // 1897
+    {  2, 13, 73,  0,  0,  0},   // 1898
+    {  3,211,  0,  0,  0,  0},   // 1899
+    {  2,  5, 19,  0,  0,  0},   // 1900
+    {  0,  0,  0,  0,  0,  0},   // 1901
+    {  2,  3,317,  0,  0,  0},   // 1902
+    { 11,173,  0,  0,  0,  0},   // 1903
+    {  2,  7, 17,  0,  0,  0},   // 1904
+    {  3,  5,127,  0,  0,  0},   // 1905
+    {  2,953,  0,  0,  0,  0},   // 1906
+    {  0,  0,  0,  0,  0,  0},   // 1907
+    {  2,  3, 53,  0,  0,  0},   // 1908
+    { 23, 83,  0,  0,  0,  0},   // 1909
+    {  2,  5,191,  0,  0,  0},   // 1910
+    {  3,  7, 13,  0,  0,  0},   // 1911
+    {  2,239,  0,  0,  0,  0},   // 1912
+    {  0,  0,  0,  0,  0,  0},   // 1913
+    {  2,  3, 11, 29,  0,  0},   // 1914
+    {  5,383,  0,  0,  0,  0},   // 1915
+    {  2,479,  0,  0,  0,  0},   // 1916
+    {  3, 71,  0,  0,  0,  0},   // 1917
+    {  2,  7,137,  0,  0,  0},   // 1918
+    { 19,101,  0,  0,  0,  0},   // 1919
+    {  2,  3,  5,  0,  0,  0},   // 1920
+    { 17,113,  0,  0,  0,  0},   // 1921
+    {  2, 31,  0,  0,  0,  0},   // 1922
+    {  3,641,  0,  0,  0,  0},   // 1923
+    {  2, 13, 37,  0,  0,  0},   // 1924
+    {  5,  7, 11,  0,  0,  0},   // 1925
+    {  2,  3,107,  0,  0,  0},   // 1926
+    { 41, 47,  0,  0,  0,  0},   // 1927
+    {  2,241,  0,  0,  0,  0},   // 1928
+    {  3,643,  0,  0,  0,  0},   // 1929
+    {  2,  5,193,  0,  0,  0},   // 1930
+    {  0,  0,  0,  0,  0,  0},   // 1931
+    {  2,  3,  7, 23,  0,  0},   // 1932
+    {  0,  0,  0,  0,  0,  0},   // 1933
+    {  2,967,  0,  0,  0,  0},   // 1934
+    {  3,  5, 43,  0,  0,  0},   // 1935
+    {  2, 11,  0,  0,  0,  0},   // 1936
+    { 13,149,  0,  0,  0,  0},   // 1937
+    {  2,  3, 17, 19,  0,  0},   // 1938
+    {  7,277,  0,  0,  0,  0},   // 1939
+    {  2,  5, 97,  0,  0,  0},   // 1940
+    {  3,647,  0,  0,  0,  0},   // 1941
+    {  2,971,  0,  0,  0,  0},   // 1942
+    { 29, 67,  0,  0,  0,  0},   // 1943
+    {  2,  3,  0,  0,  0,  0},   // 1944
+    {  5,389,  0,  0,  0,  0},   // 1945
+    {  2,  7,139,  0,  0,  0},   // 1946
+    {  3, 11, 59,  0,  0,  0},   // 1947
+    {  2,487,  0,  0,  0,  0},   // 1948
+    {  0,  0,  0,  0,  0,  0},   // 1949
+    {  2,  3,  5, 13,  0,  0},   // 1950
+    {  0,  0,  0,  0,  0,  0},   // 1951
+    {  2, 61,  0,  0,  0,  0},   // 1952
+    {  3,  7, 31,  0,  0,  0},   // 1953
+    {  2,977,  0,  0,  0,  0},   // 1954
+    {  5, 17, 23,  0,  0,  0},   // 1955
+    {  2,  3,163,  0,  0,  0},   // 1956
+    { 19,103,  0,  0,  0,  0},   // 1957
+    {  2, 11, 89,  0,  0,  0},   // 1958
+    {  3,653,  0,  0,  0,  0},   // 1959
+    {  2,  5,  7,  0,  0,  0},   // 1960
+    { 37, 53,  0,  0,  0,  0},   // 1961
+    {  2,  3,109,  0,  0,  0},   // 1962
+    { 13,151,  0,  0,  0,  0},   // 1963
+    {  2,491,  0,  0,  0,  0},   // 1964
+    {  3,  5,131,  0,  0,  0},   // 1965
+    {  2,983,  0,  0,  0,  0},   // 1966
+    {  7,281,  0,  0,  0,  0},   // 1967
+    {  2,  3, 41,  0,  0,  0},   // 1968
+    { 11,179,  0,  0,  0,  0},   // 1969
+    {  2,  5,197,  0,  0,  0},   // 1970
+    {  3, 73,  0,  0,  0,  0},   // 1971
+    {  2, 17, 29,  0,  0,  0},   // 1972
+    {  0,  0,  0,  0,  0,  0},   // 1973
+    {  2,  3,  7, 47,  0,  0},   // 1974
+    {  5, 79,  0,  0,  0,  0},   // 1975
+    {  2, 13, 19,  0,  0,  0},   // 1976
+    {  3,659,  0,  0,  0,  0},   // 1977
+    {  2, 23, 43,  0,  0,  0},   // 1978
+    {  0,  0,  0,  0,  0,  0},   // 1979
+    {  2,  3,  5, 11,  0,  0},   // 1980
+    {  7,283,  0,  0,  0,  0},   // 1981
+    {  2,991,  0,  0,  0,  0},   // 1982
+    {  3,661,  0,  0,  0,  0},   // 1983
+    {  2, 31,  0,  0,  0,  0},   // 1984
+    {  5,397,  0,  0,  0,  0},   // 1985
+    {  2,  3,331,  0,  0,  0},   // 1986
+    {  0,  0,  0,  0,  0,  0},   // 1987
+    {  2,  7, 71,  0,  0,  0},   // 1988
+    {  3, 13, 17,  0,  0,  0},   // 1989
+    {  2,  5,199,  0,  0,  0},   // 1990
+    { 11,181,  0,  0,  0,  0},   // 1991
+    {  2,  3, 83,  0,  0,  0},   // 1992
+    {  0,  0,  0,  0,  0,  0},   // 1993
+    {  2,997,  0,  0,  0,  0},   // 1994
+    {  3,  5,  7, 19,  0,  0},   // 1995
+    {  2,499,  0,  0,  0,  0},   // 1996
+    {  0,  0,  0,  0,  0,  0},   // 1997
+    {  2,  3, 37,  0,  0,  0},   // 1998
+    {  0,  0,  0,  0,  0,  0},   // 1999
+    {  2,  5,  0,  0,  0,  0},   // 2000
+    {  3, 23, 29,  0,  0,  0},   // 2001
+    {  2,  7, 11, 13,  0,  0},   // 2002
+    {  0,  0,  0,  0,  0,  0},   // 2003
+    {  2,  3,167,  0,  0,  0},   // 2004
+    {  5,401,  0,  0,  0,  0},   // 2005
+    {  2, 17, 59,  0,  0,  0},   // 2006
+    {  3,223,  0,  0,  0,  0},   // 2007
+    {  2,251,  0,  0,  0,  0},   // 2008
+    {  7, 41,  0,  0,  0,  0},   // 2009
+    {  2,  3,  5, 67,  0,  0},   // 2010
+    {  0,  0,  0,  0,  0,  0},   // 2011
+    {  2,503,  0,  0,  0,  0},   // 2012
+    {  3, 11, 61,  0,  0,  0},   // 2013
+    {  2, 19, 53,  0,  0,  0},   // 2014
+    {  5, 13, 31,  0,  0,  0},   // 2015
+    {  2,  3,  7,  0,  0,  0},   // 2016
+    {  0,  0,  0,  0,  0,  0},   // 2017
+    {  2,1009,  0,  0,  0,  0},   // 2018
+    {  3,673,  0,  0,  0,  0},   // 2019
+    {  2,  5,101,  0,  0,  0},   // 2020
+    { 43, 47,  0,  0,  0,  0},   // 2021
+    {  2,  3,337,  0,  0,  0},   // 2022
+    {  7, 17,  0,  0,  0,  0},   // 2023
+    {  2, 11, 23,  0,  0,  0},   // 2024
+    {  3,  5,  0,  0,  0,  0},   // 2025
+    {  2,1013,  0,  0,  0,  0},   // 2026
+    {  0,  0,  0,  0,  0,  0},   // 2027
+    {  2,  3, 13,  0,  0,  0},   // 2028
+    {  0,  0,  0,  0,  0,  0},   // 2029
+    {  2,  5,  7, 29,  0,  0},   // 2030
+    {  3,677,  0,  0,  0,  0},   // 2031
+    {  2,127,  0,  0,  0,  0},   // 2032
+    { 19,107,  0,  0,  0,  0},   // 2033
+    {  2,  3,113,  0,  0,  0},   // 2034
+    {  5, 11, 37,  0,  0,  0},   // 2035
+    {  2,509,  0,  0,  0,  0},   // 2036
+    {  3,  7, 97,  0,  0,  0},   // 2037
+    {  2,1019,  0,  0,  0,  0},   // 2038
+    {  0,  0,  0,  0,  0,  0},   // 2039
+    {  2,  3,  5, 17,  0,  0},   // 2040
+    { 13,157,  0,  0,  0,  0},   // 2041
+    {  2,1021,  0,  0,  0,  0},   // 2042
+    {  3,227,  0,  0,  0,  0},   // 2043
+    {  2,  7, 73,  0,  0,  0},   // 2044
+    {  5,409,  0,  0,  0,  0},   // 2045
+    {  2,  3, 11, 31,  0,  0},   // 2046
+    { 23, 89,  0,  0,  0,  0},   // 2047
+    {  2,  0,  0,  0,  0,  0},   // 2048
+    {  3,683,  0,  0,  0,  0},   // 2049
+    {  2,  5, 41,  0,  0,  0},   // 2050
+    {  7,293,  0,  0,  0,  0},   // 2051
+    {  2,  3, 19,  0,  0,  0},   // 2052
+    {  0,  0,  0,  0,  0,  0},   // 2053
+    {  2, 13, 79,  0,  0,  0},   // 2054
+    {  3,  5,137,  0,  0,  0},   // 2055
+    {  2,257,  0,  0,  0,  0},   // 2056
+    { 11, 17,  0,  0,  0,  0},   // 2057
+    {  2,  3,  7,  0,  0,  0},   // 2058
+    { 29, 71,  0,  0,  0,  0},   // 2059
+    {  2,  5,103,  0,  0,  0},   // 2060
+    {  3,229,  0,  0,  0,  0},   // 2061
+    {  2,1031,  0,  0,  0,  0},   // 2062
+    {  0,  0,  0,  0,  0,  0},   // 2063
+    {  2,  3, 43,  0,  0,  0},   // 2064
+    {  5,  7, 59,  0,  0,  0},   // 2065
+    {  2,1033,  0,  0,  0,  0},   // 2066
+    {  3, 13, 53,  0,  0,  0},   // 2067
+    {  2, 11, 47,  0,  0,  0},   // 2068
+    {  0,  0,  0,  0,  0,  0},   // 2069
+    {  2,  3,  5, 23,  0,  0},   // 2070
+    { 19,109,  0,  0,  0,  0},   // 2071
+    {  2,  7, 37,  0,  0,  0},   // 2072
+    {  3,691,  0,  0,  0,  0},   // 2073
+    {  2, 17, 61,  0,  0,  0},   // 2074
+    {  5, 83,  0,  0,  0,  0},   // 2075
+    {  2,  3,173,  0,  0,  0},   // 2076
+    { 31, 67,  0,  0,  0,  0},   // 2077
+    {  2,1039,  0,  0,  0,  0},   // 2078
+    {  3,  7, 11,  0,  0,  0},   // 2079
+    {  2,  5, 13,  0,  0,  0},   // 2080
+    {  0,  0,  0,  0,  0,  0},   // 2081
+    {  2,  3,347,  0,  0,  0},   // 2082
+    {  0,  0,  0,  0,  0,  0},   // 2083
+    {  2,521,  0,  0,  0,  0},   // 2084
+    {  3,  5,139,  0,  0,  0},   // 2085
+    {  2,  7,149,  0,  0,  0},   // 2086
+    {  0,  0,  0,  0,  0,  0},   // 2087
+    {  2,  3, 29,  0,  0,  0},   // 2088
+    {  0,  0,  0,  0,  0,  0},   // 2089
+    {  2,  5, 11, 19,  0,  0},   // 2090
+    {  3, 17, 41,  0,  0,  0},   // 2091
+    {  2,523,  0,  0,  0,  0},   // 2092
+    {  7, 13, 23,  0,  0,  0},   // 2093
+    {  2,  3,349,  0,  0,  0},   // 2094
+    {  5,419,  0,  0,  0,  0},   // 2095
+    {  2,131,  0,  0,  0,  0},   // 2096
+    {  3,233,  0,  0,  0,  0},   // 2097
+    {  2,1049,  0,  0,  0,  0},   // 2098
+    {  0,  0,  0,  0,  0,  0},   // 2099
+    {  2,  3,  5,  7,  0,  0},   // 2100
+    { 11,191,  0,  0,  0,  0},   // 2101
+    {  2,1051,  0,  0,  0,  0},   // 2102
+    {  3,701,  0,  0,  0,  0},   // 2103
+    {  2,263,  0,  0,  0,  0},   // 2104
+    {  5,421,  0,  0,  0,  0},   // 2105
+    {  2,  3, 13,  0,  0,  0},   // 2106
+    {  7, 43,  0,  0,  0,  0},   // 2107
+    {  2, 17, 31,  0,  0,  0},   // 2108
+    {  3, 19, 37,  0,  0,  0},   // 2109
+    {  2,  5,211,  0,  0,  0},   // 2110
+    {  0,  0,  0,  0,  0,  0},   // 2111
+    {  2,  3, 11,  0,  0,  0},   // 2112
+    {  0,  0,  0,  0,  0,  0},   // 2113
+    {  2,  7,151,  0,  0,  0},   // 2114
+    {  3,  5, 47,  0,  0,  0},   // 2115
+    {  2, 23,  0,  0,  0,  0},   // 2116
+    { 29, 73,  0,  0,  0,  0},   // 2117
+    {  2,  3,353,  0,  0,  0},   // 2118
+    { 13,163,  0,  0,  0,  0},   // 2119
+    {  2,  5, 53,  0,  0,  0},   // 2120
+    {  3,  7,101,  0,  0,  0},   // 2121
+    {  2,1061,  0,  0,  0,  0},   // 2122
+    { 11,193,  0,  0,  0,  0},   // 2123
+    {  2,  3, 59,  0,  0,  0},   // 2124
+    {  5, 17,  0,  0,  0,  0},   // 2125
+    {  2,1063,  0,  0,  0,  0},   // 2126
+    {  3,709,  0,  0,  0,  0},   // 2127
+    {  2,  7, 19,  0,  0,  0},   // 2128
+    {  0,  0,  0,  0,  0,  0},   // 2129
+    {  2,  3,  5, 71,  0,  0},   // 2130
+    {  0,  0,  0,  0,  0,  0},   // 2131
+    {  2, 13, 41,  0,  0,  0},   // 2132
+    {  3, 79,  0,  0,  0,  0},   // 2133
+    {  2, 11, 97,  0,  0,  0},   // 2134
+    {  5,  7, 61,  0,  0,  0},   // 2135
+    {  2,  3, 89,  0,  0,  0},   // 2136
+    {  0,  0,  0,  0,  0,  0},   // 2137
+    {  2,1069,  0,  0,  0,  0},   // 2138
+    {  3, 23, 31,  0,  0,  0},   // 2139
+    {  2,  5,107,  0,  0,  0},   // 2140
+    {  0,  0,  0,  0,  0,  0},   // 2141
+    {  2,  3,  7, 17,  0,  0},   // 2142
+    {  0,  0,  0,  0,  0,  0},   // 2143
+    {  2, 67,  0,  0,  0,  0},   // 2144
+    {  3,  5, 11, 13,  0,  0},   // 2145
+    {  2, 29, 37,  0,  0,  0},   // 2146
+    { 19,113,  0,  0,  0,  0},   // 2147
+    {  2,  3,179,  0,  0,  0},   // 2148
+    {  7,307,  0,  0,  0,  0},   // 2149
+    {  2,  5, 43,  0,  0,  0},   // 2150
+    {  3,239,  0,  0,  0,  0},   // 2151
+    {  2,269,  0,  0,  0,  0},   // 2152
+    {  0,  0,  0,  0,  0,  0},   // 2153
+    {  2,  3,359,  0,  0,  0},   // 2154
+    {  5,431,  0,  0,  0,  0},   // 2155
+    {  2,  7, 11,  0,  0,  0},   // 2156
+    {  3,719,  0,  0,  0,  0},   // 2157
+    {  2, 13, 83,  0,  0,  0},   // 2158
+    { 17,127,  0,  0,  0,  0},   // 2159
+    {  2,  3,  5,  0,  0,  0},   // 2160
+    {  0,  0,  0,  0,  0,  0},   // 2161
+    {  2, 23, 47,  0,  0,  0},   // 2162
+    {  3,  7,103,  0,  0,  0},   // 2163
+    {  2,541,  0,  0,  0,  0},   // 2164
+    {  5,433,  0,  0,  0,  0},   // 2165
+    {  2,  3, 19,  0,  0,  0},   // 2166
+    { 11,197,  0,  0,  0,  0},   // 2167
+    {  2,271,  0,  0,  0,  0},   // 2168
+    {  3,241,  0,  0,  0,  0},   // 2169
+    {  2,  5,  7, 31,  0,  0},   // 2170
+    { 13,167,  0,  0,  0,  0},   // 2171
+    {  2,  3,181,  0,  0,  0},   // 2172
+    { 41, 53,  0,  0,  0,  0},   // 2173
+    {  2,1087,  0,  0,  0,  0},   // 2174
+    {  3,  5, 29,  0,  0,  0},   // 2175
+    {  2, 17,  0,  0,  0,  0},   // 2176
+    {  7,311,  0,  0,  0,  0},   // 2177
+    {  2,  3, 11,  0,  0,  0},   // 2178
+    {  0,  0,  0,  0,  0,  0},   // 2179
+    {  2,  5,109,  0,  0,  0},   // 2180
+    {  3,727,  0,  0,  0,  0},   // 2181
+    {  2,1091,  0,  0,  0,  0},   // 2182
+    { 37, 59,  0,  0,  0,  0},   // 2183
+    {  2,  3,  7, 13,  0,  0},   // 2184
+    {  5, 19, 23,  0,  0,  0},   // 2185
+    {  2,1093,  0,  0,  0,  0},   // 2186
+    {  3,  0,  0,  0,  0,  0},   // 2187
+    {  2,547,  0,  0,  0,  0},   // 2188
+    { 11,199,  0,  0,  0,  0},   // 2189
+    {  2,  3,  5, 73,  0,  0},   // 2190
+    {  7,313,  0,  0,  0,  0},   // 2191
+    {  2,137,  0,  0,  0,  0},   // 2192
+    {  3, 17, 43,  0,  0,  0},   // 2193
+    {  2,1097,  0,  0,  0,  0},   // 2194
+    {  5,439,  0,  0,  0,  0},   // 2195
+    {  2,  3, 61,  0,  0,  0},   // 2196
+    { 13,  0,  0,  0,  0,  0},   // 2197
+    {  2,  7,157,  0,  0,  0},   // 2198
+    {  3,733,  0,  0,  0,  0},   // 2199
+    {  2,  5, 11,  0,  0,  0},   // 2200
+    { 31, 71,  0,  0,  0,  0},   // 2201
+    {  2,  3,367,  0,  0,  0},   // 2202
+    {  0,  0,  0,  0,  0,  0},   // 2203
+    {  2, 19, 29,  0,  0,  0},   // 2204
+    {  3,  5,  7,  0,  0,  0},   // 2205
+    {  2,1103,  0,  0,  0,  0},   // 2206
+    {  0,  0,  0,  0,  0,  0},   // 2207
+    {  2,  3, 23,  0,  0,  0},   // 2208
+    { 47,  0,  0,  0,  0,  0},   // 2209
+    {  2,  5, 13, 17,  0,  0},   // 2210
+    {  3, 11, 67,  0,  0,  0},   // 2211
+    {  2,  7, 79,  0,  0,  0},   // 2212
+    {  0,  0,  0,  0,  0,  0},   // 2213
+    {  2,  3, 41,  0,  0,  0},   // 2214
+    {  5,443,  0,  0,  0,  0},   // 2215
+    {  2,277,  0,  0,  0,  0},   // 2216
+    {  3,739,  0,  0,  0,  0},   // 2217
+    {  2,1109,  0,  0,  0,  0},   // 2218
+    {  7,317,  0,  0,  0,  0},   // 2219
+    {  2,  3,  5, 37,  0,  0},   // 2220
+    {  0,  0,  0,  0,  0,  0},   // 2221
+    {  2, 11,101,  0,  0,  0},   // 2222
+    {  3, 13, 19,  0,  0,  0},   // 2223
+    {  2,139,  0,  0,  0,  0},   // 2224
+    {  5, 89,  0,  0,  0,  0},   // 2225
+    {  2,  3,  7, 53,  0,  0},   // 2226
+    { 17,131,  0,  0,  0,  0},   // 2227
+    {  2,557,  0,  0,  0,  0},   // 2228
+    {  3,743,  0,  0,  0,  0},   // 2229
+    {  2,  5,223,  0,  0,  0},   // 2230
+    { 23, 97,  0,  0,  0,  0},   // 2231
+    {  2,  3, 31,  0,  0,  0},   // 2232
+    {  7, 11, 29,  0,  0,  0},   // 2233
+    {  2,1117,  0,  0,  0,  0},   // 2234
+    {  3,  5,149,  0,  0,  0},   // 2235
+    {  2, 13, 43,  0,  0,  0},   // 2236
+    {  0,  0,  0,  0,  0,  0},   // 2237
+    {  2,  3,373,  0,  0,  0},   // 2238
+    {  0,  0,  0,  0,  0,  0},   // 2239
+    {  2,  5,  7,  0,  0,  0},   // 2240
+    {  3, 83,  0,  0,  0,  0},   // 2241
+    {  2, 19, 59,  0,  0,  0},   // 2242
+    {  0,  0,  0,  0,  0,  0},   // 2243
+    {  2,  3, 11, 17,  0,  0},   // 2244
+    {  5,449,  0,  0,  0,  0},   // 2245
+    {  2,1123,  0,  0,  0,  0},   // 2246
+    {  3,  7,107,  0,  0,  0},   // 2247
+    {  2,281,  0,  0,  0,  0},   // 2248
+    { 13,173,  0,  0,  0,  0},   // 2249
+    {  2,  3,  5,  0,  0,  0},   // 2250
+    {  0,  0,  0,  0,  0,  0},   // 2251
+    {  2,563,  0,  0,  0,  0},   // 2252
+    {  3,751,  0,  0,  0,  0},   // 2253
+    {  2,  7, 23,  0,  0,  0},   // 2254
+    {  5, 11, 41,  0,  0,  0},   // 2255
+    {  2,  3, 47,  0,  0,  0},   // 2256
+    { 37, 61,  0,  0,  0,  0},   // 2257
+    {  2,1129,  0,  0,  0,  0},   // 2258
+    {  3,251,  0,  0,  0,  0},   // 2259
+    {  2,  5,113,  0,  0,  0},   // 2260
+    {  7, 17, 19,  0,  0,  0},   // 2261
+    {  2,  3, 13, 29,  0,  0},   // 2262
+    { 31, 73,  0,  0,  0,  0},   // 2263
+    {  2,283,  0,  0,  0,  0},   // 2264
+    {  3,  5,151,  0,  0,  0},   // 2265
+    {  2, 11,103,  0,  0,  0},   // 2266
+    {  0,  0,  0,  0,  0,  0},   // 2267
+    {  2,  3,  7,  0,  0,  0},   // 2268
+    {  0,  0,  0,  0,  0,  0},   // 2269
+    {  2,  5,227,  0,  0,  0},   // 2270
+    {  3,757,  0,  0,  0,  0},   // 2271
+    {  2, 71,  0,  0,  0,  0},   // 2272
+    {  0,  0,  0,  0,  0,  0},   // 2273
+    {  2,  3,379,  0,  0,  0},   // 2274
+    {  5,  7, 13,  0,  0,  0},   // 2275
+    {  2,569,  0,  0,  0,  0},   // 2276
+    {  3, 11, 23,  0,  0,  0},   // 2277
+    {  2, 17, 67,  0,  0,  0},   // 2278
+    { 43, 53,  0,  0,  0,  0},   // 2279
+    {  2,  3,  5, 19,  0,  0},   // 2280
+    {  0,  0,  0,  0,  0,  0},   // 2281
+    {  2,  7,163,  0,  0,  0},   // 2282
+    {  3,761,  0,  0,  0,  0},   // 2283
+    {  2,571,  0,  0,  0,  0},   // 2284
+    {  5,457,  0,  0,  0,  0},   // 2285
+    {  2,  3,127,  0,  0,  0},   // 2286
+    {  0,  0,  0,  0,  0,  0},   // 2287
+    {  2, 11, 13,  0,  0,  0},   // 2288
+    {  3,  7,109,  0,  0,  0},   // 2289
+    {  2,  5,229,  0,  0,  0},   // 2290
+    { 29, 79,  0,  0,  0,  0},   // 2291
+    {  2,  3,191,  0,  0,  0},   // 2292
+    {  0,  0,  0,  0,  0,  0},   // 2293
+    {  2, 31, 37,  0,  0,  0},   // 2294
+    {  3,  5, 17,  0,  0,  0},   // 2295
+    {  2,  7, 41,  0,  0,  0},   // 2296
+    {  0,  0,  0,  0,  0,  0},   // 2297
+    {  2,  3,383,  0,  0,  0},   // 2298
+    { 11, 19,  0,  0,  0,  0},   // 2299
+    {  2,  5, 23,  0,  0,  0},   // 2300
+    {  3, 13, 59,  0,  0,  0},   // 2301
+    {  2,1151,  0,  0,  0,  0},   // 2302
+    {  7, 47,  0,  0,  0,  0},   // 2303
+    {  2,  3,  0,  0,  0,  0},   // 2304
+    {  5,461,  0,  0,  0,  0},   // 2305
+    {  2,1153,  0,  0,  0,  0},   // 2306
+    {  3,769,  0,  0,  0,  0},   // 2307
+    {  2,577,  0,  0,  0,  0},   // 2308
+    {  0,  0,  0,  0,  0,  0},   // 2309
+    {  2,  3,  5,  7, 11,  0},   // 2310
+    {  0,  0,  0,  0,  0,  0},   // 2311
+    {  2, 17,  0,  0,  0,  0},   // 2312
+    {  3,257,  0,  0,  0,  0},   // 2313
+    {  2, 13, 89,  0,  0,  0},   // 2314
+    {  5,463,  0,  0,  0,  0},   // 2315
+    {  2,  3,193,  0,  0,  0},   // 2316
+    {  7,331,  0,  0,  0,  0},   // 2317
+    {  2, 19, 61,  0,  0,  0},   // 2318
+    {  3,773,  0,  0,  0,  0},   // 2319
+    {  2,  5, 29,  0,  0,  0},   // 2320
+    { 11,211,  0,  0,  0,  0},   // 2321
+    {  2,  3, 43,  0,  0,  0},   // 2322
+    { 23,101,  0,  0,  0,  0},   // 2323
+    {  2,  7, 83,  0,  0,  0},   // 2324
+    {  3,  5, 31,  0,  0,  0},   // 2325
+    {  2,1163,  0,  0,  0,  0},   // 2326
+    { 13,179,  0,  0,  0,  0},   // 2327
+    {  2,  3, 97,  0,  0,  0},   // 2328
+    { 17,137,  0,  0,  0,  0},   // 2329
+    {  2,  5,233,  0,  0,  0},   // 2330
+    {  3,  7, 37,  0,  0,  0},   // 2331
+    {  2, 11, 53,  0,  0,  0},   // 2332
+    {  0,  0,  0,  0,  0,  0},   // 2333
+    {  2,  3,389,  0,  0,  0},   // 2334
+    {  5,467,  0,  0,  0,  0},   // 2335
+    {  2, 73,  0,  0,  0,  0},   // 2336
+    {  3, 19, 41,  0,  0,  0},   // 2337
+    {  2,  7,167,  0,  0,  0},   // 2338
+    {  0,  0,  0,  0,  0,  0},   // 2339
+    {  2,  3,  5, 13,  0,  0},   // 2340
+    {  0,  0,  0,  0,  0,  0},   // 2341
+    {  2,1171,  0,  0,  0,  0},   // 2342
+    {  3, 11, 71,  0,  0,  0},   // 2343
+    {  2,293,  0,  0,  0,  0},   // 2344
+    {  5,  7, 67,  0,  0,  0},   // 2345
+    {  2,  3, 17, 23,  0,  0},   // 2346
+    {  0,  0,  0,  0,  0,  0},   // 2347
+    {  2,587,  0,  0,  0,  0},   // 2348
+    {  3, 29,  0,  0,  0,  0},   // 2349
+    {  2,  5, 47,  0,  0,  0},   // 2350
+    {  0,  0,  0,  0,  0,  0},   // 2351
+    {  2,  3,  7,  0,  0,  0},   // 2352
+    { 13,181,  0,  0,  0,  0},   // 2353
+    {  2, 11,107,  0,  0,  0},   // 2354
+    {  3,  5,157,  0,  0,  0},   // 2355
+    {  2, 19, 31,  0,  0,  0},   // 2356
+    {  0,  0,  0,  0,  0,  0},   // 2357
+    {  2,  3,131,  0,  0,  0},   // 2358
+    {  7,337,  0,  0,  0,  0},   // 2359
+    {  2,  5, 59,  0,  0,  0},   // 2360
+    {  3,787,  0,  0,  0,  0},   // 2361
+    {  2,1181,  0,  0,  0,  0},   // 2362
+    { 17,139,  0,  0,  0,  0},   // 2363
+    {  2,  3,197,  0,  0,  0},   // 2364
+    {  5, 11, 43,  0,  0,  0},   // 2365
+    {  2,  7, 13,  0,  0,  0},   // 2366
+    {  3,263,  0,  0,  0,  0},   // 2367
+    {  2, 37,  0,  0,  0,  0},   // 2368
+    { 23,103,  0,  0,  0,  0},   // 2369
+    {  2,  3,  5, 79,  0,  0},   // 2370
+    {  0,  0,  0,  0,  0,  0},   // 2371
+    {  2,593,  0,  0,  0,  0},   // 2372
+    {  3,  7,113,  0,  0,  0},   // 2373
+    {  2,1187,  0,  0,  0,  0},   // 2374
+    {  5, 19,  0,  0,  0,  0},   // 2375
+    {  2,  3, 11,  0,  0,  0},   // 2376
+    {  0,  0,  0,  0,  0,  0},   // 2377
+    {  2, 29, 41,  0,  0,  0},   // 2378
+    {  3, 13, 61,  0,  0,  0},   // 2379
+    {  2,  5,  7, 17,  0,  0},   // 2380
+    {  0,  0,  0,  0,  0,  0},   // 2381
+    {  2,  3,397,  0,  0,  0},   // 2382
+    {  0,  0,  0,  0,  0,  0},   // 2383
+    {  2,149,  0,  0,  0,  0},   // 2384
+    {  3,  5, 53,  0,  0,  0},   // 2385
+    {  2,1193,  0,  0,  0,  0},   // 2386
+    {  7, 11, 31,  0,  0,  0},   // 2387
+    {  2,  3,199,  0,  0,  0},   // 2388
+    {  0,  0,  0,  0,  0,  0},   // 2389
+    {  2,  5,239,  0,  0,  0},   // 2390
+    {  3,797,  0,  0,  0,  0},   // 2391
+    {  2, 13, 23,  0,  0,  0},   // 2392
+    {  0,  0,  0,  0,  0,  0},   // 2393
+    {  2,  3,  7, 19,  0,  0},   // 2394
+    {  5,479,  0,  0,  0,  0},   // 2395
+    {  2,599,  0,  0,  0,  0},   // 2396
+    {  3, 17, 47,  0,  0,  0},   // 2397
+    {  2, 11,109,  0,  0,  0},   // 2398
+    {  0,  0,  0,  0,  0,  0},   // 2399
+    {  2,  3,  5,  0,  0,  0},   // 2400
+    {  7,  0,  0,  0,  0,  0},   // 2401
+    {  2,1201,  0,  0,  0,  0},   // 2402
+    {  3, 89,  0,  0,  0,  0},   // 2403
+    {  2,601,  0,  0,  0,  0},   // 2404
+    {  5, 13, 37,  0,  0,  0},   // 2405
+    {  2,  3,401,  0,  0,  0},   // 2406
+    { 29, 83,  0,  0,  0,  0},   // 2407
+    {  2,  7, 43,  0,  0,  0},   // 2408
+    {  3, 11, 73,  0,  0,  0},   // 2409
+    {  2,  5,241,  0,  0,  0},   // 2410
+    {  0,  0,  0,  0,  0,  0},   // 2411
+    {  2,  3, 67,  0,  0,  0},   // 2412
+    { 19,127,  0,  0,  0,  0},   // 2413
+    {  2, 17, 71,  0,  0,  0},   // 2414
+    {  3,  5,  7, 23,  0,  0},   // 2415
+    {  2,151,  0,  0,  0,  0},   // 2416
+    {  0,  0,  0,  0,  0,  0},   // 2417
+    {  2,  3, 13, 31,  0,  0},   // 2418
+    { 41, 59,  0,  0,  0,  0},   // 2419
+    {  2,  5, 11,  0,  0,  0},   // 2420
+    {  3,269,  0,  0,  0,  0},   // 2421
+    {  2,  7,173,  0,  0,  0},   // 2422
+    {  0,  0,  0,  0,  0,  0},   // 2423
+    {  2,  3,101,  0,  0,  0},   // 2424
+    {  5, 97,  0,  0,  0,  0},   // 2425
+    {  2,1213,  0,  0,  0,  0},   // 2426
+    {  3,809,  0,  0,  0,  0},   // 2427
+    {  2,607,  0,  0,  0,  0},   // 2428
+    {  7,347,  0,  0,  0,  0},   // 2429
+    {  2,  3,  5,  0,  0,  0},   // 2430
+    { 11, 13, 17,  0,  0,  0},   // 2431
+    {  2, 19,  0,  0,  0,  0},   // 2432
+    {  3,811,  0,  0,  0,  0},   // 2433
+    {  2,1217,  0,  0,  0,  0},   // 2434
+    {  5,487,  0,  0,  0,  0},   // 2435
+    {  2,  3,  7, 29,  0,  0},   // 2436
+    {  0,  0,  0,  0,  0,  0},   // 2437
+    {  2, 23, 53,  0,  0,  0},   // 2438
+    {  3,271,  0,  0,  0,  0},   // 2439
+    {  2,  5, 61,  0,  0,  0},   // 2440
+    {  0,  0,  0,  0,  0,  0},   // 2441
+    {  2,  3, 11, 37,  0,  0},   // 2442
+    {  7,349,  0,  0,  0,  0},   // 2443
+    {  2, 13, 47,  0,  0,  0},   // 2444
+    {  3,  5,163,  0,  0,  0},   // 2445
+    {  2,1223,  0,  0,  0,  0},   // 2446
+    {  0,  0,  0,  0,  0,  0},   // 2447
+    {  2,  3, 17,  0,  0,  0},   // 2448
+    { 31, 79,  0,  0,  0,  0},   // 2449
+    {  2,  5,  7,  0,  0,  0},   // 2450
+    {  3, 19, 43,  0,  0,  0},   // 2451
+    {  2,613,  0,  0,  0,  0},   // 2452
+    { 11,223,  0,  0,  0,  0},   // 2453
+    {  2,  3,409,  0,  0,  0},   // 2454
+    {  5,491,  0,  0,  0,  0},   // 2455
+    {  2,307,  0,  0,  0,  0},   // 2456
+    {  3,  7, 13,  0,  0,  0},   // 2457
+    {  2,1229,  0,  0,  0,  0},   // 2458
+    {  0,  0,  0,  0,  0,  0},   // 2459
+    {  2,  3,  5, 41,  0,  0},   // 2460
+    { 23,107,  0,  0,  0,  0},   // 2461
+    {  2,1231,  0,  0,  0,  0},   // 2462
+    {  3,821,  0,  0,  0,  0},   // 2463
+    {  2,  7, 11,  0,  0,  0},   // 2464
+    {  5, 17, 29,  0,  0,  0},   // 2465
+    {  2,  3,137,  0,  0,  0},   // 2466
+    {  0,  0,  0,  0,  0,  0},   // 2467
+    {  2,617,  0,  0,  0,  0},   // 2468
+    {  3,823,  0,  0,  0,  0},   // 2469
+    {  2,  5, 13, 19,  0,  0},   // 2470
+    {  7,353,  0,  0,  0,  0},   // 2471
+    {  2,  3,103,  0,  0,  0},   // 2472
+    {  0,  0,  0,  0,  0,  0},   // 2473
+    {  2,1237,  0,  0,  0,  0},   // 2474
+    {  3,  5, 11,  0,  0,  0},   // 2475
+    {  2,619,  0,  0,  0,  0},   // 2476
+    {  0,  0,  0,  0,  0,  0},   // 2477
+    {  2,  3,  7, 59,  0,  0},   // 2478
+    { 37, 67,  0,  0,  0,  0},   // 2479
+    {  2,  5, 31,  0,  0,  0},   // 2480
+    {  3,827,  0,  0,  0,  0},   // 2481
+    {  2, 17, 73,  0,  0,  0},   // 2482
+    { 13,191,  0,  0,  0,  0},   // 2483
+    {  2,  3, 23,  0,  0,  0},   // 2484
+    {  5,  7, 71,  0,  0,  0},   // 2485
+    {  2, 11,113,  0,  0,  0},   // 2486
+    {  3,829,  0,  0,  0,  0},   // 2487
+    {  2,311,  0,  0,  0,  0},   // 2488
+    { 19,131,  0,  0,  0,  0},   // 2489
+    {  2,  3,  5, 83,  0,  0},   // 2490
+    { 47, 53,  0,  0,  0,  0},   // 2491
+    {  2,  7, 89,  0,  0,  0},   // 2492
+    {  3,277,  0,  0,  0,  0},   // 2493
+    {  2, 29, 43,  0,  0,  0},   // 2494
+    {  5,499,  0,  0,  0,  0},   // 2495
+    {  2,  3, 13,  0,  0,  0},   // 2496
+    { 11,227,  0,  0,  0,  0},   // 2497
+    {  2,1249,  0,  0,  0,  0},   // 2498
+    {  3,  7, 17,  0,  0,  0},   // 2499
+    {  2,  5,  0,  0,  0,  0},   // 2500
+    { 41, 61,  0,  0,  0,  0},   // 2501
+    {  2,  3,139,  0,  0,  0},   // 2502
+    {  0,  0,  0,  0,  0,  0},   // 2503
+    {  2,313,  0,  0,  0,  0},   // 2504
+    {  3,  5,167,  0,  0,  0},   // 2505
+    {  2,  7,179,  0,  0,  0},   // 2506
+    { 23,109,  0,  0,  0,  0},   // 2507
+    {  2,  3, 11, 19,  0,  0},   // 2508
+    { 13,193,  0,  0,  0,  0},   // 2509
+    {  2,  5,251,  0,  0,  0},   // 2510
+    {  3, 31,  0,  0,  0,  0},   // 2511
+    {  2,157,  0,  0,  0,  0},   // 2512
+    {  7,359,  0,  0,  0,  0},   // 2513
+    {  2,  3,419,  0,  0,  0},   // 2514
+    {  5,503,  0,  0,  0,  0},   // 2515
+    {  2, 17, 37,  0,  0,  0},   // 2516
+    {  3,839,  0,  0,  0,  0},   // 2517
+    {  2,1259,  0,  0,  0,  0},   // 2518
+    { 11,229,  0,  0,  0,  0},   // 2519
+    {  2,  3,  5,  7,  0,  0},   // 2520
+    {  0,  0,  0,  0,  0,  0},   // 2521
+    {  2, 13, 97,  0,  0,  0},   // 2522
+    {  3, 29,  0,  0,  0,  0},   // 2523
+    {  2,631,  0,  0,  0,  0},   // 2524
+    {  5,101,  0,  0,  0,  0},   // 2525
+    {  2,  3,421,  0,  0,  0},   // 2526
+    {  7, 19,  0,  0,  0,  0},   // 2527
+    {  2, 79,  0,  0,  0,  0},   // 2528
+    {  3,281,  0,  0,  0,  0},   // 2529
+    {  2,  5, 11, 23,  0,  0},   // 2530
+    {  0,  0,  0,  0,  0,  0},   // 2531
+    {  2,  3,211,  0,  0,  0},   // 2532
+    { 17,149,  0,  0,  0,  0},   // 2533
+    {  2,  7,181,  0,  0,  0},   // 2534
+    {  3,  5, 13,  0,  0,  0},   // 2535
+    {  2,317,  0,  0,  0,  0},   // 2536
+    { 43, 59,  0,  0,  0,  0},   // 2537
+    {  2,  3, 47,  0,  0,  0},   // 2538
+    {  0,  0,  0,  0,  0,  0},   // 2539
+    {  2,  5,127,  0,  0,  0},   // 2540
+    {  3,  7, 11,  0,  0,  0},   // 2541
+    {  2, 31, 41,  0,  0,  0},   // 2542
+    {  0,  0,  0,  0,  0,  0},   // 2543
+    {  2,  3, 53,  0,  0,  0},   // 2544
+    {  5,509,  0,  0,  0,  0},   // 2545
+    {  2, 19, 67,  0,  0,  0},   // 2546
+    {  3,283,  0,  0,  0,  0},   // 2547
+    {  2,  7, 13,  0,  0,  0},   // 2548
+    {  0,  0,  0,  0,  0,  0},   // 2549
+    {  2,  3,  5, 17,  0,  0},   // 2550
+    {  0,  0,  0,  0,  0,  0},   // 2551
+    {  2, 11, 29,  0,  0,  0},   // 2552
+    {  3, 23, 37,  0,  0,  0},   // 2553
+    {  2,1277,  0,  0,  0,  0},   // 2554
+    {  5,  7, 73,  0,  0,  0},   // 2555
+    {  2,  3, 71,  0,  0,  0},   // 2556
+    {  0,  0,  0,  0,  0,  0},   // 2557
+    {  2,1279,  0,  0,  0,  0},   // 2558
+    {  3,853,  0,  0,  0,  0},   // 2559
+    {  2,  5,  0,  0,  0,  0},   // 2560
+    { 13,197,  0,  0,  0,  0},   // 2561
+    {  2,  3,  7, 61,  0,  0},   // 2562
+    { 11,233,  0,  0,  0,  0},   // 2563
+    {  2,641,  0,  0,  0,  0},   // 2564
+    {  3,  5, 19,  0,  0,  0},   // 2565
+    {  2,1283,  0,  0,  0,  0},   // 2566
+    { 17,151,  0,  0,  0,  0},   // 2567
+    {  2,  3,107,  0,  0,  0},   // 2568
+    {  7,367,  0,  0,  0,  0},   // 2569
+    {  2,  5,257,  0,  0,  0},   // 2570
+    {  3,857,  0,  0,  0,  0},   // 2571
+    {  2,643,  0,  0,  0,  0},   // 2572
+    { 31, 83,  0,  0,  0,  0},   // 2573
+    {  2,  3, 11, 13,  0,  0},   // 2574
+    {  5,103,  0,  0,  0,  0},   // 2575
+    {  2,  7, 23,  0,  0,  0},   // 2576
+    {  3,859,  0,  0,  0,  0},   // 2577
+    {  2,1289,  0,  0,  0,  0},   // 2578
+    {  0,  0,  0,  0,  0,  0},   // 2579
+    {  2,  3,  5, 43,  0,  0},   // 2580
+    { 29, 89,  0,  0,  0,  0},   // 2581
+    {  2,1291,  0,  0,  0,  0},   // 2582
+    {  3,  7, 41,  0,  0,  0},   // 2583
+    {  2, 17, 19,  0,  0,  0},   // 2584
+    {  5, 11, 47,  0,  0,  0},   // 2585
+    {  2,  3,431,  0,  0,  0},   // 2586
+    { 13,199,  0,  0,  0,  0},   // 2587
+    {  2,647,  0,  0,  0,  0},   // 2588
+    {  3,863,  0,  0,  0,  0},   // 2589
+    {  2,  5,  7, 37,  0,  0},   // 2590
+    {  0,  0,  0,  0,  0,  0},   // 2591
+    {  2,  3,  0,  0,  0,  0},   // 2592
+    {  0,  0,  0,  0,  0,  0},   // 2593
+    {  2,1297,  0,  0,  0,  0},   // 2594
+    {  3,  5,173,  0,  0,  0},   // 2595
+    {  2, 11, 59,  0,  0,  0},   // 2596
+    {  7, 53,  0,  0,  0,  0},   // 2597
+    {  2,  3,433,  0,  0,  0},   // 2598
+    { 23,113,  0,  0,  0,  0},   // 2599
+    {  2,  5, 13,  0,  0,  0},   // 2600
+    {  3, 17,  0,  0,  0,  0},   // 2601
+    {  2,1301,  0,  0,  0,  0},   // 2602
+    { 19,137,  0,  0,  0,  0},   // 2603
+    {  2,  3,  7, 31,  0,  0},   // 2604
+    {  5,521,  0,  0,  0,  0},   // 2605
+    {  2,1303,  0,  0,  0,  0},   // 2606
+    {  3, 11, 79,  0,  0,  0},   // 2607
+    {  2,163,  0,  0,  0,  0},   // 2608
+    {  0,  0,  0,  0,  0,  0},   // 2609
+    {  2,  3,  5, 29,  0,  0},   // 2610
+    {  7,373,  0,  0,  0,  0},   // 2611
+    {  2,653,  0,  0,  0,  0},   // 2612
+    {  3, 13, 67,  0,  0,  0},   // 2613
+    {  2,1307,  0,  0,  0,  0},   // 2614
+    {  5,523,  0,  0,  0,  0},   // 2615
+    {  2,  3,109,  0,  0,  0},   // 2616
+    {  0,  0,  0,  0,  0,  0},   // 2617
+    {  2,  7, 11, 17,  0,  0},   // 2618
+    {  3, 97,  0,  0,  0,  0},   // 2619
+    {  2,  5,131,  0,  0,  0},   // 2620
+    {  0,  0,  0,  0,  0,  0},   // 2621
+    {  2,  3, 19, 23,  0,  0},   // 2622
+    { 43, 61,  0,  0,  0,  0},   // 2623
+    {  2, 41,  0,  0,  0,  0},   // 2624
+    {  3,  5,  7,  0,  0,  0},   // 2625
+    {  2, 13,101,  0,  0,  0},   // 2626
+    { 37, 71,  0,  0,  0,  0},   // 2627
+    {  2,  3, 73,  0,  0,  0},   // 2628
+    { 11,239,  0,  0,  0,  0},   // 2629
+    {  2,  5,263,  0,  0,  0},   // 2630
+    {  3,877,  0,  0,  0,  0},   // 2631
+    {  2,  7, 47,  0,  0,  0},   // 2632
+    {  0,  0,  0,  0,  0,  0},   // 2633
+    {  2,  3,439,  0,  0,  0},   // 2634
+    {  5, 17, 31,  0,  0,  0},   // 2635
+    {  2,659,  0,  0,  0,  0},   // 2636
+    {  3,293,  0,  0,  0,  0},   // 2637
+    {  2,1319,  0,  0,  0,  0},   // 2638
+    {  7, 13, 29,  0,  0,  0},   // 2639
+    {  2,  3,  5, 11,  0,  0},   // 2640
+    { 19,139,  0,  0,  0,  0},   // 2641
+    {  2,1321,  0,  0,  0,  0},   // 2642
+    {  3,881,  0,  0,  0,  0},   // 2643
+    {  2,661,  0,  0,  0,  0},   // 2644
+    {  5, 23,  0,  0,  0,  0},   // 2645
+    {  2,  3,  7,  0,  0,  0},   // 2646
+    {  0,  0,  0,  0,  0,  0},   // 2647
+    {  2,331,  0,  0,  0,  0},   // 2648
+    {  3,883,  0,  0,  0,  0},   // 2649
+    {  2,  5, 53,  0,  0,  0},   // 2650
+    { 11,241,  0,  0,  0,  0},   // 2651
+    {  2,  3, 13, 17,  0,  0},   // 2652
+    {  7,379,  0,  0,  0,  0},   // 2653
+    {  2,1327,  0,  0,  0,  0},   // 2654
+    {  3,  5, 59,  0,  0,  0},   // 2655
+    {  2, 83,  0,  0,  0,  0},   // 2656
+    {  0,  0,  0,  0,  0,  0},   // 2657
+    {  2,  3,443,  0,  0,  0},   // 2658
+    {  0,  0,  0,  0,  0,  0},   // 2659
+    {  2,  5,  7, 19,  0,  0},   // 2660
+    {  3,887,  0,  0,  0,  0},   // 2661
+    {  2, 11,  0,  0,  0,  0},   // 2662
+    {  0,  0,  0,  0,  0,  0},   // 2663
+    {  2,  3, 37,  0,  0,  0},   // 2664
+    {  5, 13, 41,  0,  0,  0},   // 2665
+    {  2, 31, 43,  0,  0,  0},   // 2666
+    {  3,  7,127,  0,  0,  0},   // 2667
+    {  2, 23, 29,  0,  0,  0},   // 2668
+    { 17,157,  0,  0,  0,  0},   // 2669
+    {  2,  3,  5, 89,  0,  0},   // 2670
+    {  0,  0,  0,  0,  0,  0},   // 2671
+    {  2,167,  0,  0,  0,  0},   // 2672
+    {  3, 11,  0,  0,  0,  0},   // 2673
+    {  2,  7,191,  0,  0,  0},   // 2674
+    {  5,107,  0,  0,  0,  0},   // 2675
+    {  2,  3,223,  0,  0,  0},   // 2676
+    {  0,  0,  0,  0,  0,  0},   // 2677
+    {  2, 13,103,  0,  0,  0},   // 2678
+    {  3, 19, 47,  0,  0,  0},   // 2679
+    {  2,  5, 67,  0,  0,  0},   // 2680
+    {  7,383,  0,  0,  0,  0},   // 2681
+    {  2,  3,149,  0,  0,  0},   // 2682
+    {  0,  0,  0,  0,  0,  0},   // 2683
+    {  2, 11, 61,  0,  0,  0},   // 2684
+    {  3,  5,179,  0,  0,  0},   // 2685
+    {  2, 17, 79,  0,  0,  0},   // 2686
+    {  0,  0,  0,  0,  0,  0},   // 2687
+    {  2,  3,  7,  0,  0,  0},   // 2688
+    {  0,  0,  0,  0,  0,  0},   // 2689
+    {  2,  5,269,  0,  0,  0},   // 2690
+    {  3, 13, 23,  0,  0,  0},   // 2691
+    {  2,673,  0,  0,  0,  0},   // 2692
+    {  0,  0,  0,  0,  0,  0},   // 2693
+    {  2,  3,449,  0,  0,  0},   // 2694
+    {  5,  7, 11,  0,  0,  0},   // 2695
+    {  2,337,  0,  0,  0,  0},   // 2696
+    {  3, 29, 31,  0,  0,  0},   // 2697
+    {  2, 19, 71,  0,  0,  0},   // 2698
+    {  0,  0,  0,  0,  0,  0},   // 2699
+    {  2,  3,  5,  0,  0,  0},   // 2700
+    { 37, 73,  0,  0,  0,  0},   // 2701
+    {  2,  7,193,  0,  0,  0},   // 2702
+    {  3, 17, 53,  0,  0,  0},   // 2703
+    {  2, 13,  0,  0,  0,  0},   // 2704
+    {  5,541,  0,  0,  0,  0},   // 2705
+    {  2,  3, 11, 41,  0,  0},   // 2706
+    {  0,  0,  0,  0,  0,  0},   // 2707
+    {  2,677,  0,  0,  0,  0},   // 2708
+    {  3,  7, 43,  0,  0,  0},   // 2709
+    {  2,  5,271,  0,  0,  0},   // 2710
+    {  0,  0,  0,  0,  0,  0},   // 2711
+    {  2,  3,113,  0,  0,  0},   // 2712
+    {  0,  0,  0,  0,  0,  0},   // 2713
+    {  2, 23, 59,  0,  0,  0},   // 2714
+    {  3,  5,181,  0,  0,  0},   // 2715
+    {  2,  7, 97,  0,  0,  0},   // 2716
+    { 11, 13, 19,  0,  0,  0},   // 2717
+    {  2,  3,151,  0,  0,  0},   // 2718
+    {  0,  0,  0,  0,  0,  0},   // 2719
+    {  2,  5, 17,  0,  0,  0},   // 2720
+    {  3,907,  0,  0,  0,  0},   // 2721
+    {  2,1361,  0,  0,  0,  0},   // 2722
+    {  7,389,  0,  0,  0,  0},   // 2723
+    {  2,  3,227,  0,  0,  0},   // 2724
+    {  5,109,  0,  0,  0,  0},   // 2725
+    {  2, 29, 47,  0,  0,  0},   // 2726
+    {  3,101,  0,  0,  0,  0},   // 2727
+    {  2, 11, 31,  0,  0,  0},   // 2728
+    {  0,  0,  0,  0,  0,  0},   // 2729
+    {  2,  3,  5,  7, 13,  0},   // 2730
+    {  0,  0,  0,  0,  0,  0},   // 2731
+    {  2,683,  0,  0,  0,  0},   // 2732
+    {  3,911,  0,  0,  0,  0},   // 2733
+    {  2,1367,  0,  0,  0,  0},   // 2734
+    {  5,547,  0,  0,  0,  0},   // 2735
+    {  2,  3, 19,  0,  0,  0},   // 2736
+    {  7, 17, 23,  0,  0,  0},   // 2737
+    {  2, 37,  0,  0,  0,  0},   // 2738
+    {  3, 11, 83,  0,  0,  0},   // 2739
+    {  2,  5,137,  0,  0,  0},   // 2740
+    {  0,  0,  0,  0,  0,  0},   // 2741
+    {  2,  3,457,  0,  0,  0},   // 2742
+    { 13,211,  0,  0,  0,  0},   // 2743
+    {  2,  7,  0,  0,  0,  0},   // 2744
+    {  3,  5, 61,  0,  0,  0},   // 2745
+    {  2,1373,  0,  0,  0,  0},   // 2746
+    { 41, 67,  0,  0,  0,  0},   // 2747
+    {  2,  3,229,  0,  0,  0},   // 2748
+    {  0,  0,  0,  0,  0,  0},   // 2749
+    {  2,  5, 11,  0,  0,  0},   // 2750
+    {  3,  7,131,  0,  0,  0},   // 2751
+    {  2, 43,  0,  0,  0,  0},   // 2752
+    {  0,  0,  0,  0,  0,  0},   // 2753
+    {  2,  3, 17,  0,  0,  0},   // 2754
+    {  5, 19, 29,  0,  0,  0},   // 2755
+    {  2, 13, 53,  0,  0,  0},   // 2756
+    {  3,919,  0,  0,  0,  0},   // 2757
+    {  2,  7,197,  0,  0,  0},   // 2758
+    { 31, 89,  0,  0,  0,  0},   // 2759
+    {  2,  3,  5, 23,  0,  0},   // 2760
+    { 11,251,  0,  0,  0,  0},   // 2761
+    {  2,1381,  0,  0,  0,  0},   // 2762
+    {  3,307,  0,  0,  0,  0},   // 2763
+    {  2,691,  0,  0,  0,  0},   // 2764
+    {  5,  7, 79,  0,  0,  0},   // 2765
+    {  2,  3,461,  0,  0,  0},   // 2766
+    {  0,  0,  0,  0,  0,  0},   // 2767
+    {  2,173,  0,  0,  0,  0},   // 2768
+    {  3, 13, 71,  0,  0,  0},   // 2769
+    {  2,  5,277,  0,  0,  0},   // 2770
+    { 17,163,  0,  0,  0,  0},   // 2771
+    {  2,  3,  7, 11,  0,  0},   // 2772
+    { 47, 59,  0,  0,  0,  0},   // 2773
+    {  2, 19, 73,  0,  0,  0},   // 2774
+    {  3,  5, 37,  0,  0,  0},   // 2775
+    {  2,347,  0,  0,  0,  0},   // 2776
+    {  0,  0,  0,  0,  0,  0},   // 2777
+    {  2,  3,463,  0,  0,  0},   // 2778
+    {  7,397,  0,  0,  0,  0},   // 2779
+    {  2,  5,139,  0,  0,  0},   // 2780
+    {  3,103,  0,  0,  0,  0},   // 2781
+    {  2, 13,107,  0,  0,  0},   // 2782
+    { 11, 23,  0,  0,  0,  0},   // 2783
+    {  2,  3, 29,  0,  0,  0},   // 2784
+    {  5,557,  0,  0,  0,  0},   // 2785
+    {  2,  7,199,  0,  0,  0},   // 2786
+    {  3,929,  0,  0,  0,  0},   // 2787
+    {  2, 17, 41,  0,  0,  0},   // 2788
+    {  0,  0,  0,  0,  0,  0},   // 2789
+    {  2,  3,  5, 31,  0,  0},   // 2790
+    {  0,  0,  0,  0,  0,  0},   // 2791
+    {  2,349,  0,  0,  0,  0},   // 2792
+    {  3,  7, 19,  0,  0,  0},   // 2793
+    {  2, 11,127,  0,  0,  0},   // 2794
+    {  5, 13, 43,  0,  0,  0},   // 2795
+    {  2,  3,233,  0,  0,  0},   // 2796
+    {  0,  0,  0,  0,  0,  0},   // 2797
+    {  2,1399,  0,  0,  0,  0},   // 2798
+    {  3,311,  0,  0,  0,  0},   // 2799
+    {  2,  5,  7,  0,  0,  0},   // 2800
+    {  0,  0,  0,  0,  0,  0},   // 2801
+    {  2,  3,467,  0,  0,  0},   // 2802
+    {  0,  0,  0,  0,  0,  0},   // 2803
+    {  2,701,  0,  0,  0,  0},   // 2804
+    {  3,  5, 11, 17,  0,  0},   // 2805
+    {  2, 23, 61,  0,  0,  0},   // 2806
+    {  7,401,  0,  0,  0,  0},   // 2807
+    {  2,  3, 13,  0,  0,  0},   // 2808
+    { 53,  0,  0,  0,  0,  0},   // 2809
+    {  2,  5,281,  0,  0,  0},   // 2810
+    {  3,937,  0,  0,  0,  0},   // 2811
+    {  2, 19, 37,  0,  0,  0},   // 2812
+    { 29, 97,  0,  0,  0,  0},   // 2813
+    {  2,  3,  7, 67,  0,  0},   // 2814
+    {  5,563,  0,  0,  0,  0},   // 2815
+    {  2, 11,  0,  0,  0,  0},   // 2816
+    {  3,313,  0,  0,  0,  0},   // 2817
+    {  2,1409,  0,  0,  0,  0},   // 2818
+    {  0,  0,  0,  0,  0,  0},   // 2819
+    {  2,  3,  5, 47,  0,  0},   // 2820
+    {  7, 13, 31,  0,  0,  0},   // 2821
+    {  2, 17, 83,  0,  0,  0},   // 2822
+    {  3,941,  0,  0,  0,  0},   // 2823
+    {  2,353,  0,  0,  0,  0},   // 2824
+    {  5,113,  0,  0,  0,  0},   // 2825
+    {  2,  3,157,  0,  0,  0},   // 2826
+    { 11,257,  0,  0,  0,  0},   // 2827
+    {  2,  7,101,  0,  0,  0},   // 2828
+    {  3, 23, 41,  0,  0,  0},   // 2829
+    {  2,  5,283,  0,  0,  0},   // 2830
+    { 19,149,  0,  0,  0,  0},   // 2831
+    {  2,  3, 59,  0,  0,  0},   // 2832
+    {  0,  0,  0,  0,  0,  0},   // 2833
+    {  2, 13,109,  0,  0,  0},   // 2834
+    {  3,  5,  7,  0,  0,  0},   // 2835
+    {  2,709,  0,  0,  0,  0},   // 2836
+    {  0,  0,  0,  0,  0,  0},   // 2837
+    {  2,  3, 11, 43,  0,  0},   // 2838
+    { 17,167,  0,  0,  0,  0},   // 2839
+    {  2,  5, 71,  0,  0,  0},   // 2840
+    {  3,947,  0,  0,  0,  0},   // 2841
+    {  2,  7, 29,  0,  0,  0},   // 2842
+    {  0,  0,  0,  0,  0,  0},   // 2843
+    {  2,  3, 79,  0,  0,  0},   // 2844
+    {  5,569,  0,  0,  0,  0},   // 2845
+    {  2,1423,  0,  0,  0,  0},   // 2846
+    {  3, 13, 73,  0,  0,  0},   // 2847
+    {  2, 89,  0,  0,  0,  0},   // 2848
+    {  7, 11, 37,  0,  0,  0},   // 2849
+    {  2,  3,  5, 19,  0,  0},   // 2850
+    {  0,  0,  0,  0,  0,  0},   // 2851
+    {  2, 23, 31,  0,  0,  0},   // 2852
+    {  3,317,  0,  0,  0,  0},   // 2853
+    {  2,1427,  0,  0,  0,  0},   // 2854
+    {  5,571,  0,  0,  0,  0},   // 2855
+    {  2,  3,  7, 17,  0,  0},   // 2856
+    {  0,  0,  0,  0,  0,  0},   // 2857
+    {  2,1429,  0,  0,  0,  0},   // 2858
+    {  3,953,  0,  0,  0,  0},   // 2859
+    {  2,  5, 11, 13,  0,  0},   // 2860
+    {  0,  0,  0,  0,  0,  0},   // 2861
+    {  2,  3, 53,  0,  0,  0},   // 2862
+    {  7,409,  0,  0,  0,  0},   // 2863
+    {  2,179,  0,  0,  0,  0},   // 2864
+    {  3,  5,191,  0,  0,  0},   // 2865
+    {  2,1433,  0,  0,  0,  0},   // 2866
+    { 47, 61,  0,  0,  0,  0},   // 2867
+    {  2,  3,239,  0,  0,  0},   // 2868
+    { 19,151,  0,  0,  0,  0},   // 2869
+    {  2,  5,  7, 41,  0,  0},   // 2870
+    {  3, 11, 29,  0,  0,  0},   // 2871
+    {  2,359,  0,  0,  0,  0},   // 2872
+    { 13, 17,  0,  0,  0,  0},   // 2873
+    {  2,  3,479,  0,  0,  0},   // 2874
+    {  5, 23,  0,  0,  0,  0},   // 2875
+    {  2,719,  0,  0,  0,  0},   // 2876
+    {  3,  7,137,  0,  0,  0},   // 2877
+    {  2,1439,  0,  0,  0,  0},   // 2878
+    {  0,  0,  0,  0,  0,  0},   // 2879
+    {  2,  3,  5,  0,  0,  0},   // 2880
+    { 43, 67,  0,  0,  0,  0},   // 2881
+    {  2, 11,131,  0,  0,  0},   // 2882
+    {  3, 31,  0,  0,  0,  0},   // 2883
+    {  2,  7,103,  0,  0,  0},   // 2884
+    {  5,577,  0,  0,  0,  0},   // 2885
+    {  2,  3, 13, 37,  0,  0},   // 2886
+    {  0,  0,  0,  0,  0,  0},   // 2887
+    {  2, 19,  0,  0,  0,  0},   // 2888
+    {  3,107,  0,  0,  0,  0},   // 2889
+    {  2,  5, 17,  0,  0,  0},   // 2890
+    {  7, 59,  0,  0,  0,  0},   // 2891
+    {  2,  3,241,  0,  0,  0},   // 2892
+    { 11,263,  0,  0,  0,  0},   // 2893
+    {  2,1447,  0,  0,  0,  0},   // 2894
+    {  3,  5,193,  0,  0,  0},   // 2895
+    {  2,181,  0,  0,  0,  0},   // 2896
+    {  0,  0,  0,  0,  0,  0},   // 2897
+    {  2,  3,  7, 23,  0,  0},   // 2898
+    { 13,223,  0,  0,  0,  0},   // 2899
+    {  2,  5, 29,  0,  0,  0},   // 2900
+    {  3,967,  0,  0,  0,  0},   // 2901
+    {  2,1451,  0,  0,  0,  0},   // 2902
+    {  0,  0,  0,  0,  0,  0},   // 2903
+    {  2,  3, 11,  0,  0,  0},   // 2904
+    {  5,  7, 83,  0,  0,  0},   // 2905
+    {  2,1453,  0,  0,  0,  0},   // 2906
+    {  3, 17, 19,  0,  0,  0},   // 2907
+    {  2,727,  0,  0,  0,  0},   // 2908
+    {  0,  0,  0,  0,  0,  0},   // 2909
+    {  2,  3,  5, 97,  0,  0},   // 2910
+    { 41, 71,  0,  0,  0,  0},   // 2911
+    {  2,  7, 13,  0,  0,  0},   // 2912
+    {  3,971,  0,  0,  0,  0},   // 2913
+    {  2, 31, 47,  0,  0,  0},   // 2914
+    {  5, 11, 53,  0,  0,  0},   // 2915
+    {  2,  3,  0,  0,  0,  0},   // 2916
+    {  0,  0,  0,  0,  0,  0},   // 2917
+    {  2,1459,  0,  0,  0,  0},   // 2918
+    {  3,  7,139,  0,  0,  0},   // 2919
+    {  2,  5, 73,  0,  0,  0},   // 2920
+    { 23,127,  0,  0,  0,  0},   // 2921
+    {  2,  3,487,  0,  0,  0},   // 2922
+    { 37, 79,  0,  0,  0,  0},   // 2923
+    {  2, 17, 43,  0,  0,  0},   // 2924
+    {  3,  5, 13,  0,  0,  0},   // 2925
+    {  2,  7, 11, 19,  0,  0},   // 2926
+    {  0,  0,  0,  0,  0,  0},   // 2927
+    {  2,  3, 61,  0,  0,  0},   // 2928
+    { 29,101,  0,  0,  0,  0},   // 2929
+    {  2,  5,293,  0,  0,  0},   // 2930
+    {  3,977,  0,  0,  0,  0},   // 2931
+    {  2,733,  0,  0,  0,  0},   // 2932
+    {  7,419,  0,  0,  0,  0},   // 2933
+    {  2,  3,163,  0,  0,  0},   // 2934
+    {  5,587,  0,  0,  0,  0},   // 2935
+    {  2,367,  0,  0,  0,  0},   // 2936
+    {  3, 11, 89,  0,  0,  0},   // 2937
+    {  2, 13,113,  0,  0,  0},   // 2938
+    {  0,  0,  0,  0,  0,  0},   // 2939
+    {  2,  3,  5,  7,  0,  0},   // 2940
+    { 17,173,  0,  0,  0,  0},   // 2941
+    {  2,1471,  0,  0,  0,  0},   // 2942
+    {  3,109,  0,  0,  0,  0},   // 2943
+    {  2, 23,  0,  0,  0,  0},   // 2944
+    {  5, 19, 31,  0,  0,  0},   // 2945
+    {  2,  3,491,  0,  0,  0},   // 2946
+    {  7,421,  0,  0,  0,  0},   // 2947
+    {  2, 11, 67,  0,  0,  0},   // 2948
+    {  3,983,  0,  0,  0,  0},   // 2949
+    {  2,  5, 59,  0,  0,  0},   // 2950
+    { 13,227,  0,  0,  0,  0},   // 2951
+    {  2,  3, 41,  0,  0,  0},   // 2952
+    {  0,  0,  0,  0,  0,  0},   // 2953
+    {  2,  7,211,  0,  0,  0},   // 2954
+    {  3,  5,197,  0,  0,  0},   // 2955
+    {  2,739,  0,  0,  0,  0},   // 2956
+    {  0,  0,  0,  0,  0,  0},   // 2957
+    {  2,  3, 17, 29,  0,  0},   // 2958
+    { 11,269,  0,  0,  0,  0},   // 2959
+    {  2,  5, 37,  0,  0,  0},   // 2960
+    {  3,  7, 47,  0,  0,  0},   // 2961
+    {  2,1481,  0,  0,  0,  0},   // 2962
+    {  0,  0,  0,  0,  0,  0},   // 2963
+    {  2,  3, 13, 19,  0,  0},   // 2964
+    {  5,593,  0,  0,  0,  0},   // 2965
+    {  2,1483,  0,  0,  0,  0},   // 2966
+    {  3, 23, 43,  0,  0,  0},   // 2967
+    {  2,  7, 53,  0,  0,  0},   // 2968
+    {  0,  0,  0,  0,  0,  0},   // 2969
+    {  2,  3,  5, 11,  0,  0},   // 2970
+    {  0,  0,  0,  0,  0,  0},   // 2971
+    {  2,743,  0,  0,  0,  0},   // 2972
+    {  3,991,  0,  0,  0,  0},   // 2973
+    {  2,1487,  0,  0,  0,  0},   // 2974
+    {  5,  7, 17,  0,  0,  0},   // 2975
+    {  2,  3, 31,  0,  0,  0},   // 2976
+    { 13,229,  0,  0,  0,  0},   // 2977
+    {  2,1489,  0,  0,  0,  0},   // 2978
+    {  3,331,  0,  0,  0,  0},   // 2979
+    {  2,  5,149,  0,  0,  0},   // 2980
+    { 11,271,  0,  0,  0,  0},   // 2981
+    {  2,  3,  7, 71,  0,  0},   // 2982
+    { 19,157,  0,  0,  0,  0},   // 2983
+    {  2,373,  0,  0,  0,  0},   // 2984
+    {  3,  5,199,  0,  0,  0},   // 2985
+    {  2,1493,  0,  0,  0,  0},   // 2986
+    { 29,103,  0,  0,  0,  0},   // 2987
+    {  2,  3, 83,  0,  0,  0},   // 2988
+    {  7, 61,  0,  0,  0,  0},   // 2989
+    {  2,  5, 13, 23,  0,  0},   // 2990
+    {  3,997,  0,  0,  0,  0},   // 2991
+    {  2, 11, 17,  0,  0,  0},   // 2992
+    { 41, 73,  0,  0,  0,  0},   // 2993
+    {  2,  3,499,  0,  0,  0},   // 2994
+    {  5,599,  0,  0,  0,  0},   // 2995
+    {  2,  7,107,  0,  0,  0},   // 2996
+    {  3, 37,  0,  0,  0,  0},   // 2997
+    {  2,1499,  0,  0,  0,  0},   // 2998
+    {  0,  0,  0,  0,  0,  0},   // 2999
+    {  2,  3,  5,  0,  0,  0},   // 3000
+    {  0,  0,  0,  0,  0,  0},   // 3001
+    {  2, 19, 79,  0,  0,  0},   // 3002
+    {  3,  7, 11, 13,  0,  0},   // 3003
+    {  2,751,  0,  0,  0,  0},   // 3004
+    {  5,601,  0,  0,  0,  0},   // 3005
+    {  2,  3,167,  0,  0,  0},   // 3006
+    { 31, 97,  0,  0,  0,  0},   // 3007
+    {  2, 47,  0,  0,  0,  0},   // 3008
+    {  3, 17, 59,  0,  0,  0},   // 3009
+    {  2,  5,  7, 43,  0,  0},   // 3010
+    {  0,  0,  0,  0,  0,  0},   // 3011
+    {  2,  3,251,  0,  0,  0},   // 3012
+    { 23,131,  0,  0,  0,  0},   // 3013
+    {  2, 11,137,  0,  0,  0},   // 3014
+    {  3,  5, 67,  0,  0,  0},   // 3015
+    {  2, 13, 29,  0,  0,  0},   // 3016
+    {  7,431,  0,  0,  0,  0},   // 3017
+    {  2,  3,503,  0,  0,  0},   // 3018
+    {  0,  0,  0,  0,  0,  0},   // 3019
+    {  2,  5,151,  0,  0,  0},   // 3020
+    {  3, 19, 53,  0,  0,  0},   // 3021
+    {  2,1511,  0,  0,  0,  0},   // 3022
+    {  0,  0,  0,  0,  0,  0},   // 3023
+    {  2,  3,  7,  0,  0,  0},   // 3024
+    {  5, 11,  0,  0,  0,  0},   // 3025
+    {  2, 17, 89,  0,  0,  0},   // 3026
+    {  3,1009,  0,  0,  0,  0},   // 3027
+    {  2,757,  0,  0,  0,  0},   // 3028
+    { 13,233,  0,  0,  0,  0},   // 3029
+    {  2,  3,  5,101,  0,  0},   // 3030
+    {  7,433,  0,  0,  0,  0},   // 3031
+    {  2,379,  0,  0,  0,  0},   // 3032
+    {  3,337,  0,  0,  0,  0},   // 3033
+    {  2, 37, 41,  0,  0,  0},   // 3034
+    {  5,607,  0,  0,  0,  0},   // 3035
+    {  2,  3, 11, 23,  0,  0},   // 3036
+    {  0,  0,  0,  0,  0,  0},   // 3037
+    {  2,  7, 31,  0,  0,  0},   // 3038
+    {  3,1013,  0,  0,  0,  0},   // 3039
+    {  2,  5, 19,  0,  0,  0},   // 3040
+    {  0,  0,  0,  0,  0,  0},   // 3041
+    {  2,  3, 13,  0,  0,  0},   // 3042
+    { 17,179,  0,  0,  0,  0},   // 3043
+    {  2,761,  0,  0,  0,  0},   // 3044
+    {  3,  5,  7, 29,  0,  0},   // 3045
+    {  2,1523,  0,  0,  0,  0},   // 3046
+    { 11,277,  0,  0,  0,  0},   // 3047
+    {  2,  3,127,  0,  0,  0},   // 3048
+    {  0,  0,  0,  0,  0,  0},   // 3049
+    {  2,  5, 61,  0,  0,  0},   // 3050
+    {  3,113,  0,  0,  0,  0},   // 3051
+    {  2,  7,109,  0,  0,  0},   // 3052
+    { 43, 71,  0,  0,  0,  0},   // 3053
+    {  2,  3,509,  0,  0,  0},   // 3054
+    {  5, 13, 47,  0,  0,  0},   // 3055
+    {  2,191,  0,  0,  0,  0},   // 3056
+    {  3,1019,  0,  0,  0,  0},   // 3057
+    {  2, 11,139,  0,  0,  0},   // 3058
+    {  7, 19, 23,  0,  0,  0},   // 3059
+    {  2,  3,  5, 17,  0,  0},   // 3060
+    {  0,  0,  0,  0,  0,  0},   // 3061
+    {  2,1531,  0,  0,  0,  0},   // 3062
+    {  3,1021,  0,  0,  0,  0},   // 3063
+    {  2,383,  0,  0,  0,  0},   // 3064
+    {  5,613,  0,  0,  0,  0},   // 3065
+    {  2,  3,  7, 73,  0,  0},   // 3066
+    {  0,  0,  0,  0,  0,  0},   // 3067
+    {  2, 13, 59,  0,  0,  0},   // 3068
+    {  3, 11, 31,  0,  0,  0},   // 3069
+    {  2,  5,307,  0,  0,  0},   // 3070
+    { 37, 83,  0,  0,  0,  0},   // 3071
+    {  2,  3,  0,  0,  0,  0},   // 3072
+    {  7,439,  0,  0,  0,  0},   // 3073
+    {  2, 29, 53,  0,  0,  0},   // 3074
+    {  3,  5, 41,  0,  0,  0},   // 3075
+    {  2,769,  0,  0,  0,  0},   // 3076
+    { 17,181,  0,  0,  0,  0},   // 3077
+    {  2,  3, 19,  0,  0,  0},   // 3078
+    {  0,  0,  0,  0,  0,  0},   // 3079
+    {  2,  5,  7, 11,  0,  0},   // 3080
+    {  3, 13, 79,  0,  0,  0},   // 3081
+    {  2, 23, 67,  0,  0,  0},   // 3082
+    {  0,  0,  0,  0,  0,  0},   // 3083
+    {  2,  3,257,  0,  0,  0},   // 3084
+    {  5,617,  0,  0,  0,  0},   // 3085
+    {  2,1543,  0,  0,  0,  0},   // 3086
+    {  3,  7,  0,  0,  0,  0},   // 3087
+    {  2,193,  0,  0,  0,  0},   // 3088
+    {  0,  0,  0,  0,  0,  0},   // 3089
+    {  2,  3,  5,103,  0,  0},   // 3090
+    { 11,281,  0,  0,  0,  0},   // 3091
+    {  2,773,  0,  0,  0,  0},   // 3092
+    {  3,1031,  0,  0,  0,  0},   // 3093
+    {  2,  7, 13, 17,  0,  0},   // 3094
+    {  5,619,  0,  0,  0,  0},   // 3095
+    {  2,  3, 43,  0,  0,  0},   // 3096
+    { 19,163,  0,  0,  0,  0},   // 3097
+    {  2,1549,  0,  0,  0,  0},   // 3098
+    {  3,1033,  0,  0,  0,  0},   // 3099
+    {  2,  5, 31,  0,  0,  0},   // 3100
+    {  7,443,  0,  0,  0,  0},   // 3101
+    {  2,  3, 11, 47,  0,  0},   // 3102
+    { 29,107,  0,  0,  0,  0},   // 3103
+    {  2, 97,  0,  0,  0,  0},   // 3104
+    {  3,  5, 23,  0,  0,  0},   // 3105
+    {  2,1553,  0,  0,  0,  0},   // 3106
+    { 13,239,  0,  0,  0,  0},   // 3107
+    {  2,  3,  7, 37,  0,  0},   // 3108
+    {  0,  0,  0,  0,  0,  0},   // 3109
+    {  2,  5,311,  0,  0,  0},   // 3110
+    {  3, 17, 61,  0,  0,  0},   // 3111
+    {  2,389,  0,  0,  0,  0},   // 3112
+    { 11,283,  0,  0,  0,  0},   // 3113
+    {  2,  3,173,  0,  0,  0},   // 3114
+    {  5,  7, 89,  0,  0,  0},   // 3115
+    {  2, 19, 41,  0,  0,  0},   // 3116
+    {  3,1039,  0,  0,  0,  0},   // 3117
+    {  2,1559,  0,  0,  0,  0},   // 3118
+    {  0,  0,  0,  0,  0,  0},   // 3119
+    {  2,  3,  5, 13,  0,  0},   // 3120
+    {  0,  0,  0,  0,  0,  0},   // 3121
+    {  2,  7,223,  0,  0,  0},   // 3122
+    {  3,347,  0,  0,  0,  0},   // 3123
+    {  2, 11, 71,  0,  0,  0},   // 3124
+    {  5,  0,  0,  0,  0,  0},   // 3125
+    {  2,  3,521,  0,  0,  0},   // 3126
+    { 53, 59,  0,  0,  0,  0},   // 3127
+    {  2, 17, 23,  0,  0,  0},   // 3128
+    {  3,  7,149,  0,  0,  0},   // 3129
+    {  2,  5,313,  0,  0,  0},   // 3130
+    { 31,101,  0,  0,  0,  0},   // 3131
+    {  2,  3, 29,  0,  0,  0},   // 3132
+    { 13,241,  0,  0,  0,  0},   // 3133
+    {  2,1567,  0,  0,  0,  0},   // 3134
+    {  3,  5, 11, 19,  0,  0},   // 3135
+    {  2,  7,  0,  0,  0,  0},   // 3136
+    {  0,  0,  0,  0,  0,  0},   // 3137
+    {  2,  3,523,  0,  0,  0},   // 3138
+    { 43, 73,  0,  0,  0,  0},   // 3139
+    {  2,  5,157,  0,  0,  0},   // 3140
+    {  3,349,  0,  0,  0,  0},   // 3141
+    {  2,1571,  0,  0,  0,  0},   // 3142
+    {  7,449,  0,  0,  0,  0},   // 3143
+    {  2,  3,131,  0,  0,  0},   // 3144
+    {  5, 17, 37,  0,  0,  0},   // 3145
+    {  2, 11, 13,  0,  0,  0},   // 3146
+    {  3,1049,  0,  0,  0,  0},   // 3147
+    {  2,787,  0,  0,  0,  0},   // 3148
+    { 47, 67,  0,  0,  0,  0},   // 3149
+    {  2,  3,  5,  7,  0,  0},   // 3150
+    { 23,137,  0,  0,  0,  0},   // 3151
+    {  2,197,  0,  0,  0,  0},   // 3152
+    {  3,1051,  0,  0,  0,  0},   // 3153
+    {  2, 19, 83,  0,  0,  0},   // 3154
+    {  5,631,  0,  0,  0,  0},   // 3155
+    {  2,  3,263,  0,  0,  0},   // 3156
+    {  7, 11, 41,  0,  0,  0},   // 3157
+    {  2,1579,  0,  0,  0,  0},   // 3158
+    {  3, 13,  0,  0,  0,  0},   // 3159
+    {  2,  5, 79,  0,  0,  0},   // 3160
+    { 29,109,  0,  0,  0,  0},   // 3161
+    {  2,  3, 17, 31,  0,  0},   // 3162
+    {  0,  0,  0,  0,  0,  0},   // 3163
+    {  2,  7,113,  0,  0,  0},   // 3164
+    {  3,  5,211,  0,  0,  0},   // 3165
+    {  2,1583,  0,  0,  0,  0},   // 3166
+    {  0,  0,  0,  0,  0,  0},   // 3167
+    {  2,  3, 11,  0,  0,  0},   // 3168
+    {  0,  0,  0,  0,  0,  0},   // 3169
+    {  2,  5,317,  0,  0,  0},   // 3170
+    {  3,  7,151,  0,  0,  0},   // 3171
+    {  2, 13, 61,  0,  0,  0},   // 3172
+    { 19,167,  0,  0,  0,  0},   // 3173
+    {  2,  3, 23,  0,  0,  0},   // 3174
+    {  5,127,  0,  0,  0,  0},   // 3175
+    {  2,397,  0,  0,  0,  0},   // 3176
+    {  3,353,  0,  0,  0,  0},   // 3177
+    {  2,  7,227,  0,  0,  0},   // 3178
+    { 11, 17,  0,  0,  0,  0},   // 3179
+    {  2,  3,  5, 53,  0,  0},   // 3180
+    {  0,  0,  0,  0,  0,  0},   // 3181
+    {  2, 37, 43,  0,  0,  0},   // 3182
+    {  3,1061,  0,  0,  0,  0},   // 3183
+    {  2,199,  0,  0,  0,  0},   // 3184
+    {  5,  7, 13,  0,  0,  0},   // 3185
+    {  2,  3, 59,  0,  0,  0},   // 3186
+    {  0,  0,  0,  0,  0,  0},   // 3187
+    {  2,797,  0,  0,  0,  0},   // 3188
+    {  3,1063,  0,  0,  0,  0},   // 3189
+    {  2,  5, 11, 29,  0,  0},   // 3190
+    {  0,  0,  0,  0,  0,  0},   // 3191
+    {  2,  3,  7, 19,  0,  0},   // 3192
+    { 31,103,  0,  0,  0,  0},   // 3193
+    {  2,1597,  0,  0,  0,  0},   // 3194
+    {  3,  5, 71,  0,  0,  0},   // 3195
+    {  2, 17, 47,  0,  0,  0},   // 3196
+    { 23,139,  0,  0,  0,  0},   // 3197
+    {  2,  3, 13, 41,  0,  0},   // 3198
+    {  7,457,  0,  0,  0,  0},   // 3199
+    {  2,  5,  0,  0,  0,  0},   // 3200
+    {  3, 11, 97,  0,  0,  0},   // 3201
+    {  2,1601,  0,  0,  0,  0},   // 3202
+    {  0,  0,  0,  0,  0,  0},   // 3203
+    {  2,  3, 89,  0,  0,  0},   // 3204
+    {  5,641,  0,  0,  0,  0},   // 3205
+    {  2,  7,229,  0,  0,  0},   // 3206
+    {  3,1069,  0,  0,  0,  0},   // 3207
+    {  2,401,  0,  0,  0,  0},   // 3208
+    {  0,  0,  0,  0,  0,  0},   // 3209
+    {  2,  3,  5,107,  0,  0},   // 3210
+    { 13, 19,  0,  0,  0,  0},   // 3211
+    {  2, 11, 73,  0,  0,  0},   // 3212
+    {  3,  7, 17,  0,  0,  0},   // 3213
+    {  2,1607,  0,  0,  0,  0},   // 3214
+    {  5,643,  0,  0,  0,  0},   // 3215
+    {  2,  3, 67,  0,  0,  0},   // 3216
+    {  0,  0,  0,  0,  0,  0},   // 3217
+    {  2,1609,  0,  0,  0,  0},   // 3218
+    {  3, 29, 37,  0,  0,  0},   // 3219
+    {  2,  5,  7, 23,  0,  0},   // 3220
+    {  0,  0,  0,  0,  0,  0},   // 3221
+    {  2,  3,179,  0,  0,  0},   // 3222
+    { 11,293,  0,  0,  0,  0},   // 3223
+    {  2, 13, 31,  0,  0,  0},   // 3224
+    {  3,  5, 43,  0,  0,  0},   // 3225
+    {  2,1613,  0,  0,  0,  0},   // 3226
+    {  7,461,  0,  0,  0,  0},   // 3227
+    {  2,  3,269,  0,  0,  0},   // 3228
+    {  0,  0,  0,  0,  0,  0},   // 3229
+    {  2,  5, 17, 19,  0,  0},   // 3230
+    {  3,359,  0,  0,  0,  0},   // 3231
+    {  2,101,  0,  0,  0,  0},   // 3232
+    { 53, 61,  0,  0,  0,  0},   // 3233
+    {  2,  3,  7, 11,  0,  0},   // 3234
+    {  5,647,  0,  0,  0,  0},   // 3235
+    {  2,809,  0,  0,  0,  0},   // 3236
+    {  3, 13, 83,  0,  0,  0},   // 3237
+    {  2,1619,  0,  0,  0,  0},   // 3238
+    { 41, 79,  0,  0,  0,  0},   // 3239
+    {  2,  3,  5,  0,  0,  0},   // 3240
+    {  7,463,  0,  0,  0,  0},   // 3241
+    {  2,1621,  0,  0,  0,  0},   // 3242
+    {  3, 23, 47,  0,  0,  0},   // 3243
+    {  2,811,  0,  0,  0,  0},   // 3244
+    {  5, 11, 59,  0,  0,  0},   // 3245
+    {  2,  3,541,  0,  0,  0},   // 3246
+    { 17,191,  0,  0,  0,  0},   // 3247
+    {  2,  7, 29,  0,  0,  0},   // 3248
+    {  3, 19,  0,  0,  0,  0},   // 3249
+    {  2,  5, 13,  0,  0,  0},   // 3250
+    {  0,  0,  0,  0,  0,  0},   // 3251
+    {  2,  3,271,  0,  0,  0},   // 3252
+    {  0,  0,  0,  0,  0,  0},   // 3253
+    {  2,1627,  0,  0,  0,  0},   // 3254
+    {  3,  5,  7, 31,  0,  0},   // 3255
+    {  2, 11, 37,  0,  0,  0},   // 3256
+    {  0,  0,  0,  0,  0,  0},   // 3257
+    {  2,  3,181,  0,  0,  0},   // 3258
+    {  0,  0,  0,  0,  0,  0},   // 3259
+    {  2,  5,163,  0,  0,  0},   // 3260
+    {  3,1087,  0,  0,  0,  0},   // 3261
+    {  2,  7,233,  0,  0,  0},   // 3262
+    { 13,251,  0,  0,  0,  0},   // 3263
+    {  2,  3, 17,  0,  0,  0},   // 3264
+    {  5,653,  0,  0,  0,  0},   // 3265
+    {  2, 23, 71,  0,  0,  0},   // 3266
+    {  3, 11,  0,  0,  0,  0},   // 3267
+    {  2, 19, 43,  0,  0,  0},   // 3268
+    {  7,467,  0,  0,  0,  0},   // 3269
+    {  2,  3,  5,109,  0,  0},   // 3270
+    {  0,  0,  0,  0,  0,  0},   // 3271
+    {  2,409,  0,  0,  0,  0},   // 3272
+    {  3,1091,  0,  0,  0,  0},   // 3273
+    {  2,1637,  0,  0,  0,  0},   // 3274
+    {  5,131,  0,  0,  0,  0},   // 3275
+    {  2,  3,  7, 13,  0,  0},   // 3276
+    { 29,113,  0,  0,  0,  0},   // 3277
+    {  2, 11,149,  0,  0,  0},   // 3278
+    {  3,1093,  0,  0,  0,  0},   // 3279
+    {  2,  5, 41,  0,  0,  0},   // 3280
+    { 17,193,  0,  0,  0,  0},   // 3281
+    {  2,  3,547,  0,  0,  0},   // 3282
+    {  7, 67,  0,  0,  0,  0},   // 3283
+    {  2,821,  0,  0,  0,  0},   // 3284
+    {  3,  5, 73,  0,  0,  0},   // 3285
+    {  2, 31, 53,  0,  0,  0},   // 3286
+    { 19,173,  0,  0,  0,  0},   // 3287
+    {  2,  3,137,  0,  0,  0},   // 3288
+    { 11, 13, 23,  0,  0,  0},   // 3289
+    {  2,  5,  7, 47,  0,  0},   // 3290
+    {  3,1097,  0,  0,  0,  0},   // 3291
+    {  2,823,  0,  0,  0,  0},   // 3292
+    { 37, 89,  0,  0,  0,  0},   // 3293
+    {  2,  3, 61,  0,  0,  0},   // 3294
+    {  5,659,  0,  0,  0,  0},   // 3295
+    {  2,103,  0,  0,  0,  0},   // 3296
+    {  3,  7,157,  0,  0,  0},   // 3297
+    {  2, 17, 97,  0,  0,  0},   // 3298
+    {  0,  0,  0,  0,  0,  0},   // 3299
+    {  2,  3,  5, 11,  0,  0},   // 3300
+    {  0,  0,  0,  0,  0,  0},   // 3301
+    {  2, 13,127,  0,  0,  0},   // 3302
+    {  3,367,  0,  0,  0,  0},   // 3303
+    {  2,  7, 59,  0,  0,  0},   // 3304
+    {  5,661,  0,  0,  0,  0},   // 3305
+    {  2,  3, 19, 29,  0,  0},   // 3306
+    {  0,  0,  0,  0,  0,  0},   // 3307
+    {  2,827,  0,  0,  0,  0},   // 3308
+    {  3,1103,  0,  0,  0,  0},   // 3309
+    {  2,  5,331,  0,  0,  0},   // 3310
+    {  7, 11, 43,  0,  0,  0},   // 3311
+    {  2,  3, 23,  0,  0,  0},   // 3312
+    {  0,  0,  0,  0,  0,  0},   // 3313
+    {  2,1657,  0,  0,  0,  0},   // 3314
+    {  3,  5, 13, 17,  0,  0},   // 3315
+    {  2,829,  0,  0,  0,  0},   // 3316
+    { 31,107,  0,  0,  0,  0},   // 3317
+    {  2,  3,  7, 79,  0,  0},   // 3318
+    {  0,  0,  0,  0,  0,  0},   // 3319
+    {  2,  5, 83,  0,  0,  0},   // 3320
+    {  3, 41,  0,  0,  0,  0},   // 3321
+    {  2, 11,151,  0,  0,  0},   // 3322
+    {  0,  0,  0,  0,  0,  0},   // 3323
+    {  2,  3,277,  0,  0,  0},   // 3324
+    {  5,  7, 19,  0,  0,  0},   // 3325
+    {  2,1663,  0,  0,  0,  0},   // 3326
+    {  3,1109,  0,  0,  0,  0},   // 3327
+    {  2, 13,  0,  0,  0,  0},   // 3328
+    {  0,  0,  0,  0,  0,  0},   // 3329
+    {  2,  3,  5, 37,  0,  0},   // 3330
+    {  0,  0,  0,  0,  0,  0},   // 3331
+    {  2,  7, 17,  0,  0,  0},   // 3332
+    {  3, 11,101,  0,  0,  0},   // 3333
+    {  2,1667,  0,  0,  0,  0},   // 3334
+    {  5, 23, 29,  0,  0,  0},   // 3335
+    {  2,  3,139,  0,  0,  0},   // 3336
+    { 47, 71,  0,  0,  0,  0},   // 3337
+    {  2,1669,  0,  0,  0,  0},   // 3338
+    {  3,  7, 53,  0,  0,  0},   // 3339
+    {  2,  5,167,  0,  0,  0},   // 3340
+    { 13,257,  0,  0,  0,  0},   // 3341
+    {  2,  3,557,  0,  0,  0},   // 3342
+    {  0,  0,  0,  0,  0,  0},   // 3343
+    {  2, 11, 19,  0,  0,  0},   // 3344
+    {  3,  5,223,  0,  0,  0},   // 3345
+    {  2,  7,239,  0,  0,  0},   // 3346
+    {  0,  0,  0,  0,  0,  0},   // 3347
+    {  2,  3, 31,  0,  0,  0},   // 3348
+    { 17,197,  0,  0,  0,  0},   // 3349
+    {  2,  5, 67,  0,  0,  0},   // 3350
+    {  3,1117,  0,  0,  0,  0},   // 3351
+    {  2,419,  0,  0,  0,  0},   // 3352
+    {  7,479,  0,  0,  0,  0},   // 3353
+    {  2,  3, 13, 43,  0,  0},   // 3354
+    {  5, 11, 61,  0,  0,  0},   // 3355
+    {  2,839,  0,  0,  0,  0},   // 3356
+    {  3,373,  0,  0,  0,  0},   // 3357
+    {  2, 23, 73,  0,  0,  0},   // 3358
+    {  0,  0,  0,  0,  0,  0},   // 3359
+    {  2,  3,  5,  7,  0,  0},   // 3360
+    {  0,  0,  0,  0,  0,  0},   // 3361
+    {  2, 41,  0,  0,  0,  0},   // 3362
+    {  3, 19, 59,  0,  0,  0},   // 3363
+    {  2, 29,  0,  0,  0,  0},   // 3364
+    {  5,673,  0,  0,  0,  0},   // 3365
+    {  2,  3, 11, 17,  0,  0},   // 3366
+    {  7, 13, 37,  0,  0,  0},   // 3367
+    {  2,421,  0,  0,  0,  0},   // 3368
+    {  3,1123,  0,  0,  0,  0},   // 3369
+    {  2,  5,337,  0,  0,  0},   // 3370
+    {  0,  0,  0,  0,  0,  0},   // 3371
+    {  2,  3,281,  0,  0,  0},   // 3372
+    {  0,  0,  0,  0,  0,  0},   // 3373
+    {  2,  7,241,  0,  0,  0},   // 3374
+    {  3,  5,  0,  0,  0,  0},   // 3375
+    {  2,211,  0,  0,  0,  0},   // 3376
+    { 11,307,  0,  0,  0,  0},   // 3377
+    {  2,  3,563,  0,  0,  0},   // 3378
+    { 31,109,  0,  0,  0,  0},   // 3379
+    {  2,  5, 13,  0,  0,  0},   // 3380
+    {  3,  7, 23,  0,  0,  0},   // 3381
+    {  2, 19, 89,  0,  0,  0},   // 3382
+    { 17,199,  0,  0,  0,  0},   // 3383
+    {  2,  3, 47,  0,  0,  0},   // 3384
+    {  5,677,  0,  0,  0,  0},   // 3385
+    {  2,1693,  0,  0,  0,  0},   // 3386
+    {  3,1129,  0,  0,  0,  0},   // 3387
+    {  2,  7, 11,  0,  0,  0},   // 3388
+    {  0,  0,  0,  0,  0,  0},   // 3389
+    {  2,  3,  5,113,  0,  0},   // 3390
+    {  0,  0,  0,  0,  0,  0},   // 3391
+    {  2, 53,  0,  0,  0,  0},   // 3392
+    {  3, 13, 29,  0,  0,  0},   // 3393
+    {  2,1697,  0,  0,  0,  0},   // 3394
+    {  5,  7, 97,  0,  0,  0},   // 3395
+    {  2,  3,283,  0,  0,  0},   // 3396
+    { 43, 79,  0,  0,  0,  0},   // 3397
+    {  2,1699,  0,  0,  0,  0},   // 3398
+    {  3, 11,103,  0,  0,  0},   // 3399
+    {  2,  5, 17,  0,  0,  0},   // 3400
+    { 19,179,  0,  0,  0,  0},   // 3401
+    {  2,  3,  7,  0,  0,  0},   // 3402
+    { 41, 83,  0,  0,  0,  0},   // 3403
+    {  2, 23, 37,  0,  0,  0},   // 3404
+    {  3,  5,227,  0,  0,  0},   // 3405
+    {  2, 13,131,  0,  0,  0},   // 3406
+    {  0,  0,  0,  0,  0,  0},   // 3407
+    {  2,  3, 71,  0,  0,  0},   // 3408
+    {  7,487,  0,  0,  0,  0},   // 3409
+    {  2,  5, 11, 31,  0,  0},   // 3410
+    {  3,379,  0,  0,  0,  0},   // 3411
+    {  2,853,  0,  0,  0,  0},   // 3412
+    {  0,  0,  0,  0,  0,  0},   // 3413
+    {  2,  3,569,  0,  0,  0},   // 3414
+    {  5,683,  0,  0,  0,  0},   // 3415
+    {  2,  7, 61,  0,  0,  0},   // 3416
+    {  3, 17, 67,  0,  0,  0},   // 3417
+    {  2,1709,  0,  0,  0,  0},   // 3418
+    { 13,263,  0,  0,  0,  0},   // 3419
+    {  2,  3,  5, 19,  0,  0},   // 3420
+    { 11,311,  0,  0,  0,  0},   // 3421
+    {  2, 29, 59,  0,  0,  0},   // 3422
+    {  3,  7,163,  0,  0,  0},   // 3423
+    {  2,107,  0,  0,  0,  0},   // 3424
+    {  5,137,  0,  0,  0,  0},   // 3425
+    {  2,  3,571,  0,  0,  0},   // 3426
+    { 23,149,  0,  0,  0,  0},   // 3427
+    {  2,857,  0,  0,  0,  0},   // 3428
+    {  3,127,  0,  0,  0,  0},   // 3429
+    {  2,  5,  7,  0,  0,  0},   // 3430
+    { 47, 73,  0,  0,  0,  0},   // 3431
+    {  2,  3, 11, 13,  0,  0},   // 3432
+    {  0,  0,  0,  0,  0,  0},   // 3433
+    {  2, 17,101,  0,  0,  0},   // 3434
+    {  3,  5,229,  0,  0,  0},   // 3435
+    {  2,859,  0,  0,  0,  0},   // 3436
+    {  7,491,  0,  0,  0,  0},   // 3437
+    {  2,  3,191,  0,  0,  0},   // 3438
+    { 19,181,  0,  0,  0,  0},   // 3439
+    {  2,  5, 43,  0,  0,  0},   // 3440
+    {  3, 31, 37,  0,  0,  0},   // 3441
+    {  2,1721,  0,  0,  0,  0},   // 3442
+    { 11,313,  0,  0,  0,  0},   // 3443
+    {  2,  3,  7, 41,  0,  0},   // 3444
+    {  5, 13, 53,  0,  0,  0},   // 3445
+    {  2,1723,  0,  0,  0,  0},   // 3446
+    {  3,383,  0,  0,  0,  0},   // 3447
+    {  2,431,  0,  0,  0,  0},   // 3448
+    {  0,  0,  0,  0,  0,  0},   // 3449
+    {  2,  3,  5, 23,  0,  0},   // 3450
+    {  7, 17, 29,  0,  0,  0},   // 3451
+    {  2,863,  0,  0,  0,  0},   // 3452
+    {  3,1151,  0,  0,  0,  0},   // 3453
+    {  2, 11,157,  0,  0,  0},   // 3454
+    {  5,691,  0,  0,  0,  0},   // 3455
+    {  2,  3,  0,  0,  0,  0},   // 3456
+    {  0,  0,  0,  0,  0,  0},   // 3457
+    {  2,  7, 13, 19,  0,  0},   // 3458
+    {  3,1153,  0,  0,  0,  0},   // 3459
+    {  2,  5,173,  0,  0,  0},   // 3460
+    {  0,  0,  0,  0,  0,  0},   // 3461
+    {  2,  3,577,  0,  0,  0},   // 3462
+    {  0,  0,  0,  0,  0,  0},   // 3463
+    {  2,433,  0,  0,  0,  0},   // 3464
+    {  3,  5,  7, 11,  0,  0},   // 3465
+    {  2,1733,  0,  0,  0,  0},   // 3466
+    {  0,  0,  0,  0,  0,  0},   // 3467
+    {  2,  3, 17,  0,  0,  0},   // 3468
+    {  0,  0,  0,  0,  0,  0},   // 3469
+    {  2,  5,347,  0,  0,  0},   // 3470
+    {  3, 13, 89,  0,  0,  0},   // 3471
+    {  2,  7, 31,  0,  0,  0},   // 3472
+    { 23,151,  0,  0,  0,  0},   // 3473
+    {  2,  3,193,  0,  0,  0},   // 3474
+    {  5,139,  0,  0,  0,  0},   // 3475
+    {  2, 11, 79,  0,  0,  0},   // 3476
+    {  3, 19, 61,  0,  0,  0},   // 3477
+    {  2, 37, 47,  0,  0,  0},   // 3478
+    {  7, 71,  0,  0,  0,  0},   // 3479
+    {  2,  3,  5, 29,  0,  0},   // 3480
+    { 59,  0,  0,  0,  0,  0},   // 3481
+    {  2,1741,  0,  0,  0,  0},   // 3482
+    {  3, 43,  0,  0,  0,  0},   // 3483
+    {  2, 13, 67,  0,  0,  0},   // 3484
+    {  5, 17, 41,  0,  0,  0},   // 3485
+    {  2,  3,  7, 83,  0,  0},   // 3486
+    { 11,317,  0,  0,  0,  0},   // 3487
+    {  2,109,  0,  0,  0,  0},   // 3488
+    {  3,1163,  0,  0,  0,  0},   // 3489
+    {  2,  5,349,  0,  0,  0},   // 3490
+    {  0,  0,  0,  0,  0,  0},   // 3491
+    {  2,  3, 97,  0,  0,  0},   // 3492
+    {  7,499,  0,  0,  0,  0},   // 3493
+    {  2,1747,  0,  0,  0,  0},   // 3494
+    {  3,  5,233,  0,  0,  0},   // 3495
+    {  2, 19, 23,  0,  0,  0},   // 3496
+    { 13,269,  0,  0,  0,  0},   // 3497
+    {  2,  3, 11, 53,  0,  0},   // 3498
+    {  0,  0,  0,  0,  0,  0},   // 3499
+    {  2,  5,  7,  0,  0,  0},   // 3500
+    {  3,389,  0,  0,  0,  0},   // 3501
+    {  2, 17,103,  0,  0,  0},   // 3502
+    { 31,113,  0,  0,  0,  0},   // 3503
+    {  2,  3, 73,  0,  0,  0},   // 3504
+    {  5,701,  0,  0,  0,  0},   // 3505
+    {  2,1753,  0,  0,  0,  0},   // 3506
+    {  3,  7,167,  0,  0,  0},   // 3507
+    {  2,877,  0,  0,  0,  0},   // 3508
+    { 11, 29,  0,  0,  0,  0},   // 3509
+    {  2,  3,  5, 13,  0,  0},   // 3510
+    {  0,  0,  0,  0,  0,  0},   // 3511
+    {  2,439,  0,  0,  0,  0},   // 3512
+    {  3,1171,  0,  0,  0,  0},   // 3513
+    {  2,  7,251,  0,  0,  0},   // 3514
+    {  5, 19, 37,  0,  0,  0},   // 3515
+    {  2,  3,293,  0,  0,  0},   // 3516
+    {  0,  0,  0,  0,  0,  0},   // 3517
+    {  2,1759,  0,  0,  0,  0},   // 3518
+    {  3, 17, 23,  0,  0,  0},   // 3519
+    {  2,  5, 11,  0,  0,  0},   // 3520
+    {  7,503,  0,  0,  0,  0},   // 3521
+    {  2,  3,587,  0,  0,  0},   // 3522
+    { 13,271,  0,  0,  0,  0},   // 3523
+    {  2,881,  0,  0,  0,  0},   // 3524
+    {  3,  5, 47,  0,  0,  0},   // 3525
+    {  2, 41, 43,  0,  0,  0},   // 3526
+    {  0,  0,  0,  0,  0,  0},   // 3527
+    {  2,  3,  7,  0,  0,  0},   // 3528
+    {  0,  0,  0,  0,  0,  0},   // 3529
+    {  2,  5,353,  0,  0,  0},   // 3530
+    {  3, 11,107,  0,  0,  0},   // 3531
+    {  2,883,  0,  0,  0,  0},   // 3532
+    {  0,  0,  0,  0,  0,  0},   // 3533
+    {  2,  3, 19, 31,  0,  0},   // 3534
+    {  5,  7,101,  0,  0,  0},   // 3535
+    {  2, 13, 17,  0,  0,  0},   // 3536
+    {  3,131,  0,  0,  0,  0},   // 3537
+    {  2, 29, 61,  0,  0,  0},   // 3538
+    {  0,  0,  0,  0,  0,  0},   // 3539
+    {  2,  3,  5, 59,  0,  0},   // 3540
+    {  0,  0,  0,  0,  0,  0},   // 3541
+    {  2,  7, 11, 23,  0,  0},   // 3542
+    {  3,1181,  0,  0,  0,  0},   // 3543
+    {  2,443,  0,  0,  0,  0},   // 3544
+    {  5,709,  0,  0,  0,  0},   // 3545
+    {  2,  3,197,  0,  0,  0},   // 3546
+    {  0,  0,  0,  0,  0,  0},   // 3547
+    {  2,887,  0,  0,  0,  0},   // 3548
+    {  3,  7, 13,  0,  0,  0},   // 3549
+    {  2,  5, 71,  0,  0,  0},   // 3550
+    { 53, 67,  0,  0,  0,  0},   // 3551
+    {  2,  3, 37,  0,  0,  0},   // 3552
+    { 11, 17, 19,  0,  0,  0},   // 3553
+    {  2,1777,  0,  0,  0,  0},   // 3554
+    {  3,  5, 79,  0,  0,  0},   // 3555
+    {  2,  7,127,  0,  0,  0},   // 3556
+    {  0,  0,  0,  0,  0,  0},   // 3557
+    {  2,  3,593,  0,  0,  0},   // 3558
+    {  0,  0,  0,  0,  0,  0},   // 3559
+    {  2,  5, 89,  0,  0,  0},   // 3560
+    {  3,1187,  0,  0,  0,  0},   // 3561
+    {  2, 13,137,  0,  0,  0},   // 3562
+    {  7,509,  0,  0,  0,  0},   // 3563
+    {  2,  3, 11,  0,  0,  0},   // 3564
+    {  5, 23, 31,  0,  0,  0},   // 3565
+    {  2,1783,  0,  0,  0,  0},   // 3566
+    {  3, 29, 41,  0,  0,  0},   // 3567
+    {  2,223,  0,  0,  0,  0},   // 3568
+    { 43, 83,  0,  0,  0,  0},   // 3569
+    {  2,  3,  5,  7, 17,  0},   // 3570
+    {  0,  0,  0,  0,  0,  0},   // 3571
+    {  2, 19, 47,  0,  0,  0},   // 3572
+    {  3,397,  0,  0,  0,  0},   // 3573
+    {  2,1787,  0,  0,  0,  0},   // 3574
+    {  5, 11, 13,  0,  0,  0},   // 3575
+    {  2,  3,149,  0,  0,  0},   // 3576
+    {  7, 73,  0,  0,  0,  0},   // 3577
+    {  2,1789,  0,  0,  0,  0},   // 3578
+    {  3,1193,  0,  0,  0,  0},   // 3579
+    {  2,  5,179,  0,  0,  0},   // 3580
+    {  0,  0,  0,  0,  0,  0},   // 3581
+    {  2,  3,199,  0,  0,  0},   // 3582
+    {  0,  0,  0,  0,  0,  0},   // 3583
+    {  2,  7,  0,  0,  0,  0},   // 3584
+    {  3,  5,239,  0,  0,  0},   // 3585
+    {  2, 11,163,  0,  0,  0},   // 3586
+    { 17,211,  0,  0,  0,  0},   // 3587
+    {  2,  3, 13, 23,  0,  0},   // 3588
+    { 37, 97,  0,  0,  0,  0},   // 3589
+    {  2,  5,359,  0,  0,  0},   // 3590
+    {  3,  7, 19,  0,  0,  0},   // 3591
+    {  2,449,  0,  0,  0,  0},   // 3592
+    {  0,  0,  0,  0,  0,  0},   // 3593
+    {  2,  3,599,  0,  0,  0},   // 3594
+    {  5,719,  0,  0,  0,  0},   // 3595
+    {  2, 29, 31,  0,  0,  0},   // 3596
+    {  3, 11,109,  0,  0,  0},   // 3597
+    {  2,  7,257,  0,  0,  0},   // 3598
+    { 59, 61,  0,  0,  0,  0},   // 3599
+    {  2,  3,  5,  0,  0,  0},   // 3600
+    { 13,277,  0,  0,  0,  0},   // 3601
+    {  2,1801,  0,  0,  0,  0},   // 3602
+    {  3,1201,  0,  0,  0,  0},   // 3603
+    {  2, 17, 53,  0,  0,  0},   // 3604
+    {  5,  7,103,  0,  0,  0},   // 3605
+    {  2,  3,601,  0,  0,  0},   // 3606
+    {  0,  0,  0,  0,  0,  0},   // 3607
+    {  2, 11, 41,  0,  0,  0},   // 3608
+    {  3,401,  0,  0,  0,  0},   // 3609
+    {  2,  5, 19,  0,  0,  0},   // 3610
+    { 23,157,  0,  0,  0,  0},   // 3611
+    {  2,  3,  7, 43,  0,  0},   // 3612
+    {  0,  0,  0,  0,  0,  0},   // 3613
+    {  2, 13,139,  0,  0,  0},   // 3614
+    {  3,  5,241,  0,  0,  0},   // 3615
+    {  2,113,  0,  0,  0,  0},   // 3616
+    {  0,  0,  0,  0,  0,  0},   // 3617
+    {  2,  3, 67,  0,  0,  0},   // 3618
+    {  7, 11, 47,  0,  0,  0},   // 3619
+    {  2,  5,181,  0,  0,  0},   // 3620
+    {  3, 17, 71,  0,  0,  0},   // 3621
+    {  2,1811,  0,  0,  0,  0},   // 3622
+    {  0,  0,  0,  0,  0,  0},   // 3623
+    {  2,  3,151,  0,  0,  0},   // 3624
+    {  5, 29,  0,  0,  0,  0},   // 3625
+    {  2,  7, 37,  0,  0,  0},   // 3626
+    {  3, 13, 31,  0,  0,  0},   // 3627
+    {  2,907,  0,  0,  0,  0},   // 3628
+    { 19,191,  0,  0,  0,  0},   // 3629
+    {  2,  3,  5, 11,  0,  0},   // 3630
+    {  0,  0,  0,  0,  0,  0},   // 3631
+    {  2,227,  0,  0,  0,  0},   // 3632
+    {  3,  7,173,  0,  0,  0},   // 3633
+    {  2, 23, 79,  0,  0,  0},   // 3634
+    {  5,727,  0,  0,  0,  0},   // 3635
+    {  2,  3,101,  0,  0,  0},   // 3636
+    {  0,  0,  0,  0,  0,  0},   // 3637
+    {  2, 17,107,  0,  0,  0},   // 3638
+    {  3,1213,  0,  0,  0,  0},   // 3639
+    {  2,  5,  7, 13,  0,  0},   // 3640
+    { 11,331,  0,  0,  0,  0},   // 3641
+    {  2,  3,607,  0,  0,  0},   // 3642
+    {  0,  0,  0,  0,  0,  0},   // 3643
+    {  2,911,  0,  0,  0,  0},   // 3644
+    {  3,  5,  0,  0,  0,  0},   // 3645
+    {  2,1823,  0,  0,  0,  0},   // 3646
+    {  7,521,  0,  0,  0,  0},   // 3647
+    {  2,  3, 19,  0,  0,  0},   // 3648
+    { 41, 89,  0,  0,  0,  0},   // 3649
+    {  2,  5, 73,  0,  0,  0},   // 3650
+    {  3,1217,  0,  0,  0,  0},   // 3651
+    {  2, 11, 83,  0,  0,  0},   // 3652
+    { 13,281,  0,  0,  0,  0},   // 3653
+    {  2,  3,  7, 29,  0,  0},   // 3654
+    {  5, 17, 43,  0,  0,  0},   // 3655
+    {  2,457,  0,  0,  0,  0},   // 3656
+    {  3, 23, 53,  0,  0,  0},   // 3657
+    {  2, 31, 59,  0,  0,  0},   // 3658
+    {  0,  0,  0,  0,  0,  0},   // 3659
+    {  2,  3,  5, 61,  0,  0},   // 3660
+    {  7,523,  0,  0,  0,  0},   // 3661
+    {  2,1831,  0,  0,  0,  0},   // 3662
+    {  3, 11, 37,  0,  0,  0},   // 3663
+    {  2,229,  0,  0,  0,  0},   // 3664
+    {  5,733,  0,  0,  0,  0},   // 3665
+    {  2,  3, 13, 47,  0,  0},   // 3666
+    { 19,193,  0,  0,  0,  0},   // 3667
+    {  2,  7,131,  0,  0,  0},   // 3668
+    {  3,1223,  0,  0,  0,  0},   // 3669
+    {  2,  5,367,  0,  0,  0},   // 3670
+    {  0,  0,  0,  0,  0,  0},   // 3671
+    {  2,  3, 17,  0,  0,  0},   // 3672
+    {  0,  0,  0,  0,  0,  0},   // 3673
+    {  2, 11,167,  0,  0,  0},   // 3674
+    {  3,  5,  7,  0,  0,  0},   // 3675
+    {  2,919,  0,  0,  0,  0},   // 3676
+    {  0,  0,  0,  0,  0,  0},   // 3677
+    {  2,  3,613,  0,  0,  0},   // 3678
+    { 13,283,  0,  0,  0,  0},   // 3679
+    {  2,  5, 23,  0,  0,  0},   // 3680
+    {  3,409,  0,  0,  0,  0},   // 3681
+    {  2,  7,263,  0,  0,  0},   // 3682
+    { 29,127,  0,  0,  0,  0},   // 3683
+    {  2,  3,307,  0,  0,  0},   // 3684
+    {  5, 11, 67,  0,  0,  0},   // 3685
+    {  2, 19, 97,  0,  0,  0},   // 3686
+    {  3,1229,  0,  0,  0,  0},   // 3687
+    {  2,461,  0,  0,  0,  0},   // 3688
+    {  7, 17, 31,  0,  0,  0},   // 3689
+    {  2,  3,  5, 41,  0,  0},   // 3690
+    {  0,  0,  0,  0,  0,  0},   // 3691
+    {  2, 13, 71,  0,  0,  0},   // 3692
+    {  3,1231,  0,  0,  0,  0},   // 3693
+    {  2,1847,  0,  0,  0,  0},   // 3694
+    {  5,739,  0,  0,  0,  0},   // 3695
+    {  2,  3,  7, 11,  0,  0},   // 3696
+    {  0,  0,  0,  0,  0,  0},   // 3697
+    {  2, 43,  0,  0,  0,  0},   // 3698
+    {  3,137,  0,  0,  0,  0},   // 3699
+    {  2,  5, 37,  0,  0,  0},   // 3700
+    {  0,  0,  0,  0,  0,  0},   // 3701
+    {  2,  3,617,  0,  0,  0},   // 3702
+    {  7, 23,  0,  0,  0,  0},   // 3703
+    {  2,463,  0,  0,  0,  0},   // 3704
+    {  3,  5, 13, 19,  0,  0},   // 3705
+    {  2, 17,109,  0,  0,  0},   // 3706
+    { 11,337,  0,  0,  0,  0},   // 3707
+    {  2,  3,103,  0,  0,  0},   // 3708
+    {  0,  0,  0,  0,  0,  0},   // 3709
+    {  2,  5,  7, 53,  0,  0},   // 3710
+    {  3,1237,  0,  0,  0,  0},   // 3711
+    {  2, 29,  0,  0,  0,  0},   // 3712
+    { 47, 79,  0,  0,  0,  0},   // 3713
+    {  2,  3,619,  0,  0,  0},   // 3714
+    {  5,743,  0,  0,  0,  0},   // 3715
+    {  2,929,  0,  0,  0,  0},   // 3716
+    {  3,  7, 59,  0,  0,  0},   // 3717
+    {  2, 11, 13,  0,  0,  0},   // 3718
+    {  0,  0,  0,  0,  0,  0},   // 3719
+    {  2,  3,  5, 31,  0,  0},   // 3720
+    { 61,  0,  0,  0,  0,  0},   // 3721
+    {  2,1861,  0,  0,  0,  0},   // 3722
+    {  3, 17, 73,  0,  0,  0},   // 3723
+    {  2,  7, 19,  0,  0,  0},   // 3724
+    {  5,149,  0,  0,  0,  0},   // 3725
+    {  2,  3, 23,  0,  0,  0},   // 3726
+    {  0,  0,  0,  0,  0,  0},   // 3727
+    {  2,233,  0,  0,  0,  0},   // 3728
+    {  3, 11,113,  0,  0,  0},   // 3729
+    {  2,  5,373,  0,  0,  0},   // 3730
+    {  7, 13, 41,  0,  0,  0},   // 3731
+    {  2,  3,311,  0,  0,  0},   // 3732
+    {  0,  0,  0,  0,  0,  0},   // 3733
+    {  2,1867,  0,  0,  0,  0},   // 3734
+    {  3,  5, 83,  0,  0,  0},   // 3735
+    {  2,467,  0,  0,  0,  0},   // 3736
+    { 37,101,  0,  0,  0,  0},   // 3737
+    {  2,  3,  7, 89,  0,  0},   // 3738
+    {  0,  0,  0,  0,  0,  0},   // 3739
+    {  2,  5, 11, 17,  0,  0},   // 3740
+    {  3, 29, 43,  0,  0,  0},   // 3741
+    {  2,1871,  0,  0,  0,  0},   // 3742
+    { 19,197,  0,  0,  0,  0},   // 3743
+    {  2,  3, 13,  0,  0,  0},   // 3744
+    {  5,  7,107,  0,  0,  0},   // 3745
+    {  2,1873,  0,  0,  0,  0},   // 3746
+    {  3,1249,  0,  0,  0,  0},   // 3747
+    {  2,937,  0,  0,  0,  0},   // 3748
+    { 23,163,  0,  0,  0,  0},   // 3749
+    {  2,  3,  5,  0,  0,  0},   // 3750
+    { 11, 31,  0,  0,  0,  0},   // 3751
+    {  2,  7, 67,  0,  0,  0},   // 3752
+    {  3,139,  0,  0,  0,  0},   // 3753
+    {  2,1877,  0,  0,  0,  0},   // 3754
+    {  5,751,  0,  0,  0,  0},   // 3755
+    {  2,  3,313,  0,  0,  0},   // 3756
+    { 13, 17,  0,  0,  0,  0},   // 3757
+    {  2,1879,  0,  0,  0,  0},   // 3758
+    {  3,  7,179,  0,  0,  0},   // 3759
+    {  2,  5, 47,  0,  0,  0},   // 3760
+    {  0,  0,  0,  0,  0,  0},   // 3761
+    {  2,  3, 11, 19,  0,  0},   // 3762
+    { 53, 71,  0,  0,  0,  0},   // 3763
+    {  2,941,  0,  0,  0,  0},   // 3764
+    {  3,  5,251,  0,  0,  0},   // 3765
+    {  2,  7,269,  0,  0,  0},   // 3766
+    {  0,  0,  0,  0,  0,  0},   // 3767
+    {  2,  3,157,  0,  0,  0},   // 3768
+    {  0,  0,  0,  0,  0,  0},   // 3769
+    {  2,  5, 13, 29,  0,  0},   // 3770
+    {  3,419,  0,  0,  0,  0},   // 3771
+    {  2, 23, 41,  0,  0,  0},   // 3772
+    {  7, 11,  0,  0,  0,  0},   // 3773
+    {  2,  3, 17, 37,  0,  0},   // 3774
+    {  5,151,  0,  0,  0,  0},   // 3775
+    {  2, 59,  0,  0,  0,  0},   // 3776
+    {  3,1259,  0,  0,  0,  0},   // 3777
+    {  2,1889,  0,  0,  0,  0},   // 3778
+    {  0,  0,  0,  0,  0,  0},   // 3779
+    {  2,  3,  5,  7,  0,  0},   // 3780
+    { 19,199,  0,  0,  0,  0},   // 3781
+    {  2, 31, 61,  0,  0,  0},   // 3782
+    {  3, 13, 97,  0,  0,  0},   // 3783
+    {  2, 11, 43,  0,  0,  0},   // 3784
+    {  5,757,  0,  0,  0,  0},   // 3785
+    {  2,  3,631,  0,  0,  0},   // 3786
+    {  7,541,  0,  0,  0,  0},   // 3787
+    {  2,947,  0,  0,  0,  0},   // 3788
+    {  3,421,  0,  0,  0,  0},   // 3789
+    {  2,  5,379,  0,  0,  0},   // 3790
+    { 17,223,  0,  0,  0,  0},   // 3791
+    {  2,  3, 79,  0,  0,  0},   // 3792
+    {  0,  0,  0,  0,  0,  0},   // 3793
+    {  2,  7,271,  0,  0,  0},   // 3794
+    {  3,  5, 11, 23,  0,  0},   // 3795
+    {  2, 13, 73,  0,  0,  0},   // 3796
+    {  0,  0,  0,  0,  0,  0},   // 3797
+    {  2,  3,211,  0,  0,  0},   // 3798
+    { 29,131,  0,  0,  0,  0},   // 3799
+    {  2,  5, 19,  0,  0,  0},   // 3800
+    {  3,  7,181,  0,  0,  0},   // 3801
+    {  2,1901,  0,  0,  0,  0},   // 3802
+    {  0,  0,  0,  0,  0,  0},   // 3803
+    {  2,  3,317,  0,  0,  0},   // 3804
+    {  5,761,  0,  0,  0,  0},   // 3805
+    {  2, 11,173,  0,  0,  0},   // 3806
+    {  3, 47,  0,  0,  0,  0},   // 3807
+    {  2,  7, 17,  0,  0,  0},   // 3808
+    { 13,293,  0,  0,  0,  0},   // 3809
+    {  2,  3,  5,127,  0,  0},   // 3810
+    { 37,103,  0,  0,  0,  0},   // 3811
+    {  2,953,  0,  0,  0,  0},   // 3812
+    {  3, 31, 41,  0,  0,  0},   // 3813
+    {  2,1907,  0,  0,  0,  0},   // 3814
+    {  5,  7,109,  0,  0,  0},   // 3815
+    {  2,  3, 53,  0,  0,  0},   // 3816
+    { 11,347,  0,  0,  0,  0},   // 3817
+    {  2, 23, 83,  0,  0,  0},   // 3818
+    {  3, 19, 67,  0,  0,  0},   // 3819
+    {  2,  5,191,  0,  0,  0},   // 3820
+    {  0,  0,  0,  0,  0,  0},   // 3821
+    {  2,  3,  7, 13,  0,  0},   // 3822
+    {  0,  0,  0,  0,  0,  0},   // 3823
+    {  2,239,  0,  0,  0,  0},   // 3824
+    {  3,  5, 17,  0,  0,  0},   // 3825
+    {  2,1913,  0,  0,  0,  0},   // 3826
+    { 43, 89,  0,  0,  0,  0},   // 3827
+    {  2,  3, 11, 29,  0,  0},   // 3828
+    {  7,547,  0,  0,  0,  0},   // 3829
+    {  2,  5,383,  0,  0,  0},   // 3830
+    {  3,1277,  0,  0,  0,  0},   // 3831
+    {  2,479,  0,  0,  0,  0},   // 3832
+    {  0,  0,  0,  0,  0,  0},   // 3833
+    {  2,  3, 71,  0,  0,  0},   // 3834
+    {  5, 13, 59,  0,  0,  0},   // 3835
+    {  2,  7,137,  0,  0,  0},   // 3836
+    {  3,1279,  0,  0,  0,  0},   // 3837
+    {  2, 19,101,  0,  0,  0},   // 3838
+    { 11,349,  0,  0,  0,  0},   // 3839
+    {  2,  3,  5,  0,  0,  0},   // 3840
+    { 23,167,  0,  0,  0,  0},   // 3841
+    {  2, 17,113,  0,  0,  0},   // 3842
+    {  3,  7, 61,  0,  0,  0},   // 3843
+    {  2, 31,  0,  0,  0,  0},   // 3844
+    {  5,769,  0,  0,  0,  0},   // 3845
+    {  2,  3,641,  0,  0,  0},   // 3846
+    {  0,  0,  0,  0,  0,  0},   // 3847
+    {  2, 13, 37,  0,  0,  0},   // 3848
+    {  3,1283,  0,  0,  0,  0},   // 3849
+    {  2,  5,  7, 11,  0,  0},   // 3850
+    {  0,  0,  0,  0,  0,  0},   // 3851
+    {  2,  3,107,  0,  0,  0},   // 3852
+    {  0,  0,  0,  0,  0,  0},   // 3853
+    {  2, 41, 47,  0,  0,  0},   // 3854
+    {  3,  5,257,  0,  0,  0},   // 3855
+    {  2,241,  0,  0,  0,  0},   // 3856
+    {  7, 19, 29,  0,  0,  0},   // 3857
+    {  2,  3,643,  0,  0,  0},   // 3858
+    { 17,227,  0,  0,  0,  0},   // 3859
+    {  2,  5,193,  0,  0,  0},   // 3860
+    {  3, 11, 13,  0,  0,  0},   // 3861
+    {  2,1931,  0,  0,  0,  0},   // 3862
+    {  0,  0,  0,  0,  0,  0},   // 3863
+    {  2,  3,  7, 23,  0,  0},   // 3864
+    {  5,773,  0,  0,  0,  0},   // 3865
+    {  2,1933,  0,  0,  0,  0},   // 3866
+    {  3,1289,  0,  0,  0,  0},   // 3867
+    {  2,967,  0,  0,  0,  0},   // 3868
+    { 53, 73,  0,  0,  0,  0},   // 3869
+    {  2,  3,  5, 43,  0,  0},   // 3870
+    {  7, 79,  0,  0,  0,  0},   // 3871
+    {  2, 11,  0,  0,  0,  0},   // 3872
+    {  3,1291,  0,  0,  0,  0},   // 3873
+    {  2, 13,149,  0,  0,  0},   // 3874
+    {  5, 31,  0,  0,  0,  0},   // 3875
+    {  2,  3, 17, 19,  0,  0},   // 3876
+    {  0,  0,  0,  0,  0,  0},   // 3877
+    {  2,  7,277,  0,  0,  0},   // 3878
+    {  3,431,  0,  0,  0,  0},   // 3879
+    {  2,  5, 97,  0,  0,  0},   // 3880
+    {  0,  0,  0,  0,  0,  0},   // 3881
+    {  2,  3,647,  0,  0,  0},   // 3882
+    { 11,353,  0,  0,  0,  0},   // 3883
+    {  2,971,  0,  0,  0,  0},   // 3884
+    {  3,  5,  7, 37,  0,  0},   // 3885
+    {  2, 29, 67,  0,  0,  0},   // 3886
+    { 13, 23,  0,  0,  0,  0},   // 3887
+    {  2,  3,  0,  0,  0,  0},   // 3888
+    {  0,  0,  0,  0,  0,  0},   // 3889
+    {  2,  5,389,  0,  0,  0},   // 3890
+    {  3,1297,  0,  0,  0,  0},   // 3891
+    {  2,  7,139,  0,  0,  0},   // 3892
+    { 17,229,  0,  0,  0,  0},   // 3893
+    {  2,  3, 11, 59,  0,  0},   // 3894
+    {  5, 19, 41,  0,  0,  0},   // 3895
+    {  2,487,  0,  0,  0,  0},   // 3896
+    {  3,433,  0,  0,  0,  0},   // 3897
+    {  2,1949,  0,  0,  0,  0},   // 3898
+    {  7,557,  0,  0,  0,  0},   // 3899
+    {  2,  3,  5, 13,  0,  0},   // 3900
+    { 47, 83,  0,  0,  0,  0},   // 3901
+    {  2,1951,  0,  0,  0,  0},   // 3902
+    {  3,1301,  0,  0,  0,  0},   // 3903
+    {  2, 61,  0,  0,  0,  0},   // 3904
+    {  5, 11, 71,  0,  0,  0},   // 3905
+    {  2,  3,  7, 31,  0,  0},   // 3906
+    {  0,  0,  0,  0,  0,  0},   // 3907
+    {  2,977,  0,  0,  0,  0},   // 3908
+    {  3,1303,  0,  0,  0,  0},   // 3909
+    {  2,  5, 17, 23,  0,  0},   // 3910
+    {  0,  0,  0,  0,  0,  0},   // 3911
+    {  2,  3,163,  0,  0,  0},   // 3912
+    {  7, 13, 43,  0,  0,  0},   // 3913
+    {  2, 19,103,  0,  0,  0},   // 3914
+    {  3,  5, 29,  0,  0,  0},   // 3915
+    {  2, 11, 89,  0,  0,  0},   // 3916
+    {  0,  0,  0,  0,  0,  0},   // 3917
+    {  2,  3,653,  0,  0,  0},   // 3918
+    {  0,  0,  0,  0,  0,  0},   // 3919
+    {  2,  5,  7,  0,  0,  0},   // 3920
+    {  3,1307,  0,  0,  0,  0},   // 3921
+    {  2, 37, 53,  0,  0,  0},   // 3922
+    {  0,  0,  0,  0,  0,  0},   // 3923
+    {  2,  3,109,  0,  0,  0},   // 3924
+    {  5,157,  0,  0,  0,  0},   // 3925
+    {  2, 13,151,  0,  0,  0},   // 3926
+    {  3,  7, 11, 17,  0,  0},   // 3927
+    {  2,491,  0,  0,  0,  0},   // 3928
+    {  0,  0,  0,  0,  0,  0},   // 3929
+    {  2,  3,  5,131,  0,  0},   // 3930
+    {  0,  0,  0,  0,  0,  0},   // 3931
+    {  2,983,  0,  0,  0,  0},   // 3932
+    {  3, 19, 23,  0,  0,  0},   // 3933
+    {  2,  7,281,  0,  0,  0},   // 3934
+    {  5,787,  0,  0,  0,  0},   // 3935
+    {  2,  3, 41,  0,  0,  0},   // 3936
+    { 31,127,  0,  0,  0,  0},   // 3937
+    {  2, 11,179,  0,  0,  0},   // 3938
+    {  3, 13,101,  0,  0,  0},   // 3939
+    {  2,  5,197,  0,  0,  0},   // 3940
+    {  7,563,  0,  0,  0,  0},   // 3941
+    {  2,  3, 73,  0,  0,  0},   // 3942
+    {  0,  0,  0,  0,  0,  0},   // 3943
+    {  2, 17, 29,  0,  0,  0},   // 3944
+    {  3,  5,263,  0,  0,  0},   // 3945
+    {  2,1973,  0,  0,  0,  0},   // 3946
+    {  0,  0,  0,  0,  0,  0},   // 3947
+    {  2,  3,  7, 47,  0,  0},   // 3948
+    { 11,359,  0,  0,  0,  0},   // 3949
+    {  2,  5, 79,  0,  0,  0},   // 3950
+    {  3,439,  0,  0,  0,  0},   // 3951
+    {  2, 13, 19,  0,  0,  0},   // 3952
+    { 59, 67,  0,  0,  0,  0},   // 3953
+    {  2,  3,659,  0,  0,  0},   // 3954
+    {  5,  7,113,  0,  0,  0},   // 3955
+    {  2, 23, 43,  0,  0,  0},   // 3956
+    {  3,1319,  0,  0,  0,  0},   // 3957
+    {  2,1979,  0,  0,  0,  0},   // 3958
+    { 37,107,  0,  0,  0,  0},   // 3959
+    {  2,  3,  5, 11,  0,  0},   // 3960
+    { 17,233,  0,  0,  0,  0},   // 3961
+    {  2,  7,283,  0,  0,  0},   // 3962
+    {  3,1321,  0,  0,  0,  0},   // 3963
+    {  2,991,  0,  0,  0,  0},   // 3964
+    {  5, 13, 61,  0,  0,  0},   // 3965
+    {  2,  3,661,  0,  0,  0},   // 3966
+    {  0,  0,  0,  0,  0,  0},   // 3967
+    {  2, 31,  0,  0,  0,  0},   // 3968
+    {  3,  7,  0,  0,  0,  0},   // 3969
+    {  2,  5,397,  0,  0,  0},   // 3970
+    { 11, 19,  0,  0,  0,  0},   // 3971
+    {  2,  3,331,  0,  0,  0},   // 3972
+    { 29,137,  0,  0,  0,  0},   // 3973
+    {  2,1987,  0,  0,  0,  0},   // 3974
+    {  3,  5, 53,  0,  0,  0},   // 3975
+    {  2,  7, 71,  0,  0,  0},   // 3976
+    { 41, 97,  0,  0,  0,  0},   // 3977
+    {  2,  3, 13, 17,  0,  0},   // 3978
+    { 23,173,  0,  0,  0,  0},   // 3979
+    {  2,  5,199,  0,  0,  0},   // 3980
+    {  3,1327,  0,  0,  0,  0},   // 3981
+    {  2, 11,181,  0,  0,  0},   // 3982
+    {  7,569,  0,  0,  0,  0},   // 3983
+    {  2,  3, 83,  0,  0,  0},   // 3984
+    {  5,797,  0,  0,  0,  0},   // 3985
+    {  2,1993,  0,  0,  0,  0},   // 3986
+    {  3,443,  0,  0,  0,  0},   // 3987
+    {  2,997,  0,  0,  0,  0},   // 3988
+    {  0,  0,  0,  0,  0,  0},   // 3989
+    {  2,  3,  5,  7, 19,  0},   // 3990
+    { 13,307,  0,  0,  0,  0},   // 3991
+    {  2,499,  0,  0,  0,  0},   // 3992
+    {  3, 11,  0,  0,  0,  0},   // 3993
+    {  2,1997,  0,  0,  0,  0},   // 3994
+    {  5, 17, 47,  0,  0,  0},   // 3995
+    {  2,  3, 37,  0,  0,  0},   // 3996
+    {  7,571,  0,  0,  0,  0},   // 3997
+    {  2,1999,  0,  0,  0,  0},   // 3998
+    {  3, 31, 43,  0,  0,  0},   // 3999
+    {  2,  5,  0,  0,  0,  0},   // 4000
+    {  0,  0,  0,  0,  0,  0},   // 4001
+    {  2,  3, 23, 29,  0,  0},   // 4002
+    {  0,  0,  0,  0,  0,  0},   // 4003
+    {  2,  7, 11, 13,  0,  0},   // 4004
+    {  3,  5, 89,  0,  0,  0},   // 4005
+    {  2,2003,  0,  0,  0,  0},   // 4006
+    {  0,  0,  0,  0,  0,  0},   // 4007
+    {  2,  3,167,  0,  0,  0},   // 4008
+    { 19,211,  0,  0,  0,  0},   // 4009
+    {  2,  5,401,  0,  0,  0},   // 4010
+    {  3,  7,191,  0,  0,  0},   // 4011
+    {  2, 17, 59,  0,  0,  0},   // 4012
+    {  0,  0,  0,  0,  0,  0},   // 4013
+    {  2,  3,223,  0,  0,  0},   // 4014
+    {  5, 11, 73,  0,  0,  0},   // 4015
+    {  2,251,  0,  0,  0,  0},   // 4016
+    {  3, 13,103,  0,  0,  0},   // 4017
+    {  2,  7, 41,  0,  0,  0},   // 4018
+    {  0,  0,  0,  0,  0,  0},   // 4019
+    {  2,  3,  5, 67,  0,  0},   // 4020
+    {  0,  0,  0,  0,  0,  0},   // 4021
+    {  2,2011,  0,  0,  0,  0},   // 4022
+    {  3,149,  0,  0,  0,  0},   // 4023
+    {  2,503,  0,  0,  0,  0},   // 4024
+    {  5,  7, 23,  0,  0,  0},   // 4025
+    {  2,  3, 11, 61,  0,  0},   // 4026
+    {  0,  0,  0,  0,  0,  0},   // 4027
+    {  2, 19, 53,  0,  0,  0},   // 4028
+    {  3, 17, 79,  0,  0,  0},   // 4029
+    {  2,  5, 13, 31,  0,  0},   // 4030
+    { 29,139,  0,  0,  0,  0},   // 4031
+    {  2,  3,  7,  0,  0,  0},   // 4032
+    { 37,109,  0,  0,  0,  0},   // 4033
+    {  2,2017,  0,  0,  0,  0},   // 4034
+    {  3,  5,269,  0,  0,  0},   // 4035
+    {  2,1009,  0,  0,  0,  0},   // 4036
+    { 11,367,  0,  0,  0,  0},   // 4037
+    {  2,  3,673,  0,  0,  0},   // 4038
+    {  7,577,  0,  0,  0,  0},   // 4039
+    {  2,  5,101,  0,  0,  0},   // 4040
+    {  3,449,  0,  0,  0,  0},   // 4041
+    {  2, 43, 47,  0,  0,  0},   // 4042
+    { 13,311,  0,  0,  0,  0},   // 4043
+    {  2,  3,337,  0,  0,  0},   // 4044
+    {  5,809,  0,  0,  0,  0},   // 4045
+    {  2,  7, 17,  0,  0,  0},   // 4046
+    {  3, 19, 71,  0,  0,  0},   // 4047
+    {  2, 11, 23,  0,  0,  0},   // 4048
+    {  0,  0,  0,  0,  0,  0},   // 4049
+    {  2,  3,  5,  0,  0,  0},   // 4050
+    {  0,  0,  0,  0,  0,  0},   // 4051
+    {  2,1013,  0,  0,  0,  0},   // 4052
+    {  3,  7,193,  0,  0,  0},   // 4053
+    {  2,2027,  0,  0,  0,  0},   // 4054
+    {  5,811,  0,  0,  0,  0},   // 4055
+    {  2,  3, 13,  0,  0,  0},   // 4056
+    {  0,  0,  0,  0,  0,  0},   // 4057
+    {  2,2029,  0,  0,  0,  0},   // 4058
+    {  3, 11, 41,  0,  0,  0},   // 4059
+    {  2,  5,  7, 29,  0,  0},   // 4060
+    { 31,131,  0,  0,  0,  0},   // 4061
+    {  2,  3,677,  0,  0,  0},   // 4062
+    { 17,239,  0,  0,  0,  0},   // 4063
+    {  2,127,  0,  0,  0,  0},   // 4064
+    {  3,  5,271,  0,  0,  0},   // 4065
+    {  2, 19,107,  0,  0,  0},   // 4066
+    {  7, 83,  0,  0,  0,  0},   // 4067
+    {  2,  3,113,  0,  0,  0},   // 4068
+    { 13,313,  0,  0,  0,  0},   // 4069
+    {  2,  5, 11, 37,  0,  0},   // 4070
+    {  3, 23, 59,  0,  0,  0},   // 4071
+    {  2,509,  0,  0,  0,  0},   // 4072
+    {  0,  0,  0,  0,  0,  0},   // 4073
+    {  2,  3,  7, 97,  0,  0},   // 4074
+    {  5,163,  0,  0,  0,  0},   // 4075
+    {  2,1019,  0,  0,  0,  0},   // 4076
+    {  3,151,  0,  0,  0,  0},   // 4077
+    {  2,2039,  0,  0,  0,  0},   // 4078
+    {  0,  0,  0,  0,  0,  0},   // 4079
+    {  2,  3,  5, 17,  0,  0},   // 4080
+    {  7, 11, 53,  0,  0,  0},   // 4081
+    {  2, 13,157,  0,  0,  0},   // 4082
+    {  3,1361,  0,  0,  0,  0},   // 4083
+    {  2,1021,  0,  0,  0,  0},   // 4084
+    {  5, 19, 43,  0,  0,  0},   // 4085
+    {  2,  3,227,  0,  0,  0},   // 4086
+    { 61, 67,  0,  0,  0,  0},   // 4087
+    {  2,  7, 73,  0,  0,  0},   // 4088
+    {  3, 29, 47,  0,  0,  0},   // 4089
+    {  2,  5,409,  0,  0,  0},   // 4090
+    {  0,  0,  0,  0,  0,  0},   // 4091
+    {  2,  3, 11, 31,  0,  0},   // 4092
+    {  0,  0,  0,  0,  0,  0},   // 4093
+    {  2, 23, 89,  0,  0,  0},   // 4094
+    {  3,  5,  7, 13,  0,  0},   // 4095
+    {  2,  0,  0,  0,  0,  0},   // 4096
+    { 17,241,  0,  0,  0,  0},   // 4097
+    {  2,  3,683,  0,  0,  0},   // 4098
+    {  0,  0,  0,  0,  0,  0},   // 4099
+    {  2,  5, 41,  0,  0,  0},   // 4100
+    {  3,1367,  0,  0,  0,  0},   // 4101
+    {  2,  7,293,  0,  0,  0},   // 4102
+    { 11,373,  0,  0,  0,  0},   // 4103
+    {  2,  3, 19,  0,  0,  0},   // 4104
+    {  5,821,  0,  0,  0,  0},   // 4105
+    {  2,2053,  0,  0,  0,  0},   // 4106
+    {  3, 37,  0,  0,  0,  0},   // 4107
+    {  2, 13, 79,  0,  0,  0},   // 4108
+    {  7,587,  0,  0,  0,  0},   // 4109
+    {  2,  3,  5,137,  0,  0},   // 4110
+    {  0,  0,  0,  0,  0,  0},   // 4111
+    {  2,257,  0,  0,  0,  0},   // 4112
+    {  3,457,  0,  0,  0,  0},   // 4113
+    {  2, 11, 17,  0,  0,  0},   // 4114
+    {  5,823,  0,  0,  0,  0},   // 4115
+    {  2,  3,  7,  0,  0,  0},   // 4116
+    { 23,179,  0,  0,  0,  0},   // 4117
+    {  2, 29, 71,  0,  0,  0},   // 4118
+    {  3,1373,  0,  0,  0,  0},   // 4119
+    {  2,  5,103,  0,  0,  0},   // 4120
+    { 13,317,  0,  0,  0,  0},   // 4121
+    {  2,  3,229,  0,  0,  0},   // 4122
+    {  7, 19, 31,  0,  0,  0},   // 4123
+    {  2,1031,  0,  0,  0,  0},   // 4124
+    {  3,  5, 11,  0,  0,  0},   // 4125
+    {  2,2063,  0,  0,  0,  0},   // 4126
+    {  0,  0,  0,  0,  0,  0},   // 4127
+    {  2,  3, 43,  0,  0,  0},   // 4128
+    {  0,  0,  0,  0,  0,  0},   // 4129
+    {  2,  5,  7, 59,  0,  0},   // 4130
+    {  3, 17,  0,  0,  0,  0},   // 4131
+    {  2,1033,  0,  0,  0,  0},   // 4132
+    {  0,  0,  0,  0,  0,  0},   // 4133
+    {  2,  3, 13, 53,  0,  0},   // 4134
+    {  5,827,  0,  0,  0,  0},   // 4135
+    {  2, 11, 47,  0,  0,  0},   // 4136
+    {  3,  7,197,  0,  0,  0},   // 4137
+    {  2,2069,  0,  0,  0,  0},   // 4138
+    {  0,  0,  0,  0,  0,  0},   // 4139
+    {  2,  3,  5, 23,  0,  0},   // 4140
+    { 41,101,  0,  0,  0,  0},   // 4141
+    {  2, 19,109,  0,  0,  0},   // 4142
+    {  3,1381,  0,  0,  0,  0},   // 4143
+    {  2,  7, 37,  0,  0,  0},   // 4144
+    {  5,829,  0,  0,  0,  0},   // 4145
+    {  2,  3,691,  0,  0,  0},   // 4146
+    { 11, 13, 29,  0,  0,  0},   // 4147
+    {  2, 17, 61,  0,  0,  0},   // 4148
+    {  3,461,  0,  0,  0,  0},   // 4149
+    {  2,  5, 83,  0,  0,  0},   // 4150
+    {  7,593,  0,  0,  0,  0},   // 4151
+    {  2,  3,173,  0,  0,  0},   // 4152
+    {  0,  0,  0,  0,  0,  0},   // 4153
+    {  2, 31, 67,  0,  0,  0},   // 4154
+    {  3,  5,277,  0,  0,  0},   // 4155
+    {  2,1039,  0,  0,  0,  0},   // 4156
+    {  0,  0,  0,  0,  0,  0},   // 4157
+    {  2,  3,  7, 11,  0,  0},   // 4158
+    {  0,  0,  0,  0,  0,  0},   // 4159
+    {  2,  5, 13,  0,  0,  0},   // 4160
+    {  3, 19, 73,  0,  0,  0},   // 4161
+    {  2,2081,  0,  0,  0,  0},   // 4162
+    { 23,181,  0,  0,  0,  0},   // 4163
+    {  2,  3,347,  0,  0,  0},   // 4164
+    {  5,  7, 17,  0,  0,  0},   // 4165
+    {  2,2083,  0,  0,  0,  0},   // 4166
+    {  3,463,  0,  0,  0,  0},   // 4167
+    {  2,521,  0,  0,  0,  0},   // 4168
+    { 11,379,  0,  0,  0,  0},   // 4169
+    {  2,  3,  5,139,  0,  0},   // 4170
+    { 43, 97,  0,  0,  0,  0},   // 4171
+    {  2,  7,149,  0,  0,  0},   // 4172
+    {  3, 13,107,  0,  0,  0},   // 4173
+    {  2,2087,  0,  0,  0,  0},   // 4174
+    {  5,167,  0,  0,  0,  0},   // 4175
+    {  2,  3, 29,  0,  0,  0},   // 4176
+    {  0,  0,  0,  0,  0,  0},   // 4177
+    {  2,2089,  0,  0,  0,  0},   // 4178
+    {  3,  7,199,  0,  0,  0},   // 4179
+    {  2,  5, 11, 19,  0,  0},   // 4180
+    { 37,113,  0,  0,  0,  0},   // 4181
+    {  2,  3, 17, 41,  0,  0},   // 4182
+    { 47, 89,  0,  0,  0,  0},   // 4183
+    {  2,523,  0,  0,  0,  0},   // 4184
+    {  3,  5, 31,  0,  0,  0},   // 4185
+    {  2,  7, 13, 23,  0,  0},   // 4186
+    { 53, 79,  0,  0,  0,  0},   // 4187
+    {  2,  3,349,  0,  0,  0},   // 4188
+    { 59, 71,  0,  0,  0,  0},   // 4189
+    {  2,  5,419,  0,  0,  0},   // 4190
+    {  3, 11,127,  0,  0,  0},   // 4191
+    {  2,131,  0,  0,  0,  0},   // 4192
+    {  7,599,  0,  0,  0,  0},   // 4193
+    {  2,  3,233,  0,  0,  0},   // 4194
+    {  5,839,  0,  0,  0,  0},   // 4195
+    {  2,1049,  0,  0,  0,  0},   // 4196
+    {  3,1399,  0,  0,  0,  0},   // 4197
+    {  2,2099,  0,  0,  0,  0},   // 4198
+    { 13, 17, 19,  0,  0,  0},   // 4199
+    {  2,  3,  5,  7,  0,  0},   // 4200
+    {  0,  0,  0,  0,  0,  0},   // 4201
+    {  2, 11,191,  0,  0,  0},   // 4202
+    {  3,467,  0,  0,  0,  0},   // 4203
+    {  2,1051,  0,  0,  0,  0},   // 4204
+    {  5, 29,  0,  0,  0,  0},   // 4205
+    {  2,  3,701,  0,  0,  0},   // 4206
+    {  7,601,  0,  0,  0,  0},   // 4207
+    {  2,263,  0,  0,  0,  0},   // 4208
+    {  3, 23, 61,  0,  0,  0},   // 4209
+    {  2,  5,421,  0,  0,  0},   // 4210
+    {  0,  0,  0,  0,  0,  0},   // 4211
+    {  2,  3, 13,  0,  0,  0},   // 4212
+    { 11,383,  0,  0,  0,  0},   // 4213
+    {  2,  7, 43,  0,  0,  0},   // 4214
+    {  3,  5,281,  0,  0,  0},   // 4215
+    {  2, 17, 31,  0,  0,  0},   // 4216
+    {  0,  0,  0,  0,  0,  0},   // 4217
+    {  2,  3, 19, 37,  0,  0},   // 4218
+    {  0,  0,  0,  0,  0,  0},   // 4219
+    {  2,  5,211,  0,  0,  0},   // 4220
+    {  3,  7, 67,  0,  0,  0},   // 4221
+    {  2,2111,  0,  0,  0,  0},   // 4222
+    { 41,103,  0,  0,  0,  0},   // 4223
+    {  2,  3, 11,  0,  0,  0},   // 4224
+    {  5, 13,  0,  0,  0,  0},   // 4225
+    {  2,2113,  0,  0,  0,  0},   // 4226
+    {  3,1409,  0,  0,  0,  0},   // 4227
+    {  2,  7,151,  0,  0,  0},   // 4228
+    {  0,  0,  0,  0,  0,  0},   // 4229
+    {  2,  3,  5, 47,  0,  0},   // 4230
+    {  0,  0,  0,  0,  0,  0},   // 4231
+    {  2, 23,  0,  0,  0,  0},   // 4232
+    {  3, 17, 83,  0,  0,  0},   // 4233
+    {  2, 29, 73,  0,  0,  0},   // 4234
+    {  5,  7, 11,  0,  0,  0},   // 4235
+    {  2,  3,353,  0,  0,  0},   // 4236
+    { 19,223,  0,  0,  0,  0},   // 4237
+    {  2, 13,163,  0,  0,  0},   // 4238
+    {  3,157,  0,  0,  0,  0},   // 4239
+    {  2,  5, 53,  0,  0,  0},   // 4240
+    {  0,  0,  0,  0,  0,  0},   // 4241
+    {  2,  3,  7,101,  0,  0},   // 4242
+    {  0,  0,  0,  0,  0,  0},   // 4243
+    {  2,1061,  0,  0,  0,  0},   // 4244
+    {  3,  5,283,  0,  0,  0},   // 4245
+    {  2, 11,193,  0,  0,  0},   // 4246
+    { 31,137,  0,  0,  0,  0},   // 4247
+    {  2,  3, 59,  0,  0,  0},   // 4248
+    {  7,607,  0,  0,  0,  0},   // 4249
+    {  2,  5, 17,  0,  0,  0},   // 4250
+    {  3, 13,109,  0,  0,  0},   // 4251
+    {  2,1063,  0,  0,  0,  0},   // 4252
+    {  0,  0,  0,  0,  0,  0},   // 4253
+    {  2,  3,709,  0,  0,  0},   // 4254
+    {  5, 23, 37,  0,  0,  0},   // 4255
+    {  2,  7, 19,  0,  0,  0},   // 4256
+    {  3, 11, 43,  0,  0,  0},   // 4257
+    {  2,2129,  0,  0,  0,  0},   // 4258
+    {  0,  0,  0,  0,  0,  0},   // 4259
+    {  2,  3,  5, 71,  0,  0},   // 4260
+    {  0,  0,  0,  0,  0,  0},   // 4261
+    {  2,2131,  0,  0,  0,  0},   // 4262
+    {  3,  7, 29,  0,  0,  0},   // 4263
+    {  2, 13, 41,  0,  0,  0},   // 4264
+    {  5,853,  0,  0,  0,  0},   // 4265
+    {  2,  3, 79,  0,  0,  0},   // 4266
+    { 17,251,  0,  0,  0,  0},   // 4267
+    {  2, 11, 97,  0,  0,  0},   // 4268
+    {  3,1423,  0,  0,  0,  0},   // 4269
+    {  2,  5,  7, 61,  0,  0},   // 4270
+    {  0,  0,  0,  0,  0,  0},   // 4271
+    {  2,  3, 89,  0,  0,  0},   // 4272
+    {  0,  0,  0,  0,  0,  0},   // 4273
+    {  2,2137,  0,  0,  0,  0},   // 4274
+    {  3,  5, 19,  0,  0,  0},   // 4275
+    {  2,1069,  0,  0,  0,  0},   // 4276
+    {  7, 13, 47,  0,  0,  0},   // 4277
+    {  2,  3, 23, 31,  0,  0},   // 4278
+    { 11,389,  0,  0,  0,  0},   // 4279
+    {  2,  5,107,  0,  0,  0},   // 4280
+    {  3,1427,  0,  0,  0,  0},   // 4281
+    {  2,2141,  0,  0,  0,  0},   // 4282
+    {  0,  0,  0,  0,  0,  0},   // 4283
+    {  2,  3,  7, 17,  0,  0},   // 4284
+    {  5,857,  0,  0,  0,  0},   // 4285
+    {  2,2143,  0,  0,  0,  0},   // 4286
+    {  3,1429,  0,  0,  0,  0},   // 4287
+    {  2, 67,  0,  0,  0,  0},   // 4288
+    {  0,  0,  0,  0,  0,  0},   // 4289
+    {  2,  3,  5, 11, 13,  0},   // 4290
+    {  7,613,  0,  0,  0,  0},   // 4291
+    {  2, 29, 37,  0,  0,  0},   // 4292
+    {  3, 53,  0,  0,  0,  0},   // 4293
+    {  2, 19,113,  0,  0,  0},   // 4294
+    {  5,859,  0,  0,  0,  0},   // 4295
+    {  2,  3,179,  0,  0,  0},   // 4296
+    {  0,  0,  0,  0,  0,  0},   // 4297
+    {  2,  7,307,  0,  0,  0},   // 4298
+    {  3,1433,  0,  0,  0,  0},   // 4299
+    {  2,  5, 43,  0,  0,  0},   // 4300
+    { 11, 17, 23,  0,  0,  0},   // 4301
+    {  2,  3,239,  0,  0,  0},   // 4302
+    { 13,331,  0,  0,  0,  0},   // 4303
+    {  2,269,  0,  0,  0,  0},   // 4304
+    {  3,  5,  7, 41,  0,  0},   // 4305
+    {  2,2153,  0,  0,  0,  0},   // 4306
+    { 59, 73,  0,  0,  0,  0},   // 4307
+    {  2,  3,359,  0,  0,  0},   // 4308
+    { 31,139,  0,  0,  0,  0},   // 4309
+    {  2,  5,431,  0,  0,  0},   // 4310
+    {  3,479,  0,  0,  0,  0},   // 4311
+    {  2,  7, 11,  0,  0,  0},   // 4312
+    { 19,227,  0,  0,  0,  0},   // 4313
+    {  2,  3,719,  0,  0,  0},   // 4314
+    {  5,863,  0,  0,  0,  0},   // 4315
+    {  2, 13, 83,  0,  0,  0},   // 4316
+    {  3,1439,  0,  0,  0,  0},   // 4317
+    {  2, 17,127,  0,  0,  0},   // 4318
+    {  7,617,  0,  0,  0,  0},   // 4319
+    {  2,  3,  5,  0,  0,  0},   // 4320
+    { 29,149,  0,  0,  0,  0},   // 4321
+    {  2,2161,  0,  0,  0,  0},   // 4322
+    {  3, 11,131,  0,  0,  0},   // 4323
+    {  2, 23, 47,  0,  0,  0},   // 4324
+    {  5,173,  0,  0,  0,  0},   // 4325
+    {  2,  3,  7,103,  0,  0},   // 4326
+    {  0,  0,  0,  0,  0,  0},   // 4327
+    {  2,541,  0,  0,  0,  0},   // 4328
+    {  3, 13, 37,  0,  0,  0},   // 4329
+    {  2,  5,433,  0,  0,  0},   // 4330
+    { 61, 71,  0,  0,  0,  0},   // 4331
+    {  2,  3, 19,  0,  0,  0},   // 4332
+    {  7,619,  0,  0,  0,  0},   // 4333
+    {  2, 11,197,  0,  0,  0},   // 4334
+    {  3,  5, 17,  0,  0,  0},   // 4335
+    {  2,271,  0,  0,  0,  0},   // 4336
+    {  0,  0,  0,  0,  0,  0},   // 4337
+    {  2,  3,241,  0,  0,  0},   // 4338
+    {  0,  0,  0,  0,  0,  0},   // 4339
+    {  2,  5,  7, 31,  0,  0},   // 4340
+    {  3,1447,  0,  0,  0,  0},   // 4341
+    {  2, 13,167,  0,  0,  0},   // 4342
+    { 43,101,  0,  0,  0,  0},   // 4343
+    {  2,  3,181,  0,  0,  0},   // 4344
+    {  5, 11, 79,  0,  0,  0},   // 4345
+    {  2, 41, 53,  0,  0,  0},   // 4346
+    {  3,  7, 23,  0,  0,  0},   // 4347
+    {  2,1087,  0,  0,  0,  0},   // 4348
+    {  0,  0,  0,  0,  0,  0},   // 4349
+    {  2,  3,  5, 29,  0,  0},   // 4350
+    { 19,229,  0,  0,  0,  0},   // 4351
+    {  2, 17,  0,  0,  0,  0},   // 4352
+    {  3,1451,  0,  0,  0,  0},   // 4353
+    {  2,  7,311,  0,  0,  0},   // 4354
+    {  5, 13, 67,  0,  0,  0},   // 4355
+    {  2,  3, 11,  0,  0,  0},   // 4356
+    {  0,  0,  0,  0,  0,  0},   // 4357
+    {  2,2179,  0,  0,  0,  0},   // 4358
+    {  3,1453,  0,  0,  0,  0},   // 4359
+    {  2,  5,109,  0,  0,  0},   // 4360
+    {  7, 89,  0,  0,  0,  0},   // 4361
+    {  2,  3,727,  0,  0,  0},   // 4362
+    {  0,  0,  0,  0,  0,  0},   // 4363
+    {  2,1091,  0,  0,  0,  0},   // 4364
+    {  3,  5, 97,  0,  0,  0},   // 4365
+    {  2, 37, 59,  0,  0,  0},   // 4366
+    { 11,397,  0,  0,  0,  0},   // 4367
+    {  2,  3,  7, 13,  0,  0},   // 4368
+    { 17,257,  0,  0,  0,  0},   // 4369
+    {  2,  5, 19, 23,  0,  0},   // 4370
+    {  3, 31, 47,  0,  0,  0},   // 4371
+    {  2,1093,  0,  0,  0,  0},   // 4372
+    {  0,  0,  0,  0,  0,  0},   // 4373
+    {  2,  3,  0,  0,  0,  0},   // 4374
+    {  5,  7,  0,  0,  0,  0},   // 4375
+    {  2,547,  0,  0,  0,  0},   // 4376
+    {  3,1459,  0,  0,  0,  0},   // 4377
+    {  2, 11,199,  0,  0,  0},   // 4378
+    { 29,151,  0,  0,  0,  0},   // 4379
+    {  2,  3,  5, 73,  0,  0},   // 4380
+    { 13,337,  0,  0,  0,  0},   // 4381
+    {  2,  7,313,  0,  0,  0},   // 4382
+    {  3,487,  0,  0,  0,  0},   // 4383
+    {  2,137,  0,  0,  0,  0},   // 4384
+    {  5,877,  0,  0,  0,  0},   // 4385
+    {  2,  3, 17, 43,  0,  0},   // 4386
+    { 41,107,  0,  0,  0,  0},   // 4387
+    {  2,1097,  0,  0,  0,  0},   // 4388
+    {  3,  7, 11, 19,  0,  0},   // 4389
+    {  2,  5,439,  0,  0,  0},   // 4390
+    {  0,  0,  0,  0,  0,  0},   // 4391
+    {  2,  3, 61,  0,  0,  0},   // 4392
+    { 23,191,  0,  0,  0,  0},   // 4393
+    {  2, 13,  0,  0,  0,  0},   // 4394
+    {  3,  5,293,  0,  0,  0},   // 4395
+    {  2,  7,157,  0,  0,  0},   // 4396
+    {  0,  0,  0,  0,  0,  0},   // 4397
+    {  2,  3,733,  0,  0,  0},   // 4398
+    { 53, 83,  0,  0,  0,  0},   // 4399
+    {  2,  5, 11,  0,  0,  0},   // 4400
+    {  3,163,  0,  0,  0,  0},   // 4401
+    {  2, 31, 71,  0,  0,  0},   // 4402
+    {  7, 17, 37,  0,  0,  0},   // 4403
+    {  2,  3,367,  0,  0,  0},   // 4404
+    {  5,881,  0,  0,  0,  0},   // 4405
+    {  2,2203,  0,  0,  0,  0},   // 4406
+    {  3, 13,113,  0,  0,  0},   // 4407
+    {  2, 19, 29,  0,  0,  0},   // 4408
+    {  0,  0,  0,  0,  0,  0},   // 4409
+    {  2,  3,  5,  7,  0,  0},   // 4410
+    { 11,401,  0,  0,  0,  0},   // 4411
+    {  2,1103,  0,  0,  0,  0},   // 4412
+    {  3,1471,  0,  0,  0,  0},   // 4413
+    {  2,2207,  0,  0,  0,  0},   // 4414
+    {  5,883,  0,  0,  0,  0},   // 4415
+    {  2,  3, 23,  0,  0,  0},   // 4416
+    {  7,631,  0,  0,  0,  0},   // 4417
+    {  2, 47,  0,  0,  0,  0},   // 4418
+    {  3,491,  0,  0,  0,  0},   // 4419
+    {  2,  5, 13, 17,  0,  0},   // 4420
+    {  0,  0,  0,  0,  0,  0},   // 4421
+    {  2,  3, 11, 67,  0,  0},   // 4422
+    {  0,  0,  0,  0,  0,  0},   // 4423
+    {  2,  7, 79,  0,  0,  0},   // 4424
+    {  3,  5, 59,  0,  0,  0},   // 4425
+    {  2,2213,  0,  0,  0,  0},   // 4426
+    { 19,233,  0,  0,  0,  0},   // 4427
+    {  2,  3, 41,  0,  0,  0},   // 4428
+    { 43,103,  0,  0,  0,  0},   // 4429
+    {  2,  5,443,  0,  0,  0},   // 4430
+    {  3,  7,211,  0,  0,  0},   // 4431
+    {  2,277,  0,  0,  0,  0},   // 4432
+    { 11, 13, 31,  0,  0,  0},   // 4433
+    {  2,  3,739,  0,  0,  0},   // 4434
+    {  5,887,  0,  0,  0,  0},   // 4435
+    {  2,1109,  0,  0,  0,  0},   // 4436
+    {  3, 17, 29,  0,  0,  0},   // 4437
+    {  2,  7,317,  0,  0,  0},   // 4438
+    { 23,193,  0,  0,  0,  0},   // 4439
+    {  2,  3,  5, 37,  0,  0},   // 4440
+    {  0,  0,  0,  0,  0,  0},   // 4441
+    {  2,2221,  0,  0,  0,  0},   // 4442
+    {  3,1481,  0,  0,  0,  0},   // 4443
+    {  2, 11,101,  0,  0,  0},   // 4444
+    {  5,  7,127,  0,  0,  0},   // 4445
+    {  2,  3, 13, 19,  0,  0},   // 4446
+    {  0,  0,  0,  0,  0,  0},   // 4447
+    {  2,139,  0,  0,  0,  0},   // 4448
+    {  3,1483,  0,  0,  0,  0},   // 4449
+    {  2,  5, 89,  0,  0,  0},   // 4450
+    {  0,  0,  0,  0,  0,  0},   // 4451
+    {  2,  3,  7, 53,  0,  0},   // 4452
+    { 61, 73,  0,  0,  0,  0},   // 4453
+    {  2, 17,131,  0,  0,  0},   // 4454
+    {  3,  5, 11,  0,  0,  0},   // 4455
+    {  2,557,  0,  0,  0,  0},   // 4456
+    {  0,  0,  0,  0,  0,  0},   // 4457
+    {  2,  3,743,  0,  0,  0},   // 4458
+    {  7, 13,  0,  0,  0,  0},   // 4459
+    {  2,  5,223,  0,  0,  0},   // 4460
+    {  3,1487,  0,  0,  0,  0},   // 4461
+    {  2, 23, 97,  0,  0,  0},   // 4462
+    {  0,  0,  0,  0,  0,  0},   // 4463
+    {  2,  3, 31,  0,  0,  0},   // 4464
+    {  5, 19, 47,  0,  0,  0},   // 4465
+    {  2,  7, 11, 29,  0,  0},   // 4466
+    {  3,1489,  0,  0,  0,  0},   // 4467
+    {  2,1117,  0,  0,  0,  0},   // 4468
+    { 41,109,  0,  0,  0,  0},   // 4469
+    {  2,  3,  5,149,  0,  0},   // 4470
+    { 17,263,  0,  0,  0,  0},   // 4471
+    {  2, 13, 43,  0,  0,  0},   // 4472
+    {  3,  7, 71,  0,  0,  0},   // 4473
+    {  2,2237,  0,  0,  0,  0},   // 4474
+    {  5,179,  0,  0,  0,  0},   // 4475
+    {  2,  3,373,  0,  0,  0},   // 4476
+    { 11, 37,  0,  0,  0,  0},   // 4477
+    {  2,2239,  0,  0,  0,  0},   // 4478
+    {  3,1493,  0,  0,  0,  0},   // 4479
+    {  2,  5,  7,  0,  0,  0},   // 4480
+    {  0,  0,  0,  0,  0,  0},   // 4481
+    {  2,  3, 83,  0,  0,  0},   // 4482
+    {  0,  0,  0,  0,  0,  0},   // 4483
+    {  2, 19, 59,  0,  0,  0},   // 4484
+    {  3,  5, 13, 23,  0,  0},   // 4485
+    {  2,2243,  0,  0,  0,  0},   // 4486
+    {  7,641,  0,  0,  0,  0},   // 4487
+    {  2,  3, 11, 17,  0,  0},   // 4488
+    { 67,  0,  0,  0,  0,  0},   // 4489
+    {  2,  5,449,  0,  0,  0},   // 4490
+    {  3,499,  0,  0,  0,  0},   // 4491
+    {  2,1123,  0,  0,  0,  0},   // 4492
+    {  0,  0,  0,  0,  0,  0},   // 4493
+    {  2,  3,  7,107,  0,  0},   // 4494
+    {  5, 29, 31,  0,  0,  0},   // 4495
+    {  2,281,  0,  0,  0,  0},   // 4496
+    {  3,1499,  0,  0,  0,  0},   // 4497
+    {  2, 13,173,  0,  0,  0},   // 4498
+    { 11,409,  0,  0,  0,  0},   // 4499
+    {  2,  3,  5,  0,  0,  0},   // 4500
+    {  7,643,  0,  0,  0,  0},   // 4501
+    {  2,2251,  0,  0,  0,  0},   // 4502
+    {  3, 19, 79,  0,  0,  0},   // 4503
+    {  2,563,  0,  0,  0,  0},   // 4504
+    {  5, 17, 53,  0,  0,  0},   // 4505
+    {  2,  3,751,  0,  0,  0},   // 4506
+    {  0,  0,  0,  0,  0,  0},   // 4507
+    {  2,  7, 23,  0,  0,  0},   // 4508
+    {  3,167,  0,  0,  0,  0},   // 4509
+    {  2,  5, 11, 41,  0,  0},   // 4510
+    { 13,347,  0,  0,  0,  0},   // 4511
+    {  2,  3, 47,  0,  0,  0},   // 4512
+    {  0,  0,  0,  0,  0,  0},   // 4513
+    {  2, 37, 61,  0,  0,  0},   // 4514
+    {  3,  5,  7, 43,  0,  0},   // 4515
+    {  2,1129,  0,  0,  0,  0},   // 4516
+    {  0,  0,  0,  0,  0,  0},   // 4517
+    {  2,  3,251,  0,  0,  0},   // 4518
+    {  0,  0,  0,  0,  0,  0},   // 4519
+    {  2,  5,113,  0,  0,  0},   // 4520
+    {  3, 11,137,  0,  0,  0},   // 4521
+    {  2,  7, 17, 19,  0,  0},   // 4522
+    {  0,  0,  0,  0,  0,  0},   // 4523
+    {  2,  3, 13, 29,  0,  0},   // 4524
+    {  5,181,  0,  0,  0,  0},   // 4525
+    {  2, 31, 73,  0,  0,  0},   // 4526
+    {  3,503,  0,  0,  0,  0},   // 4527
+    {  2,283,  0,  0,  0,  0},   // 4528
+    {  7,647,  0,  0,  0,  0},   // 4529
+    {  2,  3,  5,151,  0,  0},   // 4530
+    { 23,197,  0,  0,  0,  0},   // 4531
+    {  2, 11,103,  0,  0,  0},   // 4532
+    {  3,1511,  0,  0,  0,  0},   // 4533
+    {  2,2267,  0,  0,  0,  0},   // 4534
+    {  5,907,  0,  0,  0,  0},   // 4535
+    {  2,  3,  7,  0,  0,  0},   // 4536
+    { 13,349,  0,  0,  0,  0},   // 4537
+    {  2,2269,  0,  0,  0,  0},   // 4538
+    {  3, 17, 89,  0,  0,  0},   // 4539
+    {  2,  5,227,  0,  0,  0},   // 4540
+    { 19,239,  0,  0,  0,  0},   // 4541
+    {  2,  3,757,  0,  0,  0},   // 4542
+    {  7, 11, 59,  0,  0,  0},   // 4543
+    {  2, 71,  0,  0,  0,  0},   // 4544
+    {  3,  5,101,  0,  0,  0},   // 4545
+    {  2,2273,  0,  0,  0,  0},   // 4546
+    {  0,  0,  0,  0,  0,  0},   // 4547
+    {  2,  3,379,  0,  0,  0},   // 4548
+    {  0,  0,  0,  0,  0,  0},   // 4549
+    {  2,  5,  7, 13,  0,  0},   // 4550
+    {  3, 37, 41,  0,  0,  0},   // 4551
+    {  2,569,  0,  0,  0,  0},   // 4552
+    { 29,157,  0,  0,  0,  0},   // 4553
+    {  2,  3, 11, 23,  0,  0},   // 4554
+    {  5,911,  0,  0,  0,  0},   // 4555
+    {  2, 17, 67,  0,  0,  0},   // 4556
+    {  3,  7, 31,  0,  0,  0},   // 4557
+    {  2, 43, 53,  0,  0,  0},   // 4558
+    { 47, 97,  0,  0,  0,  0},   // 4559
+    {  2,  3,  5, 19,  0,  0},   // 4560
+    {  0,  0,  0,  0,  0,  0},   // 4561
+    {  2,2281,  0,  0,  0,  0},   // 4562
+    {  3, 13,  0,  0,  0,  0},   // 4563
+    {  2,  7,163,  0,  0,  0},   // 4564
+    {  5, 11, 83,  0,  0,  0},   // 4565
+    {  2,  3,761,  0,  0,  0},   // 4566
+    {  0,  0,  0,  0,  0,  0},   // 4567
+    {  2,571,  0,  0,  0,  0},   // 4568
+    {  3,1523,  0,  0,  0,  0},   // 4569
+    {  2,  5,457,  0,  0,  0},   // 4570
+    {  7,653,  0,  0,  0,  0},   // 4571
+    {  2,  3,127,  0,  0,  0},   // 4572
+    { 17,269,  0,  0,  0,  0},   // 4573
+    {  2,2287,  0,  0,  0,  0},   // 4574
+    {  3,  5, 61,  0,  0,  0},   // 4575
+    {  2, 11, 13,  0,  0,  0},   // 4576
+    { 23,199,  0,  0,  0,  0},   // 4577
+    {  2,  3,  7,109,  0,  0},   // 4578
+    { 19,241,  0,  0,  0,  0},   // 4579
+    {  2,  5,229,  0,  0,  0},   // 4580
+    {  3,509,  0,  0,  0,  0},   // 4581
+    {  2, 29, 79,  0,  0,  0},   // 4582
+    {  0,  0,  0,  0,  0,  0},   // 4583
+    {  2,  3,191,  0,  0,  0},   // 4584
+    {  5,  7,131,  0,  0,  0},   // 4585
+    {  2,2293,  0,  0,  0,  0},   // 4586
+    {  3, 11,139,  0,  0,  0},   // 4587
+    {  2, 31, 37,  0,  0,  0},   // 4588
+    { 13,353,  0,  0,  0,  0},   // 4589
+    {  2,  3,  5, 17,  0,  0},   // 4590
+    {  0,  0,  0,  0,  0,  0},   // 4591
+    {  2,  7, 41,  0,  0,  0},   // 4592
+    {  3,1531,  0,  0,  0,  0},   // 4593
+    {  2,2297,  0,  0,  0,  0},   // 4594
+    {  5,919,  0,  0,  0,  0},   // 4595
+    {  2,  3,383,  0,  0,  0},   // 4596
+    {  0,  0,  0,  0,  0,  0},   // 4597
+    {  2, 11, 19,  0,  0,  0},   // 4598
+    {  3,  7, 73,  0,  0,  0},   // 4599
+    {  2,  5, 23,  0,  0,  0},   // 4600
+    { 43,107,  0,  0,  0,  0},   // 4601
+    {  2,  3, 13, 59,  0,  0},   // 4602
+    {  0,  0,  0,  0,  0,  0},   // 4603
+    {  2,1151,  0,  0,  0,  0},   // 4604
+    {  3,  5,307,  0,  0,  0},   // 4605
+    {  2,  7, 47,  0,  0,  0},   // 4606
+    { 17,271,  0,  0,  0,  0},   // 4607
+    {  2,  3,  0,  0,  0,  0},   // 4608
+    { 11,419,  0,  0,  0,  0},   // 4609
+    {  2,  5,461,  0,  0,  0},   // 4610
+    {  3, 29, 53,  0,  0,  0},   // 4611
+    {  2,1153,  0,  0,  0,  0},   // 4612
+    {  7,659,  0,  0,  0,  0},   // 4613
+    {  2,  3,769,  0,  0,  0},   // 4614
+    {  5, 13, 71,  0,  0,  0},   // 4615
+    {  2,577,  0,  0,  0,  0},   // 4616
+    {  3, 19,  0,  0,  0,  0},   // 4617
+    {  2,2309,  0,  0,  0,  0},   // 4618
+    { 31,149,  0,  0,  0,  0},   // 4619
+    {  2,  3,  5,  7, 11,  0},   // 4620
+    {  0,  0,  0,  0,  0,  0},   // 4621
+    {  2,2311,  0,  0,  0,  0},   // 4622
+    {  3, 23, 67,  0,  0,  0},   // 4623
+    {  2, 17,  0,  0,  0,  0},   // 4624
+    {  5, 37,  0,  0,  0,  0},   // 4625
+    {  2,  3,257,  0,  0,  0},   // 4626
+    {  7,661,  0,  0,  0,  0},   // 4627
+    {  2, 13, 89,  0,  0,  0},   // 4628
+    {  3,1543,  0,  0,  0,  0},   // 4629
+    {  2,  5,463,  0,  0,  0},   // 4630
+    { 11,421,  0,  0,  0,  0},   // 4631
+    {  2,  3,193,  0,  0,  0},   // 4632
+    { 41,113,  0,  0,  0,  0},   // 4633
+    {  2,  7,331,  0,  0,  0},   // 4634
+    {  3,  5,103,  0,  0,  0},   // 4635
+    {  2, 19, 61,  0,  0,  0},   // 4636
+    {  0,  0,  0,  0,  0,  0},   // 4637
+    {  2,  3,773,  0,  0,  0},   // 4638
+    {  0,  0,  0,  0,  0,  0},   // 4639
+    {  2,  5, 29,  0,  0,  0},   // 4640
+    {  3,  7, 13, 17,  0,  0},   // 4641
+    {  2, 11,211,  0,  0,  0},   // 4642
+    {  0,  0,  0,  0,  0,  0},   // 4643
+    {  2,  3, 43,  0,  0,  0},   // 4644
+    {  5,929,  0,  0,  0,  0},   // 4645
+    {  2, 23,101,  0,  0,  0},   // 4646
+    {  3,1549,  0,  0,  0,  0},   // 4647
+    {  2,  7, 83,  0,  0,  0},   // 4648
+    {  0,  0,  0,  0,  0,  0},   // 4649
+    {  2,  3,  5, 31,  0,  0},   // 4650
+    {  0,  0,  0,  0,  0,  0},   // 4651
+    {  2,1163,  0,  0,  0,  0},   // 4652
+    {  3, 11, 47,  0,  0,  0},   // 4653
+    {  2, 13,179,  0,  0,  0},   // 4654
+    {  5,  7, 19,  0,  0,  0},   // 4655
+    {  2,  3, 97,  0,  0,  0},   // 4656
+    {  0,  0,  0,  0,  0,  0},   // 4657
+    {  2, 17,137,  0,  0,  0},   // 4658
+    {  3,1553,  0,  0,  0,  0},   // 4659
+    {  2,  5,233,  0,  0,  0},   // 4660
+    { 59, 79,  0,  0,  0,  0},   // 4661
+    {  2,  3,  7, 37,  0,  0},   // 4662
+    {  0,  0,  0,  0,  0,  0},   // 4663
+    {  2, 11, 53,  0,  0,  0},   // 4664
+    {  3,  5,311,  0,  0,  0},   // 4665
+    {  2,2333,  0,  0,  0,  0},   // 4666
+    { 13,359,  0,  0,  0,  0},   // 4667
+    {  2,  3,389,  0,  0,  0},   // 4668
+    {  7, 23, 29,  0,  0,  0},   // 4669
+    {  2,  5,467,  0,  0,  0},   // 4670
+    {  3,173,  0,  0,  0,  0},   // 4671
+    {  2, 73,  0,  0,  0,  0},   // 4672
+    {  0,  0,  0,  0,  0,  0},   // 4673
+    {  2,  3, 19, 41,  0,  0},   // 4674
+    {  5, 11, 17,  0,  0,  0},   // 4675
+    {  2,  7,167,  0,  0,  0},   // 4676
+    {  3,1559,  0,  0,  0,  0},   // 4677
+    {  2,2339,  0,  0,  0,  0},   // 4678
+    {  0,  0,  0,  0,  0,  0},   // 4679
+    {  2,  3,  5, 13,  0,  0},   // 4680
+    { 31,151,  0,  0,  0,  0},   // 4681
+    {  2,2341,  0,  0,  0,  0},   // 4682
+    {  3,  7,223,  0,  0,  0},   // 4683
+    {  2,1171,  0,  0,  0,  0},   // 4684
+    {  5,937,  0,  0,  0,  0},   // 4685
+    {  2,  3, 11, 71,  0,  0},   // 4686
+    { 43,109,  0,  0,  0,  0},   // 4687
+    {  2,293,  0,  0,  0,  0},   // 4688
+    {  3,521,  0,  0,  0,  0},   // 4689
+    {  2,  5,  7, 67,  0,  0},   // 4690
+    {  0,  0,  0,  0,  0,  0},   // 4691
+    {  2,  3, 17, 23,  0,  0},   // 4692
+    { 13, 19,  0,  0,  0,  0},   // 4693
+    {  2,2347,  0,  0,  0,  0},   // 4694
+    {  3,  5,313,  0,  0,  0},   // 4695
+    {  2,587,  0,  0,  0,  0},   // 4696
+    {  7, 11, 61,  0,  0,  0},   // 4697
+    {  2,  3, 29,  0,  0,  0},   // 4698
+    { 37,127,  0,  0,  0,  0},   // 4699
+    {  2,  5, 47,  0,  0,  0},   // 4700
+    {  3,1567,  0,  0,  0,  0},   // 4701
+    {  2,2351,  0,  0,  0,  0},   // 4702
+    {  0,  0,  0,  0,  0,  0},   // 4703
+    {  2,  3,  7,  0,  0,  0},   // 4704
+    {  5,941,  0,  0,  0,  0},   // 4705
+    {  2, 13,181,  0,  0,  0},   // 4706
+    {  3,523,  0,  0,  0,  0},   // 4707
+    {  2, 11,107,  0,  0,  0},   // 4708
+    { 17,277,  0,  0,  0,  0},   // 4709
+    {  2,  3,  5,157,  0,  0},   // 4710
+    {  7,673,  0,  0,  0,  0},   // 4711
+    {  2, 19, 31,  0,  0,  0},   // 4712
+    {  3,1571,  0,  0,  0,  0},   // 4713
+    {  2,2357,  0,  0,  0,  0},   // 4714
+    {  5, 23, 41,  0,  0,  0},   // 4715
+    {  2,  3,131,  0,  0,  0},   // 4716
+    { 53, 89,  0,  0,  0,  0},   // 4717
+    {  2,  7,337,  0,  0,  0},   // 4718
+    {  3, 11, 13,  0,  0,  0},   // 4719
+    {  2,  5, 59,  0,  0,  0},   // 4720
+    {  0,  0,  0,  0,  0,  0},   // 4721
+    {  2,  3,787,  0,  0,  0},   // 4722
+    {  0,  0,  0,  0,  0,  0},   // 4723
+    {  2,1181,  0,  0,  0,  0},   // 4724
+    {  3,  5,  7,  0,  0,  0},   // 4725
+    {  2, 17,139,  0,  0,  0},   // 4726
+    { 29,163,  0,  0,  0,  0},   // 4727
+    {  2,  3,197,  0,  0,  0},   // 4728
+    {  0,  0,  0,  0,  0,  0},   // 4729
+    {  2,  5, 11, 43,  0,  0},   // 4730
+    {  3, 19, 83,  0,  0,  0},   // 4731
+    {  2,  7, 13,  0,  0,  0},   // 4732
+    {  0,  0,  0,  0,  0,  0},   // 4733
+    {  2,  3,263,  0,  0,  0},   // 4734
+    {  5,947,  0,  0,  0,  0},   // 4735
+    {  2, 37,  0,  0,  0,  0},   // 4736
+    {  3,1579,  0,  0,  0,  0},   // 4737
+    {  2, 23,103,  0,  0,  0},   // 4738
+    {  7,677,  0,  0,  0,  0},   // 4739
+    {  2,  3,  5, 79,  0,  0},   // 4740
+    { 11,431,  0,  0,  0,  0},   // 4741
+    {  2,2371,  0,  0,  0,  0},   // 4742
+    {  3, 17, 31,  0,  0,  0},   // 4743
+    {  2,593,  0,  0,  0,  0},   // 4744
+    {  5, 13, 73,  0,  0,  0},   // 4745
+    {  2,  3,  7,113,  0,  0},   // 4746
+    { 47,101,  0,  0,  0,  0},   // 4747
+    {  2,1187,  0,  0,  0,  0},   // 4748
+    {  3,1583,  0,  0,  0,  0},   // 4749
+    {  2,  5, 19,  0,  0,  0},   // 4750
+    {  0,  0,  0,  0,  0,  0},   // 4751
+    {  2,  3, 11,  0,  0,  0},   // 4752
+    {  7, 97,  0,  0,  0,  0},   // 4753
+    {  2,2377,  0,  0,  0,  0},   // 4754
+    {  3,  5,317,  0,  0,  0},   // 4755
+    {  2, 29, 41,  0,  0,  0},   // 4756
+    { 67, 71,  0,  0,  0,  0},   // 4757
+    {  2,  3, 13, 61,  0,  0},   // 4758
+    {  0,  0,  0,  0,  0,  0},   // 4759
+    {  2,  5,  7, 17,  0,  0},   // 4760
+    {  3, 23,  0,  0,  0,  0},   // 4761
+    {  2,2381,  0,  0,  0,  0},   // 4762
+    { 11,433,  0,  0,  0,  0},   // 4763
+    {  2,  3,397,  0,  0,  0},   // 4764
+    {  5,953,  0,  0,  0,  0},   // 4765
+    {  2,2383,  0,  0,  0,  0},   // 4766
+    {  3,  7,227,  0,  0,  0},   // 4767
+    {  2,149,  0,  0,  0,  0},   // 4768
+    { 19,251,  0,  0,  0,  0},   // 4769
+    {  2,  3,  5, 53,  0,  0},   // 4770
+    { 13,367,  0,  0,  0,  0},   // 4771
+    {  2,1193,  0,  0,  0,  0},   // 4772
+    {  3, 37, 43,  0,  0,  0},   // 4773
+    {  2,  7, 11, 31,  0,  0},   // 4774
+    {  5,191,  0,  0,  0,  0},   // 4775
+    {  2,  3,199,  0,  0,  0},   // 4776
+    { 17,281,  0,  0,  0,  0},   // 4777
+    {  2,2389,  0,  0,  0,  0},   // 4778
+    {  3, 59,  0,  0,  0,  0},   // 4779
+    {  2,  5,239,  0,  0,  0},   // 4780
+    {  7,683,  0,  0,  0,  0},   // 4781
+    {  2,  3,797,  0,  0,  0},   // 4782
+    {  0,  0,  0,  0,  0,  0},   // 4783
+    {  2, 13, 23,  0,  0,  0},   // 4784
+    {  3,  5, 11, 29,  0,  0},   // 4785
+    {  2,2393,  0,  0,  0,  0},   // 4786
+    {  0,  0,  0,  0,  0,  0},   // 4787
+    {  2,  3,  7, 19,  0,  0},   // 4788
+    {  0,  0,  0,  0,  0,  0},   // 4789
+    {  2,  5,479,  0,  0,  0},   // 4790
+    {  3,1597,  0,  0,  0,  0},   // 4791
+    {  2,599,  0,  0,  0,  0},   // 4792
+    {  0,  0,  0,  0,  0,  0},   // 4793
+    {  2,  3, 17, 47,  0,  0},   // 4794
+    {  5,  7,137,  0,  0,  0},   // 4795
+    {  2, 11,109,  0,  0,  0},   // 4796
+    {  3, 13, 41,  0,  0,  0},   // 4797
+    {  2,2399,  0,  0,  0,  0},   // 4798
+    {  0,  0,  0,  0,  0,  0},   // 4799
+    {  2,  3,  5,  0,  0,  0},   // 4800
+    {  0,  0,  0,  0,  0,  0},   // 4801
+    {  2,  7,  0,  0,  0,  0},   // 4802
+    {  3,1601,  0,  0,  0,  0},   // 4803
+    {  2,1201,  0,  0,  0,  0},   // 4804
+    {  5, 31,  0,  0,  0,  0},   // 4805
+    {  2,  3, 89,  0,  0,  0},   // 4806
+    { 11, 19, 23,  0,  0,  0},   // 4807
+    {  2,601,  0,  0,  0,  0},   // 4808
+    {  3,  7,229,  0,  0,  0},   // 4809
+    {  2,  5, 13, 37,  0,  0},   // 4810
+    { 17,283,  0,  0,  0,  0},   // 4811
+    {  2,  3,401,  0,  0,  0},   // 4812
+    {  0,  0,  0,  0,  0,  0},   // 4813
+    {  2, 29, 83,  0,  0,  0},   // 4814
+    {  3,  5,107,  0,  0,  0},   // 4815
+    {  2,  7, 43,  0,  0,  0},   // 4816
+    {  0,  0,  0,  0,  0,  0},   // 4817
+    {  2,  3, 11, 73,  0,  0},   // 4818
+    { 61, 79,  0,  0,  0,  0},   // 4819
+    {  2,  5,241,  0,  0,  0},   // 4820
+    {  3,1607,  0,  0,  0,  0},   // 4821
+    {  2,2411,  0,  0,  0,  0},   // 4822
+    {  7, 13, 53,  0,  0,  0},   // 4823
+    {  2,  3, 67,  0,  0,  0},   // 4824
+    {  5,193,  0,  0,  0,  0},   // 4825
+    {  2, 19,127,  0,  0,  0},   // 4826
+    {  3,1609,  0,  0,  0,  0},   // 4827
+    {  2, 17, 71,  0,  0,  0},   // 4828
+    { 11,439,  0,  0,  0,  0},   // 4829
+    {  2,  3,  5,  7, 23,  0},   // 4830
+    {  0,  0,  0,  0,  0,  0},   // 4831
+    {  2,151,  0,  0,  0,  0},   // 4832
+    {  3,179,  0,  0,  0,  0},   // 4833
+    {  2,2417,  0,  0,  0,  0},   // 4834
+    {  5,967,  0,  0,  0,  0},   // 4835
+    {  2,  3, 13, 31,  0,  0},   // 4836
+    {  7,691,  0,  0,  0,  0},   // 4837
+    {  2, 41, 59,  0,  0,  0},   // 4838
+    {  3,1613,  0,  0,  0,  0},   // 4839
+    {  2,  5, 11,  0,  0,  0},   // 4840
+    { 47,103,  0,  0,  0,  0},   // 4841
+    {  2,  3,269,  0,  0,  0},   // 4842
+    { 29,167,  0,  0,  0,  0},   // 4843
+    {  2,  7,173,  0,  0,  0},   // 4844
+    {  3,  5, 17, 19,  0,  0},   // 4845
+    {  2,2423,  0,  0,  0,  0},   // 4846
+    { 37,131,  0,  0,  0,  0},   // 4847
+    {  2,  3,101,  0,  0,  0},   // 4848
+    { 13,373,  0,  0,  0,  0},   // 4849
+    {  2,  5, 97,  0,  0,  0},   // 4850
+    {  3,  7, 11,  0,  0,  0},   // 4851
+    {  2,1213,  0,  0,  0,  0},   // 4852
+    { 23,211,  0,  0,  0,  0},   // 4853
+    {  2,  3,809,  0,  0,  0},   // 4854
+    {  5,971,  0,  0,  0,  0},   // 4855
+    {  2,607,  0,  0,  0,  0},   // 4856
+    {  3,1619,  0,  0,  0,  0},   // 4857
+    {  2,  7,347,  0,  0,  0},   // 4858
+    { 43,113,  0,  0,  0,  0},   // 4859
+    {  2,  3,  5,  0,  0,  0},   // 4860
+    {  0,  0,  0,  0,  0,  0},   // 4861
+    {  2, 11, 13, 17,  0,  0},   // 4862
+    {  3,1621,  0,  0,  0,  0},   // 4863
+    {  2, 19,  0,  0,  0,  0},   // 4864
+    {  5,  7,139,  0,  0,  0},   // 4865
+    {  2,  3,811,  0,  0,  0},   // 4866
+    { 31,157,  0,  0,  0,  0},   // 4867
+    {  2,1217,  0,  0,  0,  0},   // 4868
+    {  3,541,  0,  0,  0,  0},   // 4869
+    {  2,  5,487,  0,  0,  0},   // 4870
+    {  0,  0,  0,  0,  0,  0},   // 4871
+    {  2,  3,  7, 29,  0,  0},   // 4872
+    { 11,443,  0,  0,  0,  0},   // 4873
+    {  2,2437,  0,  0,  0,  0},   // 4874
+    {  3,  5, 13,  0,  0,  0},   // 4875
+    {  2, 23, 53,  0,  0,  0},   // 4876
+    {  0,  0,  0,  0,  0,  0},   // 4877
+    {  2,  3,271,  0,  0,  0},   // 4878
+    {  7, 17, 41,  0,  0,  0},   // 4879
+    {  2,  5, 61,  0,  0,  0},   // 4880
+    {  3,1627,  0,  0,  0,  0},   // 4881
+    {  2,2441,  0,  0,  0,  0},   // 4882
+    { 19,257,  0,  0,  0,  0},   // 4883
+    {  2,  3, 11, 37,  0,  0},   // 4884
+    {  5,977,  0,  0,  0,  0},   // 4885
+    {  2,  7,349,  0,  0,  0},   // 4886
+    {  3,181,  0,  0,  0,  0},   // 4887
+    {  2, 13, 47,  0,  0,  0},   // 4888
+    {  0,  0,  0,  0,  0,  0},   // 4889
+    {  2,  3,  5,163,  0,  0},   // 4890
+    { 67, 73,  0,  0,  0,  0},   // 4891
+    {  2,1223,  0,  0,  0,  0},   // 4892
+    {  3,  7,233,  0,  0,  0},   // 4893
+    {  2,2447,  0,  0,  0,  0},   // 4894
+    {  5, 11, 89,  0,  0,  0},   // 4895
+    {  2,  3, 17,  0,  0,  0},   // 4896
+    { 59, 83,  0,  0,  0,  0},   // 4897
+    {  2, 31, 79,  0,  0,  0},   // 4898
+    {  3, 23, 71,  0,  0,  0},   // 4899
+    {  2,  5,  7,  0,  0,  0},   // 4900
+    { 13, 29,  0,  0,  0,  0},   // 4901
+    {  2,  3, 19, 43,  0,  0},   // 4902
+    {  0,  0,  0,  0,  0,  0},   // 4903
+    {  2,613,  0,  0,  0,  0},   // 4904
+    {  3,  5,109,  0,  0,  0},   // 4905
+    {  2, 11,223,  0,  0,  0},   // 4906
+    {  7,701,  0,  0,  0,  0},   // 4907
+    {  2,  3,409,  0,  0,  0},   // 4908
+    {  0,  0,  0,  0,  0,  0},   // 4909
+    {  2,  5,491,  0,  0,  0},   // 4910
+    {  3,1637,  0,  0,  0,  0},   // 4911
+    {  2,307,  0,  0,  0,  0},   // 4912
+    { 17,  0,  0,  0,  0,  0},   // 4913
+    {  2,  3,  7, 13,  0,  0},   // 4914
+    {  5,983,  0,  0,  0,  0},   // 4915
+    {  2,1229,  0,  0,  0,  0},   // 4916
+    {  3, 11,149,  0,  0,  0},   // 4917
+    {  2,2459,  0,  0,  0,  0},   // 4918
+    {  0,  0,  0,  0,  0,  0},   // 4919
+    {  2,  3,  5, 41,  0,  0},   // 4920
+    {  7, 19, 37,  0,  0,  0},   // 4921
+    {  2, 23,107,  0,  0,  0},   // 4922
+    {  3,547,  0,  0,  0,  0},   // 4923
+    {  2,1231,  0,  0,  0,  0},   // 4924
+    {  5,197,  0,  0,  0,  0},   // 4925
+    {  2,  3,821,  0,  0,  0},   // 4926
+    { 13,379,  0,  0,  0,  0},   // 4927
+    {  2,  7, 11,  0,  0,  0},   // 4928
+    {  3, 31, 53,  0,  0,  0},   // 4929
+    {  2,  5, 17, 29,  0,  0},   // 4930
+    {  0,  0,  0,  0,  0,  0},   // 4931
+    {  2,  3,137,  0,  0,  0},   // 4932
+    {  0,  0,  0,  0,  0,  0},   // 4933
+    {  2,2467,  0,  0,  0,  0},   // 4934
+    {  3,  5,  7, 47,  0,  0},   // 4935
+    {  2,617,  0,  0,  0,  0},   // 4936
+    {  0,  0,  0,  0,  0,  0},   // 4937
+    {  2,  3,823,  0,  0,  0},   // 4938
+    { 11,449,  0,  0,  0,  0},   // 4939
+    {  2,  5, 13, 19,  0,  0},   // 4940
+    {  3, 61,  0,  0,  0,  0},   // 4941
+    {  2,  7,353,  0,  0,  0},   // 4942
+    {  0,  0,  0,  0,  0,  0},   // 4943
+    {  2,  3,103,  0,  0,  0},   // 4944
+    {  5, 23, 43,  0,  0,  0},   // 4945
+    {  2,2473,  0,  0,  0,  0},   // 4946
+    {  3, 17, 97,  0,  0,  0},   // 4947
+    {  2,1237,  0,  0,  0,  0},   // 4948
+    {  7,101,  0,  0,  0,  0},   // 4949
+    {  2,  3,  5, 11,  0,  0},   // 4950
+    {  0,  0,  0,  0,  0,  0},   // 4951
+    {  2,619,  0,  0,  0,  0},   // 4952
+    {  3, 13,127,  0,  0,  0},   // 4953
+    {  2,2477,  0,  0,  0,  0},   // 4954
+    {  5,991,  0,  0,  0,  0},   // 4955
+    {  2,  3,  7, 59,  0,  0},   // 4956
+    {  0,  0,  0,  0,  0,  0},   // 4957
+    {  2, 37, 67,  0,  0,  0},   // 4958
+    {  3, 19, 29,  0,  0,  0},   // 4959
+    {  2,  5, 31,  0,  0,  0},   // 4960
+    { 11, 41,  0,  0,  0,  0},   // 4961
+    {  2,  3,827,  0,  0,  0},   // 4962
+    {  7,709,  0,  0,  0,  0},   // 4963
+    {  2, 17, 73,  0,  0,  0},   // 4964
+    {  3,  5,331,  0,  0,  0},   // 4965
+    {  2, 13,191,  0,  0,  0},   // 4966
+    {  0,  0,  0,  0,  0,  0},   // 4967
+    {  2,  3, 23,  0,  0,  0},   // 4968
+    {  0,  0,  0,  0,  0,  0},   // 4969
+    {  2,  5,  7, 71,  0,  0},   // 4970
+    {  3,1657,  0,  0,  0,  0},   // 4971
+    {  2, 11,113,  0,  0,  0},   // 4972
+    {  0,  0,  0,  0,  0,  0},   // 4973
+    {  2,  3,829,  0,  0,  0},   // 4974
+    {  5,199,  0,  0,  0,  0},   // 4975
+    {  2,311,  0,  0,  0,  0},   // 4976
+    {  3,  7, 79,  0,  0,  0},   // 4977
+    {  2, 19,131,  0,  0,  0},   // 4978
+    { 13,383,  0,  0,  0,  0},   // 4979
+    {  2,  3,  5, 83,  0,  0},   // 4980
+    { 17,293,  0,  0,  0,  0},   // 4981
+    {  2, 47, 53,  0,  0,  0},   // 4982
+    {  3, 11,151,  0,  0,  0},   // 4983
+    {  2,  7, 89,  0,  0,  0},   // 4984
+    {  5,997,  0,  0,  0,  0},   // 4985
+    {  2,  3,277,  0,  0,  0},   // 4986
+    {  0,  0,  0,  0,  0,  0},   // 4987
+    {  2, 29, 43,  0,  0,  0},   // 4988
+    {  3,1663,  0,  0,  0,  0},   // 4989
+    {  2,  5,499,  0,  0,  0},   // 4990
+    {  7, 23, 31,  0,  0,  0},   // 4991
+    {  2,  3, 13,  0,  0,  0},   // 4992
+    {  0,  0,  0,  0,  0,  0},   // 4993
+    {  2, 11,227,  0,  0,  0},   // 4994
+    {  3,  5, 37,  0,  0,  0},   // 4995
+    {  2,1249,  0,  0,  0,  0},   // 4996
+    { 19,263,  0,  0,  0,  0},   // 4997
+    {  2,  3,  7, 17,  0,  0},   // 4998
+    {  0,  0,  0,  0,  0,  0},   // 4999
+    {  2,  5,  0,  0,  0,  0},   // 5000
+    {  3,1667,  0,  0,  0,  0},   // 5001
+    {  2, 41, 61,  0,  0,  0},   // 5002
+    {  0,  0,  0,  0,  0,  0},   // 5003
+    {  2,  3,139,  0,  0,  0},   // 5004
+    {  5,  7, 11, 13,  0,  0},   // 5005
+    {  2,2503,  0,  0,  0,  0},   // 5006
+    {  3,1669,  0,  0,  0,  0},   // 5007
+    {  2,313,  0,  0,  0,  0},   // 5008
+    {  0,  0,  0,  0,  0,  0},   // 5009
+    {  2,  3,  5,167,  0,  0},   // 5010
+    {  0,  0,  0,  0,  0,  0},   // 5011
+    {  2,  7,179,  0,  0,  0},   // 5012
+    {  3,557,  0,  0,  0,  0},   // 5013
+    {  2, 23,109,  0,  0,  0},   // 5014
+    {  5, 17, 59,  0,  0,  0},   // 5015
+    {  2,  3, 11, 19,  0,  0},   // 5016
+    { 29,173,  0,  0,  0,  0},   // 5017
+    {  2, 13,193,  0,  0,  0},   // 5018
+    {  3,  7,239,  0,  0,  0},   // 5019
+    {  2,  5,251,  0,  0,  0},   // 5020
+    {  0,  0,  0,  0,  0,  0},   // 5021
+    {  2,  3, 31,  0,  0,  0},   // 5022
+    {  0,  0,  0,  0,  0,  0},   // 5023
+    {  2,157,  0,  0,  0,  0},   // 5024
+    {  3,  5, 67,  0,  0,  0},   // 5025
+    {  2,  7,359,  0,  0,  0},   // 5026
+    { 11,457,  0,  0,  0,  0},   // 5027
+    {  2,  3,419,  0,  0,  0},   // 5028
+    { 47,107,  0,  0,  0,  0},   // 5029
+    {  2,  5,503,  0,  0,  0},   // 5030
+    {  3, 13, 43,  0,  0,  0},   // 5031
+    {  2, 17, 37,  0,  0,  0},   // 5032
+    {  7,719,  0,  0,  0,  0},   // 5033
+    {  2,  3,839,  0,  0,  0},   // 5034
+    {  5, 19, 53,  0,  0,  0},   // 5035
+    {  2,1259,  0,  0,  0,  0},   // 5036
+    {  3, 23, 73,  0,  0,  0},   // 5037
+    {  2, 11,229,  0,  0,  0},   // 5038
+    {  0,  0,  0,  0,  0,  0},   // 5039
+    {  2,  3,  5,  7,  0,  0},   // 5040
+    { 71,  0,  0,  0,  0,  0},   // 5041
+    {  2,2521,  0,  0,  0,  0},   // 5042
+    {  3, 41,  0,  0,  0,  0},   // 5043
+    {  2, 13, 97,  0,  0,  0},   // 5044
+    {  5,1009,  0,  0,  0,  0},   // 5045
+    {  2,  3, 29,  0,  0,  0},   // 5046
+    {  7,103,  0,  0,  0,  0},   // 5047
+    {  2,631,  0,  0,  0,  0},   // 5048
+    {  3, 11, 17,  0,  0,  0},   // 5049
+    {  2,  5,101,  0,  0,  0},   // 5050
+    {  0,  0,  0,  0,  0,  0},   // 5051
+    {  2,  3,421,  0,  0,  0},   // 5052
+    { 31,163,  0,  0,  0,  0},   // 5053
+    {  2,  7, 19,  0,  0,  0},   // 5054
+    {  3,  5,337,  0,  0,  0},   // 5055
+    {  2, 79,  0,  0,  0,  0},   // 5056
+    { 13,389,  0,  0,  0,  0},   // 5057
+    {  2,  3,281,  0,  0,  0},   // 5058
+    {  0,  0,  0,  0,  0,  0},   // 5059
+    {  2,  5, 11, 23,  0,  0},   // 5060
+    {  3,  7,241,  0,  0,  0},   // 5061
+    {  2,2531,  0,  0,  0,  0},   // 5062
+    { 61, 83,  0,  0,  0,  0},   // 5063
+    {  2,  3,211,  0,  0,  0},   // 5064
+    {  5,1013,  0,  0,  0,  0},   // 5065
+    {  2, 17,149,  0,  0,  0},   // 5066
+    {  3,563,  0,  0,  0,  0},   // 5067
+    {  2,  7,181,  0,  0,  0},   // 5068
+    { 37,137,  0,  0,  0,  0},   // 5069
+    {  2,  3,  5, 13,  0,  0},   // 5070
+    { 11,461,  0,  0,  0,  0},   // 5071
+    {  2,317,  0,  0,  0,  0},   // 5072
+    {  3, 19, 89,  0,  0,  0},   // 5073
+    {  2, 43, 59,  0,  0,  0},   // 5074
+    {  5,  7, 29,  0,  0,  0},   // 5075
+    {  2,  3, 47,  0,  0,  0},   // 5076
+    {  0,  0,  0,  0,  0,  0},   // 5077
+    {  2,2539,  0,  0,  0,  0},   // 5078
+    {  3,1693,  0,  0,  0,  0},   // 5079
+    {  2,  5,127,  0,  0,  0},   // 5080
+    {  0,  0,  0,  0,  0,  0},   // 5081
+    {  2,  3,  7, 11,  0,  0},   // 5082
+    { 13, 17, 23,  0,  0,  0},   // 5083
+    {  2, 31, 41,  0,  0,  0},   // 5084
+    {  3,  5,113,  0,  0,  0},   // 5085
+    {  2,2543,  0,  0,  0,  0},   // 5086
+    {  0,  0,  0,  0,  0,  0},   // 5087
+    {  2,  3, 53,  0,  0,  0},   // 5088
+    {  7,727,  0,  0,  0,  0},   // 5089
+    {  2,  5,509,  0,  0,  0},   // 5090
+    {  3,1697,  0,  0,  0,  0},   // 5091
+    {  2, 19, 67,  0,  0,  0},   // 5092
+    { 11,463,  0,  0,  0,  0},   // 5093
+    {  2,  3,283,  0,  0,  0},   // 5094
+    {  5,1019,  0,  0,  0,  0},   // 5095
+    {  2,  7, 13,  0,  0,  0},   // 5096
+    {  3,1699,  0,  0,  0,  0},   // 5097
+    {  2,2549,  0,  0,  0,  0},   // 5098
+    {  0,  0,  0,  0,  0,  0},   // 5099
+    {  2,  3,  5, 17,  0,  0},   // 5100
+    {  0,  0,  0,  0,  0,  0},   // 5101
+    {  2,2551,  0,  0,  0,  0},   // 5102
+    {  3,  7,  0,  0,  0,  0},   // 5103
+    {  2, 11, 29,  0,  0,  0},   // 5104
+    {  5,1021,  0,  0,  0,  0},   // 5105
+    {  2,  3, 23, 37,  0,  0},   // 5106
+    {  0,  0,  0,  0,  0,  0},   // 5107
+    {  2,1277,  0,  0,  0,  0},   // 5108
+    {  3, 13,131,  0,  0,  0},   // 5109
+    {  2,  5,  7, 73,  0,  0},   // 5110
+    { 19,269,  0,  0,  0,  0},   // 5111
+    {  2,  3, 71,  0,  0,  0},   // 5112
+    {  0,  0,  0,  0,  0,  0},   // 5113
+    {  2,2557,  0,  0,  0,  0},   // 5114
+    {  3,  5, 11, 31,  0,  0},   // 5115
+    {  2,1279,  0,  0,  0,  0},   // 5116
+    {  7, 17, 43,  0,  0,  0},   // 5117
+    {  2,  3,853,  0,  0,  0},   // 5118
+    {  0,  0,  0,  0,  0,  0},   // 5119
+    {  2,  5,  0,  0,  0,  0},   // 5120
+    {  3,569,  0,  0,  0,  0},   // 5121
+    {  2, 13,197,  0,  0,  0},   // 5122
+    { 47,109,  0,  0,  0,  0},   // 5123
+    {  2,  3,  7, 61,  0,  0},   // 5124
+    {  5, 41,  0,  0,  0,  0},   // 5125
+    {  2, 11,233,  0,  0,  0},   // 5126
+    {  3,1709,  0,  0,  0,  0},   // 5127
+    {  2,641,  0,  0,  0,  0},   // 5128
+    { 23,223,  0,  0,  0,  0},   // 5129
+    {  2,  3,  5, 19,  0,  0},   // 5130
+    {  7,733,  0,  0,  0,  0},   // 5131
+    {  2,1283,  0,  0,  0,  0},   // 5132
+    {  3, 29, 59,  0,  0,  0},   // 5133
+    {  2, 17,151,  0,  0,  0},   // 5134
+    {  5, 13, 79,  0,  0,  0},   // 5135
+    {  2,  3,107,  0,  0,  0},   // 5136
+    { 11,467,  0,  0,  0,  0},   // 5137
+    {  2,  7,367,  0,  0,  0},   // 5138
+    {  3,571,  0,  0,  0,  0},   // 5139
+    {  2,  5,257,  0,  0,  0},   // 5140
+    { 53, 97,  0,  0,  0,  0},   // 5141
+    {  2,  3,857,  0,  0,  0},   // 5142
+    { 37,139,  0,  0,  0,  0},   // 5143
+    {  2,643,  0,  0,  0,  0},   // 5144
+    {  3,  5,  7,  0,  0,  0},   // 5145
+    {  2, 31, 83,  0,  0,  0},   // 5146
+    {  0,  0,  0,  0,  0,  0},   // 5147
+    {  2,  3, 11, 13,  0,  0},   // 5148
+    { 19,271,  0,  0,  0,  0},   // 5149
+    {  2,  5,103,  0,  0,  0},   // 5150
+    {  3, 17,101,  0,  0,  0},   // 5151
+    {  2,  7, 23,  0,  0,  0},   // 5152
+    {  0,  0,  0,  0,  0,  0},   // 5153
+    {  2,  3,859,  0,  0,  0},   // 5154
+    {  5,1031,  0,  0,  0,  0},   // 5155
+    {  2,1289,  0,  0,  0,  0},   // 5156
+    {  3,191,  0,  0,  0,  0},   // 5157
+    {  2,2579,  0,  0,  0,  0},   // 5158
+    {  7, 11, 67,  0,  0,  0},   // 5159
+    {  2,  3,  5, 43,  0,  0},   // 5160
+    { 13,397,  0,  0,  0,  0},   // 5161
+    {  2, 29, 89,  0,  0,  0},   // 5162
+    {  3,1721,  0,  0,  0,  0},   // 5163
+    {  2,1291,  0,  0,  0,  0},   // 5164
+    {  5,1033,  0,  0,  0,  0},   // 5165
+    {  2,  3,  7, 41,  0,  0},   // 5166
+    {  0,  0,  0,  0,  0,  0},   // 5167
+    {  2, 17, 19,  0,  0,  0},   // 5168
+    {  3,1723,  0,  0,  0,  0},   // 5169
+    {  2,  5, 11, 47,  0,  0},   // 5170
+    {  0,  0,  0,  0,  0,  0},   // 5171
+    {  2,  3,431,  0,  0,  0},   // 5172
+    {  7,739,  0,  0,  0,  0},   // 5173
+    {  2, 13,199,  0,  0,  0},   // 5174
+    {  3,  5, 23,  0,  0,  0},   // 5175
+    {  2,647,  0,  0,  0,  0},   // 5176
+    { 31,167,  0,  0,  0,  0},   // 5177
+    {  2,  3,863,  0,  0,  0},   // 5178
+    {  0,  0,  0,  0,  0,  0},   // 5179
+    {  2,  5,  7, 37,  0,  0},   // 5180
+    {  3, 11,157,  0,  0,  0},   // 5181
+    {  2,2591,  0,  0,  0,  0},   // 5182
+    { 71, 73,  0,  0,  0,  0},   // 5183
+    {  2,  3,  0,  0,  0,  0},   // 5184
+    {  5, 17, 61,  0,  0,  0},   // 5185
+    {  2,2593,  0,  0,  0,  0},   // 5186
+    {  3,  7, 13, 19,  0,  0},   // 5187
+    {  2,1297,  0,  0,  0,  0},   // 5188
+    {  0,  0,  0,  0,  0,  0},   // 5189
+    {  2,  3,  5,173,  0,  0},   // 5190
+    { 29,179,  0,  0,  0,  0},   // 5191
+    {  2, 11, 59,  0,  0,  0},   // 5192
+    {  3,577,  0,  0,  0,  0},   // 5193
+    {  2,  7, 53,  0,  0,  0},   // 5194
+    {  5,1039,  0,  0,  0,  0},   // 5195
+    {  2,  3,433,  0,  0,  0},   // 5196
+    {  0,  0,  0,  0,  0,  0},   // 5197
+    {  2, 23,113,  0,  0,  0},   // 5198
+    {  3,1733,  0,  0,  0,  0},   // 5199
+    {  2,  5, 13,  0,  0,  0},   // 5200
+    {  7,743,  0,  0,  0,  0},   // 5201
+    {  2,  3, 17,  0,  0,  0},   // 5202
+    { 11, 43,  0,  0,  0,  0},   // 5203
+    {  2,1301,  0,  0,  0,  0},   // 5204
+    {  3,  5,347,  0,  0,  0},   // 5205
+    {  2, 19,137,  0,  0,  0},   // 5206
+    { 41,127,  0,  0,  0,  0},   // 5207
+    {  2,  3,  7, 31,  0,  0},   // 5208
+    {  0,  0,  0,  0,  0,  0},   // 5209
+    {  2,  5,521,  0,  0,  0},   // 5210
+    {  3,193,  0,  0,  0,  0},   // 5211
+    {  2,1303,  0,  0,  0,  0},   // 5212
+    { 13,401,  0,  0,  0,  0},   // 5213
+    {  2,  3, 11, 79,  0,  0},   // 5214
+    {  5,  7,149,  0,  0,  0},   // 5215
+    {  2,163,  0,  0,  0,  0},   // 5216
+    {  3, 37, 47,  0,  0,  0},   // 5217
+    {  2,2609,  0,  0,  0,  0},   // 5218
+    { 17,307,  0,  0,  0,  0},   // 5219
+    {  2,  3,  5, 29,  0,  0},   // 5220
+    { 23,227,  0,  0,  0,  0},   // 5221
+    {  2,  7,373,  0,  0,  0},   // 5222
+    {  3,1741,  0,  0,  0,  0},   // 5223
+    {  2,653,  0,  0,  0,  0},   // 5224
+    {  5, 11, 19,  0,  0,  0},   // 5225
+    {  2,  3, 13, 67,  0,  0},   // 5226
+    {  0,  0,  0,  0,  0,  0},   // 5227
+    {  2,1307,  0,  0,  0,  0},   // 5228
+    {  3,  7, 83,  0,  0,  0},   // 5229
+    {  2,  5,523,  0,  0,  0},   // 5230
+    {  0,  0,  0,  0,  0,  0},   // 5231
+    {  2,  3,109,  0,  0,  0},   // 5232
+    {  0,  0,  0,  0,  0,  0},   // 5233
+    {  2,2617,  0,  0,  0,  0},   // 5234
+    {  3,  5,349,  0,  0,  0},   // 5235
+    {  2,  7, 11, 17,  0,  0},   // 5236
+    {  0,  0,  0,  0,  0,  0},   // 5237
+    {  2,  3, 97,  0,  0,  0},   // 5238
+    { 13, 31,  0,  0,  0,  0},   // 5239
+    {  2,  5,131,  0,  0,  0},   // 5240
+    {  3,1747,  0,  0,  0,  0},   // 5241
+    {  2,2621,  0,  0,  0,  0},   // 5242
+    {  7,107,  0,  0,  0,  0},   // 5243
+    {  2,  3, 19, 23,  0,  0},   // 5244
+    {  5,1049,  0,  0,  0,  0},   // 5245
+    {  2, 43, 61,  0,  0,  0},   // 5246
+    {  3, 11, 53,  0,  0,  0},   // 5247
+    {  2, 41,  0,  0,  0,  0},   // 5248
+    { 29,181,  0,  0,  0,  0},   // 5249
+    {  2,  3,  5,  7,  0,  0},   // 5250
+    { 59, 89,  0,  0,  0,  0},   // 5251
+    {  2, 13,101,  0,  0,  0},   // 5252
+    {  3, 17,103,  0,  0,  0},   // 5253
+    {  2, 37, 71,  0,  0,  0},   // 5254
+    {  5,1051,  0,  0,  0,  0},   // 5255
+    {  2,  3, 73,  0,  0,  0},   // 5256
+    {  7,751,  0,  0,  0,  0},   // 5257
+    {  2, 11,239,  0,  0,  0},   // 5258
+    {  3,1753,  0,  0,  0,  0},   // 5259
+    {  2,  5,263,  0,  0,  0},   // 5260
+    {  0,  0,  0,  0,  0,  0},   // 5261
+    {  2,  3,877,  0,  0,  0},   // 5262
+    { 19,277,  0,  0,  0,  0},   // 5263
+    {  2,  7, 47,  0,  0,  0},   // 5264
+    {  3,  5, 13,  0,  0,  0},   // 5265
+    {  2,2633,  0,  0,  0,  0},   // 5266
+    { 23,229,  0,  0,  0,  0},   // 5267
+    {  2,  3,439,  0,  0,  0},   // 5268
+    { 11,479,  0,  0,  0,  0},   // 5269
+    {  2,  5, 17, 31,  0,  0},   // 5270
+    {  3,  7,251,  0,  0,  0},   // 5271
+    {  2,659,  0,  0,  0,  0},   // 5272
+    {  0,  0,  0,  0,  0,  0},   // 5273
+    {  2,  3,293,  0,  0,  0},   // 5274
+    {  5,211,  0,  0,  0,  0},   // 5275
+    {  2,1319,  0,  0,  0,  0},   // 5276
+    {  3,1759,  0,  0,  0,  0},   // 5277
+    {  2,  7, 13, 29,  0,  0},   // 5278
+    {  0,  0,  0,  0,  0,  0},   // 5279
+    {  2,  3,  5, 11,  0,  0},   // 5280
+    {  0,  0,  0,  0,  0,  0},   // 5281
+    {  2, 19,139,  0,  0,  0},   // 5282
+    {  3,587,  0,  0,  0,  0},   // 5283
+    {  2,1321,  0,  0,  0,  0},   // 5284
+    {  5,  7,151,  0,  0,  0},   // 5285
+    {  2,  3,881,  0,  0,  0},   // 5286
+    { 17,311,  0,  0,  0,  0},   // 5287
+    {  2,661,  0,  0,  0,  0},   // 5288
+    {  3, 41, 43,  0,  0,  0},   // 5289
+    {  2,  5, 23,  0,  0,  0},   // 5290
+    { 11, 13, 37,  0,  0,  0},   // 5291
+    {  2,  3,  7,  0,  0,  0},   // 5292
+    { 67, 79,  0,  0,  0,  0},   // 5293
+    {  2,2647,  0,  0,  0,  0},   // 5294
+    {  3,  5,353,  0,  0,  0},   // 5295
+    {  2,331,  0,  0,  0,  0},   // 5296
+    {  0,  0,  0,  0,  0,  0},   // 5297
+    {  2,  3,883,  0,  0,  0},   // 5298
+    {  7,757,  0,  0,  0,  0},   // 5299
+    {  2,  5, 53,  0,  0,  0},   // 5300
+    {  3, 19, 31,  0,  0,  0},   // 5301
+    {  2, 11,241,  0,  0,  0},   // 5302
+    {  0,  0,  0,  0,  0,  0},   // 5303
+    {  2,  3, 13, 17,  0,  0},   // 5304
+    {  5,1061,  0,  0,  0,  0},   // 5305
+    {  2,  7,379,  0,  0,  0},   // 5306
+    {  3, 29, 61,  0,  0,  0},   // 5307
+    {  2,1327,  0,  0,  0,  0},   // 5308
+    {  0,  0,  0,  0,  0,  0},   // 5309
+    {  2,  3,  5, 59,  0,  0},   // 5310
+    { 47,113,  0,  0,  0,  0},   // 5311
+    {  2, 83,  0,  0,  0,  0},   // 5312
+    {  3,  7, 11, 23,  0,  0},   // 5313
+    {  2,2657,  0,  0,  0,  0},   // 5314
+    {  5,1063,  0,  0,  0,  0},   // 5315
+    {  2,  3,443,  0,  0,  0},   // 5316
+    { 13,409,  0,  0,  0,  0},   // 5317
+    {  2,2659,  0,  0,  0,  0},   // 5318
+    {  3,197,  0,  0,  0,  0},   // 5319
+    {  2,  5,  7, 19,  0,  0},   // 5320
+    { 17,313,  0,  0,  0,  0},   // 5321
+    {  2,  3,887,  0,  0,  0},   // 5322
+    {  0,  0,  0,  0,  0,  0},   // 5323
+    {  2, 11,  0,  0,  0,  0},   // 5324
+    {  3,  5, 71,  0,  0,  0},   // 5325
+    {  2,2663,  0,  0,  0,  0},   // 5326
+    {  7,761,  0,  0,  0,  0},   // 5327
+    {  2,  3, 37,  0,  0,  0},   // 5328
+    { 73,  0,  0,  0,  0,  0},   // 5329
+    {  2,  5, 13, 41,  0,  0},   // 5330
+    {  3,1777,  0,  0,  0,  0},   // 5331
+    {  2, 31, 43,  0,  0,  0},   // 5332
+    {  0,  0,  0,  0,  0,  0},   // 5333
+    {  2,  3,  7,127,  0,  0},   // 5334
+    {  5, 11, 97,  0,  0,  0},   // 5335
+    {  2, 23, 29,  0,  0,  0},   // 5336
+    {  3,593,  0,  0,  0,  0},   // 5337
+    {  2, 17,157,  0,  0,  0},   // 5338
+    { 19,281,  0,  0,  0,  0},   // 5339
+    {  2,  3,  5, 89,  0,  0},   // 5340
+    {  7,109,  0,  0,  0,  0},   // 5341
+    {  2,2671,  0,  0,  0,  0},   // 5342
+    {  3, 13,137,  0,  0,  0},   // 5343
+    {  2,167,  0,  0,  0,  0},   // 5344
+    {  5,1069,  0,  0,  0,  0},   // 5345
+    {  2,  3, 11,  0,  0,  0},   // 5346
+    {  0,  0,  0,  0,  0,  0},   // 5347
+    {  2,  7,191,  0,  0,  0},   // 5348
+    {  3,1783,  0,  0,  0,  0},   // 5349
+    {  2,  5,107,  0,  0,  0},   // 5350
+    {  0,  0,  0,  0,  0,  0},   // 5351
+    {  2,  3,223,  0,  0,  0},   // 5352
+    { 53,101,  0,  0,  0,  0},   // 5353
+    {  2,2677,  0,  0,  0,  0},   // 5354
+    {  3,  5,  7, 17,  0,  0},   // 5355
+    {  2, 13,103,  0,  0,  0},   // 5356
+    { 11,487,  0,  0,  0,  0},   // 5357
+    {  2,  3, 19, 47,  0,  0},   // 5358
+    { 23,233,  0,  0,  0,  0},   // 5359
+    {  2,  5, 67,  0,  0,  0},   // 5360
+    {  3,1787,  0,  0,  0,  0},   // 5361
+    {  2,  7,383,  0,  0,  0},   // 5362
+    { 31,173,  0,  0,  0,  0},   // 5363
+    {  2,  3,149,  0,  0,  0},   // 5364
+    {  5, 29, 37,  0,  0,  0},   // 5365
+    {  2,2683,  0,  0,  0,  0},   // 5366
+    {  3,1789,  0,  0,  0,  0},   // 5367
+    {  2, 11, 61,  0,  0,  0},   // 5368
+    {  7, 13, 59,  0,  0,  0},   // 5369
+    {  2,  3,  5,179,  0,  0},   // 5370
+    { 41,131,  0,  0,  0,  0},   // 5371
+    {  2, 17, 79,  0,  0,  0},   // 5372
+    {  3,199,  0,  0,  0,  0},   // 5373
+    {  2,2687,  0,  0,  0,  0},   // 5374
+    {  5, 43,  0,  0,  0,  0},   // 5375
+    {  2,  3,  7,  0,  0,  0},   // 5376
+    { 19,283,  0,  0,  0,  0},   // 5377
+    {  2,2689,  0,  0,  0,  0},   // 5378
+    {  3, 11,163,  0,  0,  0},   // 5379
+    {  2,  5,269,  0,  0,  0},   // 5380
+    {  0,  0,  0,  0,  0,  0},   // 5381
+    {  2,  3, 13, 23,  0,  0},   // 5382
+    {  7,769,  0,  0,  0,  0},   // 5383
+    {  2,673,  0,  0,  0,  0},   // 5384
+    {  3,  5,359,  0,  0,  0},   // 5385
+    {  2,2693,  0,  0,  0,  0},   // 5386
+    {  0,  0,  0,  0,  0,  0},   // 5387
+    {  2,  3,449,  0,  0,  0},   // 5388
+    { 17,317,  0,  0,  0,  0},   // 5389
+    {  2,  5,  7, 11,  0,  0},   // 5390
+    {  3,599,  0,  0,  0,  0},   // 5391
+    {  2,337,  0,  0,  0,  0},   // 5392
+    {  0,  0,  0,  0,  0,  0},   // 5393
+    {  2,  3, 29, 31,  0,  0},   // 5394
+    {  5, 13, 83,  0,  0,  0},   // 5395
+    {  2, 19, 71,  0,  0,  0},   // 5396
+    {  3,  7,257,  0,  0,  0},   // 5397
+    {  2,2699,  0,  0,  0,  0},   // 5398
+    {  0,  0,  0,  0,  0,  0},   // 5399
+    {  2,  3,  5,  0,  0,  0},   // 5400
+    { 11,491,  0,  0,  0,  0},   // 5401
+    {  2, 37, 73,  0,  0,  0},   // 5402
+    {  3,1801,  0,  0,  0,  0},   // 5403
+    {  2,  7,193,  0,  0,  0},   // 5404
+    {  5, 23, 47,  0,  0,  0},   // 5405
+    {  2,  3, 17, 53,  0,  0},   // 5406
+    {  0,  0,  0,  0,  0,  0},   // 5407
+    {  2, 13,  0,  0,  0,  0},   // 5408
+    {  3,601,  0,  0,  0,  0},   // 5409
+    {  2,  5,541,  0,  0,  0},   // 5410
+    {  7,773,  0,  0,  0,  0},   // 5411
+    {  2,  3, 11, 41,  0,  0},   // 5412
+    {  0,  0,  0,  0,  0,  0},   // 5413
+    {  2,2707,  0,  0,  0,  0},   // 5414
+    {  3,  5, 19,  0,  0,  0},   // 5415
+    {  2,677,  0,  0,  0,  0},   // 5416
+    {  0,  0,  0,  0,  0,  0},   // 5417
+    {  2,  3,  7, 43,  0,  0},   // 5418
+    {  0,  0,  0,  0,  0,  0},   // 5419
+    {  2,  5,271,  0,  0,  0},   // 5420
+    {  3, 13,139,  0,  0,  0},   // 5421
+    {  2,2711,  0,  0,  0,  0},   // 5422
+    { 11, 17, 29,  0,  0,  0},   // 5423
+    {  2,  3,113,  0,  0,  0},   // 5424
+    {  5,  7, 31,  0,  0,  0},   // 5425
+    {  2,2713,  0,  0,  0,  0},   // 5426
+    {  3, 67,  0,  0,  0,  0},   // 5427
+    {  2, 23, 59,  0,  0,  0},   // 5428
+    { 61, 89,  0,  0,  0,  0},   // 5429
+    {  2,  3,  5,181,  0,  0},   // 5430
+    {  0,  0,  0,  0,  0,  0},   // 5431
+    {  2,  7, 97,  0,  0,  0},   // 5432
+    {  3,1811,  0,  0,  0,  0},   // 5433
+    {  2, 11, 13, 19,  0,  0},   // 5434
+    {  5,1087,  0,  0,  0,  0},   // 5435
+    {  2,  3,151,  0,  0,  0},   // 5436
+    {  0,  0,  0,  0,  0,  0},   // 5437
+    {  2,2719,  0,  0,  0,  0},   // 5438
+    {  3,  7, 37,  0,  0,  0},   // 5439
+    {  2,  5, 17,  0,  0,  0},   // 5440
+    {  0,  0,  0,  0,  0,  0},   // 5441
+    {  2,  3,907,  0,  0,  0},   // 5442
+    {  0,  0,  0,  0,  0,  0},   // 5443
+    {  2,1361,  0,  0,  0,  0},   // 5444
+    {  3,  5, 11,  0,  0,  0},   // 5445
+    {  2,  7,389,  0,  0,  0},   // 5446
+    { 13,419,  0,  0,  0,  0},   // 5447
+    {  2,  3,227,  0,  0,  0},   // 5448
+    {  0,  0,  0,  0,  0,  0},   // 5449
+    {  2,  5,109,  0,  0,  0},   // 5450
+    {  3, 23, 79,  0,  0,  0},   // 5451
+    {  2, 29, 47,  0,  0,  0},   // 5452
+    {  7, 19, 41,  0,  0,  0},   // 5453
+    {  2,  3,101,  0,  0,  0},   // 5454
+    {  5,1091,  0,  0,  0,  0},   // 5455
+    {  2, 11, 31,  0,  0,  0},   // 5456
+    {  3, 17,107,  0,  0,  0},   // 5457
+    {  2,2729,  0,  0,  0,  0},   // 5458
+    { 53,103,  0,  0,  0,  0},   // 5459
+    {  2,  3,  5,  7, 13,  0},   // 5460
+    { 43,127,  0,  0,  0,  0},   // 5461
+    {  2,2731,  0,  0,  0,  0},   // 5462
+    {  3,607,  0,  0,  0,  0},   // 5463
+    {  2,683,  0,  0,  0,  0},   // 5464
+    {  5,1093,  0,  0,  0,  0},   // 5465
+    {  2,  3,911,  0,  0,  0},   // 5466
+    {  7, 11, 71,  0,  0,  0},   // 5467
+    {  2,1367,  0,  0,  0,  0},   // 5468
+    {  3,1823,  0,  0,  0,  0},   // 5469
+    {  2,  5,547,  0,  0,  0},   // 5470
+    {  0,  0,  0,  0,  0,  0},   // 5471
+    {  2,  3, 19,  0,  0,  0},   // 5472
+    { 13,421,  0,  0,  0,  0},   // 5473
+    {  2,  7, 17, 23,  0,  0},   // 5474
+    {  3,  5, 73,  0,  0,  0},   // 5475
+    {  2, 37,  0,  0,  0,  0},   // 5476
+    {  0,  0,  0,  0,  0,  0},   // 5477
+    {  2,  3, 11, 83,  0,  0},   // 5478
+    {  0,  0,  0,  0,  0,  0},   // 5479
+    {  2,  5,137,  0,  0,  0},   // 5480
+    {  3,  7, 29,  0,  0,  0},   // 5481
+    {  2,2741,  0,  0,  0,  0},   // 5482
+    {  0,  0,  0,  0,  0,  0},   // 5483
+    {  2,  3,457,  0,  0,  0},   // 5484
+    {  5,1097,  0,  0,  0,  0},   // 5485
+    {  2, 13,211,  0,  0,  0},   // 5486
+    {  3, 31, 59,  0,  0,  0},   // 5487
+    {  2,  7,  0,  0,  0,  0},   // 5488
+    { 11,499,  0,  0,  0,  0},   // 5489
+    {  2,  3,  5, 61,  0,  0},   // 5490
+    { 17, 19,  0,  0,  0,  0},   // 5491
+    {  2,1373,  0,  0,  0,  0},   // 5492
+    {  3,1831,  0,  0,  0,  0},   // 5493
+    {  2, 41, 67,  0,  0,  0},   // 5494
+    {  5,  7,157,  0,  0,  0},   // 5495
+    {  2,  3,229,  0,  0,  0},   // 5496
+    { 23,239,  0,  0,  0,  0},   // 5497
+    {  2,2749,  0,  0,  0,  0},   // 5498
+    {  3, 13, 47,  0,  0,  0},   // 5499
+    {  2,  5, 11,  0,  0,  0},   // 5500
+    {  0,  0,  0,  0,  0,  0},   // 5501
+    {  2,  3,  7,131,  0,  0},   // 5502
+    {  0,  0,  0,  0,  0,  0},   // 5503
+    {  2, 43,  0,  0,  0,  0},   // 5504
+    {  3,  5,367,  0,  0,  0},   // 5505
+    {  2,2753,  0,  0,  0,  0},   // 5506
+    {  0,  0,  0,  0,  0,  0},   // 5507
+    {  2,  3, 17,  0,  0,  0},   // 5508
+    {  7,787,  0,  0,  0,  0},   // 5509
+    {  2,  5, 19, 29,  0,  0},   // 5510
+    {  3, 11,167,  0,  0,  0},   // 5511
+    {  2, 13, 53,  0,  0,  0},   // 5512
+    { 37,149,  0,  0,  0,  0},   // 5513
+    {  2,  3,919,  0,  0,  0},   // 5514
+    {  5,1103,  0,  0,  0,  0},   // 5515
+    {  2,  7,197,  0,  0,  0},   // 5516
+    {  3,613,  0,  0,  0,  0},   // 5517
+    {  2, 31, 89,  0,  0,  0},   // 5518
+    {  0,  0,  0,  0,  0,  0},   // 5519
+    {  2,  3,  5, 23,  0,  0},   // 5520
+    {  0,  0,  0,  0,  0,  0},   // 5521
+    {  2, 11,251,  0,  0,  0},   // 5522
+    {  3,  7,263,  0,  0,  0},   // 5523
+    {  2,1381,  0,  0,  0,  0},   // 5524
+    {  5, 13, 17,  0,  0,  0},   // 5525
+    {  2,  3,307,  0,  0,  0},   // 5526
+    {  0,  0,  0,  0,  0,  0},   // 5527
+    {  2,691,  0,  0,  0,  0},   // 5528
+    {  3, 19, 97,  0,  0,  0},   // 5529
+    {  2,  5,  7, 79,  0,  0},   // 5530
+    {  0,  0,  0,  0,  0,  0},   // 5531
+    {  2,  3,461,  0,  0,  0},   // 5532
+    { 11,503,  0,  0,  0,  0},   // 5533
+    {  2,2767,  0,  0,  0,  0},   // 5534
+    {  3,  5, 41,  0,  0,  0},   // 5535
+    {  2,173,  0,  0,  0,  0},   // 5536
+    {  7,113,  0,  0,  0,  0},   // 5537
+    {  2,  3, 13, 71,  0,  0},   // 5538
+    { 29,191,  0,  0,  0,  0},   // 5539
+    {  2,  5,277,  0,  0,  0},   // 5540
+    {  3,1847,  0,  0,  0,  0},   // 5541
+    {  2, 17,163,  0,  0,  0},   // 5542
+    { 23,241,  0,  0,  0,  0},   // 5543
+    {  2,  3,  7, 11,  0,  0},   // 5544
+    {  5,1109,  0,  0,  0,  0},   // 5545
+    {  2, 47, 59,  0,  0,  0},   // 5546
+    {  3, 43,  0,  0,  0,  0},   // 5547
+    {  2, 19, 73,  0,  0,  0},   // 5548
+    { 31,179,  0,  0,  0,  0},   // 5549
+    {  2,  3,  5, 37,  0,  0},   // 5550
+    {  7, 13, 61,  0,  0,  0},   // 5551
+    {  2,347,  0,  0,  0,  0},   // 5552
+    {  3,617,  0,  0,  0,  0},   // 5553
+    {  2,2777,  0,  0,  0,  0},   // 5554
+    {  5, 11,101,  0,  0,  0},   // 5555
+    {  2,  3,463,  0,  0,  0},   // 5556
+    {  0,  0,  0,  0,  0,  0},   // 5557
+    {  2,  7,397,  0,  0,  0},   // 5558
+    {  3, 17,109,  0,  0,  0},   // 5559
+    {  2,  5,139,  0,  0,  0},   // 5560
+    { 67, 83,  0,  0,  0,  0},   // 5561
+    {  2,  3,103,  0,  0,  0},   // 5562
+    {  0,  0,  0,  0,  0,  0},   // 5563
+    {  2, 13,107,  0,  0,  0},   // 5564
+    {  3,  5,  7, 53,  0,  0},   // 5565
+    {  2, 11, 23,  0,  0,  0},   // 5566
+    { 19,293,  0,  0,  0,  0},   // 5567
+    {  2,  3, 29,  0,  0,  0},   // 5568
+    {  0,  0,  0,  0,  0,  0},   // 5569
+    {  2,  5,557,  0,  0,  0},   // 5570
+    {  3,619,  0,  0,  0,  0},   // 5571
+    {  2,  7,199,  0,  0,  0},   // 5572
+    {  0,  0,  0,  0,  0,  0},   // 5573
+    {  2,  3,929,  0,  0,  0},   // 5574
+    {  5,223,  0,  0,  0,  0},   // 5575
+    {  2, 17, 41,  0,  0,  0},   // 5576
+    {  3, 11, 13,  0,  0,  0},   // 5577
+    {  2,2789,  0,  0,  0,  0},   // 5578
+    {  7,797,  0,  0,  0,  0},   // 5579
+    {  2,  3,  5, 31,  0,  0},   // 5580
+    {  0,  0,  0,  0,  0,  0},   // 5581
+    {  2,2791,  0,  0,  0,  0},   // 5582
+    {  3,1861,  0,  0,  0,  0},   // 5583
+    {  2,349,  0,  0,  0,  0},   // 5584
+    {  5,1117,  0,  0,  0,  0},   // 5585
+    {  2,  3,  7, 19,  0,  0},   // 5586
+    { 37,151,  0,  0,  0,  0},   // 5587
+    {  2, 11,127,  0,  0,  0},   // 5588
+    {  3, 23,  0,  0,  0,  0},   // 5589
+    {  2,  5, 13, 43,  0,  0},   // 5590
+    {  0,  0,  0,  0,  0,  0},   // 5591
+    {  2,  3,233,  0,  0,  0},   // 5592
+    {  7, 17, 47,  0,  0,  0},   // 5593
+    {  2,2797,  0,  0,  0,  0},   // 5594
+    {  3,  5,373,  0,  0,  0},   // 5595
+    {  2,1399,  0,  0,  0,  0},   // 5596
+    { 29,193,  0,  0,  0,  0},   // 5597
+    {  2,  3,311,  0,  0,  0},   // 5598
+    { 11,509,  0,  0,  0,  0},   // 5599
+    {  2,  5,  7,  0,  0,  0},   // 5600
+    {  3,1867,  0,  0,  0,  0},   // 5601
+    {  2,2801,  0,  0,  0,  0},   // 5602
+    { 13,431,  0,  0,  0,  0},   // 5603
+    {  2,  3,467,  0,  0,  0},   // 5604
+    {  5, 19, 59,  0,  0,  0},   // 5605
+    {  2,2803,  0,  0,  0,  0},   // 5606
+    {  3,  7, 89,  0,  0,  0},   // 5607
+    {  2,701,  0,  0,  0,  0},   // 5608
+    { 71, 79,  0,  0,  0,  0},   // 5609
+    {  2,  3,  5, 11, 17,  0},   // 5610
+    { 31,181,  0,  0,  0,  0},   // 5611
+    {  2, 23, 61,  0,  0,  0},   // 5612
+    {  3,1871,  0,  0,  0,  0},   // 5613
+    {  2,  7,401,  0,  0,  0},   // 5614
+    {  5,1123,  0,  0,  0,  0},   // 5615
+    {  2,  3, 13,  0,  0,  0},   // 5616
+    { 41,137,  0,  0,  0,  0},   // 5617
+    {  2, 53,  0,  0,  0,  0},   // 5618
+    {  3,1873,  0,  0,  0,  0},   // 5619
+    {  2,  5,281,  0,  0,  0},   // 5620
+    {  7, 11, 73,  0,  0,  0},   // 5621
+    {  2,  3,937,  0,  0,  0},   // 5622
+    {  0,  0,  0,  0,  0,  0},   // 5623
+    {  2, 19, 37,  0,  0,  0},   // 5624
+    {  3,  5,  0,  0,  0,  0},   // 5625
+    {  2, 29, 97,  0,  0,  0},   // 5626
+    { 17,331,  0,  0,  0,  0},   // 5627
+    {  2,  3,  7, 67,  0,  0},   // 5628
+    { 13,433,  0,  0,  0,  0},   // 5629
+    {  2,  5,563,  0,  0,  0},   // 5630
+    {  3,1877,  0,  0,  0,  0},   // 5631
+    {  2, 11,  0,  0,  0,  0},   // 5632
+    { 43,131,  0,  0,  0,  0},   // 5633
+    {  2,  3,313,  0,  0,  0},   // 5634
+    {  5,  7, 23,  0,  0,  0},   // 5635
+    {  2,1409,  0,  0,  0,  0},   // 5636
+    {  3,1879,  0,  0,  0,  0},   // 5637
+    {  2,2819,  0,  0,  0,  0},   // 5638
+    {  0,  0,  0,  0,  0,  0},   // 5639
+    {  2,  3,  5, 47,  0,  0},   // 5640
+    {  0,  0,  0,  0,  0,  0},   // 5641
+    {  2,  7, 13, 31,  0,  0},   // 5642
+    {  3, 11, 19,  0,  0,  0},   // 5643
+    {  2, 17, 83,  0,  0,  0},   // 5644
+    {  5,1129,  0,  0,  0,  0},   // 5645
+    {  2,  3,941,  0,  0,  0},   // 5646
+    {  0,  0,  0,  0,  0,  0},   // 5647
+    {  2,353,  0,  0,  0,  0},   // 5648
+    {  3,  7,269,  0,  0,  0},   // 5649
+    {  2,  5,113,  0,  0,  0},   // 5650
+    {  0,  0,  0,  0,  0,  0},   // 5651
+    {  2,  3,157,  0,  0,  0},   // 5652
+    {  0,  0,  0,  0,  0,  0},   // 5653
+    {  2, 11,257,  0,  0,  0},   // 5654
+    {  3,  5, 13, 29,  0,  0},   // 5655
+    {  2,  7,101,  0,  0,  0},   // 5656
+    {  0,  0,  0,  0,  0,  0},   // 5657
+    {  2,  3, 23, 41,  0,  0},   // 5658
+    {  0,  0,  0,  0,  0,  0},   // 5659
+    {  2,  5,283,  0,  0,  0},   // 5660
+    {  3, 17, 37,  0,  0,  0},   // 5661
+    {  2, 19,149,  0,  0,  0},   // 5662
+    {  7,809,  0,  0,  0,  0},   // 5663
+    {  2,  3, 59,  0,  0,  0},   // 5664
+    {  5, 11,103,  0,  0,  0},   // 5665
+    {  2,2833,  0,  0,  0,  0},   // 5666
+    {  3,1889,  0,  0,  0,  0},   // 5667
+    {  2, 13,109,  0,  0,  0},   // 5668
+    {  0,  0,  0,  0,  0,  0},   // 5669
+    {  2,  3,  5,  7,  0,  0},   // 5670
+    { 53,107,  0,  0,  0,  0},   // 5671
+    {  2,709,  0,  0,  0,  0},   // 5672
+    {  3, 31, 61,  0,  0,  0},   // 5673
+    {  2,2837,  0,  0,  0,  0},   // 5674
+    {  5,227,  0,  0,  0,  0},   // 5675
+    {  2,  3, 11, 43,  0,  0},   // 5676
+    {  7,811,  0,  0,  0,  0},   // 5677
+    {  2, 17,167,  0,  0,  0},   // 5678
+    {  3,631,  0,  0,  0,  0},   // 5679
+    {  2,  5, 71,  0,  0,  0},   // 5680
+    { 13, 19, 23,  0,  0,  0},   // 5681
+    {  2,  3,947,  0,  0,  0},   // 5682
+    {  0,  0,  0,  0,  0,  0},   // 5683
+    {  2,  7, 29,  0,  0,  0},   // 5684
+    {  3,  5,379,  0,  0,  0},   // 5685
+    {  2,2843,  0,  0,  0,  0},   // 5686
+    { 11, 47,  0,  0,  0,  0},   // 5687
+    {  2,  3, 79,  0,  0,  0},   // 5688
+    {  0,  0,  0,  0,  0,  0},   // 5689
+    {  2,  5,569,  0,  0,  0},   // 5690
+    {  3,  7,271,  0,  0,  0},   // 5691
+    {  2,1423,  0,  0,  0,  0},   // 5692
+    {  0,  0,  0,  0,  0,  0},   // 5693
+    {  2,  3, 13, 73,  0,  0},   // 5694
+    {  5, 17, 67,  0,  0,  0},   // 5695
+    {  2, 89,  0,  0,  0,  0},   // 5696
+    {  3,211,  0,  0,  0,  0},   // 5697
+    {  2,  7, 11, 37,  0,  0},   // 5698
+    { 41,139,  0,  0,  0,  0},   // 5699
+    {  2,  3,  5, 19,  0,  0},   // 5700
+    {  0,  0,  0,  0,  0,  0},   // 5701
+    {  2,2851,  0,  0,  0,  0},   // 5702
+    {  3,1901,  0,  0,  0,  0},   // 5703
+    {  2, 23, 31,  0,  0,  0},   // 5704
+    {  5,  7,163,  0,  0,  0},   // 5705
+    {  2,  3,317,  0,  0,  0},   // 5706
+    { 13,439,  0,  0,  0,  0},   // 5707
+    {  2,1427,  0,  0,  0,  0},   // 5708
+    {  3, 11,173,  0,  0,  0},   // 5709
+    {  2,  5,571,  0,  0,  0},   // 5710
+    {  0,  0,  0,  0,  0,  0},   // 5711
+    {  2,  3,  7, 17,  0,  0},   // 5712
+    { 29,197,  0,  0,  0,  0},   // 5713
+    {  2,2857,  0,  0,  0,  0},   // 5714
+    {  3,  5,127,  0,  0,  0},   // 5715
+    {  2,1429,  0,  0,  0,  0},   // 5716
+    {  0,  0,  0,  0,  0,  0},   // 5717
+    {  2,  3,953,  0,  0,  0},   // 5718
+    {  7, 19, 43,  0,  0,  0},   // 5719
+    {  2,  5, 11, 13,  0,  0},   // 5720
+    {  3,1907,  0,  0,  0,  0},   // 5721
+    {  2,2861,  0,  0,  0,  0},   // 5722
+    { 59, 97,  0,  0,  0,  0},   // 5723
+    {  2,  3, 53,  0,  0,  0},   // 5724
+    {  5,229,  0,  0,  0,  0},   // 5725
+    {  2,  7,409,  0,  0,  0},   // 5726
+    {  3, 23, 83,  0,  0,  0},   // 5727
+    {  2,179,  0,  0,  0,  0},   // 5728
+    { 17,337,  0,  0,  0,  0},   // 5729
+    {  2,  3,  5,191,  0,  0},   // 5730
+    { 11,521,  0,  0,  0,  0},   // 5731
+    {  2,1433,  0,  0,  0,  0},   // 5732
+    {  3,  7, 13,  0,  0,  0},   // 5733
+    {  2, 47, 61,  0,  0,  0},   // 5734
+    {  5, 31, 37,  0,  0,  0},   // 5735
+    {  2,  3,239,  0,  0,  0},   // 5736
+    {  0,  0,  0,  0,  0,  0},   // 5737
+    {  2, 19,151,  0,  0,  0},   // 5738
+    {  3,1913,  0,  0,  0,  0},   // 5739
+    {  2,  5,  7, 41,  0,  0},   // 5740
+    {  0,  0,  0,  0,  0,  0},   // 5741
+    {  2,  3, 11, 29,  0,  0},   // 5742
+    {  0,  0,  0,  0,  0,  0},   // 5743
+    {  2,359,  0,  0,  0,  0},   // 5744
+    {  3,  5,383,  0,  0,  0},   // 5745
+    {  2, 13, 17,  0,  0,  0},   // 5746
+    {  7,821,  0,  0,  0,  0},   // 5747
+    {  2,  3,479,  0,  0,  0},   // 5748
+    {  0,  0,  0,  0,  0,  0},   // 5749
+    {  2,  5, 23,  0,  0,  0},   // 5750
+    {  3, 71,  0,  0,  0,  0},   // 5751
+    {  2,719,  0,  0,  0,  0},   // 5752
+    { 11,523,  0,  0,  0,  0},   // 5753
+    {  2,  3,  7,137,  0,  0},   // 5754
+    {  5,1151,  0,  0,  0,  0},   // 5755
+    {  2,1439,  0,  0,  0,  0},   // 5756
+    {  3, 19,101,  0,  0,  0},   // 5757
+    {  2,2879,  0,  0,  0,  0},   // 5758
+    { 13,443,  0,  0,  0,  0},   // 5759
+    {  2,  3,  5,  0,  0,  0},   // 5760
+    {  7,823,  0,  0,  0,  0},   // 5761
+    {  2, 43, 67,  0,  0,  0},   // 5762
+    {  3, 17,113,  0,  0,  0},   // 5763
+    {  2, 11,131,  0,  0,  0},   // 5764
+    {  5,1153,  0,  0,  0,  0},   // 5765
+    {  2,  3, 31,  0,  0,  0},   // 5766
+    { 73, 79,  0,  0,  0,  0},   // 5767
+    {  2,  7,103,  0,  0,  0},   // 5768
+    {  3,641,  0,  0,  0,  0},   // 5769
+    {  2,  5,577,  0,  0,  0},   // 5770
+    { 29,199,  0,  0,  0,  0},   // 5771
+    {  2,  3, 13, 37,  0,  0},   // 5772
+    { 23,251,  0,  0,  0,  0},   // 5773
+    {  2,2887,  0,  0,  0,  0},   // 5774
+    {  3,  5,  7, 11,  0,  0},   // 5775
+    {  2, 19,  0,  0,  0,  0},   // 5776
+    { 53,109,  0,  0,  0,  0},   // 5777
+    {  2,  3,107,  0,  0,  0},   // 5778
+    {  0,  0,  0,  0,  0,  0},   // 5779
+    {  2,  5, 17,  0,  0,  0},   // 5780
+    {  3, 41, 47,  0,  0,  0},   // 5781
+    {  2,  7, 59,  0,  0,  0},   // 5782
+    {  0,  0,  0,  0,  0,  0},   // 5783
+    {  2,  3,241,  0,  0,  0},   // 5784
+    {  5, 13, 89,  0,  0,  0},   // 5785
+    {  2, 11,263,  0,  0,  0},   // 5786
+    {  3,643,  0,  0,  0,  0},   // 5787
+    {  2,1447,  0,  0,  0,  0},   // 5788
+    {  7,827,  0,  0,  0,  0},   // 5789
+    {  2,  3,  5,193,  0,  0},   // 5790
+    {  0,  0,  0,  0,  0,  0},   // 5791
+    {  2,181,  0,  0,  0,  0},   // 5792
+    {  3,1931,  0,  0,  0,  0},   // 5793
+    {  2,2897,  0,  0,  0,  0},   // 5794
+    {  5, 19, 61,  0,  0,  0},   // 5795
+    {  2,  3,  7, 23,  0,  0},   // 5796
+    { 11, 17, 31,  0,  0,  0},   // 5797
+    {  2, 13,223,  0,  0,  0},   // 5798
+    {  3,1933,  0,  0,  0,  0},   // 5799
+    {  2,  5, 29,  0,  0,  0},   // 5800
+    {  0,  0,  0,  0,  0,  0},   // 5801
+    {  2,  3,967,  0,  0,  0},   // 5802
+    {  7,829,  0,  0,  0,  0},   // 5803
+    {  2,1451,  0,  0,  0,  0},   // 5804
+    {  3,  5, 43,  0,  0,  0},   // 5805
+    {  2,2903,  0,  0,  0,  0},   // 5806
+    {  0,  0,  0,  0,  0,  0},   // 5807
+    {  2,  3, 11,  0,  0,  0},   // 5808
+    { 37,157,  0,  0,  0,  0},   // 5809
+    {  2,  5,  7, 83,  0,  0},   // 5810
+    {  3, 13,149,  0,  0,  0},   // 5811
+    {  2,1453,  0,  0,  0,  0},   // 5812
+    {  0,  0,  0,  0,  0,  0},   // 5813
+    {  2,  3, 17, 19,  0,  0},   // 5814
+    {  5,1163,  0,  0,  0,  0},   // 5815
+    {  2,727,  0,  0,  0,  0},   // 5816
+    {  3,  7,277,  0,  0,  0},   // 5817
+    {  2,2909,  0,  0,  0,  0},   // 5818
+    { 11, 23,  0,  0,  0,  0},   // 5819
+    {  2,  3,  5, 97,  0,  0},   // 5820
+    {  0,  0,  0,  0,  0,  0},   // 5821
+    {  2, 41, 71,  0,  0,  0},   // 5822
+    {  3,647,  0,  0,  0,  0},   // 5823
+    {  2,  7, 13,  0,  0,  0},   // 5824
+    {  5,233,  0,  0,  0,  0},   // 5825
+    {  2,  3,971,  0,  0,  0},   // 5826
+    {  0,  0,  0,  0,  0,  0},   // 5827
+    {  2, 31, 47,  0,  0,  0},   // 5828
+    {  3, 29, 67,  0,  0,  0},   // 5829
+    {  2,  5, 11, 53,  0,  0},   // 5830
+    {  7, 17,  0,  0,  0,  0},   // 5831
+    {  2,  3,  0,  0,  0,  0},   // 5832
+    { 19,307,  0,  0,  0,  0},   // 5833
+    {  2,2917,  0,  0,  0,  0},   // 5834
+    {  3,  5,389,  0,  0,  0},   // 5835
+    {  2,1459,  0,  0,  0,  0},   // 5836
+    { 13,449,  0,  0,  0,  0},   // 5837
+    {  2,  3,  7,139,  0,  0},   // 5838
+    {  0,  0,  0,  0,  0,  0},   // 5839
+    {  2,  5, 73,  0,  0,  0},   // 5840
+    {  3, 11, 59,  0,  0,  0},   // 5841
+    {  2, 23,127,  0,  0,  0},   // 5842
+    {  0,  0,  0,  0,  0,  0},   // 5843
+    {  2,  3,487,  0,  0,  0},   // 5844
+    {  5,  7,167,  0,  0,  0},   // 5845
+    {  2, 37, 79,  0,  0,  0},   // 5846
+    {  3,1949,  0,  0,  0,  0},   // 5847
+    {  2, 17, 43,  0,  0,  0},   // 5848
+    {  0,  0,  0,  0,  0,  0},   // 5849
+    {  2,  3,  5, 13,  0,  0},   // 5850
+    {  0,  0,  0,  0,  0,  0},   // 5851
+    {  2,  7, 11, 19,  0,  0},   // 5852
+    {  3,1951,  0,  0,  0,  0},   // 5853
+    {  2,2927,  0,  0,  0,  0},   // 5854
+    {  5,1171,  0,  0,  0,  0},   // 5855
+    {  2,  3, 61,  0,  0,  0},   // 5856
+    {  0,  0,  0,  0,  0,  0},   // 5857
+    {  2, 29,101,  0,  0,  0},   // 5858
+    {  3,  7, 31,  0,  0,  0},   // 5859
+    {  2,  5,293,  0,  0,  0},   // 5860
+    {  0,  0,  0,  0,  0,  0},   // 5861
+    {  2,  3,977,  0,  0,  0},   // 5862
+    { 11, 13, 41,  0,  0,  0},   // 5863
+    {  2,733,  0,  0,  0,  0},   // 5864
+    {  3,  5, 17, 23,  0,  0},   // 5865
+    {  2,  7,419,  0,  0,  0},   // 5866
+    {  0,  0,  0,  0,  0,  0},   // 5867
+    {  2,  3,163,  0,  0,  0},   // 5868
+    {  0,  0,  0,  0,  0,  0},   // 5869
+    {  2,  5,587,  0,  0,  0},   // 5870
+    {  3, 19,103,  0,  0,  0},   // 5871
+    {  2,367,  0,  0,  0,  0},   // 5872
+    {  7,839,  0,  0,  0,  0},   // 5873
+    {  2,  3, 11, 89,  0,  0},   // 5874
+    {  5, 47,  0,  0,  0,  0},   // 5875
+    {  2, 13,113,  0,  0,  0},   // 5876
+    {  3,653,  0,  0,  0,  0},   // 5877
+    {  2,2939,  0,  0,  0,  0},   // 5878
+    {  0,  0,  0,  0,  0,  0},   // 5879
+    {  2,  3,  5,  7,  0,  0},   // 5880
+    {  0,  0,  0,  0,  0,  0},   // 5881
+    {  2, 17,173,  0,  0,  0},   // 5882
+    {  3, 37, 53,  0,  0,  0},   // 5883
+    {  2,1471,  0,  0,  0,  0},   // 5884
+    {  5, 11,107,  0,  0,  0},   // 5885
+    {  2,  3,109,  0,  0,  0},   // 5886
+    {  7, 29,  0,  0,  0,  0},   // 5887
+    {  2, 23,  0,  0,  0,  0},   // 5888
+    {  3, 13,151,  0,  0,  0},   // 5889
+    {  2,  5, 19, 31,  0,  0},   // 5890
+    { 43,137,  0,  0,  0,  0},   // 5891
+    {  2,  3,491,  0,  0,  0},   // 5892
+    { 71, 83,  0,  0,  0,  0},   // 5893
+    {  2,  7,421,  0,  0,  0},   // 5894
+    {  3,  5,131,  0,  0,  0},   // 5895
+    {  2, 11, 67,  0,  0,  0},   // 5896
+    {  0,  0,  0,  0,  0,  0},   // 5897
+    {  2,  3,983,  0,  0,  0},   // 5898
+    { 17,347,  0,  0,  0,  0},   // 5899
+    {  2,  5, 59,  0,  0,  0},   // 5900
+    {  3,  7,281,  0,  0,  0},   // 5901
+    {  2, 13,227,  0,  0,  0},   // 5902
+    {  0,  0,  0,  0,  0,  0},   // 5903
+    {  2,  3, 41,  0,  0,  0},   // 5904
+    {  5,1181,  0,  0,  0,  0},   // 5905
+    {  2,2953,  0,  0,  0,  0},   // 5906
+    {  3, 11,179,  0,  0,  0},   // 5907
+    {  2,  7,211,  0,  0,  0},   // 5908
+    { 19,311,  0,  0,  0,  0},   // 5909
+    {  2,  3,  5,197,  0,  0},   // 5910
+    { 23,257,  0,  0,  0,  0},   // 5911
+    {  2,739,  0,  0,  0,  0},   // 5912
+    {  3, 73,  0,  0,  0,  0},   // 5913
+    {  2,2957,  0,  0,  0,  0},   // 5914
+    {  5,  7, 13,  0,  0,  0},   // 5915
+    {  2,  3, 17, 29,  0,  0},   // 5916
+    { 61, 97,  0,  0,  0,  0},   // 5917
+    {  2, 11,269,  0,  0,  0},   // 5918
+    {  3,1973,  0,  0,  0,  0},   // 5919
+    {  2,  5, 37,  0,  0,  0},   // 5920
+    { 31,191,  0,  0,  0,  0},   // 5921
+    {  2,  3,  7, 47,  0,  0},   // 5922
+    {  0,  0,  0,  0,  0,  0},   // 5923
+    {  2,1481,  0,  0,  0,  0},   // 5924
+    {  3,  5, 79,  0,  0,  0},   // 5925
+    {  2,2963,  0,  0,  0,  0},   // 5926
+    {  0,  0,  0,  0,  0,  0},   // 5927
+    {  2,  3, 13, 19,  0,  0},   // 5928
+    {  7, 11,  0,  0,  0,  0},   // 5929
+    {  2,  5,593,  0,  0,  0},   // 5930
+    {  3,659,  0,  0,  0,  0},   // 5931
+    {  2,1483,  0,  0,  0,  0},   // 5932
+    { 17,349,  0,  0,  0,  0},   // 5933
+    {  2,  3, 23, 43,  0,  0},   // 5934
+    {  5,1187,  0,  0,  0,  0},   // 5935
+    {  2,  7, 53,  0,  0,  0},   // 5936
+    {  3,1979,  0,  0,  0,  0},   // 5937
+    {  2,2969,  0,  0,  0,  0},   // 5938
+    {  0,  0,  0,  0,  0,  0},   // 5939
+    {  2,  3,  5, 11,  0,  0},   // 5940
+    { 13,457,  0,  0,  0,  0},   // 5941
+    {  2,2971,  0,  0,  0,  0},   // 5942
+    {  3,  7,283,  0,  0,  0},   // 5943
+    {  2,743,  0,  0,  0,  0},   // 5944
+    {  5, 29, 41,  0,  0,  0},   // 5945
+    {  2,  3,991,  0,  0,  0},   // 5946
+    { 19,313,  0,  0,  0,  0},   // 5947
+    {  2,1487,  0,  0,  0,  0},   // 5948
+    {  3,661,  0,  0,  0,  0},   // 5949
+    {  2,  5,  7, 17,  0,  0},   // 5950
+    { 11,541,  0,  0,  0,  0},   // 5951
+    {  2,  3, 31,  0,  0,  0},   // 5952
+    {  0,  0,  0,  0,  0,  0},   // 5953
+    {  2, 13,229,  0,  0,  0},   // 5954
+    {  3,  5,397,  0,  0,  0},   // 5955
+    {  2,1489,  0,  0,  0,  0},   // 5956
+    {  7, 23, 37,  0,  0,  0},   // 5957
+    {  2,  3,331,  0,  0,  0},   // 5958
+    { 59,101,  0,  0,  0,  0},   // 5959
+    {  2,  5,149,  0,  0,  0},   // 5960
+    {  3,1987,  0,  0,  0,  0},   // 5961
+    {  2, 11,271,  0,  0,  0},   // 5962
+    { 67, 89,  0,  0,  0,  0},   // 5963
+    {  2,  3,  7, 71,  0,  0},   // 5964
+    {  5,1193,  0,  0,  0,  0},   // 5965
+    {  2, 19,157,  0,  0,  0},   // 5966
+    {  3, 13, 17,  0,  0,  0},   // 5967
+    {  2,373,  0,  0,  0,  0},   // 5968
+    { 47,127,  0,  0,  0,  0},   // 5969
+    {  2,  3,  5,199,  0,  0},   // 5970
+    {  7,853,  0,  0,  0,  0},   // 5971
+    {  2,1493,  0,  0,  0,  0},   // 5972
+    {  3, 11,181,  0,  0,  0},   // 5973
+    {  2, 29,103,  0,  0,  0},   // 5974
+    {  5,239,  0,  0,  0,  0},   // 5975
+    {  2,  3, 83,  0,  0,  0},   // 5976
+    { 43,139,  0,  0,  0,  0},   // 5977
+    {  2,  7, 61,  0,  0,  0},   // 5978
+    {  3,1993,  0,  0,  0,  0},   // 5979
+    {  2,  5, 13, 23,  0,  0},   // 5980
+    {  0,  0,  0,  0,  0,  0},   // 5981
+    {  2,  3,997,  0,  0,  0},   // 5982
+    { 31,193,  0,  0,  0,  0},   // 5983
+    {  2, 11, 17,  0,  0,  0},   // 5984
+    {  3,  5,  7, 19,  0,  0},   // 5985
+    {  2, 41, 73,  0,  0,  0},   // 5986
+    {  0,  0,  0,  0,  0,  0},   // 5987
+    {  2,  3,499,  0,  0,  0},   // 5988
+    { 53,113,  0,  0,  0,  0},   // 5989
+    {  2,  5,599,  0,  0,  0},   // 5990
+    {  3,1997,  0,  0,  0,  0},   // 5991
+    {  2,  7,107,  0,  0,  0},   // 5992
+    { 13,461,  0,  0,  0,  0},   // 5993
+    {  2,  3, 37,  0,  0,  0},   // 5994
+    {  5, 11,109,  0,  0,  0},   // 5995
+    {  2,1499,  0,  0,  0,  0},   // 5996
+    {  3,1999,  0,  0,  0,  0},   // 5997
+    {  2,2999,  0,  0,  0,  0},   // 5998
+    {  7,857,  0,  0,  0,  0},   // 5999
+    {  2,  3,  5,  0,  0,  0},   // 6000
+    { 17,353,  0,  0,  0,  0},   // 6001
+    {  2,3001,  0,  0,  0,  0},   // 6002
+    {  3, 23, 29,  0,  0,  0},   // 6003
+    {  2, 19, 79,  0,  0,  0},   // 6004
+    {  5,1201,  0,  0,  0,  0},   // 6005
+    {  2,  3,  7, 11, 13,  0},   // 6006
+    {  0,  0,  0,  0,  0,  0},   // 6007
+    {  2,751,  0,  0,  0,  0},   // 6008
+    {  3,2003,  0,  0,  0,  0},   // 6009
+    {  2,  5,601,  0,  0,  0},   // 6010
+    {  0,  0,  0,  0,  0,  0},   // 6011
+    {  2,  3,167,  0,  0,  0},   // 6012
+    {  7,859,  0,  0,  0,  0},   // 6013
+    {  2, 31, 97,  0,  0,  0},   // 6014
+    {  3,  5,401,  0,  0,  0},   // 6015
+    {  2, 47,  0,  0,  0,  0},   // 6016
+    { 11,547,  0,  0,  0,  0},   // 6017
+    {  2,  3, 17, 59,  0,  0},   // 6018
+    { 13,463,  0,  0,  0,  0},   // 6019
+    {  2,  5,  7, 43,  0,  0},   // 6020
+    {  3,223,  0,  0,  0,  0},   // 6021
+    {  2,3011,  0,  0,  0,  0},   // 6022
+    { 19,317,  0,  0,  0,  0},   // 6023
+    {  2,  3,251,  0,  0,  0},   // 6024
+    {  5,241,  0,  0,  0,  0},   // 6025
+    {  2, 23,131,  0,  0,  0},   // 6026
+    {  3,  7, 41,  0,  0,  0},   // 6027
+    {  2, 11,137,  0,  0,  0},   // 6028
+    {  0,  0,  0,  0,  0,  0},   // 6029
+    {  2,  3,  5, 67,  0,  0},   // 6030
+    { 37,163,  0,  0,  0,  0},   // 6031
+    {  2, 13, 29,  0,  0,  0},   // 6032
+    {  3,2011,  0,  0,  0,  0},   // 6033
+    {  2,  7,431,  0,  0,  0},   // 6034
+    {  5, 17, 71,  0,  0,  0},   // 6035
+    {  2,  3,503,  0,  0,  0},   // 6036
+    {  0,  0,  0,  0,  0,  0},   // 6037
+    {  2,3019,  0,  0,  0,  0},   // 6038
+    {  3, 11, 61,  0,  0,  0},   // 6039
+    {  2,  5,151,  0,  0,  0},   // 6040
+    {  7,863,  0,  0,  0,  0},   // 6041
+    {  2,  3, 19, 53,  0,  0},   // 6042
+    {  0,  0,  0,  0,  0,  0},   // 6043
+    {  2,1511,  0,  0,  0,  0},   // 6044
+    {  3,  5, 13, 31,  0,  0},   // 6045
+    {  2,3023,  0,  0,  0,  0},   // 6046
+    {  0,  0,  0,  0,  0,  0},   // 6047
+    {  2,  3,  7,  0,  0,  0},   // 6048
+    { 23,263,  0,  0,  0,  0},   // 6049
+    {  2,  5, 11,  0,  0,  0},   // 6050
+    {  3,2017,  0,  0,  0,  0},   // 6051
+    {  2, 17, 89,  0,  0,  0},   // 6052
+    {  0,  0,  0,  0,  0,  0},   // 6053
+    {  2,  3,1009,  0,  0,  0},   // 6054
+    {  5,  7,173,  0,  0,  0},   // 6055
+    {  2,757,  0,  0,  0,  0},   // 6056
+    {  3,673,  0,  0,  0,  0},   // 6057
+    {  2, 13,233,  0,  0,  0},   // 6058
+    { 73, 83,  0,  0,  0,  0},   // 6059
+    {  2,  3,  5,101,  0,  0},   // 6060
+    { 11, 19, 29,  0,  0,  0},   // 6061
+    {  2,  7,433,  0,  0,  0},   // 6062
+    {  3, 43, 47,  0,  0,  0},   // 6063
+    {  2,379,  0,  0,  0,  0},   // 6064
+    {  5,1213,  0,  0,  0,  0},   // 6065
+    {  2,  3,337,  0,  0,  0},   // 6066
+    {  0,  0,  0,  0,  0,  0},   // 6067
+    {  2, 37, 41,  0,  0,  0},   // 6068
+    {  3,  7, 17,  0,  0,  0},   // 6069
+    {  2,  5,607,  0,  0,  0},   // 6070
+    { 13,467,  0,  0,  0,  0},   // 6071
+    {  2,  3, 11, 23,  0,  0},   // 6072
+    {  0,  0,  0,  0,  0,  0},   // 6073
+    {  2,3037,  0,  0,  0,  0},   // 6074
+    {  3,  5,  0,  0,  0,  0},   // 6075
+    {  2,  7, 31,  0,  0,  0},   // 6076
+    { 59,103,  0,  0,  0,  0},   // 6077
+    {  2,  3,1013,  0,  0,  0},   // 6078
+    {  0,  0,  0,  0,  0,  0},   // 6079
+    {  2,  5, 19,  0,  0,  0},   // 6080
+    {  3,2027,  0,  0,  0,  0},   // 6081
+    {  2,3041,  0,  0,  0,  0},   // 6082
+    {  7, 11, 79,  0,  0,  0},   // 6083
+    {  2,  3, 13,  0,  0,  0},   // 6084
+    {  5,1217,  0,  0,  0,  0},   // 6085
+    {  2, 17,179,  0,  0,  0},   // 6086
+    {  3,2029,  0,  0,  0,  0},   // 6087
+    {  2,761,  0,  0,  0,  0},   // 6088
+    {  0,  0,  0,  0,  0,  0},   // 6089
+    {  2,  3,  5,  7, 29,  0},   // 6090
+    {  0,  0,  0,  0,  0,  0},   // 6091
+    {  2,1523,  0,  0,  0,  0},   // 6092
+    {  3,677,  0,  0,  0,  0},   // 6093
+    {  2, 11,277,  0,  0,  0},   // 6094
+    {  5, 23, 53,  0,  0,  0},   // 6095
+    {  2,  3,127,  0,  0,  0},   // 6096
+    {  7, 13, 67,  0,  0,  0},   // 6097
+    {  2,3049,  0,  0,  0,  0},   // 6098
+    {  3, 19,107,  0,  0,  0},   // 6099
+    {  2,  5, 61,  0,  0,  0},   // 6100
+    {  0,  0,  0,  0,  0,  0},   // 6101
+    {  2,  3,113,  0,  0,  0},   // 6102
+    { 17,359,  0,  0,  0,  0},   // 6103
+    {  2,  7,109,  0,  0,  0},   // 6104
+    {  3,  5, 11, 37,  0,  0},   // 6105
+    {  2, 43, 71,  0,  0,  0},   // 6106
+    { 31,197,  0,  0,  0,  0},   // 6107
+    {  2,  3,509,  0,  0,  0},   // 6108
+    { 41,149,  0,  0,  0,  0},   // 6109
+    {  2,  5, 13, 47,  0,  0},   // 6110
+    {  3,  7, 97,  0,  0,  0},   // 6111
+    {  2,191,  0,  0,  0,  0},   // 6112
+    {  0,  0,  0,  0,  0,  0},   // 6113
+    {  2,  3,1019,  0,  0,  0},   // 6114
+    {  5,1223,  0,  0,  0,  0},   // 6115
+    {  2, 11,139,  0,  0,  0},   // 6116
+    {  3,2039,  0,  0,  0,  0},   // 6117
+    {  2,  7, 19, 23,  0,  0},   // 6118
+    { 29,211,  0,  0,  0,  0},   // 6119
+    {  2,  3,  5, 17,  0,  0},   // 6120
+    {  0,  0,  0,  0,  0,  0},   // 6121
+    {  2,3061,  0,  0,  0,  0},   // 6122
+    {  3, 13,157,  0,  0,  0},   // 6123
+    {  2,1531,  0,  0,  0,  0},   // 6124
+    {  5,  7,  0,  0,  0,  0},   // 6125
+    {  2,  3,1021,  0,  0,  0},   // 6126
+    { 11,557,  0,  0,  0,  0},   // 6127
+    {  2,383,  0,  0,  0,  0},   // 6128
+    {  3,227,  0,  0,  0,  0},   // 6129
+    {  2,  5,613,  0,  0,  0},   // 6130
+    {  0,  0,  0,  0,  0,  0},   // 6131
+    {  2,  3,  7, 73,  0,  0},   // 6132
+    {  0,  0,  0,  0,  0,  0},   // 6133
+    {  2,3067,  0,  0,  0,  0},   // 6134
+    {  3,  5,409,  0,  0,  0},   // 6135
+    {  2, 13, 59,  0,  0,  0},   // 6136
+    { 17, 19,  0,  0,  0,  0},   // 6137
+    {  2,  3, 11, 31,  0,  0},   // 6138
+    {  7,877,  0,  0,  0,  0},   // 6139
+    {  2,  5,307,  0,  0,  0},   // 6140
+    {  3, 23, 89,  0,  0,  0},   // 6141
+    {  2, 37, 83,  0,  0,  0},   // 6142
+    {  0,  0,  0,  0,  0,  0},   // 6143
+    {  2,  3,  0,  0,  0,  0},   // 6144
+    {  5,1229,  0,  0,  0,  0},   // 6145
+    {  2,  7,439,  0,  0,  0},   // 6146
+    {  3,683,  0,  0,  0,  0},   // 6147
+    {  2, 29, 53,  0,  0,  0},   // 6148
+    { 11, 13, 43,  0,  0,  0},   // 6149
+    {  2,  3,  5, 41,  0,  0},   // 6150
+    {  0,  0,  0,  0,  0,  0},   // 6151
+    {  2,769,  0,  0,  0,  0},   // 6152
+    {  3,  7,293,  0,  0,  0},   // 6153
+    {  2, 17,181,  0,  0,  0},   // 6154
+    {  5,1231,  0,  0,  0,  0},   // 6155
+    {  2,  3, 19,  0,  0,  0},   // 6156
+    { 47,131,  0,  0,  0,  0},   // 6157
+    {  2,3079,  0,  0,  0,  0},   // 6158
+    {  3,2053,  0,  0,  0,  0},   // 6159
+    {  2,  5,  7, 11,  0,  0},   // 6160
+    { 61,101,  0,  0,  0,  0},   // 6161
+    {  2,  3, 13, 79,  0,  0},   // 6162
+    {  0,  0,  0,  0,  0,  0},   // 6163
+    {  2, 23, 67,  0,  0,  0},   // 6164
+    {  3,  5,137,  0,  0,  0},   // 6165
+    {  2,3083,  0,  0,  0,  0},   // 6166
+    {  7,881,  0,  0,  0,  0},   // 6167
+    {  2,  3,257,  0,  0,  0},   // 6168
+    { 31,199,  0,  0,  0,  0},   // 6169
+    {  2,  5,617,  0,  0,  0},   // 6170
+    {  3, 11, 17,  0,  0,  0},   // 6171
+    {  2,1543,  0,  0,  0,  0},   // 6172
+    {  0,  0,  0,  0,  0,  0},   // 6173
+    {  2,  3,  7,  0,  0,  0},   // 6174
+    {  5, 13, 19,  0,  0,  0},   // 6175
+    {  2,193,  0,  0,  0,  0},   // 6176
+    {  3, 29, 71,  0,  0,  0},   // 6177
+    {  2,3089,  0,  0,  0,  0},   // 6178
+    { 37,167,  0,  0,  0,  0},   // 6179
+    {  2,  3,  5,103,  0,  0},   // 6180
+    {  7,883,  0,  0,  0,  0},   // 6181
+    {  2, 11,281,  0,  0,  0},   // 6182
+    {  3,229,  0,  0,  0,  0},   // 6183
+    {  2,773,  0,  0,  0,  0},   // 6184
+    {  5,1237,  0,  0,  0,  0},   // 6185
+    {  2,  3,1031,  0,  0,  0},   // 6186
+    { 23,269,  0,  0,  0,  0},   // 6187
+    {  2,  7, 13, 17,  0,  0},   // 6188
+    {  3,2063,  0,  0,  0,  0},   // 6189
+    {  2,  5,619,  0,  0,  0},   // 6190
+    { 41,151,  0,  0,  0,  0},   // 6191
+    {  2,  3, 43,  0,  0,  0},   // 6192
+    { 11,563,  0,  0,  0,  0},   // 6193
+    {  2, 19,163,  0,  0,  0},   // 6194
+    {  3,  5,  7, 59,  0,  0},   // 6195
+    {  2,1549,  0,  0,  0,  0},   // 6196
+    {  0,  0,  0,  0,  0,  0},   // 6197
+    {  2,  3,1033,  0,  0,  0},   // 6198
+    {  0,  0,  0,  0,  0,  0},   // 6199
+    {  2,  5, 31,  0,  0,  0},   // 6200
+    {  3, 13, 53,  0,  0,  0},   // 6201
+    {  2,  7,443,  0,  0,  0},   // 6202
+    {  0,  0,  0,  0,  0,  0},   // 6203
+    {  2,  3, 11, 47,  0,  0},   // 6204
+    {  5, 17, 73,  0,  0,  0},   // 6205
+    {  2, 29,107,  0,  0,  0},   // 6206
+    {  3,2069,  0,  0,  0,  0},   // 6207
+    {  2, 97,  0,  0,  0,  0},   // 6208
+    {  7,887,  0,  0,  0,  0},   // 6209
+    {  2,  3,  5, 23,  0,  0},   // 6210
+    {  0,  0,  0,  0,  0,  0},   // 6211
+    {  2,1553,  0,  0,  0,  0},   // 6212
+    {  3, 19,109,  0,  0,  0},   // 6213
+    {  2, 13,239,  0,  0,  0},   // 6214
+    {  5, 11,113,  0,  0,  0},   // 6215
+    {  2,  3,  7, 37,  0,  0},   // 6216
+    {  0,  0,  0,  0,  0,  0},   // 6217
+    {  2,3109,  0,  0,  0,  0},   // 6218
+    {  3,691,  0,  0,  0,  0},   // 6219
+    {  2,  5,311,  0,  0,  0},   // 6220
+    {  0,  0,  0,  0,  0,  0},   // 6221
+    {  2,  3, 17, 61,  0,  0},   // 6222
+    {  7,127,  0,  0,  0,  0},   // 6223
+    {  2,389,  0,  0,  0,  0},   // 6224
+    {  3,  5, 83,  0,  0,  0},   // 6225
+    {  2, 11,283,  0,  0,  0},   // 6226
+    { 13,479,  0,  0,  0,  0},   // 6227
+    {  2,  3,173,  0,  0,  0},   // 6228
+    {  0,  0,  0,  0,  0,  0},   // 6229
+    {  2,  5,  7, 89,  0,  0},   // 6230
+    {  3, 31, 67,  0,  0,  0},   // 6231
+    {  2, 19, 41,  0,  0,  0},   // 6232
+    { 23,271,  0,  0,  0,  0},   // 6233
+    {  2,  3,1039,  0,  0,  0},   // 6234
+    {  5, 29, 43,  0,  0,  0},   // 6235
+    {  2,1559,  0,  0,  0,  0},   // 6236
+    {  3,  7, 11,  0,  0,  0},   // 6237
+    {  2,3119,  0,  0,  0,  0},   // 6238
+    { 17,367,  0,  0,  0,  0},   // 6239
+    {  2,  3,  5, 13,  0,  0},   // 6240
+    { 79,  0,  0,  0,  0,  0},   // 6241
+    {  2,3121,  0,  0,  0,  0},   // 6242
+    {  3,2081,  0,  0,  0,  0},   // 6243
+    {  2,  7,223,  0,  0,  0},   // 6244
+    {  5,1249,  0,  0,  0,  0},   // 6245
+    {  2,  3,347,  0,  0,  0},   // 6246
+    {  0,  0,  0,  0,  0,  0},   // 6247
+    {  2, 11, 71,  0,  0,  0},   // 6248
+    {  3,2083,  0,  0,  0,  0},   // 6249
+    {  2,  5,  0,  0,  0,  0},   // 6250
+    {  7, 19, 47,  0,  0,  0},   // 6251
+    {  2,  3,521,  0,  0,  0},   // 6252
+    { 13, 37,  0,  0,  0,  0},   // 6253
+    {  2, 53, 59,  0,  0,  0},   // 6254
+    {  3,  5,139,  0,  0,  0},   // 6255
+    {  2, 17, 23,  0,  0,  0},   // 6256
+    {  0,  0,  0,  0,  0,  0},   // 6257
+    {  2,  3,  7,149,  0,  0},   // 6258
+    { 11,569,  0,  0,  0,  0},   // 6259
+    {  2,  5,313,  0,  0,  0},   // 6260
+    {  3,2087,  0,  0,  0,  0},   // 6261
+    {  2, 31,101,  0,  0,  0},   // 6262
+    {  0,  0,  0,  0,  0,  0},   // 6263
+    {  2,  3, 29,  0,  0,  0},   // 6264
+    {  5,  7,179,  0,  0,  0},   // 6265
+    {  2, 13,241,  0,  0,  0},   // 6266
+    {  3,2089,  0,  0,  0,  0},   // 6267
+    {  2,1567,  0,  0,  0,  0},   // 6268
+    {  0,  0,  0,  0,  0,  0},   // 6269
+    {  2,  3,  5, 11, 19,  0},   // 6270
+    {  0,  0,  0,  0,  0,  0},   // 6271
+    {  2,  7,  0,  0,  0,  0},   // 6272
+    {  3, 17, 41,  0,  0,  0},   // 6273
+    {  2,3137,  0,  0,  0,  0},   // 6274
+    {  5,251,  0,  0,  0,  0},   // 6275
+    {  2,  3,523,  0,  0,  0},   // 6276
+    {  0,  0,  0,  0,  0,  0},   // 6277
+    {  2, 43, 73,  0,  0,  0},   // 6278
+    {  3,  7, 13, 23,  0,  0},   // 6279
+    {  2,  5,157,  0,  0,  0},   // 6280
+    { 11,571,  0,  0,  0,  0},   // 6281
+    {  2,  3,349,  0,  0,  0},   // 6282
+    { 61,103,  0,  0,  0,  0},   // 6283
+    {  2,1571,  0,  0,  0,  0},   // 6284
+    {  3,  5,419,  0,  0,  0},   // 6285
+    {  2,  7,449,  0,  0,  0},   // 6286
+    {  0,  0,  0,  0,  0,  0},   // 6287
+    {  2,  3,131,  0,  0,  0},   // 6288
+    { 19,331,  0,  0,  0,  0},   // 6289
+    {  2,  5, 17, 37,  0,  0},   // 6290
+    {  3,233,  0,  0,  0,  0},   // 6291
+    {  2, 11, 13,  0,  0,  0},   // 6292
+    {  7, 29, 31,  0,  0,  0},   // 6293
+    {  2,  3,1049,  0,  0,  0},   // 6294
+    {  5,1259,  0,  0,  0,  0},   // 6295
+    {  2,787,  0,  0,  0,  0},   // 6296
+    {  3,2099,  0,  0,  0,  0},   // 6297
+    {  2, 47, 67,  0,  0,  0},   // 6298
+    {  0,  0,  0,  0,  0,  0},   // 6299
+    {  2,  3,  5,  7,  0,  0},   // 6300
+    {  0,  0,  0,  0,  0,  0},   // 6301
+    {  2, 23,137,  0,  0,  0},   // 6302
+    {  3, 11,191,  0,  0,  0},   // 6303
+    {  2,197,  0,  0,  0,  0},   // 6304
+    {  5, 13, 97,  0,  0,  0},   // 6305
+    {  2,  3,1051,  0,  0,  0},   // 6306
+    {  7, 17, 53,  0,  0,  0},   // 6307
+    {  2, 19, 83,  0,  0,  0},   // 6308
+    {  3,701,  0,  0,  0,  0},   // 6309
+    {  2,  5,631,  0,  0,  0},   // 6310
+    {  0,  0,  0,  0,  0,  0},   // 6311
+    {  2,  3,263,  0,  0,  0},   // 6312
+    { 59,107,  0,  0,  0,  0},   // 6313
+    {  2,  7, 11, 41,  0,  0},   // 6314
+    {  3,  5,421,  0,  0,  0},   // 6315
+    {  2,1579,  0,  0,  0,  0},   // 6316
+    {  0,  0,  0,  0,  0,  0},   // 6317
+    {  2,  3, 13,  0,  0,  0},   // 6318
+    { 71, 89,  0,  0,  0,  0},   // 6319
+    {  2,  5, 79,  0,  0,  0},   // 6320
+    {  3,  7, 43,  0,  0,  0},   // 6321
+    {  2, 29,109,  0,  0,  0},   // 6322
+    {  0,  0,  0,  0,  0,  0},   // 6323
+    {  2,  3, 17, 31,  0,  0},   // 6324
+    {  5, 11, 23,  0,  0,  0},   // 6325
+    {  2,3163,  0,  0,  0,  0},   // 6326
+    {  3, 19, 37,  0,  0,  0},   // 6327
+    {  2,  7,113,  0,  0,  0},   // 6328
+    {  0,  0,  0,  0,  0,  0},   // 6329
+    {  2,  3,  5,211,  0,  0},   // 6330
+    { 13,487,  0,  0,  0,  0},   // 6331
+    {  2,1583,  0,  0,  0,  0},   // 6332
+    {  3,2111,  0,  0,  0,  0},   // 6333
+    {  2,3167,  0,  0,  0,  0},   // 6334
+    {  5,  7,181,  0,  0,  0},   // 6335
+    {  2,  3, 11,  0,  0,  0},   // 6336
+    {  0,  0,  0,  0,  0,  0},   // 6337
+    {  2,3169,  0,  0,  0,  0},   // 6338
+    {  3,2113,  0,  0,  0,  0},   // 6339
+    {  2,  5,317,  0,  0,  0},   // 6340
+    { 17,373,  0,  0,  0,  0},   // 6341
+    {  2,  3,  7,151,  0,  0},   // 6342
+    {  0,  0,  0,  0,  0,  0},   // 6343
+    {  2, 13, 61,  0,  0,  0},   // 6344
+    {  3,  5, 47,  0,  0,  0},   // 6345
+    {  2, 19,167,  0,  0,  0},   // 6346
+    { 11,577,  0,  0,  0,  0},   // 6347
+    {  2,  3, 23,  0,  0,  0},   // 6348
+    {  7,907,  0,  0,  0,  0},   // 6349
+    {  2,  5,127,  0,  0,  0},   // 6350
+    {  3, 29, 73,  0,  0,  0},   // 6351
+    {  2,397,  0,  0,  0,  0},   // 6352
+    {  0,  0,  0,  0,  0,  0},   // 6353
+    {  2,  3,353,  0,  0,  0},   // 6354
+    {  5, 31, 41,  0,  0,  0},   // 6355
+    {  2,  7,227,  0,  0,  0},   // 6356
+    {  3, 13,163,  0,  0,  0},   // 6357
+    {  2, 11, 17,  0,  0,  0},   // 6358
+    {  0,  0,  0,  0,  0,  0},   // 6359
+    {  2,  3,  5, 53,  0,  0},   // 6360
+    {  0,  0,  0,  0,  0,  0},   // 6361
+    {  2,3181,  0,  0,  0,  0},   // 6362
+    {  3,  7,101,  0,  0,  0},   // 6363
+    {  2, 37, 43,  0,  0,  0},   // 6364
+    {  5, 19, 67,  0,  0,  0},   // 6365
+    {  2,  3,1061,  0,  0,  0},   // 6366
+    {  0,  0,  0,  0,  0,  0},   // 6367
+    {  2,199,  0,  0,  0,  0},   // 6368
+    {  3, 11,193,  0,  0,  0},   // 6369
+    {  2,  5,  7, 13,  0,  0},   // 6370
+    { 23,277,  0,  0,  0,  0},   // 6371
+    {  2,  3, 59,  0,  0,  0},   // 6372
+    {  0,  0,  0,  0,  0,  0},   // 6373
+    {  2,3187,  0,  0,  0,  0},   // 6374
+    {  3,  5, 17,  0,  0,  0},   // 6375
+    {  2,797,  0,  0,  0,  0},   // 6376
+    {  7,911,  0,  0,  0,  0},   // 6377
+    {  2,  3,1063,  0,  0,  0},   // 6378
+    {  0,  0,  0,  0,  0,  0},   // 6379
+    {  2,  5, 11, 29,  0,  0},   // 6380
+    {  3,709,  0,  0,  0,  0},   // 6381
+    {  2,3191,  0,  0,  0,  0},   // 6382
+    { 13,491,  0,  0,  0,  0},   // 6383
+    {  2,  3,  7, 19,  0,  0},   // 6384
+    {  5,1277,  0,  0,  0,  0},   // 6385
+    {  2, 31,103,  0,  0,  0},   // 6386
+    {  3,2129,  0,  0,  0,  0},   // 6387
+    {  2,1597,  0,  0,  0,  0},   // 6388
+    {  0,  0,  0,  0,  0,  0},   // 6389
+    {  2,  3,  5, 71,  0,  0},   // 6390
+    {  7, 11, 83,  0,  0,  0},   // 6391
+    {  2, 17, 47,  0,  0,  0},   // 6392
+    {  3,2131,  0,  0,  0,  0},   // 6393
+    {  2, 23,139,  0,  0,  0},   // 6394
+    {  5,1279,  0,  0,  0,  0},   // 6395
+    {  2,  3, 13, 41,  0,  0},   // 6396
+    {  0,  0,  0,  0,  0,  0},   // 6397
+    {  2,  7,457,  0,  0,  0},   // 6398
+    {  3, 79,  0,  0,  0,  0},   // 6399
+    {  2,  5,  0,  0,  0,  0},   // 6400
+    { 37,173,  0,  0,  0,  0},   // 6401
+    {  2,  3, 11, 97,  0,  0},   // 6402
+    { 19,337,  0,  0,  0,  0},   // 6403
+    {  2,1601,  0,  0,  0,  0},   // 6404
+    {  3,  5,  7, 61,  0,  0},   // 6405
+    {  2,3203,  0,  0,  0,  0},   // 6406
+    { 43,149,  0,  0,  0,  0},   // 6407
+    {  2,  3, 89,  0,  0,  0},   // 6408
+    { 13, 17, 29,  0,  0,  0},   // 6409
+    {  2,  5,641,  0,  0,  0},   // 6410
+    {  3,2137,  0,  0,  0,  0},   // 6411
+    {  2,  7,229,  0,  0,  0},   // 6412
+    { 11, 53,  0,  0,  0,  0},   // 6413
+    {  2,  3,1069,  0,  0,  0},   // 6414
+    {  5,1283,  0,  0,  0,  0},   // 6415
+    {  2,401,  0,  0,  0,  0},   // 6416
+    {  3, 23, 31,  0,  0,  0},   // 6417
+    {  2,3209,  0,  0,  0,  0},   // 6418
+    {  7,131,  0,  0,  0,  0},   // 6419
+    {  2,  3,  5,107,  0,  0},   // 6420
+    {  0,  0,  0,  0,  0,  0},   // 6421
+    {  2, 13, 19,  0,  0,  0},   // 6422
+    {  3,2141,  0,  0,  0,  0},   // 6423
+    {  2, 11, 73,  0,  0,  0},   // 6424
+    {  5,257,  0,  0,  0,  0},   // 6425
+    {  2,  3,  7, 17,  0,  0},   // 6426
+    {  0,  0,  0,  0,  0,  0},   // 6427
+    {  2,1607,  0,  0,  0,  0},   // 6428
+    {  3,2143,  0,  0,  0,  0},   // 6429
+    {  2,  5,643,  0,  0,  0},   // 6430
+    { 59,109,  0,  0,  0,  0},   // 6431
+    {  2,  3, 67,  0,  0,  0},   // 6432
+    {  7,919,  0,  0,  0,  0},   // 6433
+    {  2,3217,  0,  0,  0,  0},   // 6434
+    {  3,  5, 11, 13,  0,  0},   // 6435
+    {  2,1609,  0,  0,  0,  0},   // 6436
+    { 41,157,  0,  0,  0,  0},   // 6437
+    {  2,  3, 29, 37,  0,  0},   // 6438
+    { 47,137,  0,  0,  0,  0},   // 6439
+    {  2,  5,  7, 23,  0,  0},   // 6440
+    {  3, 19,113,  0,  0,  0},   // 6441
+    {  2,3221,  0,  0,  0,  0},   // 6442
+    { 17,379,  0,  0,  0,  0},   // 6443
+    {  2,  3,179,  0,  0,  0},   // 6444
+    {  5,1289,  0,  0,  0,  0},   // 6445
+    {  2, 11,293,  0,  0,  0},   // 6446
+    {  3,  7,307,  0,  0,  0},   // 6447
+    {  2, 13, 31,  0,  0,  0},   // 6448
+    {  0,  0,  0,  0,  0,  0},   // 6449
+    {  2,  3,  5, 43,  0,  0},   // 6450
+    {  0,  0,  0,  0,  0,  0},   // 6451
+    {  2,1613,  0,  0,  0,  0},   // 6452
+    {  3,239,  0,  0,  0,  0},   // 6453
+    {  2,  7,461,  0,  0,  0},   // 6454
+    {  5,1291,  0,  0,  0,  0},   // 6455
+    {  2,  3,269,  0,  0,  0},   // 6456
+    { 11,587,  0,  0,  0,  0},   // 6457
+    {  2,3229,  0,  0,  0,  0},   // 6458
+    {  3,2153,  0,  0,  0,  0},   // 6459
+    {  2,  5, 17, 19,  0,  0},   // 6460
+    {  7, 13, 71,  0,  0,  0},   // 6461
+    {  2,  3,359,  0,  0,  0},   // 6462
+    { 23,281,  0,  0,  0,  0},   // 6463
+    {  2,101,  0,  0,  0,  0},   // 6464
+    {  3,  5,431,  0,  0,  0},   // 6465
+    {  2, 53, 61,  0,  0,  0},   // 6466
+    { 29,223,  0,  0,  0,  0},   // 6467
+    {  2,  3,  7, 11,  0,  0},   // 6468
+    {  0,  0,  0,  0,  0,  0},   // 6469
+    {  2,  5,647,  0,  0,  0},   // 6470
+    {  3,719,  0,  0,  0,  0},   // 6471
+    {  2,809,  0,  0,  0,  0},   // 6472
+    {  0,  0,  0,  0,  0,  0},   // 6473
+    {  2,  3, 13, 83,  0,  0},   // 6474
+    {  5,  7, 37,  0,  0,  0},   // 6475
+    {  2,1619,  0,  0,  0,  0},   // 6476
+    {  3, 17,127,  0,  0,  0},   // 6477
+    {  2, 41, 79,  0,  0,  0},   // 6478
+    { 11, 19, 31,  0,  0,  0},   // 6479
+    {  2,  3,  5,  0,  0,  0},   // 6480
+    {  0,  0,  0,  0,  0,  0},   // 6481
+    {  2,  7,463,  0,  0,  0},   // 6482
+    {  3,2161,  0,  0,  0,  0},   // 6483
+    {  2,1621,  0,  0,  0,  0},   // 6484
+    {  5,1297,  0,  0,  0,  0},   // 6485
+    {  2,  3, 23, 47,  0,  0},   // 6486
+    { 13,499,  0,  0,  0,  0},   // 6487
+    {  2,811,  0,  0,  0,  0},   // 6488
+    {  3,  7,103,  0,  0,  0},   // 6489
+    {  2,  5, 11, 59,  0,  0},   // 6490
+    {  0,  0,  0,  0,  0,  0},   // 6491
+    {  2,  3,541,  0,  0,  0},   // 6492
+    { 43,151,  0,  0,  0,  0},   // 6493
+    {  2, 17,191,  0,  0,  0},   // 6494
+    {  3,  5,433,  0,  0,  0},   // 6495
+    {  2,  7, 29,  0,  0,  0},   // 6496
+    { 73, 89,  0,  0,  0,  0},   // 6497
+    {  2,  3, 19,  0,  0,  0},   // 6498
+    { 67, 97,  0,  0,  0,  0},   // 6499
+    {  2,  5, 13,  0,  0,  0},   // 6500
+    {  3, 11,197,  0,  0,  0},   // 6501
+    {  2,3251,  0,  0,  0,  0},   // 6502
+    {  7,929,  0,  0,  0,  0},   // 6503
+    {  2,  3,271,  0,  0,  0},   // 6504
+    {  5,1301,  0,  0,  0,  0},   // 6505
+    {  2,3253,  0,  0,  0,  0},   // 6506
+    {  3,241,  0,  0,  0,  0},   // 6507
+    {  2,1627,  0,  0,  0,  0},   // 6508
+    { 23,283,  0,  0,  0,  0},   // 6509
+    {  2,  3,  5,  7, 31,  0},   // 6510
+    { 17,383,  0,  0,  0,  0},   // 6511
+    {  2, 11, 37,  0,  0,  0},   // 6512
+    {  3, 13,167,  0,  0,  0},   // 6513
+    {  2,3257,  0,  0,  0,  0},   // 6514
+    {  5,1303,  0,  0,  0,  0},   // 6515
+    {  2,  3,181,  0,  0,  0},   // 6516
+    {  7, 19,  0,  0,  0,  0},   // 6517
+    {  2,3259,  0,  0,  0,  0},   // 6518
+    {  3, 41, 53,  0,  0,  0},   // 6519
+    {  2,  5,163,  0,  0,  0},   // 6520
+    {  0,  0,  0,  0,  0,  0},   // 6521
+    {  2,  3,1087,  0,  0,  0},   // 6522
+    { 11,593,  0,  0,  0,  0},   // 6523
+    {  2,  7,233,  0,  0,  0},   // 6524
+    {  3,  5, 29,  0,  0,  0},   // 6525
+    {  2, 13,251,  0,  0,  0},   // 6526
+    { 61,107,  0,  0,  0,  0},   // 6527
+    {  2,  3, 17,  0,  0,  0},   // 6528
+    {  0,  0,  0,  0,  0,  0},   // 6529
+    {  2,  5,653,  0,  0,  0},   // 6530
+    {  3,  7,311,  0,  0,  0},   // 6531
+    {  2, 23, 71,  0,  0,  0},   // 6532
+    { 47,139,  0,  0,  0,  0},   // 6533
+    {  2,  3, 11,  0,  0,  0},   // 6534
+    {  5,1307,  0,  0,  0,  0},   // 6535
+    {  2, 19, 43,  0,  0,  0},   // 6536
+    {  3,2179,  0,  0,  0,  0},   // 6537
+    {  2,  7,467,  0,  0,  0},   // 6538
+    { 13,503,  0,  0,  0,  0},   // 6539
+    {  2,  3,  5,109,  0,  0},   // 6540
+    { 31,211,  0,  0,  0,  0},   // 6541
+    {  2,3271,  0,  0,  0,  0},   // 6542
+    {  3,727,  0,  0,  0,  0},   // 6543
+    {  2,409,  0,  0,  0,  0},   // 6544
+    {  5,  7, 11, 17,  0,  0},   // 6545
+    {  2,  3,1091,  0,  0,  0},   // 6546
+    {  0,  0,  0,  0,  0,  0},   // 6547
+    {  2,1637,  0,  0,  0,  0},   // 6548
+    {  3, 37, 59,  0,  0,  0},   // 6549
+    {  2,  5,131,  0,  0,  0},   // 6550
+    {  0,  0,  0,  0,  0,  0},   // 6551
+    {  2,  3,  7, 13,  0,  0},   // 6552
+    {  0,  0,  0,  0,  0,  0},   // 6553
+    {  2, 29,113,  0,  0,  0},   // 6554
+    {  3,  5, 19, 23,  0,  0},   // 6555
+    {  2, 11,149,  0,  0,  0},   // 6556
+    { 79, 83,  0,  0,  0,  0},   // 6557
+    {  2,  3,1093,  0,  0,  0},   // 6558
+    {  7,937,  0,  0,  0,  0},   // 6559
+    {  2,  5, 41,  0,  0,  0},   // 6560
+    {  3,  0,  0,  0,  0,  0},   // 6561
+    {  2, 17,193,  0,  0,  0},   // 6562
+    {  0,  0,  0,  0,  0,  0},   // 6563
+    {  2,  3,547,  0,  0,  0},   // 6564
+    {  5, 13,101,  0,  0,  0},   // 6565
+    {  2,  7, 67,  0,  0,  0},   // 6566
+    {  3, 11,199,  0,  0,  0},   // 6567
+    {  2,821,  0,  0,  0,  0},   // 6568
+    {  0,  0,  0,  0,  0,  0},   // 6569
+    {  2,  3,  5, 73,  0,  0},   // 6570
+    {  0,  0,  0,  0,  0,  0},   // 6571
+    {  2, 31, 53,  0,  0,  0},   // 6572
+    {  3,  7,313,  0,  0,  0},   // 6573
+    {  2, 19,173,  0,  0,  0},   // 6574
+    {  5,263,  0,  0,  0,  0},   // 6575
+    {  2,  3,137,  0,  0,  0},   // 6576
+    {  0,  0,  0,  0,  0,  0},   // 6577
+    {  2, 11, 13, 23,  0,  0},   // 6578
+    {  3, 17, 43,  0,  0,  0},   // 6579
+    {  2,  5,  7, 47,  0,  0},   // 6580
+    {  0,  0,  0,  0,  0,  0},   // 6581
+    {  2,  3,1097,  0,  0,  0},   // 6582
+    { 29,227,  0,  0,  0,  0},   // 6583
+    {  2,823,  0,  0,  0,  0},   // 6584
+    {  3,  5,439,  0,  0,  0},   // 6585
+    {  2, 37, 89,  0,  0,  0},   // 6586
+    {  7,941,  0,  0,  0,  0},   // 6587
+    {  2,  3, 61,  0,  0,  0},   // 6588
+    { 11,599,  0,  0,  0,  0},   // 6589
+    {  2,  5,659,  0,  0,  0},   // 6590
+    {  3, 13,  0,  0,  0,  0},   // 6591
+    {  2,103,  0,  0,  0,  0},   // 6592
+    { 19,347,  0,  0,  0,  0},   // 6593
+    {  2,  3,  7,157,  0,  0},   // 6594
+    {  5,1319,  0,  0,  0,  0},   // 6595
+    {  2, 17, 97,  0,  0,  0},   // 6596
+    {  3,733,  0,  0,  0,  0},   // 6597
+    {  2,3299,  0,  0,  0,  0},   // 6598
+    {  0,  0,  0,  0,  0,  0},   // 6599
+    {  2,  3,  5, 11,  0,  0},   // 6600
+    {  7, 23, 41,  0,  0,  0},   // 6601
+    {  2,3301,  0,  0,  0,  0},   // 6602
+    {  3, 31, 71,  0,  0,  0},   // 6603
+    {  2, 13,127,  0,  0,  0},   // 6604
+    {  5,1321,  0,  0,  0,  0},   // 6605
+    {  2,  3,367,  0,  0,  0},   // 6606
+    {  0,  0,  0,  0,  0,  0},   // 6607
+    {  2,  7, 59,  0,  0,  0},   // 6608
+    {  3,2203,  0,  0,  0,  0},   // 6609
+    {  2,  5,661,  0,  0,  0},   // 6610
+    { 11,601,  0,  0,  0,  0},   // 6611
+    {  2,  3, 19, 29,  0,  0},   // 6612
+    { 17,389,  0,  0,  0,  0},   // 6613
+    {  2,3307,  0,  0,  0,  0},   // 6614
+    {  3,  5,  7,  0,  0,  0},   // 6615
+    {  2,827,  0,  0,  0,  0},   // 6616
+    { 13,509,  0,  0,  0,  0},   // 6617
+    {  2,  3,1103,  0,  0,  0},   // 6618
+    {  0,  0,  0,  0,  0,  0},   // 6619
+    {  2,  5,331,  0,  0,  0},   // 6620
+    {  3,2207,  0,  0,  0,  0},   // 6621
+    {  2,  7, 11, 43,  0,  0},   // 6622
+    { 37,179,  0,  0,  0,  0},   // 6623
+    {  2,  3, 23,  0,  0,  0},   // 6624
+    {  5, 53,  0,  0,  0,  0},   // 6625
+    {  2,3313,  0,  0,  0,  0},   // 6626
+    {  3, 47,  0,  0,  0,  0},   // 6627
+    {  2,1657,  0,  0,  0,  0},   // 6628
+    {  7,947,  0,  0,  0,  0},   // 6629
+    {  2,  3,  5, 13, 17,  0},   // 6630
+    { 19,349,  0,  0,  0,  0},   // 6631
+    {  2,829,  0,  0,  0,  0},   // 6632
+    {  3, 11, 67,  0,  0,  0},   // 6633
+    {  2, 31,107,  0,  0,  0},   // 6634
+    {  5,1327,  0,  0,  0,  0},   // 6635
+    {  2,  3,  7, 79,  0,  0},   // 6636
+    {  0,  0,  0,  0,  0,  0},   // 6637
+    {  2,3319,  0,  0,  0,  0},   // 6638
+    {  3,2213,  0,  0,  0,  0},   // 6639
+    {  2,  5, 83,  0,  0,  0},   // 6640
+    { 29,229,  0,  0,  0,  0},   // 6641
+    {  2,  3, 41,  0,  0,  0},   // 6642
+    {  7, 13, 73,  0,  0,  0},   // 6643
+    {  2, 11,151,  0,  0,  0},   // 6644
+    {  3,  5,443,  0,  0,  0},   // 6645
+    {  2,3323,  0,  0,  0,  0},   // 6646
+    { 17, 23,  0,  0,  0,  0},   // 6647
+    {  2,  3,277,  0,  0,  0},   // 6648
+    { 61,109,  0,  0,  0,  0},   // 6649
+    {  2,  5,  7, 19,  0,  0},   // 6650
+    {  3,739,  0,  0,  0,  0},   // 6651
+    {  2,1663,  0,  0,  0,  0},   // 6652
+    {  0,  0,  0,  0,  0,  0},   // 6653
+    {  2,  3,1109,  0,  0,  0},   // 6654
+    {  5, 11,  0,  0,  0,  0},   // 6655
+    {  2, 13,  0,  0,  0,  0},   // 6656
+    {  3,  7,317,  0,  0,  0},   // 6657
+    {  2,3329,  0,  0,  0,  0},   // 6658
+    {  0,  0,  0,  0,  0,  0},   // 6659
+    {  2,  3,  5, 37,  0,  0},   // 6660
+    {  0,  0,  0,  0,  0,  0},   // 6661
+    {  2,3331,  0,  0,  0,  0},   // 6662
+    {  3,2221,  0,  0,  0,  0},   // 6663
+    {  2,  7, 17,  0,  0,  0},   // 6664
+    {  5, 31, 43,  0,  0,  0},   // 6665
+    {  2,  3, 11,101,  0,  0},   // 6666
+    { 59,113,  0,  0,  0,  0},   // 6667
+    {  2,1667,  0,  0,  0,  0},   // 6668
+    {  3, 13, 19,  0,  0,  0},   // 6669
+    {  2,  5, 23, 29,  0,  0},   // 6670
+    {  7,953,  0,  0,  0,  0},   // 6671
+    {  2,  3,139,  0,  0,  0},   // 6672
+    {  0,  0,  0,  0,  0,  0},   // 6673
+    {  2, 47, 71,  0,  0,  0},   // 6674
+    {  3,  5, 89,  0,  0,  0},   // 6675
+    {  2,1669,  0,  0,  0,  0},   // 6676
+    { 11,607,  0,  0,  0,  0},   // 6677
+    {  2,  3,  7, 53,  0,  0},   // 6678
+    {  0,  0,  0,  0,  0,  0},   // 6679
+    {  2,  5,167,  0,  0,  0},   // 6680
+    {  3, 17,131,  0,  0,  0},   // 6681
+    {  2, 13,257,  0,  0,  0},   // 6682
+    { 41,163,  0,  0,  0,  0},   // 6683
+    {  2,  3,557,  0,  0,  0},   // 6684
+    {  5,  7,191,  0,  0,  0},   // 6685
+    {  2,3343,  0,  0,  0,  0},   // 6686
+    {  3,743,  0,  0,  0,  0},   // 6687
+    {  2, 11, 19,  0,  0,  0},   // 6688
+    {  0,  0,  0,  0,  0,  0},   // 6689
+    {  2,  3,  5,223,  0,  0},   // 6690
+    {  0,  0,  0,  0,  0,  0},   // 6691
+    {  2,  7,239,  0,  0,  0},   // 6692
+    {  3, 23, 97,  0,  0,  0},   // 6693
+    {  2,3347,  0,  0,  0,  0},   // 6694
+    {  5, 13,103,  0,  0,  0},   // 6695
+    {  2,  3, 31,  0,  0,  0},   // 6696
+    { 37,181,  0,  0,  0,  0},   // 6697
+    {  2, 17,197,  0,  0,  0},   // 6698
+    {  3,  7, 11, 29,  0,  0},   // 6699
+    {  2,  5, 67,  0,  0,  0},   // 6700
+    {  0,  0,  0,  0,  0,  0},   // 6701
+    {  2,  3,1117,  0,  0,  0},   // 6702
+    {  0,  0,  0,  0,  0,  0},   // 6703
+    {  2,419,  0,  0,  0,  0},   // 6704
+    {  3,  5,149,  0,  0,  0},   // 6705
+    {  2,  7,479,  0,  0,  0},   // 6706
+    { 19,353,  0,  0,  0,  0},   // 6707
+    {  2,  3, 13, 43,  0,  0},   // 6708
+    {  0,  0,  0,  0,  0,  0},   // 6709
+    {  2,  5, 11, 61,  0,  0},   // 6710
+    {  3,2237,  0,  0,  0,  0},   // 6711
+    {  2,839,  0,  0,  0,  0},   // 6712
+    {  7,137,  0,  0,  0,  0},   // 6713
+    {  2,  3,373,  0,  0,  0},   // 6714
+    {  5, 17, 79,  0,  0,  0},   // 6715
+    {  2, 23, 73,  0,  0,  0},   // 6716
+    {  3,2239,  0,  0,  0,  0},   // 6717
+    {  2,3359,  0,  0,  0,  0},   // 6718
+    {  0,  0,  0,  0,  0,  0},   // 6719
+    {  2,  3,  5,  7,  0,  0},   // 6720
+    { 11, 13, 47,  0,  0,  0},   // 6721
+    {  2,3361,  0,  0,  0,  0},   // 6722
+    {  3, 83,  0,  0,  0,  0},   // 6723
+    {  2, 41,  0,  0,  0,  0},   // 6724
+    {  5,269,  0,  0,  0,  0},   // 6725
+    {  2,  3, 19, 59,  0,  0},   // 6726
+    {  7, 31,  0,  0,  0,  0},   // 6727
+    {  2, 29,  0,  0,  0,  0},   // 6728
+    {  3,2243,  0,  0,  0,  0},   // 6729
+    {  2,  5,673,  0,  0,  0},   // 6730
+    { 53,127,  0,  0,  0,  0},   // 6731
+    {  2,  3, 11, 17,  0,  0},   // 6732
+    {  0,  0,  0,  0,  0,  0},   // 6733
+    {  2,  7, 13, 37,  0,  0},   // 6734
+    {  3,  5,449,  0,  0,  0},   // 6735
+    {  2,421,  0,  0,  0,  0},   // 6736
+    {  0,  0,  0,  0,  0,  0},   // 6737
+    {  2,  3,1123,  0,  0,  0},   // 6738
+    { 23,293,  0,  0,  0,  0},   // 6739
+    {  2,  5,337,  0,  0,  0},   // 6740
+    {  3,  7,107,  0,  0,  0},   // 6741
+    {  2,3371,  0,  0,  0,  0},   // 6742
+    { 11,613,  0,  0,  0,  0},   // 6743
+    {  2,  3,281,  0,  0,  0},   // 6744
+    {  5, 19, 71,  0,  0,  0},   // 6745
+    {  2,3373,  0,  0,  0,  0},   // 6746
+    {  3, 13,173,  0,  0,  0},   // 6747
+    {  2,  7,241,  0,  0,  0},   // 6748
+    { 17,397,  0,  0,  0,  0},   // 6749
+    {  2,  3,  5,  0,  0,  0},   // 6750
+    { 43,157,  0,  0,  0,  0},   // 6751
+    {  2,211,  0,  0,  0,  0},   // 6752
+    {  3,2251,  0,  0,  0,  0},   // 6753
+    {  2, 11,307,  0,  0,  0},   // 6754
+    {  5,  7,193,  0,  0,  0},   // 6755
+    {  2,  3,563,  0,  0,  0},   // 6756
+    { 29,233,  0,  0,  0,  0},   // 6757
+    {  2, 31,109,  0,  0,  0},   // 6758
+    {  3,751,  0,  0,  0,  0},   // 6759
+    {  2,  5, 13,  0,  0,  0},   // 6760
+    {  0,  0,  0,  0,  0,  0},   // 6761
+    {  2,  3,  7, 23,  0,  0},   // 6762
+    {  0,  0,  0,  0,  0,  0},   // 6763
+    {  2, 19, 89,  0,  0,  0},   // 6764
+    {  3,  5, 11, 41,  0,  0},   // 6765
+    {  2, 17,199,  0,  0,  0},   // 6766
+    { 67,101,  0,  0,  0,  0},   // 6767
+    {  2,  3, 47,  0,  0,  0},   // 6768
+    {  7,967,  0,  0,  0,  0},   // 6769
+    {  2,  5,677,  0,  0,  0},   // 6770
+    {  3, 37, 61,  0,  0,  0},   // 6771
+    {  2,1693,  0,  0,  0,  0},   // 6772
+    { 13,521,  0,  0,  0,  0},   // 6773
+    {  2,  3,1129,  0,  0,  0},   // 6774
+    {  5,271,  0,  0,  0,  0},   // 6775
+    {  2,  7, 11,  0,  0,  0},   // 6776
+    {  3,251,  0,  0,  0,  0},   // 6777
+    {  2,3389,  0,  0,  0,  0},   // 6778
+    {  0,  0,  0,  0,  0,  0},   // 6779
+    {  2,  3,  5,113,  0,  0},   // 6780
+    {  0,  0,  0,  0,  0,  0},   // 6781
+    {  2,3391,  0,  0,  0,  0},   // 6782
+    {  3,  7, 17, 19,  0,  0},   // 6783
+    {  2, 53,  0,  0,  0,  0},   // 6784
+    {  5, 23, 59,  0,  0,  0},   // 6785
+    {  2,  3, 13, 29,  0,  0},   // 6786
+    { 11,617,  0,  0,  0,  0},   // 6787
+    {  2,1697,  0,  0,  0,  0},   // 6788
+    {  3, 31, 73,  0,  0,  0},   // 6789
+    {  2,  5,  7, 97,  0,  0},   // 6790
+    {  0,  0,  0,  0,  0,  0},   // 6791
+    {  2,  3,283,  0,  0,  0},   // 6792
+    {  0,  0,  0,  0,  0,  0},   // 6793
+    {  2, 43, 79,  0,  0,  0},   // 6794
+    {  3,  5,151,  0,  0,  0},   // 6795
+    {  2,1699,  0,  0,  0,  0},   // 6796
+    {  7,971,  0,  0,  0,  0},   // 6797
+    {  2,  3, 11,103,  0,  0},   // 6798
+    { 13,523,  0,  0,  0,  0},   // 6799
+    {  2,  5, 17,  0,  0,  0},   // 6800
+    {  3,2267,  0,  0,  0,  0},   // 6801
+    {  2, 19,179,  0,  0,  0},   // 6802
+    {  0,  0,  0,  0,  0,  0},   // 6803
+    {  2,  3,  7,  0,  0,  0},   // 6804
+    {  5,1361,  0,  0,  0,  0},   // 6805
+    {  2, 41, 83,  0,  0,  0},   // 6806
+    {  3,2269,  0,  0,  0,  0},   // 6807
+    {  2, 23, 37,  0,  0,  0},   // 6808
+    { 11,619,  0,  0,  0,  0},   // 6809
+    {  2,  3,  5,227,  0,  0},   // 6810
+    {  7,139,  0,  0,  0,  0},   // 6811
+    {  2, 13,131,  0,  0,  0},   // 6812
+    {  3,757,  0,  0,  0,  0},   // 6813
+    {  2,3407,  0,  0,  0,  0},   // 6814
+    {  5, 29, 47,  0,  0,  0},   // 6815
+    {  2,  3, 71,  0,  0,  0},   // 6816
+    { 17,401,  0,  0,  0,  0},   // 6817
+    {  2,  7,487,  0,  0,  0},   // 6818
+    {  3,2273,  0,  0,  0,  0},   // 6819
+    {  2,  5, 11, 31,  0,  0},   // 6820
+    { 19,359,  0,  0,  0,  0},   // 6821
+    {  2,  3,379,  0,  0,  0},   // 6822
+    {  0,  0,  0,  0,  0,  0},   // 6823
+    {  2,853,  0,  0,  0,  0},   // 6824
+    {  3,  5,  7, 13,  0,  0},   // 6825
+    {  2,3413,  0,  0,  0,  0},   // 6826
+    {  0,  0,  0,  0,  0,  0},   // 6827
+    {  2,  3,569,  0,  0,  0},   // 6828
+    {  0,  0,  0,  0,  0,  0},   // 6829
+    {  2,  5,683,  0,  0,  0},   // 6830
+    {  3, 11, 23,  0,  0,  0},   // 6831
+    {  2,  7, 61,  0,  0,  0},   // 6832
+    {  0,  0,  0,  0,  0,  0},   // 6833
+    {  2,  3, 17, 67,  0,  0},   // 6834
+    {  5,1367,  0,  0,  0,  0},   // 6835
+    {  2,1709,  0,  0,  0,  0},   // 6836
+    {  3, 43, 53,  0,  0,  0},   // 6837
+    {  2, 13,263,  0,  0,  0},   // 6838
+    {  7,977,  0,  0,  0,  0},   // 6839
+    {  2,  3,  5, 19,  0,  0},   // 6840
+    {  0,  0,  0,  0,  0,  0},   // 6841
+    {  2, 11,311,  0,  0,  0},   // 6842
+    {  3,2281,  0,  0,  0,  0},   // 6843
+    {  2, 29, 59,  0,  0,  0},   // 6844
+    {  5, 37,  0,  0,  0,  0},   // 6845
+    {  2,  3,  7,163,  0,  0},   // 6846
+    { 41,167,  0,  0,  0,  0},   // 6847
+    {  2,107,  0,  0,  0,  0},   // 6848
+    {  3,761,  0,  0,  0,  0},   // 6849
+    {  2,  5,137,  0,  0,  0},   // 6850
+    { 13, 17, 31,  0,  0,  0},   // 6851
+    {  2,  3,571,  0,  0,  0},   // 6852
+    {  7, 11, 89,  0,  0,  0},   // 6853
+    {  2, 23,149,  0,  0,  0},   // 6854
+    {  3,  5,457,  0,  0,  0},   // 6855
+    {  2,857,  0,  0,  0,  0},   // 6856
+    {  0,  0,  0,  0,  0,  0},   // 6857
+    {  2,  3,127,  0,  0,  0},   // 6858
+    { 19,  0,  0,  0,  0,  0},   // 6859
+    {  2,  5,  7,  0,  0,  0},   // 6860
+    {  3,2287,  0,  0,  0,  0},   // 6861
+    {  2, 47, 73,  0,  0,  0},   // 6862
+    {  0,  0,  0,  0,  0,  0},   // 6863
+    {  2,  3, 11, 13,  0,  0},   // 6864
+    {  5,1373,  0,  0,  0,  0},   // 6865
+    {  2,3433,  0,  0,  0,  0},   // 6866
+    {  3,  7,109,  0,  0,  0},   // 6867
+    {  2, 17,101,  0,  0,  0},   // 6868
+    {  0,  0,  0,  0,  0,  0},   // 6869
+    {  2,  3,  5,229,  0,  0},   // 6870
+    {  0,  0,  0,  0,  0,  0},   // 6871
+    {  2,859,  0,  0,  0,  0},   // 6872
+    {  3, 29, 79,  0,  0,  0},   // 6873
+    {  2,  7,491,  0,  0,  0},   // 6874
+    {  5, 11,  0,  0,  0,  0},   // 6875
+    {  2,  3,191,  0,  0,  0},   // 6876
+    { 13, 23,  0,  0,  0,  0},   // 6877
+    {  2, 19,181,  0,  0,  0},   // 6878
+    {  3,2293,  0,  0,  0,  0},   // 6879
+    {  2,  5, 43,  0,  0,  0},   // 6880
+    {  7,983,  0,  0,  0,  0},   // 6881
+    {  2,  3, 31, 37,  0,  0},   // 6882
+    {  0,  0,  0,  0,  0,  0},   // 6883
+    {  2,1721,  0,  0,  0,  0},   // 6884
+    {  3,  5, 17,  0,  0,  0},   // 6885
+    {  2, 11,313,  0,  0,  0},   // 6886
+    { 71, 97,  0,  0,  0,  0},   // 6887
+    {  2,  3,  7, 41,  0,  0},   // 6888
+    { 83,  0,  0,  0,  0,  0},   // 6889
+    {  2,  5, 13, 53,  0,  0},   // 6890
+    {  3,2297,  0,  0,  0,  0},   // 6891
+    {  2,1723,  0,  0,  0,  0},   // 6892
+    { 61,113,  0,  0,  0,  0},   // 6893
+    {  2,  3,383,  0,  0,  0},   // 6894
+    {  5,  7,197,  0,  0,  0},   // 6895
+    {  2,431,  0,  0,  0,  0},   // 6896
+    {  3, 11, 19,  0,  0,  0},   // 6897
+    {  2,3449,  0,  0,  0,  0},   // 6898
+    {  0,  0,  0,  0,  0,  0},   // 6899
+    {  2,  3,  5, 23,  0,  0},   // 6900
+    { 67,103,  0,  0,  0,  0},   // 6901
+    {  2,  7, 17, 29,  0,  0},   // 6902
+    {  3, 13, 59,  0,  0,  0},   // 6903
+    {  2,863,  0,  0,  0,  0},   // 6904
+    {  5,1381,  0,  0,  0,  0},   // 6905
+    {  2,  3,1151,  0,  0,  0},   // 6906
+    {  0,  0,  0,  0,  0,  0},   // 6907
+    {  2, 11,157,  0,  0,  0},   // 6908
+    {  3,  7, 47,  0,  0,  0},   // 6909
+    {  2,  5,691,  0,  0,  0},   // 6910
+    {  0,  0,  0,  0,  0,  0},   // 6911
+    {  2,  3,  0,  0,  0,  0},   // 6912
+    { 31,223,  0,  0,  0,  0},   // 6913
+    {  2,3457,  0,  0,  0,  0},   // 6914
+    {  3,  5,461,  0,  0,  0},   // 6915
+    {  2,  7, 13, 19,  0,  0},   // 6916
+    {  0,  0,  0,  0,  0,  0},   // 6917
+    {  2,  3,1153,  0,  0,  0},   // 6918
+    { 11, 17, 37,  0,  0,  0},   // 6919
+    {  2,  5,173,  0,  0,  0},   // 6920
+    {  3,769,  0,  0,  0,  0},   // 6921
+    {  2,3461,  0,  0,  0,  0},   // 6922
+    {  7, 23, 43,  0,  0,  0},   // 6923
+    {  2,  3,577,  0,  0,  0},   // 6924
+    {  5,277,  0,  0,  0,  0},   // 6925
+    {  2,3463,  0,  0,  0,  0},   // 6926
+    {  3,2309,  0,  0,  0,  0},   // 6927
+    {  2,433,  0,  0,  0,  0},   // 6928
+    { 13, 41,  0,  0,  0,  0},   // 6929
+    {  2,  3,  5,  7, 11,  0},   // 6930
+    { 29,239,  0,  0,  0,  0},   // 6931
+    {  2,1733,  0,  0,  0,  0},   // 6932
+    {  3,2311,  0,  0,  0,  0},   // 6933
+    {  2,3467,  0,  0,  0,  0},   // 6934
+    {  5, 19, 73,  0,  0,  0},   // 6935
+    {  2,  3, 17,  0,  0,  0},   // 6936
+    {  7,991,  0,  0,  0,  0},   // 6937
+    {  2,3469,  0,  0,  0,  0},   // 6938
+    {  3,257,  0,  0,  0,  0},   // 6939
+    {  2,  5,347,  0,  0,  0},   // 6940
+    { 11,631,  0,  0,  0,  0},   // 6941
+    {  2,  3, 13, 89,  0,  0},   // 6942
+    { 53,131,  0,  0,  0,  0},   // 6943
+    {  2,  7, 31,  0,  0,  0},   // 6944
+    {  3,  5,463,  0,  0,  0},   // 6945
+    {  2, 23,151,  0,  0,  0},   // 6946
+    {  0,  0,  0,  0,  0,  0},   // 6947
+    {  2,  3,193,  0,  0,  0},   // 6948
+    {  0,  0,  0,  0,  0,  0},   // 6949
+    {  2,  5,139,  0,  0,  0},   // 6950
+    {  3,  7,331,  0,  0,  0},   // 6951
+    {  2, 11, 79,  0,  0,  0},   // 6952
+    { 17,409,  0,  0,  0,  0},   // 6953
+    {  2,  3, 19, 61,  0,  0},   // 6954
+    {  5, 13,107,  0,  0,  0},   // 6955
+    {  2, 37, 47,  0,  0,  0},   // 6956
+    {  3,773,  0,  0,  0,  0},   // 6957
+    {  2,  7, 71,  0,  0,  0},   // 6958
+    {  0,  0,  0,  0,  0,  0},   // 6959
+    {  2,  3,  5, 29,  0,  0},   // 6960
+    {  0,  0,  0,  0,  0,  0},   // 6961
+    {  2, 59,  0,  0,  0,  0},   // 6962
+    {  3, 11,211,  0,  0,  0},   // 6963
+    {  2,1741,  0,  0,  0,  0},   // 6964
+    {  5,  7,199,  0,  0,  0},   // 6965
+    {  2,  3, 43,  0,  0,  0},   // 6966
+    {  0,  0,  0,  0,  0,  0},   // 6967
+    {  2, 13, 67,  0,  0,  0},   // 6968
+    {  3, 23,101,  0,  0,  0},   // 6969
+    {  2,  5, 17, 41,  0,  0},   // 6970
+    {  0,  0,  0,  0,  0,  0},   // 6971
+    {  2,  3,  7, 83,  0,  0},   // 6972
+    { 19,367,  0,  0,  0,  0},   // 6973
+    {  2, 11,317,  0,  0,  0},   // 6974
+    {  3,  5, 31,  0,  0,  0},   // 6975
+    {  2,109,  0,  0,  0,  0},   // 6976
+    {  0,  0,  0,  0,  0,  0},   // 6977
+    {  2,  3,1163,  0,  0,  0},   // 6978
+    {  7,997,  0,  0,  0,  0},   // 6979
+    {  2,  5,349,  0,  0,  0},   // 6980
+    {  3, 13,179,  0,  0,  0},   // 6981
+    {  2,3491,  0,  0,  0,  0},   // 6982
+    {  0,  0,  0,  0,  0,  0},   // 6983
+    {  2,  3, 97,  0,  0,  0},   // 6984
+    {  5, 11,127,  0,  0,  0},   // 6985
+    {  2,  7,499,  0,  0,  0},   // 6986
+    {  3, 17,137,  0,  0,  0},   // 6987
+    {  2,1747,  0,  0,  0,  0},   // 6988
+    { 29,241,  0,  0,  0,  0},   // 6989
+    {  2,  3,  5,233,  0,  0},   // 6990
+    {  0,  0,  0,  0,  0,  0},   // 6991
+    {  2, 19, 23,  0,  0,  0},   // 6992
+    {  3,  7, 37,  0,  0,  0},   // 6993
+    {  2, 13,269,  0,  0,  0},   // 6994
+    {  5,1399,  0,  0,  0,  0},   // 6995
+    {  2,  3, 11, 53,  0,  0},   // 6996
+    {  0,  0,  0,  0,  0,  0},   // 6997
+    {  2,3499,  0,  0,  0,  0},   // 6998
+    {  3,2333,  0,  0,  0,  0},   // 6999
+    {  2,  5,  7,  0,  0,  0},   // 7000
+    {  0,  0,  0,  0,  0,  0},   // 7001
+    {  2,  3,389,  0,  0,  0},   // 7002
+    { 47,149,  0,  0,  0,  0},   // 7003
+    {  2, 17,103,  0,  0,  0},   // 7004
+    {  3,  5,467,  0,  0,  0},   // 7005
+    {  2, 31,113,  0,  0,  0},   // 7006
+    {  7, 11, 13,  0,  0,  0},   // 7007
+    {  2,  3, 73,  0,  0,  0},   // 7008
+    { 43,163,  0,  0,  0,  0},   // 7009
+    {  2,  5,701,  0,  0,  0},   // 7010
+    {  3, 19, 41,  0,  0,  0},   // 7011
+    {  2,1753,  0,  0,  0,  0},   // 7012
+    {  0,  0,  0,  0,  0,  0},   // 7013
+    {  2,  3,  7,167,  0,  0},   // 7014
+    {  5, 23, 61,  0,  0,  0},   // 7015
+    {  2,877,  0,  0,  0,  0},   // 7016
+    {  3,2339,  0,  0,  0,  0},   // 7017
+    {  2, 11, 29,  0,  0,  0},   // 7018
+    {  0,  0,  0,  0,  0,  0},   // 7019
+    {  2,  3,  5, 13,  0,  0},   // 7020
+    {  7, 17, 59,  0,  0,  0},   // 7021
+    {  2,3511,  0,  0,  0,  0},   // 7022
+    {  3,2341,  0,  0,  0,  0},   // 7023
+    {  2,439,  0,  0,  0,  0},   // 7024
+    {  5,281,  0,  0,  0,  0},   // 7025
+    {  2,  3,1171,  0,  0,  0},   // 7026
+    {  0,  0,  0,  0,  0,  0},   // 7027
+    {  2,  7,251,  0,  0,  0},   // 7028
+    {  3, 11, 71,  0,  0,  0},   // 7029
+    {  2,  5, 19, 37,  0,  0},   // 7030
+    { 79, 89,  0,  0,  0,  0},   // 7031
+    {  2,  3,293,  0,  0,  0},   // 7032
+    { 13,541,  0,  0,  0,  0},   // 7033
+    {  2,3517,  0,  0,  0,  0},   // 7034
+    {  3,  5,  7, 67,  0,  0},   // 7035
+    {  2,1759,  0,  0,  0,  0},   // 7036
+    { 31,227,  0,  0,  0,  0},   // 7037
+    {  2,  3, 17, 23,  0,  0},   // 7038
+    {  0,  0,  0,  0,  0,  0},   // 7039
+    {  2,  5, 11,  0,  0,  0},   // 7040
+    {  3,2347,  0,  0,  0,  0},   // 7041
+    {  2,  7,503,  0,  0,  0},   // 7042
+    {  0,  0,  0,  0,  0,  0},   // 7043
+    {  2,  3,587,  0,  0,  0},   // 7044
+    {  5,1409,  0,  0,  0,  0},   // 7045
+    {  2, 13,271,  0,  0,  0},   // 7046
+    {  3, 29,  0,  0,  0,  0},   // 7047
+    {  2,881,  0,  0,  0,  0},   // 7048
+    {  7, 19, 53,  0,  0,  0},   // 7049
+    {  2,  3,  5, 47,  0,  0},   // 7050
+    { 11,641,  0,  0,  0,  0},   // 7051
+    {  2, 41, 43,  0,  0,  0},   // 7052
+    {  3,2351,  0,  0,  0,  0},   // 7053
+    {  2,3527,  0,  0,  0,  0},   // 7054
+    {  5, 17, 83,  0,  0,  0},   // 7055
+    {  2,  3,  7,  0,  0,  0},   // 7056
+    {  0,  0,  0,  0,  0,  0},   // 7057
+    {  2,3529,  0,  0,  0,  0},   // 7058
+    {  3, 13,181,  0,  0,  0},   // 7059
+    {  2,  5,353,  0,  0,  0},   // 7060
+    { 23,307,  0,  0,  0,  0},   // 7061
+    {  2,  3, 11,107,  0,  0},   // 7062
+    {  7,1009,  0,  0,  0,  0},   // 7063
+    {  2,883,  0,  0,  0,  0},   // 7064
+    {  3,  5,157,  0,  0,  0},   // 7065
+    {  2,3533,  0,  0,  0,  0},   // 7066
+    { 37,191,  0,  0,  0,  0},   // 7067
+    {  2,  3, 19, 31,  0,  0},   // 7068
+    {  0,  0,  0,  0,  0,  0},   // 7069
+    {  2,  5,  7,101,  0,  0},   // 7070
+    {  3,2357,  0,  0,  0,  0},   // 7071
+    {  2, 13, 17,  0,  0,  0},   // 7072
+    { 11,643,  0,  0,  0,  0},   // 7073
+    {  2,  3,131,  0,  0,  0},   // 7074
+    {  5,283,  0,  0,  0,  0},   // 7075
+    {  2, 29, 61,  0,  0,  0},   // 7076
+    {  3,  7,337,  0,  0,  0},   // 7077
+    {  2,3539,  0,  0,  0,  0},   // 7078
+    {  0,  0,  0,  0,  0,  0},   // 7079
+    {  2,  3,  5, 59,  0,  0},   // 7080
+    { 73, 97,  0,  0,  0,  0},   // 7081
+    {  2,3541,  0,  0,  0,  0},   // 7082
+    {  3,787,  0,  0,  0,  0},   // 7083
+    {  2,  7, 11, 23,  0,  0},   // 7084
+    {  5, 13,109,  0,  0,  0},   // 7085
+    {  2,  3,1181,  0,  0,  0},   // 7086
+    { 19,373,  0,  0,  0,  0},   // 7087
+    {  2,443,  0,  0,  0,  0},   // 7088
+    {  3, 17,139,  0,  0,  0},   // 7089
+    {  2,  5,709,  0,  0,  0},   // 7090
+    {  7,1013,  0,  0,  0,  0},   // 7091
+    {  2,  3,197,  0,  0,  0},   // 7092
+    { 41,173,  0,  0,  0,  0},   // 7093
+    {  2,3547,  0,  0,  0,  0},   // 7094
+    {  3,  5, 11, 43,  0,  0},   // 7095
+    {  2,887,  0,  0,  0,  0},   // 7096
+    { 47,151,  0,  0,  0,  0},   // 7097
+    {  2,  3,  7, 13,  0,  0},   // 7098
+    { 31,229,  0,  0,  0,  0},   // 7099
+    {  2,  5, 71,  0,  0,  0},   // 7100
+    {  3,263,  0,  0,  0,  0},   // 7101
+    {  2, 53, 67,  0,  0,  0},   // 7102
+    {  0,  0,  0,  0,  0,  0},   // 7103
+    {  2,  3, 37,  0,  0,  0},   // 7104
+    {  5,  7, 29,  0,  0,  0},   // 7105
+    {  2, 11, 17, 19,  0,  0},   // 7106
+    {  3, 23,103,  0,  0,  0},   // 7107
+    {  2,1777,  0,  0,  0,  0},   // 7108
+    {  0,  0,  0,  0,  0,  0},   // 7109
+    {  2,  3,  5, 79,  0,  0},   // 7110
+    { 13,547,  0,  0,  0,  0},   // 7111
+    {  2,  7,127,  0,  0,  0},   // 7112
+    {  3,2371,  0,  0,  0,  0},   // 7113
+    {  2,3557,  0,  0,  0,  0},   // 7114
+    {  5,1423,  0,  0,  0,  0},   // 7115
+    {  2,  3,593,  0,  0,  0},   // 7116
+    { 11,647,  0,  0,  0,  0},   // 7117
+    {  2,3559,  0,  0,  0,  0},   // 7118
+    {  3,  7,113,  0,  0,  0},   // 7119
+    {  2,  5, 89,  0,  0,  0},   // 7120
+    {  0,  0,  0,  0,  0,  0},   // 7121
+    {  2,  3,1187,  0,  0,  0},   // 7122
+    { 17,419,  0,  0,  0,  0},   // 7123
+    {  2, 13,137,  0,  0,  0},   // 7124
+    {  3,  5, 19,  0,  0,  0},   // 7125
+    {  2,  7,509,  0,  0,  0},   // 7126
+    {  0,  0,  0,  0,  0,  0},   // 7127
+    {  2,  3, 11,  0,  0,  0},   // 7128
+    {  0,  0,  0,  0,  0,  0},   // 7129
+    {  2,  5, 23, 31,  0,  0},   // 7130
+    {  3,2377,  0,  0,  0,  0},   // 7131
+    {  2,1783,  0,  0,  0,  0},   // 7132
+    {  7,1019,  0,  0,  0,  0},   // 7133
+    {  2,  3, 29, 41,  0,  0},   // 7134
+    {  5,1427,  0,  0,  0,  0},   // 7135
+    {  2,223,  0,  0,  0,  0},   // 7136
+    {  3, 13, 61,  0,  0,  0},   // 7137
+    {  2, 43, 83,  0,  0,  0},   // 7138
+    { 11, 59,  0,  0,  0,  0},   // 7139
+    {  2,  3,  5,  7, 17,  0},   // 7140
+    { 37,193,  0,  0,  0,  0},   // 7141
+    {  2,3571,  0,  0,  0,  0},   // 7142
+    {  3,2381,  0,  0,  0,  0},   // 7143
+    {  2, 19, 47,  0,  0,  0},   // 7144
+    {  5,1429,  0,  0,  0,  0},   // 7145
+    {  2,  3,397,  0,  0,  0},   // 7146
+    {  7,1021,  0,  0,  0,  0},   // 7147
+    {  2,1787,  0,  0,  0,  0},   // 7148
+    {  3,2383,  0,  0,  0,  0},   // 7149
+    {  2,  5, 11, 13,  0,  0},   // 7150
+    {  0,  0,  0,  0,  0,  0},   // 7151
+    {  2,  3,149,  0,  0,  0},   // 7152
+    { 23,311,  0,  0,  0,  0},   // 7153
+    {  2,  7, 73,  0,  0,  0},   // 7154
+    {  3,  5, 53,  0,  0,  0},   // 7155
+    {  2,1789,  0,  0,  0,  0},   // 7156
+    { 17,421,  0,  0,  0,  0},   // 7157
+    {  2,  3,1193,  0,  0,  0},   // 7158
+    {  0,  0,  0,  0,  0,  0},   // 7159
+    {  2,  5,179,  0,  0,  0},   // 7160
+    {  3,  7, 11, 31,  0,  0},   // 7161
+    {  2,3581,  0,  0,  0,  0},   // 7162
+    { 13, 19, 29,  0,  0,  0},   // 7163
+    {  2,  3,199,  0,  0,  0},   // 7164
+    {  5,1433,  0,  0,  0,  0},   // 7165
+    {  2,3583,  0,  0,  0,  0},   // 7166
+    {  3,2389,  0,  0,  0,  0},   // 7167
+    {  2,  7,  0,  0,  0,  0},   // 7168
+    { 67,107,  0,  0,  0,  0},   // 7169
+    {  2,  3,  5,239,  0,  0},   // 7170
+    { 71,101,  0,  0,  0,  0},   // 7171
+    {  2, 11,163,  0,  0,  0},   // 7172
+    {  3,797,  0,  0,  0,  0},   // 7173
+    {  2, 17,211,  0,  0,  0},   // 7174
+    {  5,  7, 41,  0,  0,  0},   // 7175
+    {  2,  3, 13, 23,  0,  0},   // 7176
+    {  0,  0,  0,  0,  0,  0},   // 7177
+    {  2, 37, 97,  0,  0,  0},   // 7178
+    {  3,2393,  0,  0,  0,  0},   // 7179
+    {  2,  5,359,  0,  0,  0},   // 7180
+    { 43,167,  0,  0,  0,  0},   // 7181
+    {  2,  3,  7, 19,  0,  0},   // 7182
+    { 11,653,  0,  0,  0,  0},   // 7183
+    {  2,449,  0,  0,  0,  0},   // 7184
+    {  3,  5,479,  0,  0,  0},   // 7185
+    {  2,3593,  0,  0,  0,  0},   // 7186
+    {  0,  0,  0,  0,  0,  0},   // 7187
+    {  2,  3,599,  0,  0,  0},   // 7188
+    {  7, 13, 79,  0,  0,  0},   // 7189
+    {  2,  5,719,  0,  0,  0},   // 7190
+    {  3, 17, 47,  0,  0,  0},   // 7191
+    {  2, 29, 31,  0,  0,  0},   // 7192
+    {  0,  0,  0,  0,  0,  0},   // 7193
+    {  2,  3, 11,109,  0,  0},   // 7194
+    {  5,1439,  0,  0,  0,  0},   // 7195
+    {  2,  7,257,  0,  0,  0},   // 7196
+    {  3,2399,  0,  0,  0,  0},   // 7197
+    {  2, 59, 61,  0,  0,  0},   // 7198
+    { 23,313,  0,  0,  0,  0},   // 7199
+    {  2,  3,  5,  0,  0,  0},   // 7200
+    { 19,379,  0,  0,  0,  0},   // 7201
+    {  2, 13,277,  0,  0,  0},   // 7202
+    {  3,  7,  0,  0,  0,  0},   // 7203
+    {  2,1801,  0,  0,  0,  0},   // 7204
+    {  5, 11,131,  0,  0,  0},   // 7205
+    {  2,  3,1201,  0,  0,  0},   // 7206
+    {  0,  0,  0,  0,  0,  0},   // 7207
+    {  2, 17, 53,  0,  0,  0},   // 7208
+    {  3, 89,  0,  0,  0,  0},   // 7209
+    {  2,  5,  7,103,  0,  0},   // 7210
+    {  0,  0,  0,  0,  0,  0},   // 7211
+    {  2,  3,601,  0,  0,  0},   // 7212
+    {  0,  0,  0,  0,  0,  0},   // 7213
+    {  2,3607,  0,  0,  0,  0},   // 7214
+    {  3,  5, 13, 37,  0,  0},   // 7215
+    {  2, 11, 41,  0,  0,  0},   // 7216
+    {  7,1031,  0,  0,  0,  0},   // 7217
+    {  2,  3,401,  0,  0,  0},   // 7218
+    {  0,  0,  0,  0,  0,  0},   // 7219
+    {  2,  5, 19,  0,  0,  0},   // 7220
+    {  3, 29, 83,  0,  0,  0},   // 7221
+    {  2, 23,157,  0,  0,  0},   // 7222
+    { 31,233,  0,  0,  0,  0},   // 7223
+    {  2,  3,  7, 43,  0,  0},   // 7224
+    {  5, 17,  0,  0,  0,  0},   // 7225
+    {  2,3613,  0,  0,  0,  0},   // 7226
+    {  3, 11, 73,  0,  0,  0},   // 7227
+    {  2, 13,139,  0,  0,  0},   // 7228
+    {  0,  0,  0,  0,  0,  0},   // 7229
+    {  2,  3,  5,241,  0,  0},   // 7230
+    {  7,1033,  0,  0,  0,  0},   // 7231
+    {  2,113,  0,  0,  0,  0},   // 7232
+    {  3,2411,  0,  0,  0,  0},   // 7233
+    {  2,3617,  0,  0,  0,  0},   // 7234
+    {  5,1447,  0,  0,  0,  0},   // 7235
+    {  2,  3, 67,  0,  0,  0},   // 7236
+    {  0,  0,  0,  0,  0,  0},   // 7237
+    {  2,  7, 11, 47,  0,  0},   // 7238
+    {  3, 19,127,  0,  0,  0},   // 7239
+    {  2,  5,181,  0,  0,  0},   // 7240
+    { 13,557,  0,  0,  0,  0},   // 7241
+    {  2,  3, 17, 71,  0,  0},   // 7242
+    {  0,  0,  0,  0,  0,  0},   // 7243
+    {  2,1811,  0,  0,  0,  0},   // 7244
+    {  3,  5,  7, 23,  0,  0},   // 7245
+    {  2,3623,  0,  0,  0,  0},   // 7246
+    {  0,  0,  0,  0,  0,  0},   // 7247
+    {  2,  3,151,  0,  0,  0},   // 7248
+    { 11,659,  0,  0,  0,  0},   // 7249
+    {  2,  5, 29,  0,  0,  0},   // 7250
+    {  3,2417,  0,  0,  0,  0},   // 7251
+    {  2,  7, 37,  0,  0,  0},   // 7252
+    {  0,  0,  0,  0,  0,  0},   // 7253
+    {  2,  3, 13, 31,  0,  0},   // 7254
+    {  5,1451,  0,  0,  0,  0},   // 7255
+    {  2,907,  0,  0,  0,  0},   // 7256
+    {  3, 41, 59,  0,  0,  0},   // 7257
+    {  2, 19,191,  0,  0,  0},   // 7258
+    {  7, 17, 61,  0,  0,  0},   // 7259
+    {  2,  3,  5, 11,  0,  0},   // 7260
+    { 53,137,  0,  0,  0,  0},   // 7261
+    {  2,3631,  0,  0,  0,  0},   // 7262
+    {  3,269,  0,  0,  0,  0},   // 7263
+    {  2,227,  0,  0,  0,  0},   // 7264
+    {  5,1453,  0,  0,  0,  0},   // 7265
+    {  2,  3,  7,173,  0,  0},   // 7266
+    { 13, 43,  0,  0,  0,  0},   // 7267
+    {  2, 23, 79,  0,  0,  0},   // 7268
+    {  3,2423,  0,  0,  0,  0},   // 7269
+    {  2,  5,727,  0,  0,  0},   // 7270
+    { 11,661,  0,  0,  0,  0},   // 7271
+    {  2,  3,101,  0,  0,  0},   // 7272
+    {  7,1039,  0,  0,  0,  0},   // 7273
+    {  2,3637,  0,  0,  0,  0},   // 7274
+    {  3,  5, 97,  0,  0,  0},   // 7275
+    {  2, 17,107,  0,  0,  0},   // 7276
+    { 19,383,  0,  0,  0,  0},   // 7277
+    {  2,  3,1213,  0,  0,  0},   // 7278
+    { 29,251,  0,  0,  0,  0},   // 7279
+    {  2,  5,  7, 13,  0,  0},   // 7280
+    {  3,809,  0,  0,  0,  0},   // 7281
+    {  2, 11,331,  0,  0,  0},   // 7282
+    {  0,  0,  0,  0,  0,  0},   // 7283
+    {  2,  3,607,  0,  0,  0},   // 7284
+    {  5, 31, 47,  0,  0,  0},   // 7285
+    {  2,3643,  0,  0,  0,  0},   // 7286
+    {  3,  7,347,  0,  0,  0},   // 7287
+    {  2,911,  0,  0,  0,  0},   // 7288
+    { 37,197,  0,  0,  0,  0},   // 7289
+    {  2,  3,  5,  0,  0,  0},   // 7290
+    { 23,317,  0,  0,  0,  0},   // 7291
+    {  2,1823,  0,  0,  0,  0},   // 7292
+    {  3, 11, 13, 17,  0,  0},   // 7293
+    {  2,  7,521,  0,  0,  0},   // 7294
+    {  5,1459,  0,  0,  0,  0},   // 7295
+    {  2,  3, 19,  0,  0,  0},   // 7296
+    {  0,  0,  0,  0,  0,  0},   // 7297
+    {  2, 41, 89,  0,  0,  0},   // 7298
+    {  3,811,  0,  0,  0,  0},   // 7299
+    {  2,  5, 73,  0,  0,  0},   // 7300
+    {  7,149,  0,  0,  0,  0},   // 7301
+    {  2,  3,1217,  0,  0,  0},   // 7302
+    { 67,109,  0,  0,  0,  0},   // 7303
+    {  2, 11, 83,  0,  0,  0},   // 7304
+    {  3,  5,487,  0,  0,  0},   // 7305
+    {  2, 13,281,  0,  0,  0},   // 7306
+    {  0,  0,  0,  0,  0,  0},   // 7307
+    {  2,  3,  7, 29,  0,  0},   // 7308
+    {  0,  0,  0,  0,  0,  0},   // 7309
+    {  2,  5, 17, 43,  0,  0},   // 7310
+    {  3,2437,  0,  0,  0,  0},   // 7311
+    {  2,457,  0,  0,  0,  0},   // 7312
+    { 71,103,  0,  0,  0,  0},   // 7313
+    {  2,  3, 23, 53,  0,  0},   // 7314
+    {  5,  7, 11, 19,  0,  0},   // 7315
+    {  2, 31, 59,  0,  0,  0},   // 7316
+    {  3,271,  0,  0,  0,  0},   // 7317
+    {  2,3659,  0,  0,  0,  0},   // 7318
+    { 13,563,  0,  0,  0,  0},   // 7319
+    {  2,  3,  5, 61,  0,  0},   // 7320
+    {  0,  0,  0,  0,  0,  0},   // 7321
+    {  2,  7,523,  0,  0,  0},   // 7322
+    {  3,2441,  0,  0,  0,  0},   // 7323
+    {  2,1831,  0,  0,  0,  0},   // 7324
+    {  5,293,  0,  0,  0,  0},   // 7325
+    {  2,  3, 11, 37,  0,  0},   // 7326
+    { 17,431,  0,  0,  0,  0},   // 7327
+    {  2,229,  0,  0,  0,  0},   // 7328
+    {  3,  7,349,  0,  0,  0},   // 7329
+    {  2,  5,733,  0,  0,  0},   // 7330
+    {  0,  0,  0,  0,  0,  0},   // 7331
+    {  2,  3, 13, 47,  0,  0},   // 7332
+    {  0,  0,  0,  0,  0,  0},   // 7333
+    {  2, 19,193,  0,  0,  0},   // 7334
+    {  3,  5,163,  0,  0,  0},   // 7335
+    {  2,  7,131,  0,  0,  0},   // 7336
+    { 11, 23, 29,  0,  0,  0},   // 7337
+    {  2,  3,1223,  0,  0,  0},   // 7338
+    { 41,179,  0,  0,  0,  0},   // 7339
+    {  2,  5,367,  0,  0,  0},   // 7340
+    {  3,2447,  0,  0,  0,  0},   // 7341
+    {  2,3671,  0,  0,  0,  0},   // 7342
+    {  7,1049,  0,  0,  0,  0},   // 7343
+    {  2,  3, 17,  0,  0,  0},   // 7344
+    {  5, 13,113,  0,  0,  0},   // 7345
+    {  2,3673,  0,  0,  0,  0},   // 7346
+    {  3, 31, 79,  0,  0,  0},   // 7347
+    {  2, 11,167,  0,  0,  0},   // 7348
+    {  0,  0,  0,  0,  0,  0},   // 7349
+    {  2,  3,  5,  7,  0,  0},   // 7350
+    {  0,  0,  0,  0,  0,  0},   // 7351
+    {  2,919,  0,  0,  0,  0},   // 7352
+    {  3, 19, 43,  0,  0,  0},   // 7353
+    {  2,3677,  0,  0,  0,  0},   // 7354
+    {  5,1471,  0,  0,  0,  0},   // 7355
+    {  2,  3,613,  0,  0,  0},   // 7356
+    {  7,1051,  0,  0,  0,  0},   // 7357
+    {  2, 13,283,  0,  0,  0},   // 7358
+    {  3, 11,223,  0,  0,  0},   // 7359
+    {  2,  5, 23,  0,  0,  0},   // 7360
+    { 17,433,  0,  0,  0,  0},   // 7361
+    {  2,  3,409,  0,  0,  0},   // 7362
+    { 37,199,  0,  0,  0,  0},   // 7363
+    {  2,  7,263,  0,  0,  0},   // 7364
+    {  3,  5,491,  0,  0,  0},   // 7365
+    {  2, 29,127,  0,  0,  0},   // 7366
+    { 53,139,  0,  0,  0,  0},   // 7367
+    {  2,  3,307,  0,  0,  0},   // 7368
+    {  0,  0,  0,  0,  0,  0},   // 7369
+    {  2,  5, 11, 67,  0,  0},   // 7370
+    {  3,  7, 13,  0,  0,  0},   // 7371
+    {  2, 19, 97,  0,  0,  0},   // 7372
+    { 73,101,  0,  0,  0,  0},   // 7373
+    {  2,  3,1229,  0,  0,  0},   // 7374
+    {  5, 59,  0,  0,  0,  0},   // 7375
+    {  2,461,  0,  0,  0,  0},   // 7376
+    {  3,2459,  0,  0,  0,  0},   // 7377
+    {  2,  7, 17, 31,  0,  0},   // 7378
+    { 47,157,  0,  0,  0,  0},   // 7379
+    {  2,  3,  5, 41,  0,  0},   // 7380
+    { 11, 61,  0,  0,  0,  0},   // 7381
+    {  2,3691,  0,  0,  0,  0},   // 7382
+    {  3, 23,107,  0,  0,  0},   // 7383
+    {  2, 13, 71,  0,  0,  0},   // 7384
+    {  5,  7,211,  0,  0,  0},   // 7385
+    {  2,  3,1231,  0,  0,  0},   // 7386
+    { 83, 89,  0,  0,  0,  0},   // 7387
+    {  2,1847,  0,  0,  0,  0},   // 7388
+    {  3,821,  0,  0,  0,  0},   // 7389
+    {  2,  5,739,  0,  0,  0},   // 7390
+    { 19,389,  0,  0,  0,  0},   // 7391
+    {  2,  3,  7, 11,  0,  0},   // 7392
+    {  0,  0,  0,  0,  0,  0},   // 7393
+    {  2,3697,  0,  0,  0,  0},   // 7394
+    {  3,  5, 17, 29,  0,  0},   // 7395
+    {  2, 43,  0,  0,  0,  0},   // 7396
+    { 13,569,  0,  0,  0,  0},   // 7397
+    {  2,  3,137,  0,  0,  0},   // 7398
+    {  7,151,  0,  0,  0,  0},   // 7399
+    {  2,  5, 37,  0,  0,  0},   // 7400
+    {  3,2467,  0,  0,  0,  0},   // 7401
+    {  2,3701,  0,  0,  0,  0},   // 7402
+    { 11,673,  0,  0,  0,  0},   // 7403
+    {  2,  3,617,  0,  0,  0},   // 7404
+    {  5,1481,  0,  0,  0,  0},   // 7405
+    {  2,  7, 23,  0,  0,  0},   // 7406
+    {  3,823,  0,  0,  0,  0},   // 7407
+    {  2,463,  0,  0,  0,  0},   // 7408
+    { 31,239,  0,  0,  0,  0},   // 7409
+    {  2,  3,  5, 13, 19,  0},   // 7410
+    {  0,  0,  0,  0,  0,  0},   // 7411
+    {  2, 17,109,  0,  0,  0},   // 7412
+    {  3,  7,353,  0,  0,  0},   // 7413
+    {  2, 11,337,  0,  0,  0},   // 7414
+    {  5,1483,  0,  0,  0,  0},   // 7415
+    {  2,  3,103,  0,  0,  0},   // 7416
+    {  0,  0,  0,  0,  0,  0},   // 7417
+    {  2,3709,  0,  0,  0,  0},   // 7418
+    {  3,2473,  0,  0,  0,  0},   // 7419
+    {  2,  5,  7, 53,  0,  0},   // 7420
+    { 41,181,  0,  0,  0,  0},   // 7421
+    {  2,  3,1237,  0,  0,  0},   // 7422
+    { 13,571,  0,  0,  0,  0},   // 7423
+    {  2, 29,  0,  0,  0,  0},   // 7424
+    {  3,  5, 11,  0,  0,  0},   // 7425
+    {  2, 47, 79,  0,  0,  0},   // 7426
+    {  7,1061,  0,  0,  0,  0},   // 7427
+    {  2,  3,619,  0,  0,  0},   // 7428
+    { 17, 19, 23,  0,  0,  0},   // 7429
+    {  2,  5,743,  0,  0,  0},   // 7430
+    {  3,2477,  0,  0,  0,  0},   // 7431
+    {  2,929,  0,  0,  0,  0},   // 7432
+    {  0,  0,  0,  0,  0,  0},   // 7433
+    {  2,  3,  7, 59,  0,  0},   // 7434
+    {  5,1487,  0,  0,  0,  0},   // 7435
+    {  2, 11, 13,  0,  0,  0},   // 7436
+    {  3, 37, 67,  0,  0,  0},   // 7437
+    {  2,3719,  0,  0,  0,  0},   // 7438
+    { 43,173,  0,  0,  0,  0},   // 7439
+    {  2,  3,  5, 31,  0,  0},   // 7440
+    {  7,1063,  0,  0,  0,  0},   // 7441
+    {  2, 61,  0,  0,  0,  0},   // 7442
+    {  3,827,  0,  0,  0,  0},   // 7443
+    {  2,1861,  0,  0,  0,  0},   // 7444
+    {  5,1489,  0,  0,  0,  0},   // 7445
+    {  2,  3, 17, 73,  0,  0},   // 7446
+    { 11,677,  0,  0,  0,  0},   // 7447
+    {  2,  7, 19,  0,  0,  0},   // 7448
+    {  3, 13,191,  0,  0,  0},   // 7449
+    {  2,  5,149,  0,  0,  0},   // 7450
+    {  0,  0,  0,  0,  0,  0},   // 7451
+    {  2,  3, 23,  0,  0,  0},   // 7452
+    { 29,257,  0,  0,  0,  0},   // 7453
+    {  2,3727,  0,  0,  0,  0},   // 7454
+    {  3,  5,  7, 71,  0,  0},   // 7455
+    {  2,233,  0,  0,  0,  0},   // 7456
+    {  0,  0,  0,  0,  0,  0},   // 7457
+    {  2,  3, 11,113,  0,  0},   // 7458
+    {  0,  0,  0,  0,  0,  0},   // 7459
+    {  2,  5,373,  0,  0,  0},   // 7460
+    {  3,829,  0,  0,  0,  0},   // 7461
+    {  2,  7, 13, 41,  0,  0},   // 7462
+    { 17,439,  0,  0,  0,  0},   // 7463
+    {  2,  3,311,  0,  0,  0},   // 7464
+    {  5,1493,  0,  0,  0,  0},   // 7465
+    {  2,3733,  0,  0,  0,  0},   // 7466
+    {  3, 19,131,  0,  0,  0},   // 7467
+    {  2,1867,  0,  0,  0,  0},   // 7468
+    {  7, 11, 97,  0,  0,  0},   // 7469
+    {  2,  3,  5, 83,  0,  0},   // 7470
+    { 31,241,  0,  0,  0,  0},   // 7471
+    {  2,467,  0,  0,  0,  0},   // 7472
+    {  3, 47, 53,  0,  0,  0},   // 7473
+    {  2, 37,101,  0,  0,  0},   // 7474
+    {  5, 13, 23,  0,  0,  0},   // 7475
+    {  2,  3,  7, 89,  0,  0},   // 7476
+    {  0,  0,  0,  0,  0,  0},   // 7477
+    {  2,3739,  0,  0,  0,  0},   // 7478
+    {  3,277,  0,  0,  0,  0},   // 7479
+    {  2,  5, 11, 17,  0,  0},   // 7480
+    {  0,  0,  0,  0,  0,  0},   // 7481
+    {  2,  3, 29, 43,  0,  0},   // 7482
+    {  7,1069,  0,  0,  0,  0},   // 7483
+    {  2,1871,  0,  0,  0,  0},   // 7484
+    {  3,  5,499,  0,  0,  0},   // 7485
+    {  2, 19,197,  0,  0,  0},   // 7486
+    {  0,  0,  0,  0,  0,  0},   // 7487
+    {  2,  3, 13,  0,  0,  0},   // 7488
+    {  0,  0,  0,  0,  0,  0},   // 7489
+    {  2,  5,  7,107,  0,  0},   // 7490
+    {  3, 11,227,  0,  0,  0},   // 7491
+    {  2,1873,  0,  0,  0,  0},   // 7492
+    { 59,127,  0,  0,  0,  0},   // 7493
+    {  2,  3,1249,  0,  0,  0},   // 7494
+    {  5,1499,  0,  0,  0,  0},   // 7495
+    {  2,937,  0,  0,  0,  0},   // 7496
+    {  3,  7, 17,  0,  0,  0},   // 7497
+    {  2, 23,163,  0,  0,  0},   // 7498
+    {  0,  0,  0,  0,  0,  0},   // 7499
+    {  2,  3,  5,  0,  0,  0},   // 7500
+    { 13,577,  0,  0,  0,  0},   // 7501
+    {  2, 11, 31,  0,  0,  0},   // 7502
+    {  3, 41, 61,  0,  0,  0},   // 7503
+    {  2,  7, 67,  0,  0,  0},   // 7504
+    {  5, 19, 79,  0,  0,  0},   // 7505
+    {  2,  3,139,  0,  0,  0},   // 7506
+    {  0,  0,  0,  0,  0,  0},   // 7507
+    {  2,1877,  0,  0,  0,  0},   // 7508
+    {  3,2503,  0,  0,  0,  0},   // 7509
+    {  2,  5,751,  0,  0,  0},   // 7510
+    {  7, 29, 37,  0,  0,  0},   // 7511
+    {  2,  3,313,  0,  0,  0},   // 7512
+    { 11,683,  0,  0,  0,  0},   // 7513
+    {  2, 13, 17,  0,  0,  0},   // 7514
+    {  3,  5,167,  0,  0,  0},   // 7515
+    {  2,1879,  0,  0,  0,  0},   // 7516
+    {  0,  0,  0,  0,  0,  0},   // 7517
+    {  2,  3,  7,179,  0,  0},   // 7518
+    { 73,103,  0,  0,  0,  0},   // 7519
+    {  2,  5, 47,  0,  0,  0},   // 7520
+    {  3, 23,109,  0,  0,  0},   // 7521
+    {  2,3761,  0,  0,  0,  0},   // 7522
+    {  0,  0,  0,  0,  0,  0},   // 7523
+    {  2,  3, 11, 19,  0,  0},   // 7524
+    {  5,  7, 43,  0,  0,  0},   // 7525
+    {  2, 53, 71,  0,  0,  0},   // 7526
+    {  3, 13,193,  0,  0,  0},   // 7527
+    {  2,941,  0,  0,  0,  0},   // 7528
+    {  0,  0,  0,  0,  0,  0},   // 7529
+    {  2,  3,  5,251,  0,  0},   // 7530
+    { 17,443,  0,  0,  0,  0},   // 7531
+    {  2,  7,269,  0,  0,  0},   // 7532
+    {  3, 31,  0,  0,  0,  0},   // 7533
+    {  2,3767,  0,  0,  0,  0},   // 7534
+    {  5, 11,137,  0,  0,  0},   // 7535
+    {  2,  3,157,  0,  0,  0},   // 7536
+    {  0,  0,  0,  0,  0,  0},   // 7537
+    {  2,3769,  0,  0,  0,  0},   // 7538
+    {  3,  7,359,  0,  0,  0},   // 7539
+    {  2,  5, 13, 29,  0,  0},   // 7540
+    {  0,  0,  0,  0,  0,  0},   // 7541
+    {  2,  3,419,  0,  0,  0},   // 7542
+    { 19,397,  0,  0,  0,  0},   // 7543
+    {  2, 23, 41,  0,  0,  0},   // 7544
+    {  3,  5,503,  0,  0,  0},   // 7545
+    {  2,  7, 11,  0,  0,  0},   // 7546
+    {  0,  0,  0,  0,  0,  0},   // 7547
+    {  2,  3, 17, 37,  0,  0},   // 7548
+    {  0,  0,  0,  0,  0,  0},   // 7549
+    {  2,  5,151,  0,  0,  0},   // 7550
+    {  3,839,  0,  0,  0,  0},   // 7551
+    {  2, 59,  0,  0,  0,  0},   // 7552
+    {  7, 13, 83,  0,  0,  0},   // 7553
+    {  2,  3,1259,  0,  0,  0},   // 7554
+    {  5,1511,  0,  0,  0,  0},   // 7555
+    {  2,1889,  0,  0,  0,  0},   // 7556
+    {  3, 11,229,  0,  0,  0},   // 7557
+    {  2,3779,  0,  0,  0,  0},   // 7558
+    {  0,  0,  0,  0,  0,  0},   // 7559
+    {  2,  3,  5,  7,  0,  0},   // 7560
+    {  0,  0,  0,  0,  0,  0},   // 7561
+    {  2, 19,199,  0,  0,  0},   // 7562
+    {  3,2521,  0,  0,  0,  0},   // 7563
+    {  2, 31, 61,  0,  0,  0},   // 7564
+    {  5, 17, 89,  0,  0,  0},   // 7565
+    {  2,  3, 13, 97,  0,  0},   // 7566
+    {  7, 23, 47,  0,  0,  0},   // 7567
+    {  2, 11, 43,  0,  0,  0},   // 7568
+    {  3, 29,  0,  0,  0,  0},   // 7569
+    {  2,  5,757,  0,  0,  0},   // 7570
+    { 67,113,  0,  0,  0,  0},   // 7571
+    {  2,  3,631,  0,  0,  0},   // 7572
+    {  0,  0,  0,  0,  0,  0},   // 7573
+    {  2,  7,541,  0,  0,  0},   // 7574
+    {  3,  5,101,  0,  0,  0},   // 7575
+    {  2,947,  0,  0,  0,  0},   // 7576
+    {  0,  0,  0,  0,  0,  0},   // 7577
+    {  2,  3,421,  0,  0,  0},   // 7578
+    { 11, 13, 53,  0,  0,  0},   // 7579
+    {  2,  5,379,  0,  0,  0},   // 7580
+    {  3,  7, 19,  0,  0,  0},   // 7581
+    {  2, 17,223,  0,  0,  0},   // 7582
+    {  0,  0,  0,  0,  0,  0},   // 7583
+    {  2,  3, 79,  0,  0,  0},   // 7584
+    {  5, 37, 41,  0,  0,  0},   // 7585
+    {  2,3793,  0,  0,  0,  0},   // 7586
+    {  3,281,  0,  0,  0,  0},   // 7587
+    {  2,  7,271,  0,  0,  0},   // 7588
+    {  0,  0,  0,  0,  0,  0},   // 7589
+    {  2,  3,  5, 11, 23,  0},   // 7590
+    {  0,  0,  0,  0,  0,  0},   // 7591
+    {  2, 13, 73,  0,  0,  0},   // 7592
+    {  3,2531,  0,  0,  0,  0},   // 7593
+    {  2,3797,  0,  0,  0,  0},   // 7594
+    {  5,  7, 31,  0,  0,  0},   // 7595
+    {  2,  3,211,  0,  0,  0},   // 7596
+    { 71,107,  0,  0,  0,  0},   // 7597
+    {  2, 29,131,  0,  0,  0},   // 7598
+    {  3, 17,149,  0,  0,  0},   // 7599
+    {  2,  5, 19,  0,  0,  0},   // 7600
+    { 11,691,  0,  0,  0,  0},   // 7601
+    {  2,  3,  7,181,  0,  0},   // 7602
+    {  0,  0,  0,  0,  0,  0},   // 7603
+    {  2,1901,  0,  0,  0,  0},   // 7604
+    {  3,  5, 13,  0,  0,  0},   // 7605
+    {  2,3803,  0,  0,  0,  0},   // 7606
+    {  0,  0,  0,  0,  0,  0},   // 7607
+    {  2,  3,317,  0,  0,  0},   // 7608
+    {  7,1087,  0,  0,  0,  0},   // 7609
+    {  2,  5,761,  0,  0,  0},   // 7610
+    {  3, 43, 59,  0,  0,  0},   // 7611
+    {  2, 11,173,  0,  0,  0},   // 7612
+    { 23,331,  0,  0,  0,  0},   // 7613
+    {  2,  3, 47,  0,  0,  0},   // 7614
+    {  5,1523,  0,  0,  0,  0},   // 7615
+    {  2,  7, 17,  0,  0,  0},   // 7616
+    {  3,2539,  0,  0,  0,  0},   // 7617
+    {  2, 13,293,  0,  0,  0},   // 7618
+    { 19,401,  0,  0,  0,  0},   // 7619
+    {  2,  3,  5,127,  0,  0},   // 7620
+    {  0,  0,  0,  0,  0,  0},   // 7621
+    {  2, 37,103,  0,  0,  0},   // 7622
+    {  3,  7, 11,  0,  0,  0},   // 7623
+    {  2,953,  0,  0,  0,  0},   // 7624
+    {  5, 61,  0,  0,  0,  0},   // 7625
+    {  2,  3, 31, 41,  0,  0},   // 7626
+    { 29,263,  0,  0,  0,  0},   // 7627
+    {  2,1907,  0,  0,  0,  0},   // 7628
+    {  3,2543,  0,  0,  0,  0},   // 7629
+    {  2,  5,  7,109,  0,  0},   // 7630
+    { 13,587,  0,  0,  0,  0},   // 7631
+    {  2,  3, 53,  0,  0,  0},   // 7632
+    { 17,449,  0,  0,  0,  0},   // 7633
+    {  2, 11,347,  0,  0,  0},   // 7634
+    {  3,  5,509,  0,  0,  0},   // 7635
+    {  2, 23, 83,  0,  0,  0},   // 7636
+    {  7,1091,  0,  0,  0,  0},   // 7637
+    {  2,  3, 19, 67,  0,  0},   // 7638
+    {  0,  0,  0,  0,  0,  0},   // 7639
+    {  2,  5,191,  0,  0,  0},   // 7640
+    {  3,283,  0,  0,  0,  0},   // 7641
+    {  2,3821,  0,  0,  0,  0},   // 7642
+    {  0,  0,  0,  0,  0,  0},   // 7643
+    {  2,  3,  7, 13,  0,  0},   // 7644
+    {  5, 11,139,  0,  0,  0},   // 7645
+    {  2,3823,  0,  0,  0,  0},   // 7646
+    {  3,2549,  0,  0,  0,  0},   // 7647
+    {  2,239,  0,  0,  0,  0},   // 7648
+    {  0,  0,  0,  0,  0,  0},   // 7649
+    {  2,  3,  5, 17,  0,  0},   // 7650
+    {  7,1093,  0,  0,  0,  0},   // 7651
+    {  2,1913,  0,  0,  0,  0},   // 7652
+    {  3,2551,  0,  0,  0,  0},   // 7653
+    {  2, 43, 89,  0,  0,  0},   // 7654
+    {  5,1531,  0,  0,  0,  0},   // 7655
+    {  2,  3, 11, 29,  0,  0},   // 7656
+    { 13, 19, 31,  0,  0,  0},   // 7657
+    {  2,  7,547,  0,  0,  0},   // 7658
+    {  3, 23, 37,  0,  0,  0},   // 7659
+    {  2,  5,383,  0,  0,  0},   // 7660
+    { 47,163,  0,  0,  0,  0},   // 7661
+    {  2,  3,1277,  0,  0,  0},   // 7662
+    { 79, 97,  0,  0,  0,  0},   // 7663
+    {  2,479,  0,  0,  0,  0},   // 7664
+    {  3,  5,  7, 73,  0,  0},   // 7665
+    {  2,3833,  0,  0,  0,  0},   // 7666
+    { 11, 17, 41,  0,  0,  0},   // 7667
+    {  2,  3, 71,  0,  0,  0},   // 7668
+    {  0,  0,  0,  0,  0,  0},   // 7669
+    {  2,  5, 13, 59,  0,  0},   // 7670
+    {  3,2557,  0,  0,  0,  0},   // 7671
+    {  2,  7,137,  0,  0,  0},   // 7672
+    {  0,  0,  0,  0,  0,  0},   // 7673
+    {  2,  3,1279,  0,  0,  0},   // 7674
+    {  5,307,  0,  0,  0,  0},   // 7675
+    {  2, 19,101,  0,  0,  0},   // 7676
+    {  3,853,  0,  0,  0,  0},   // 7677
+    {  2, 11,349,  0,  0,  0},   // 7678
+    {  7,1097,  0,  0,  0,  0},   // 7679
+    {  2,  3,  5,  0,  0,  0},   // 7680
+    {  0,  0,  0,  0,  0,  0},   // 7681
+    {  2, 23,167,  0,  0,  0},   // 7682
+    {  3, 13,197,  0,  0,  0},   // 7683
+    {  2, 17,113,  0,  0,  0},   // 7684
+    {  5, 29, 53,  0,  0,  0},   // 7685
+    {  2,  3,  7, 61,  0,  0},   // 7686
+    {  0,  0,  0,  0,  0,  0},   // 7687
+    {  2, 31,  0,  0,  0,  0},   // 7688
+    {  3, 11,233,  0,  0,  0},   // 7689
+    {  2,  5,769,  0,  0,  0},   // 7690
+    {  0,  0,  0,  0,  0,  0},   // 7691
+    {  2,  3,641,  0,  0,  0},   // 7692
+    {  7,157,  0,  0,  0,  0},   // 7693
+    {  2,3847,  0,  0,  0,  0},   // 7694
+    {  3,  5, 19,  0,  0,  0},   // 7695
+    {  2, 13, 37,  0,  0,  0},   // 7696
+    { 43,179,  0,  0,  0,  0},   // 7697
+    {  2,  3,1283,  0,  0,  0},   // 7698
+    {  0,  0,  0,  0,  0,  0},   // 7699
+    {  2,  5,  7, 11,  0,  0},   // 7700
+    {  3, 17,151,  0,  0,  0},   // 7701
+    {  2,3851,  0,  0,  0,  0},   // 7702
+    {  0,  0,  0,  0,  0,  0},   // 7703
+    {  2,  3,107,  0,  0,  0},   // 7704
+    {  5, 23, 67,  0,  0,  0},   // 7705
+    {  2,3853,  0,  0,  0,  0},   // 7706
+    {  3,  7,367,  0,  0,  0},   // 7707
+    {  2, 41, 47,  0,  0,  0},   // 7708
+    { 13,593,  0,  0,  0,  0},   // 7709
+    {  2,  3,  5,257,  0,  0},   // 7710
+    { 11,701,  0,  0,  0,  0},   // 7711
+    {  2,241,  0,  0,  0,  0},   // 7712
+    {  3,857,  0,  0,  0,  0},   // 7713
+    {  2,  7, 19, 29,  0,  0},   // 7714
+    {  5,1543,  0,  0,  0,  0},   // 7715
+    {  2,  3,643,  0,  0,  0},   // 7716
+    {  0,  0,  0,  0,  0,  0},   // 7717
+    {  2, 17,227,  0,  0,  0},   // 7718
+    {  3, 31, 83,  0,  0,  0},   // 7719
+    {  2,  5,193,  0,  0,  0},   // 7720
+    {  7,1103,  0,  0,  0,  0},   // 7721
+    {  2,  3, 11, 13,  0,  0},   // 7722
+    {  0,  0,  0,  0,  0,  0},   // 7723
+    {  2,1931,  0,  0,  0,  0},   // 7724
+    {  3,  5,103,  0,  0,  0},   // 7725
+    {  2,3863,  0,  0,  0,  0},   // 7726
+    {  0,  0,  0,  0,  0,  0},   // 7727
+    {  2,  3,  7, 23,  0,  0},   // 7728
+    { 59,131,  0,  0,  0,  0},   // 7729
+    {  2,  5,773,  0,  0,  0},   // 7730
+    {  3,859,  0,  0,  0,  0},   // 7731
+    {  2,1933,  0,  0,  0,  0},   // 7732
+    { 11, 19, 37,  0,  0,  0},   // 7733
+    {  2,  3,1289,  0,  0,  0},   // 7734
+    {  5,  7, 13, 17,  0,  0},   // 7735
+    {  2,967,  0,  0,  0,  0},   // 7736
+    {  3,2579,  0,  0,  0,  0},   // 7737
+    {  2, 53, 73,  0,  0,  0},   // 7738
+    { 71,109,  0,  0,  0,  0},   // 7739
+    {  2,  3,  5, 43,  0,  0},   // 7740
+    {  0,  0,  0,  0,  0,  0},   // 7741
+    {  2,  7, 79,  0,  0,  0},   // 7742
+    {  3, 29, 89,  0,  0,  0},   // 7743
+    {  2, 11,  0,  0,  0,  0},   // 7744
+    {  5,1549,  0,  0,  0,  0},   // 7745
+    {  2,  3,1291,  0,  0,  0},   // 7746
+    { 61,127,  0,  0,  0,  0},   // 7747
+    {  2, 13,149,  0,  0,  0},   // 7748
+    {  3,  7, 41,  0,  0,  0},   // 7749
+    {  2,  5, 31,  0,  0,  0},   // 7750
+    { 23,337,  0,  0,  0,  0},   // 7751
+    {  2,  3, 17, 19,  0,  0},   // 7752
+    {  0,  0,  0,  0,  0,  0},   // 7753
+    {  2,3877,  0,  0,  0,  0},   // 7754
+    {  3,  5, 11, 47,  0,  0},   // 7755
+    {  2,  7,277,  0,  0,  0},   // 7756
+    {  0,  0,  0,  0,  0,  0},   // 7757
+    {  2,  3,431,  0,  0,  0},   // 7758
+    {  0,  0,  0,  0,  0,  0},   // 7759
+    {  2,  5, 97,  0,  0,  0},   // 7760
+    {  3, 13,199,  0,  0,  0},   // 7761
+    {  2,3881,  0,  0,  0,  0},   // 7762
+    {  7,1109,  0,  0,  0,  0},   // 7763
+    {  2,  3,647,  0,  0,  0},   // 7764
+    {  5,1553,  0,  0,  0,  0},   // 7765
+    {  2, 11,353,  0,  0,  0},   // 7766
+    {  3,863,  0,  0,  0,  0},   // 7767
+    {  2,971,  0,  0,  0,  0},   // 7768
+    { 17,457,  0,  0,  0,  0},   // 7769
+    {  2,  3,  5,  7, 37,  0},   // 7770
+    { 19,409,  0,  0,  0,  0},   // 7771
+    {  2, 29, 67,  0,  0,  0},   // 7772
+    {  3,2591,  0,  0,  0,  0},   // 7773
+    {  2, 13, 23,  0,  0,  0},   // 7774
+    {  5,311,  0,  0,  0,  0},   // 7775
+    {  2,  3,  0,  0,  0,  0},   // 7776
+    {  7, 11,101,  0,  0,  0},   // 7777
+    {  2,3889,  0,  0,  0,  0},   // 7778
+    {  3,2593,  0,  0,  0,  0},   // 7779
+    {  2,  5,389,  0,  0,  0},   // 7780
+    { 31,251,  0,  0,  0,  0},   // 7781
+    {  2,  3,1297,  0,  0,  0},   // 7782
+    { 43,181,  0,  0,  0,  0},   // 7783
+    {  2,  7,139,  0,  0,  0},   // 7784
+    {  3,  5,173,  0,  0,  0},   // 7785
+    {  2, 17,229,  0,  0,  0},   // 7786
+    { 13,599,  0,  0,  0,  0},   // 7787
+    {  2,  3, 11, 59,  0,  0},   // 7788
+    {  0,  0,  0,  0,  0,  0},   // 7789
+    {  2,  5, 19, 41,  0,  0},   // 7790
+    {  3,  7, 53,  0,  0,  0},   // 7791
+    {  2,487,  0,  0,  0,  0},   // 7792
+    {  0,  0,  0,  0,  0,  0},   // 7793
+    {  2,  3,433,  0,  0,  0},   // 7794
+    {  5,1559,  0,  0,  0,  0},   // 7795
+    {  2,1949,  0,  0,  0,  0},   // 7796
+    {  3, 23,113,  0,  0,  0},   // 7797
+    {  2,  7,557,  0,  0,  0},   // 7798
+    { 11,709,  0,  0,  0,  0},   // 7799
+    {  2,  3,  5, 13,  0,  0},   // 7800
+    { 29,269,  0,  0,  0,  0},   // 7801
+    {  2, 47, 83,  0,  0,  0},   // 7802
+    {  3, 17,  0,  0,  0,  0},   // 7803
+    {  2,1951,  0,  0,  0,  0},   // 7804
+    {  5,  7,223,  0,  0,  0},   // 7805
+    {  2,  3,1301,  0,  0,  0},   // 7806
+    { 37,211,  0,  0,  0,  0},   // 7807
+    {  2, 61,  0,  0,  0,  0},   // 7808
+    {  3, 19,137,  0,  0,  0},   // 7809
+    {  2,  5, 11, 71,  0,  0},   // 7810
+    { 73,107,  0,  0,  0,  0},   // 7811
+    {  2,  3,  7, 31,  0,  0},   // 7812
+    { 13,601,  0,  0,  0,  0},   // 7813
+    {  2,3907,  0,  0,  0,  0},   // 7814
+    {  3,  5,521,  0,  0,  0},   // 7815
+    {  2,977,  0,  0,  0,  0},   // 7816
+    {  0,  0,  0,  0,  0,  0},   // 7817
+    {  2,  3,1303,  0,  0,  0},   // 7818
+    {  7,1117,  0,  0,  0,  0},   // 7819
+    {  2,  5, 17, 23,  0,  0},   // 7820
+    {  3, 11, 79,  0,  0,  0},   // 7821
+    {  2,3911,  0,  0,  0,  0},   // 7822
+    {  0,  0,  0,  0,  0,  0},   // 7823
+    {  2,  3,163,  0,  0,  0},   // 7824
+    {  5,313,  0,  0,  0,  0},   // 7825
+    {  2,  7, 13, 43,  0,  0},   // 7826
+    {  3,2609,  0,  0,  0,  0},   // 7827
+    {  2, 19,103,  0,  0,  0},   // 7828
+    {  0,  0,  0,  0,  0,  0},   // 7829
+    {  2,  3,  5, 29,  0,  0},   // 7830
+    { 41,191,  0,  0,  0,  0},   // 7831
+    {  2, 11, 89,  0,  0,  0},   // 7832
+    {  3,  7,373,  0,  0,  0},   // 7833
+    {  2,3917,  0,  0,  0,  0},   // 7834
+    {  5,1567,  0,  0,  0,  0},   // 7835
+    {  2,  3,653,  0,  0,  0},   // 7836
+    { 17,461,  0,  0,  0,  0},   // 7837
+    {  2,3919,  0,  0,  0,  0},   // 7838
+    {  3, 13, 67,  0,  0,  0},   // 7839
+    {  2,  5,  7,  0,  0,  0},   // 7840
+    {  0,  0,  0,  0,  0,  0},   // 7841
+    {  2,  3,1307,  0,  0,  0},   // 7842
+    { 11, 23, 31,  0,  0,  0},   // 7843
+    {  2, 37, 53,  0,  0,  0},   // 7844
+    {  3,  5,523,  0,  0,  0},   // 7845
+    {  2,3923,  0,  0,  0,  0},   // 7846
+    {  7, 19, 59,  0,  0,  0},   // 7847
+    {  2,  3,109,  0,  0,  0},   // 7848
+    { 47,167,  0,  0,  0,  0},   // 7849
+    {  2,  5,157,  0,  0,  0},   // 7850
+    {  3,2617,  0,  0,  0,  0},   // 7851
+    {  2, 13,151,  0,  0,  0},   // 7852
+    {  0,  0,  0,  0,  0,  0},   // 7853
+    {  2,  3,  7, 11, 17,  0},   // 7854
+    {  5,1571,  0,  0,  0,  0},   // 7855
+    {  2,491,  0,  0,  0,  0},   // 7856
+    {  3, 97,  0,  0,  0,  0},   // 7857
+    {  2,3929,  0,  0,  0,  0},   // 7858
+    { 29,271,  0,  0,  0,  0},   // 7859
+    {  2,  3,  5,131,  0,  0},   // 7860
+    {  7,1123,  0,  0,  0,  0},   // 7861
+    {  2,3931,  0,  0,  0,  0},   // 7862
+    {  3,2621,  0,  0,  0,  0},   // 7863
+    {  2,983,  0,  0,  0,  0},   // 7864
+    {  5, 11, 13,  0,  0,  0},   // 7865
+    {  2,  3, 19, 23,  0,  0},   // 7866
+    {  0,  0,  0,  0,  0,  0},   // 7867
+    {  2,  7,281,  0,  0,  0},   // 7868
+    {  3, 43, 61,  0,  0,  0},   // 7869
+    {  2,  5,787,  0,  0,  0},   // 7870
+    { 17,463,  0,  0,  0,  0},   // 7871
+    {  2,  3, 41,  0,  0,  0},   // 7872
+    {  0,  0,  0,  0,  0,  0},   // 7873
+    {  2, 31,127,  0,  0,  0},   // 7874
+    {  3,  5,  7,  0,  0,  0},   // 7875
+    {  2, 11,179,  0,  0,  0},   // 7876
+    {  0,  0,  0,  0,  0,  0},   // 7877
+    {  2,  3, 13,101,  0,  0},   // 7878
+    {  0,  0,  0,  0,  0,  0},   // 7879
+    {  2,  5,197,  0,  0,  0},   // 7880
+    {  3, 37, 71,  0,  0,  0},   // 7881
+    {  2,  7,563,  0,  0,  0},   // 7882
+    {  0,  0,  0,  0,  0,  0},   // 7883
+    {  2,  3, 73,  0,  0,  0},   // 7884
+    {  5, 19, 83,  0,  0,  0},   // 7885
+    {  2,3943,  0,  0,  0,  0},   // 7886
+    {  3, 11,239,  0,  0,  0},   // 7887
+    {  2, 17, 29,  0,  0,  0},   // 7888
+    {  7, 23,  0,  0,  0,  0},   // 7889
+    {  2,  3,  5,263,  0,  0},   // 7890
+    { 13,607,  0,  0,  0,  0},   // 7891
+    {  2,1973,  0,  0,  0,  0},   // 7892
+    {  3,877,  0,  0,  0,  0},   // 7893
+    {  2,3947,  0,  0,  0,  0},   // 7894
+    {  5,1579,  0,  0,  0,  0},   // 7895
+    {  2,  3,  7, 47,  0,  0},   // 7896
+    { 53,149,  0,  0,  0,  0},   // 7897
+    {  2, 11,359,  0,  0,  0},   // 7898
+    {  3,2633,  0,  0,  0,  0},   // 7899
+    {  2,  5, 79,  0,  0,  0},   // 7900
+    {  0,  0,  0,  0,  0,  0},   // 7901
+    {  2,  3,439,  0,  0,  0},   // 7902
+    {  7,1129,  0,  0,  0,  0},   // 7903
+    {  2, 13, 19,  0,  0,  0},   // 7904
+    {  3,  5, 17, 31,  0,  0},   // 7905
+    {  2, 59, 67,  0,  0,  0},   // 7906
+    {  0,  0,  0,  0,  0,  0},   // 7907
+    {  2,  3,659,  0,  0,  0},   // 7908
+    { 11,719,  0,  0,  0,  0},   // 7909
+    {  2,  5,  7,113,  0,  0},   // 7910
+    {  3,293,  0,  0,  0,  0},   // 7911
+    {  2, 23, 43,  0,  0,  0},   // 7912
+    { 41,193,  0,  0,  0,  0},   // 7913
+    {  2,  3,1319,  0,  0,  0},   // 7914
+    {  5,1583,  0,  0,  0,  0},   // 7915
+    {  2,1979,  0,  0,  0,  0},   // 7916
+    {  3,  7, 13, 29,  0,  0},   // 7917
+    {  2, 37,107,  0,  0,  0},   // 7918
+    {  0,  0,  0,  0,  0,  0},   // 7919
+    {  2,  3,  5, 11,  0,  0},   // 7920
+    { 89,  0,  0,  0,  0,  0},   // 7921
+    {  2, 17,233,  0,  0,  0},   // 7922
+    {  3, 19,139,  0,  0,  0},   // 7923
+    {  2,  7,283,  0,  0,  0},   // 7924
+    {  5,317,  0,  0,  0,  0},   // 7925
+    {  2,  3,1321,  0,  0,  0},   // 7926
+    {  0,  0,  0,  0,  0,  0},   // 7927
+    {  2,991,  0,  0,  0,  0},   // 7928
+    {  3,881,  0,  0,  0,  0},   // 7929
+    {  2,  5, 13, 61,  0,  0},   // 7930
+    {  7, 11,103,  0,  0,  0},   // 7931
+    {  2,  3,661,  0,  0,  0},   // 7932
+    {  0,  0,  0,  0,  0,  0},   // 7933
+    {  2,3967,  0,  0,  0,  0},   // 7934
+    {  3,  5, 23,  0,  0,  0},   // 7935
+    {  2, 31,  0,  0,  0,  0},   // 7936
+    {  0,  0,  0,  0,  0,  0},   // 7937
+    {  2,  3,  7,  0,  0,  0},   // 7938
+    { 17,467,  0,  0,  0,  0},   // 7939
+    {  2,  5,397,  0,  0,  0},   // 7940
+    {  3,2647,  0,  0,  0,  0},   // 7941
+    {  2, 11, 19,  0,  0,  0},   // 7942
+    { 13, 47,  0,  0,  0,  0},   // 7943
+    {  2,  3,331,  0,  0,  0},   // 7944
+    {  5,  7,227,  0,  0,  0},   // 7945
+    {  2, 29,137,  0,  0,  0},   // 7946
+    {  3,883,  0,  0,  0,  0},   // 7947
+    {  2,1987,  0,  0,  0,  0},   // 7948
+    {  0,  0,  0,  0,  0,  0},   // 7949
+    {  2,  3,  5, 53,  0,  0},   // 7950
+    {  0,  0,  0,  0,  0,  0},   // 7951
+    {  2,  7, 71,  0,  0,  0},   // 7952
+    {  3, 11,241,  0,  0,  0},   // 7953
+    {  2, 41, 97,  0,  0,  0},   // 7954
+    {  5, 37, 43,  0,  0,  0},   // 7955
+    {  2,  3, 13, 17,  0,  0},   // 7956
+    { 73,109,  0,  0,  0,  0},   // 7957
+    {  2, 23,173,  0,  0,  0},   // 7958
+    {  3,  7,379,  0,  0,  0},   // 7959
+    {  2,  5,199,  0,  0,  0},   // 7960
+    { 19,419,  0,  0,  0,  0},   // 7961
+    {  2,  3,1327,  0,  0,  0},   // 7962
+    {  0,  0,  0,  0,  0,  0},   // 7963
+    {  2, 11,181,  0,  0,  0},   // 7964
+    {  3,  5, 59,  0,  0,  0},   // 7965
+    {  2,  7,569,  0,  0,  0},   // 7966
+    { 31,257,  0,  0,  0,  0},   // 7967
+    {  2,  3, 83,  0,  0,  0},   // 7968
+    { 13,613,  0,  0,  0,  0},   // 7969
+    {  2,  5,797,  0,  0,  0},   // 7970
+    {  3,2657,  0,  0,  0,  0},   // 7971
+    {  2,1993,  0,  0,  0,  0},   // 7972
+    {  7, 17, 67,  0,  0,  0},   // 7973
+    {  2,  3,443,  0,  0,  0},   // 7974
+    {  5, 11, 29,  0,  0,  0},   // 7975
+    {  2,997,  0,  0,  0,  0},   // 7976
+    {  3,2659,  0,  0,  0,  0},   // 7977
+    {  2,3989,  0,  0,  0,  0},   // 7978
+    { 79,101,  0,  0,  0,  0},   // 7979
+    {  2,  3,  5,  7, 19,  0},   // 7980
+    { 23,347,  0,  0,  0,  0},   // 7981
+    {  2, 13,307,  0,  0,  0},   // 7982
+    {  3,887,  0,  0,  0,  0},   // 7983
+    {  2,499,  0,  0,  0,  0},   // 7984
+    {  5,1597,  0,  0,  0,  0},   // 7985
+    {  2,  3, 11,  0,  0,  0},   // 7986
+    {  7,163,  0,  0,  0,  0},   // 7987
+    {  2,1997,  0,  0,  0,  0},   // 7988
+    {  3,2663,  0,  0,  0,  0},   // 7989
+    {  2,  5, 17, 47,  0,  0},   // 7990
+    { 61,131,  0,  0,  0,  0},   // 7991
+    {  2,  3, 37,  0,  0,  0},   // 7992
+    {  0,  0,  0,  0,  0,  0},   // 7993
+    {  2,  7,571,  0,  0,  0},   // 7994
+    {  3,  5, 13, 41,  0,  0},   // 7995
+    {  2,1999,  0,  0,  0,  0},   // 7996
+    { 11,727,  0,  0,  0,  0},   // 7997
+    {  2,  3, 31, 43,  0,  0},   // 7998
+    { 19,421,  0,  0,  0,  0},   // 7999
+    {  2,  5,  0,  0,  0,  0},   // 8000
+    {  3,  7,127,  0,  0,  0},   // 8001
+    {  2,4001,  0,  0,  0,  0},   // 8002
+    { 53,151,  0,  0,  0,  0},   // 8003
+    {  2,  3, 23, 29,  0,  0},   // 8004
+    {  5,1601,  0,  0,  0,  0},   // 8005
+    {  2,4003,  0,  0,  0,  0},   // 8006
+    {  3, 17,157,  0,  0,  0},   // 8007
+    {  2,  7, 11, 13,  0,  0},   // 8008
+    {  0,  0,  0,  0,  0,  0},   // 8009
+    {  2,  3,  5, 89,  0,  0},   // 8010
+    {  0,  0,  0,  0,  0,  0},   // 8011
+    {  2,2003,  0,  0,  0,  0},   // 8012
+    {  3,2671,  0,  0,  0,  0},   // 8013
+    {  2,4007,  0,  0,  0,  0},   // 8014
+    {  5,  7,229,  0,  0,  0},   // 8015
+    {  2,  3,167,  0,  0,  0},   // 8016
+    {  0,  0,  0,  0,  0,  0},   // 8017
+    {  2, 19,211,  0,  0,  0},   // 8018
+    {  3, 11,  0,  0,  0,  0},   // 8019
+    {  2,  5,401,  0,  0,  0},   // 8020
+    { 13,617,  0,  0,  0,  0},   // 8021
+    {  2,  3,  7,191,  0,  0},   // 8022
+    { 71,113,  0,  0,  0,  0},   // 8023
+    {  2, 17, 59,  0,  0,  0},   // 8024
+    {  3,  5,107,  0,  0,  0},   // 8025
+    {  2,4013,  0,  0,  0,  0},   // 8026
+    { 23,349,  0,  0,  0,  0},   // 8027
+    {  2,  3,223,  0,  0,  0},   // 8028
+    {  7, 31, 37,  0,  0,  0},   // 8029
+    {  2,  5, 11, 73,  0,  0},   // 8030
+    {  3,2677,  0,  0,  0,  0},   // 8031
+    {  2,251,  0,  0,  0,  0},   // 8032
+    { 29,277,  0,  0,  0,  0},   // 8033
+    {  2,  3, 13,103,  0,  0},   // 8034
+    {  5,1607,  0,  0,  0,  0},   // 8035
+    {  2,  7, 41,  0,  0,  0},   // 8036
+    {  3, 19, 47,  0,  0,  0},   // 8037
+    {  2,4019,  0,  0,  0,  0},   // 8038
+    {  0,  0,  0,  0,  0,  0},   // 8039
+    {  2,  3,  5, 67,  0,  0},   // 8040
+    { 11, 17, 43,  0,  0,  0},   // 8041
+    {  2,4021,  0,  0,  0,  0},   // 8042
+    {  3,  7,383,  0,  0,  0},   // 8043
+    {  2,2011,  0,  0,  0,  0},   // 8044
+    {  5,1609,  0,  0,  0,  0},   // 8045
+    {  2,  3,149,  0,  0,  0},   // 8046
+    { 13,619,  0,  0,  0,  0},   // 8047
+    {  2,503,  0,  0,  0,  0},   // 8048
+    {  3,2683,  0,  0,  0,  0},   // 8049
+    {  2,  5,  7, 23,  0,  0},   // 8050
+    { 83, 97,  0,  0,  0,  0},   // 8051
+    {  2,  3, 11, 61,  0,  0},   // 8052
+    {  0,  0,  0,  0,  0,  0},   // 8053
+    {  2,4027,  0,  0,  0,  0},   // 8054
+    {  3,  5,179,  0,  0,  0},   // 8055
+    {  2, 19, 53,  0,  0,  0},   // 8056
+    {  7,1151,  0,  0,  0,  0},   // 8057
+    {  2,  3, 17, 79,  0,  0},   // 8058
+    {  0,  0,  0,  0,  0,  0},   // 8059
+    {  2,  5, 13, 31,  0,  0},   // 8060
+    {  3,2687,  0,  0,  0,  0},   // 8061
+    {  2, 29,139,  0,  0,  0},   // 8062
+    { 11,733,  0,  0,  0,  0},   // 8063
+    {  2,  3,  7,  0,  0,  0},   // 8064
+    {  5,1613,  0,  0,  0,  0},   // 8065
+    {  2, 37,109,  0,  0,  0},   // 8066
+    {  3,2689,  0,  0,  0,  0},   // 8067
+    {  2,2017,  0,  0,  0,  0},   // 8068
+    {  0,  0,  0,  0,  0,  0},   // 8069
+    {  2,  3,  5,269,  0,  0},   // 8070
+    {  7,1153,  0,  0,  0,  0},   // 8071
+    {  2,1009,  0,  0,  0,  0},   // 8072
+    {  3, 13, 23,  0,  0,  0},   // 8073
+    {  2, 11,367,  0,  0,  0},   // 8074
+    {  5, 17, 19,  0,  0,  0},   // 8075
+    {  2,  3,673,  0,  0,  0},   // 8076
+    { 41,197,  0,  0,  0,  0},   // 8077
+    {  2,  7,577,  0,  0,  0},   // 8078
+    {  3,2693,  0,  0,  0,  0},   // 8079
+    {  2,  5,101,  0,  0,  0},   // 8080
+    {  0,  0,  0,  0,  0,  0},   // 8081
+    {  2,  3,449,  0,  0,  0},   // 8082
+    { 59,137,  0,  0,  0,  0},   // 8083
+    {  2, 43, 47,  0,  0,  0},   // 8084
+    {  3,  5,  7, 11,  0,  0},   // 8085
+    {  2, 13,311,  0,  0,  0},   // 8086
+    {  0,  0,  0,  0,  0,  0},   // 8087
+    {  2,  3,337,  0,  0,  0},   // 8088
+    {  0,  0,  0,  0,  0,  0},   // 8089
+    {  2,  5,809,  0,  0,  0},   // 8090
+    {  3, 29, 31,  0,  0,  0},   // 8091
+    {  2,  7, 17,  0,  0,  0},   // 8092
+    {  0,  0,  0,  0,  0,  0},   // 8093
+    {  2,  3, 19, 71,  0,  0},   // 8094
+    {  5,1619,  0,  0,  0,  0},   // 8095
+    {  2, 11, 23,  0,  0,  0},   // 8096
+    {  3,2699,  0,  0,  0,  0},   // 8097
+    {  2,4049,  0,  0,  0,  0},   // 8098
+    {  7, 13, 89,  0,  0,  0},   // 8099
+    {  2,  3,  5,  0,  0,  0},   // 8100
+    {  0,  0,  0,  0,  0,  0},   // 8101
+    {  2,4051,  0,  0,  0,  0},   // 8102
+    {  3, 37, 73,  0,  0,  0},   // 8103
+    {  2,1013,  0,  0,  0,  0},   // 8104
+    {  5,1621,  0,  0,  0,  0},   // 8105
+    {  2,  3,  7,193,  0,  0},   // 8106
+    { 11, 67,  0,  0,  0,  0},   // 8107
+    {  2,2027,  0,  0,  0,  0},   // 8108
+    {  3, 17, 53,  0,  0,  0},   // 8109
+    {  2,  5,811,  0,  0,  0},   // 8110
+    {  0,  0,  0,  0,  0,  0},   // 8111
+    {  2,  3, 13,  0,  0,  0},   // 8112
+    {  7, 19, 61,  0,  0,  0},   // 8113
+    {  2,4057,  0,  0,  0,  0},   // 8114
+    {  3,  5,541,  0,  0,  0},   // 8115
+    {  2,2029,  0,  0,  0,  0},   // 8116
+    {  0,  0,  0,  0,  0,  0},   // 8117
+    {  2,  3, 11, 41,  0,  0},   // 8118
+    { 23,353,  0,  0,  0,  0},   // 8119
+    {  2,  5,  7, 29,  0,  0},   // 8120
+    {  3,2707,  0,  0,  0,  0},   // 8121
+    {  2, 31,131,  0,  0,  0},   // 8122
+    {  0,  0,  0,  0,  0,  0},   // 8123
+    {  2,  3,677,  0,  0,  0},   // 8124
+    {  5, 13,  0,  0,  0,  0},   // 8125
+    {  2, 17,239,  0,  0,  0},   // 8126
+    {  3,  7, 43,  0,  0,  0},   // 8127
+    {  2,127,  0,  0,  0,  0},   // 8128
+    { 11,739,  0,  0,  0,  0},   // 8129
+    {  2,  3,  5,271,  0,  0},   // 8130
+    { 47,173,  0,  0,  0,  0},   // 8131
+    {  2, 19,107,  0,  0,  0},   // 8132
+    {  3,2711,  0,  0,  0,  0},   // 8133
+    {  2,  7, 83,  0,  0,  0},   // 8134
+    {  5,1627,  0,  0,  0,  0},   // 8135
+    {  2,  3,113,  0,  0,  0},   // 8136
+    { 79,103,  0,  0,  0,  0},   // 8137
+    {  2, 13,313,  0,  0,  0},   // 8138
+    {  3,2713,  0,  0,  0,  0},   // 8139
+    {  2,  5, 11, 37,  0,  0},   // 8140
+    {  7,1163,  0,  0,  0,  0},   // 8141
+    {  2,  3, 23, 59,  0,  0},   // 8142
+    { 17,479,  0,  0,  0,  0},   // 8143
+    {  2,509,  0,  0,  0,  0},   // 8144
+    {  3,  5,181,  0,  0,  0},   // 8145
+    {  2,4073,  0,  0,  0,  0},   // 8146
+    {  0,  0,  0,  0,  0,  0},   // 8147
+    {  2,  3,  7, 97,  0,  0},   // 8148
+    { 29,281,  0,  0,  0,  0},   // 8149
+    {  2,  5,163,  0,  0,  0},   // 8150
+    {  3, 11, 13, 19,  0,  0},   // 8151
+    {  2,1019,  0,  0,  0,  0},   // 8152
+    { 31,263,  0,  0,  0,  0},   // 8153
+    {  2,  3,151,  0,  0,  0},   // 8154
+    {  5,  7,233,  0,  0,  0},   // 8155
+    {  2,2039,  0,  0,  0,  0},   // 8156
+    {  3,2719,  0,  0,  0,  0},   // 8157
+    {  2,4079,  0,  0,  0,  0},   // 8158
+    { 41,199,  0,  0,  0,  0},   // 8159
+    {  2,  3,  5, 17,  0,  0},   // 8160
+    {  0,  0,  0,  0,  0,  0},   // 8161
+    {  2,  7, 11, 53,  0,  0},   // 8162
+    {  3,907,  0,  0,  0,  0},   // 8163
+    {  2, 13,157,  0,  0,  0},   // 8164
+    {  5, 23, 71,  0,  0,  0},   // 8165
+    {  2,  3,1361,  0,  0,  0},   // 8166
+    {  0,  0,  0,  0,  0,  0},   // 8167
+    {  2,1021,  0,  0,  0,  0},   // 8168
+    {  3,  7,389,  0,  0,  0},   // 8169
+    {  2,  5, 19, 43,  0,  0},   // 8170
+    {  0,  0,  0,  0,  0,  0},   // 8171
+    {  2,  3,227,  0,  0,  0},   // 8172
+    { 11,743,  0,  0,  0,  0},   // 8173
+    {  2, 61, 67,  0,  0,  0},   // 8174
+    {  3,  5,109,  0,  0,  0},   // 8175
+    {  2,  7, 73,  0,  0,  0},   // 8176
+    { 13, 17, 37,  0,  0,  0},   // 8177
+    {  2,  3, 29, 47,  0,  0},   // 8178
+    {  0,  0,  0,  0,  0,  0},   // 8179
+    {  2,  5,409,  0,  0,  0},   // 8180
+    {  3,101,  0,  0,  0,  0},   // 8181
+    {  2,4091,  0,  0,  0,  0},   // 8182
+    {  7,167,  0,  0,  0,  0},   // 8183
+    {  2,  3, 11, 31,  0,  0},   // 8184
+    {  5,1637,  0,  0,  0,  0},   // 8185
+    {  2,4093,  0,  0,  0,  0},   // 8186
+    {  3,2729,  0,  0,  0,  0},   // 8187
+    {  2, 23, 89,  0,  0,  0},   // 8188
+    { 19,431,  0,  0,  0,  0},   // 8189
+    {  2,  3,  5,  7, 13,  0},   // 8190
+    {  0,  0,  0,  0,  0,  0},   // 8191
+    {  2,  0,  0,  0,  0,  0},   // 8192
+    {  3,2731,  0,  0,  0,  0},   // 8193
+    {  2, 17,241,  0,  0,  0},   // 8194
+    {  5, 11,149,  0,  0,  0},   // 8195
+    {  2,  3,683,  0,  0,  0},   // 8196
+    {  7,1171,  0,  0,  0,  0},   // 8197
+    {  2,4099,  0,  0,  0,  0},   // 8198
+    {  3,911,  0,  0,  0,  0},   // 8199
+    {  2,  5, 41,  0,  0,  0},   // 8200
+    { 59,139,  0,  0,  0,  0},   // 8201
+    {  2,  3,1367,  0,  0,  0},   // 8202
+    { 13,631,  0,  0,  0,  0},   // 8203
+    {  2,  7,293,  0,  0,  0},   // 8204
+    {  3,  5,547,  0,  0,  0},   // 8205
+    {  2, 11,373,  0,  0,  0},   // 8206
+    { 29,283,  0,  0,  0,  0},   // 8207
+    {  2,  3, 19,  0,  0,  0},   // 8208
+    {  0,  0,  0,  0,  0,  0},   // 8209
+    {  2,  5,821,  0,  0,  0},   // 8210
+    {  3,  7, 17, 23,  0,  0},   // 8211
+    {  2,2053,  0,  0,  0,  0},   // 8212
+    { 43,191,  0,  0,  0,  0},   // 8213
+    {  2,  3, 37,  0,  0,  0},   // 8214
+    {  5, 31, 53,  0,  0,  0},   // 8215
+    {  2, 13, 79,  0,  0,  0},   // 8216
+    {  3, 11, 83,  0,  0,  0},   // 8217
+    {  2,  7,587,  0,  0,  0},   // 8218
+    {  0,  0,  0,  0,  0,  0},   // 8219
+    {  2,  3,  5,137,  0,  0},   // 8220
+    {  0,  0,  0,  0,  0,  0},   // 8221
+    {  2,4111,  0,  0,  0,  0},   // 8222
+    {  3,2741,  0,  0,  0,  0},   // 8223
+    {  2,257,  0,  0,  0,  0},   // 8224
+    {  5,  7, 47,  0,  0,  0},   // 8225
+    {  2,  3,457,  0,  0,  0},   // 8226
+    { 19,433,  0,  0,  0,  0},   // 8227
+    {  2, 11, 17,  0,  0,  0},   // 8228
+    {  3, 13,211,  0,  0,  0},   // 8229
+    {  2,  5,823,  0,  0,  0},   // 8230
+    {  0,  0,  0,  0,  0,  0},   // 8231
+    {  2,  3,  7,  0,  0,  0},   // 8232
+    {  0,  0,  0,  0,  0,  0},   // 8233
+    {  2, 23,179,  0,  0,  0},   // 8234
+    {  3,  5, 61,  0,  0,  0},   // 8235
+    {  2, 29, 71,  0,  0,  0},   // 8236
+    {  0,  0,  0,  0,  0,  0},   // 8237
+    {  2,  3,1373,  0,  0,  0},   // 8238
+    {  7, 11,107,  0,  0,  0},   // 8239
+    {  2,  5,103,  0,  0,  0},   // 8240
+    {  3, 41, 67,  0,  0,  0},   // 8241
+    {  2, 13,317,  0,  0,  0},   // 8242
+    {  0,  0,  0,  0,  0,  0},   // 8243
+    {  2,  3,229,  0,  0,  0},   // 8244
+    {  5, 17, 97,  0,  0,  0},   // 8245
+    {  2,  7, 19, 31,  0,  0},   // 8246
+    {  3,2749,  0,  0,  0,  0},   // 8247
+    {  2,1031,  0,  0,  0,  0},   // 8248
+    { 73,113,  0,  0,  0,  0},   // 8249
+    {  2,  3,  5, 11,  0,  0},   // 8250
+    { 37,223,  0,  0,  0,  0},   // 8251
+    {  2,2063,  0,  0,  0,  0},   // 8252
+    {  3,  7,131,  0,  0,  0},   // 8253
+    {  2,4127,  0,  0,  0,  0},   // 8254
+    {  5, 13,127,  0,  0,  0},   // 8255
+    {  2,  3, 43,  0,  0,  0},   // 8256
+    { 23,359,  0,  0,  0,  0},   // 8257
+    {  2,4129,  0,  0,  0,  0},   // 8258
+    {  3,2753,  0,  0,  0,  0},   // 8259
+    {  2,  5,  7, 59,  0,  0},   // 8260
+    { 11,751,  0,  0,  0,  0},   // 8261
+    {  2,  3, 17,  0,  0,  0},   // 8262
+    {  0,  0,  0,  0,  0,  0},   // 8263
+    {  2,1033,  0,  0,  0,  0},   // 8264
+    {  3,  5, 19, 29,  0,  0},   // 8265
+    {  2,4133,  0,  0,  0,  0},   // 8266
+    {  7,1181,  0,  0,  0,  0},   // 8267
+    {  2,  3, 13, 53,  0,  0},   // 8268
+    {  0,  0,  0,  0,  0,  0},   // 8269
+    {  2,  5,827,  0,  0,  0},   // 8270
+    {  3,919,  0,  0,  0,  0},   // 8271
+    {  2, 11, 47,  0,  0,  0},   // 8272
+    {  0,  0,  0,  0,  0,  0},   // 8273
+    {  2,  3,  7,197,  0,  0},   // 8274
+    {  5,331,  0,  0,  0,  0},   // 8275
+    {  2,2069,  0,  0,  0,  0},   // 8276
+    {  3, 31, 89,  0,  0,  0},   // 8277
+    {  2,4139,  0,  0,  0,  0},   // 8278
+    { 17,487,  0,  0,  0,  0},   // 8279
+    {  2,  3,  5, 23,  0,  0},   // 8280
+    {  7, 13,  0,  0,  0,  0},   // 8281
+    {  2, 41,101,  0,  0,  0},   // 8282
+    {  3, 11,251,  0,  0,  0},   // 8283
+    {  2, 19,109,  0,  0,  0},   // 8284
+    {  5,1657,  0,  0,  0,  0},   // 8285
+    {  2,  3,1381,  0,  0,  0},   // 8286
+    {  0,  0,  0,  0,  0,  0},   // 8287
+    {  2,  7, 37,  0,  0,  0},   // 8288
+    {  3,307,  0,  0,  0,  0},   // 8289
+    {  2,  5,829,  0,  0,  0},   // 8290
+    {  0,  0,  0,  0,  0,  0},   // 8291
+    {  2,  3,691,  0,  0,  0},   // 8292
+    {  0,  0,  0,  0,  0,  0},   // 8293
+    {  2, 11, 13, 29,  0,  0},   // 8294
+    {  3,  5,  7, 79,  0,  0},   // 8295
+    {  2, 17, 61,  0,  0,  0},   // 8296
+    {  0,  0,  0,  0,  0,  0},   // 8297
+    {  2,  3,461,  0,  0,  0},   // 8298
+    { 43,193,  0,  0,  0,  0},   // 8299
+    {  2,  5, 83,  0,  0,  0},   // 8300
+    {  3,2767,  0,  0,  0,  0},   // 8301
+    {  2,  7,593,  0,  0,  0},   // 8302
+    { 19, 23,  0,  0,  0,  0},   // 8303
+    {  2,  3,173,  0,  0,  0},   // 8304
+    {  5, 11,151,  0,  0,  0},   // 8305
+    {  2,4153,  0,  0,  0,  0},   // 8306
+    {  3, 13, 71,  0,  0,  0},   // 8307
+    {  2, 31, 67,  0,  0,  0},   // 8308
+    {  7,1187,  0,  0,  0,  0},   // 8309
+    {  2,  3,  5,277,  0,  0},   // 8310
+    {  0,  0,  0,  0,  0,  0},   // 8311
+    {  2,1039,  0,  0,  0,  0},   // 8312
+    {  3, 17,163,  0,  0,  0},   // 8313
+    {  2,4157,  0,  0,  0,  0},   // 8314
+    {  5,1663,  0,  0,  0,  0},   // 8315
+    {  2,  3,  7, 11,  0,  0},   // 8316
+    {  0,  0,  0,  0,  0,  0},   // 8317
+    {  2,4159,  0,  0,  0,  0},   // 8318
+    {  3, 47, 59,  0,  0,  0},   // 8319
+    {  2,  5, 13,  0,  0,  0},   // 8320
+    { 53,157,  0,  0,  0,  0},   // 8321
+    {  2,  3, 19, 73,  0,  0},   // 8322
+    {  7, 29, 41,  0,  0,  0},   // 8323
+    {  2,2081,  0,  0,  0,  0},   // 8324
+    {  3,  5, 37,  0,  0,  0},   // 8325
+    {  2, 23,181,  0,  0,  0},   // 8326
+    { 11,757,  0,  0,  0,  0},   // 8327
+    {  2,  3,347,  0,  0,  0},   // 8328
+    {  0,  0,  0,  0,  0,  0},   // 8329
+    {  2,  5,  7, 17,  0,  0},   // 8330
+    {  3,2777,  0,  0,  0,  0},   // 8331
+    {  2,2083,  0,  0,  0,  0},   // 8332
+    { 13,641,  0,  0,  0,  0},   // 8333
+    {  2,  3,463,  0,  0,  0},   // 8334
+    {  5,1667,  0,  0,  0,  0},   // 8335
+    {  2,521,  0,  0,  0,  0},   // 8336
+    {  3,  7,397,  0,  0,  0},   // 8337
+    {  2, 11,379,  0,  0,  0},   // 8338
+    { 31,269,  0,  0,  0,  0},   // 8339
+    {  2,  3,  5,139,  0,  0},   // 8340
+    { 19,439,  0,  0,  0,  0},   // 8341
+    {  2, 43, 97,  0,  0,  0},   // 8342
+    {  3,103,  0,  0,  0,  0},   // 8343
+    {  2,  7,149,  0,  0,  0},   // 8344
+    {  5,1669,  0,  0,  0,  0},   // 8345
+    {  2,  3, 13,107,  0,  0},   // 8346
+    { 17,491,  0,  0,  0,  0},   // 8347
+    {  2,2087,  0,  0,  0,  0},   // 8348
+    {  3, 11, 23,  0,  0,  0},   // 8349
+    {  2,  5,167,  0,  0,  0},   // 8350
+    {  7,1193,  0,  0,  0,  0},   // 8351
+    {  2,  3, 29,  0,  0,  0},   // 8352
+    {  0,  0,  0,  0,  0,  0},   // 8353
+    {  2,4177,  0,  0,  0,  0},   // 8354
+    {  3,  5,557,  0,  0,  0},   // 8355
+    {  2,2089,  0,  0,  0,  0},   // 8356
+    { 61,137,  0,  0,  0,  0},   // 8357
+    {  2,  3,  7,199,  0,  0},   // 8358
+    { 13,643,  0,  0,  0,  0},   // 8359
+    {  2,  5, 11, 19,  0,  0},   // 8360
+    {  3,929,  0,  0,  0,  0},   // 8361
+    {  2, 37,113,  0,  0,  0},   // 8362
+    {  0,  0,  0,  0,  0,  0},   // 8363
+    {  2,  3, 17, 41,  0,  0},   // 8364
+    {  5,  7,239,  0,  0,  0},   // 8365
+    {  2, 47, 89,  0,  0,  0},   // 8366
+    {  3,2789,  0,  0,  0,  0},   // 8367
+    {  2,523,  0,  0,  0,  0},   // 8368
+    {  0,  0,  0,  0,  0,  0},   // 8369
+    {  2,  3,  5, 31,  0,  0},   // 8370
+    { 11,761,  0,  0,  0,  0},   // 8371
+    {  2,  7, 13, 23,  0,  0},   // 8372
+    {  3,2791,  0,  0,  0,  0},   // 8373
+    {  2, 53, 79,  0,  0,  0},   // 8374
+    {  5, 67,  0,  0,  0,  0},   // 8375
+    {  2,  3,349,  0,  0,  0},   // 8376
+    {  0,  0,  0,  0,  0,  0},   // 8377
+    {  2, 59, 71,  0,  0,  0},   // 8378
+    {  3,  7, 19,  0,  0,  0},   // 8379
+    {  2,  5,419,  0,  0,  0},   // 8380
+    { 17, 29,  0,  0,  0,  0},   // 8381
+    {  2,  3, 11,127,  0,  0},   // 8382
+    { 83,101,  0,  0,  0,  0},   // 8383
+    {  2,131,  0,  0,  0,  0},   // 8384
+    {  3,  5, 13, 43,  0,  0},   // 8385
+    {  2,  7,599,  0,  0,  0},   // 8386
+    {  0,  0,  0,  0,  0,  0},   // 8387
+    {  2,  3,233,  0,  0,  0},   // 8388
+    {  0,  0,  0,  0,  0,  0},   // 8389
+    {  2,  5,839,  0,  0,  0},   // 8390
+    {  3,2797,  0,  0,  0,  0},   // 8391
+    {  2,1049,  0,  0,  0,  0},   // 8392
+    {  7, 11,109,  0,  0,  0},   // 8393
+    {  2,  3,1399,  0,  0,  0},   // 8394
+    {  5, 23, 73,  0,  0,  0},   // 8395
+    {  2,2099,  0,  0,  0,  0},   // 8396
+    {  3,311,  0,  0,  0,  0},   // 8397
+    {  2, 13, 17, 19,  0,  0},   // 8398
+    { 37,227,  0,  0,  0,  0},   // 8399
+    {  2,  3,  5,  7,  0,  0},   // 8400
+    { 31,271,  0,  0,  0,  0},   // 8401
+    {  2,4201,  0,  0,  0,  0},   // 8402
+    {  3,2801,  0,  0,  0,  0},   // 8403
+    {  2, 11,191,  0,  0,  0},   // 8404
+    {  5, 41,  0,  0,  0,  0},   // 8405
+    {  2,  3,467,  0,  0,  0},   // 8406
+    {  7,1201,  0,  0,  0,  0},   // 8407
+    {  2,1051,  0,  0,  0,  0},   // 8408
+    {  3,2803,  0,  0,  0,  0},   // 8409
+    {  2,  5, 29,  0,  0,  0},   // 8410
+    { 13,647,  0,  0,  0,  0},   // 8411
+    {  2,  3,701,  0,  0,  0},   // 8412
+    { 47,179,  0,  0,  0,  0},   // 8413
+    {  2,  7,601,  0,  0,  0},   // 8414
+    {  3,  5, 11, 17,  0,  0},   // 8415
+    {  2,263,  0,  0,  0,  0},   // 8416
+    { 19,443,  0,  0,  0,  0},   // 8417
+    {  2,  3, 23, 61,  0,  0},   // 8418
+    {  0,  0,  0,  0,  0,  0},   // 8419
+    {  2,  5,421,  0,  0,  0},   // 8420
+    {  3,  7,401,  0,  0,  0},   // 8421
+    {  2,4211,  0,  0,  0,  0},   // 8422
+    {  0,  0,  0,  0,  0,  0},   // 8423
+    {  2,  3, 13,  0,  0,  0},   // 8424
+    {  5,337,  0,  0,  0,  0},   // 8425
+    {  2, 11,383,  0,  0,  0},   // 8426
+    {  3, 53,  0,  0,  0,  0},   // 8427
+    {  2,  7, 43,  0,  0,  0},   // 8428
+    {  0,  0,  0,  0,  0,  0},   // 8429
+    {  2,  3,  5,281,  0,  0},   // 8430
+    {  0,  0,  0,  0,  0,  0},   // 8431
+    {  2, 17, 31,  0,  0,  0},   // 8432
+    {  3,937,  0,  0,  0,  0},   // 8433
+    {  2,4217,  0,  0,  0,  0},   // 8434
+    {  5,  7,241,  0,  0,  0},   // 8435
+    {  2,  3, 19, 37,  0,  0},   // 8436
+    { 11, 13, 59,  0,  0,  0},   // 8437
+    {  2,4219,  0,  0,  0,  0},   // 8438
+    {  3, 29, 97,  0,  0,  0},   // 8439
+    {  2,  5,211,  0,  0,  0},   // 8440
+    { 23,367,  0,  0,  0,  0},   // 8441
+    {  2,  3,  7, 67,  0,  0},   // 8442
+    {  0,  0,  0,  0,  0,  0},   // 8443
+    {  2,2111,  0,  0,  0,  0},   // 8444
+    {  3,  5,563,  0,  0,  0},   // 8445
+    {  2, 41,103,  0,  0,  0},   // 8446
+    {  0,  0,  0,  0,  0,  0},   // 8447
+    {  2,  3, 11,  0,  0,  0},   // 8448
+    {  7, 17, 71,  0,  0,  0},   // 8449
+    {  2,  5, 13,  0,  0,  0},   // 8450
+    {  3,313,  0,  0,  0,  0},   // 8451
+    {  2,2113,  0,  0,  0,  0},   // 8452
+    { 79,107,  0,  0,  0,  0},   // 8453
+    {  2,  3,1409,  0,  0,  0},   // 8454
+    {  5, 19, 89,  0,  0,  0},   // 8455
+    {  2,  7,151,  0,  0,  0},   // 8456
+    {  3,2819,  0,  0,  0,  0},   // 8457
+    {  2,4229,  0,  0,  0,  0},   // 8458
+    { 11,769,  0,  0,  0,  0},   // 8459
+    {  2,  3,  5, 47,  0,  0},   // 8460
+    {  0,  0,  0,  0,  0,  0},   // 8461
+    {  2,4231,  0,  0,  0,  0},   // 8462
+    {  3,  7, 13, 31,  0,  0},   // 8463
+    {  2, 23,  0,  0,  0,  0},   // 8464
+    {  5,1693,  0,  0,  0,  0},   // 8465
+    {  2,  3, 17, 83,  0,  0},   // 8466
+    {  0,  0,  0,  0,  0,  0},   // 8467
+    {  2, 29, 73,  0,  0,  0},   // 8468
+    {  3,941,  0,  0,  0,  0},   // 8469
+    {  2,  5,  7, 11,  0,  0},   // 8470
+    { 43,197,  0,  0,  0,  0},   // 8471
+    {  2,  3,353,  0,  0,  0},   // 8472
+    { 37,229,  0,  0,  0,  0},   // 8473
+    {  2, 19,223,  0,  0,  0},   // 8474
+    {  3,  5,113,  0,  0,  0},   // 8475
+    {  2, 13,163,  0,  0,  0},   // 8476
+    {  7,173,  0,  0,  0,  0},   // 8477
+    {  2,  3,157,  0,  0,  0},   // 8478
+    { 61,139,  0,  0,  0,  0},   // 8479
+    {  2,  5, 53,  0,  0,  0},   // 8480
+    {  3, 11,257,  0,  0,  0},   // 8481
+    {  2,4241,  0,  0,  0,  0},   // 8482
+    { 17,499,  0,  0,  0,  0},   // 8483
+    {  2,  3,  7,101,  0,  0},   // 8484
+    {  5,1697,  0,  0,  0,  0},   // 8485
+    {  2,4243,  0,  0,  0,  0},   // 8486
+    {  3, 23, 41,  0,  0,  0},   // 8487
+    {  2,1061,  0,  0,  0,  0},   // 8488
+    { 13,653,  0,  0,  0,  0},   // 8489
+    {  2,  3,  5,283,  0,  0},   // 8490
+    {  7,1213,  0,  0,  0,  0},   // 8491
+    {  2, 11,193,  0,  0,  0},   // 8492
+    {  3, 19,149,  0,  0,  0},   // 8493
+    {  2, 31,137,  0,  0,  0},   // 8494
+    {  5,1699,  0,  0,  0,  0},   // 8495
+    {  2,  3, 59,  0,  0,  0},   // 8496
+    { 29,293,  0,  0,  0,  0},   // 8497
+    {  2,  7,607,  0,  0,  0},   // 8498
+    {  3,2833,  0,  0,  0,  0},   // 8499
+    {  2,  5, 17,  0,  0,  0},   // 8500
+    {  0,  0,  0,  0,  0,  0},   // 8501
+    {  2,  3, 13,109,  0,  0},   // 8502
+    { 11,773,  0,  0,  0,  0},   // 8503
+    {  2,1063,  0,  0,  0,  0},   // 8504
+    {  3,  5,  7,  0,  0,  0},   // 8505
+    {  2,4253,  0,  0,  0,  0},   // 8506
+    { 47,181,  0,  0,  0,  0},   // 8507
+    {  2,  3,709,  0,  0,  0},   // 8508
+    { 67,127,  0,  0,  0,  0},   // 8509
+    {  2,  5, 23, 37,  0,  0},   // 8510
+    {  3,2837,  0,  0,  0,  0},   // 8511
+    {  2,  7, 19,  0,  0,  0},   // 8512
+    {  0,  0,  0,  0,  0,  0},   // 8513
+    {  2,  3, 11, 43,  0,  0},   // 8514
+    {  5, 13,131,  0,  0,  0},   // 8515
+    {  2,2129,  0,  0,  0,  0},   // 8516
+    {  3, 17,167,  0,  0,  0},   // 8517
+    {  2,4259,  0,  0,  0,  0},   // 8518
+    {  7,1217,  0,  0,  0,  0},   // 8519
+    {  2,  3,  5, 71,  0,  0},   // 8520
+    {  0,  0,  0,  0,  0,  0},   // 8521
+    {  2,4261,  0,  0,  0,  0},   // 8522
+    {  3,947,  0,  0,  0,  0},   // 8523
+    {  2,2131,  0,  0,  0,  0},   // 8524
+    {  5, 11, 31,  0,  0,  0},   // 8525
+    {  2,  3,  7, 29,  0,  0},   // 8526
+    {  0,  0,  0,  0,  0,  0},   // 8527
+    {  2, 13, 41,  0,  0,  0},   // 8528
+    {  3,2843,  0,  0,  0,  0},   // 8529
+    {  2,  5,853,  0,  0,  0},   // 8530
+    { 19,449,  0,  0,  0,  0},   // 8531
+    {  2,  3, 79,  0,  0,  0},   // 8532
+    {  7, 23, 53,  0,  0,  0},   // 8533
+    {  2, 17,251,  0,  0,  0},   // 8534
+    {  3,  5,569,  0,  0,  0},   // 8535
+    {  2, 11, 97,  0,  0,  0},   // 8536
+    {  0,  0,  0,  0,  0,  0},   // 8537
+    {  2,  3,1423,  0,  0,  0},   // 8538
+    {  0,  0,  0,  0,  0,  0},   // 8539
+    {  2,  5,  7, 61,  0,  0},   // 8540
+    {  3, 13, 73,  0,  0,  0},   // 8541
+    {  2,4271,  0,  0,  0,  0},   // 8542
+    {  0,  0,  0,  0,  0,  0},   // 8543
+    {  2,  3, 89,  0,  0,  0},   // 8544
+    {  5,1709,  0,  0,  0,  0},   // 8545
+    {  2,4273,  0,  0,  0,  0},   // 8546
+    {  3,  7, 11, 37,  0,  0},   // 8547
+    {  2,2137,  0,  0,  0,  0},   // 8548
+    { 83,103,  0,  0,  0,  0},   // 8549
+    {  2,  3,  5, 19,  0,  0},   // 8550
+    { 17,503,  0,  0,  0,  0},   // 8551
+    {  2,1069,  0,  0,  0,  0},   // 8552
+    {  3,2851,  0,  0,  0,  0},   // 8553
+    {  2,  7, 13, 47,  0,  0},   // 8554
+    {  5, 29, 59,  0,  0,  0},   // 8555
+    {  2,  3, 23, 31,  0,  0},   // 8556
+    { 43,199,  0,  0,  0,  0},   // 8557
+    {  2, 11,389,  0,  0,  0},   // 8558
+    {  3,317,  0,  0,  0,  0},   // 8559
+    {  2,  5,107,  0,  0,  0},   // 8560
+    {  7,1223,  0,  0,  0,  0},   // 8561
+    {  2,  3,1427,  0,  0,  0},   // 8562
+    {  0,  0,  0,  0,  0,  0},   // 8563
+    {  2,2141,  0,  0,  0,  0},   // 8564
+    {  3,  5,571,  0,  0,  0},   // 8565
+    {  2,4283,  0,  0,  0,  0},   // 8566
+    { 13,659,  0,  0,  0,  0},   // 8567
+    {  2,  3,  7, 17,  0,  0},   // 8568
+    { 11, 19, 41,  0,  0,  0},   // 8569
+    {  2,  5,857,  0,  0,  0},   // 8570
+    {  3,2857,  0,  0,  0,  0},   // 8571
+    {  2,2143,  0,  0,  0,  0},   // 8572
+    {  0,  0,  0,  0,  0,  0},   // 8573
+    {  2,  3,1429,  0,  0,  0},   // 8574
+    {  5,  7,  0,  0,  0,  0},   // 8575
+    {  2, 67,  0,  0,  0,  0},   // 8576
+    {  3,953,  0,  0,  0,  0},   // 8577
+    {  2,4289,  0,  0,  0,  0},   // 8578
+    { 23,373,  0,  0,  0,  0},   // 8579
+    {  2,  3,  5, 11, 13,  0},   // 8580
+    {  0,  0,  0,  0,  0,  0},   // 8581
+    {  2,  7,613,  0,  0,  0},   // 8582
+    {  3,2861,  0,  0,  0,  0},   // 8583
+    {  2, 29, 37,  0,  0,  0},   // 8584
+    {  5, 17,101,  0,  0,  0},   // 8585
+    {  2,  3, 53,  0,  0,  0},   // 8586
+    { 31,277,  0,  0,  0,  0},   // 8587
+    {  2, 19,113,  0,  0,  0},   // 8588
+    {  3,  7,409,  0,  0,  0},   // 8589
+    {  2,  5,859,  0,  0,  0},   // 8590
+    { 11, 71,  0,  0,  0,  0},   // 8591
+    {  2,  3,179,  0,  0,  0},   // 8592
+    { 13,661,  0,  0,  0,  0},   // 8593
+    {  2,4297,  0,  0,  0,  0},   // 8594
+    {  3,  5,191,  0,  0,  0},   // 8595
+    {  2,  7,307,  0,  0,  0},   // 8596
+    {  0,  0,  0,  0,  0,  0},   // 8597
+    {  2,  3,1433,  0,  0,  0},   // 8598
+    {  0,  0,  0,  0,  0,  0},   // 8599
+    {  2,  5, 43,  0,  0,  0},   // 8600
+    {  3, 47, 61,  0,  0,  0},   // 8601
+    {  2, 11, 17, 23,  0,  0},   // 8602
+    {  7,1229,  0,  0,  0,  0},   // 8603
+    {  2,  3,239,  0,  0,  0},   // 8604
+    {  5,1721,  0,  0,  0,  0},   // 8605
+    {  2, 13,331,  0,  0,  0},   // 8606
+    {  3, 19,151,  0,  0,  0},   // 8607
+    {  2,269,  0,  0,  0,  0},   // 8608
+    {  0,  0,  0,  0,  0,  0},   // 8609
+    {  2,  3,  5,  7, 41,  0},   // 8610
+    { 79,109,  0,  0,  0,  0},   // 8611
+    {  2,2153,  0,  0,  0,  0},   // 8612
+    {  3, 11, 29,  0,  0,  0},   // 8613
+    {  2, 59, 73,  0,  0,  0},   // 8614
+    {  5,1723,  0,  0,  0,  0},   // 8615
+    {  2,  3,359,  0,  0,  0},   // 8616
+    {  7,1231,  0,  0,  0,  0},   // 8617
+    {  2, 31,139,  0,  0,  0},   // 8618
+    {  3, 13, 17,  0,  0,  0},   // 8619
+    {  2,  5,431,  0,  0,  0},   // 8620
+    { 37,233,  0,  0,  0,  0},   // 8621
+    {  2,  3,479,  0,  0,  0},   // 8622
+    {  0,  0,  0,  0,  0,  0},   // 8623
+    {  2,  7, 11,  0,  0,  0},   // 8624
+    {  3,  5, 23,  0,  0,  0},   // 8625
+    {  2, 19,227,  0,  0,  0},   // 8626
+    {  0,  0,  0,  0,  0,  0},   // 8627
+    {  2,  3,719,  0,  0,  0},   // 8628
+    {  0,  0,  0,  0,  0,  0},   // 8629
+    {  2,  5,863,  0,  0,  0},   // 8630
+    {  3,  7,137,  0,  0,  0},   // 8631
+    {  2, 13, 83,  0,  0,  0},   // 8632
+    { 89, 97,  0,  0,  0,  0},   // 8633
+    {  2,  3,1439,  0,  0,  0},   // 8634
+    {  5, 11,157,  0,  0,  0},   // 8635
+    {  2, 17,127,  0,  0,  0},   // 8636
+    {  3,2879,  0,  0,  0,  0},   // 8637
+    {  2,  7,617,  0,  0,  0},   // 8638
+    { 53,163,  0,  0,  0,  0},   // 8639
+    {  2,  3,  5,  0,  0,  0},   // 8640
+    {  0,  0,  0,  0,  0,  0},   // 8641
+    {  2, 29,149,  0,  0,  0},   // 8642
+    {  3, 43, 67,  0,  0,  0},   // 8643
+    {  2,2161,  0,  0,  0,  0},   // 8644
+    {  5,  7, 13, 19,  0,  0},   // 8645
+    {  2,  3, 11,131,  0,  0},   // 8646
+    {  0,  0,  0,  0,  0,  0},   // 8647
+    {  2, 23, 47,  0,  0,  0},   // 8648
+    {  3, 31,  0,  0,  0,  0},   // 8649
+    {  2,  5,173,  0,  0,  0},   // 8650
+    { 41,211,  0,  0,  0,  0},   // 8651
+    {  2,  3,  7,103,  0,  0},   // 8652
+    { 17,509,  0,  0,  0,  0},   // 8653
+    {  2,4327,  0,  0,  0,  0},   // 8654
+    {  3,  5,577,  0,  0,  0},   // 8655
+    {  2,541,  0,  0,  0,  0},   // 8656
+    { 11,787,  0,  0,  0,  0},   // 8657
+    {  2,  3, 13, 37,  0,  0},   // 8658
+    {  7,1237,  0,  0,  0,  0},   // 8659
+    {  2,  5,433,  0,  0,  0},   // 8660
+    {  3,2887,  0,  0,  0,  0},   // 8661
+    {  2, 61, 71,  0,  0,  0},   // 8662
+    {  0,  0,  0,  0,  0,  0},   // 8663
+    {  2,  3, 19,  0,  0,  0},   // 8664
+    {  5,1733,  0,  0,  0,  0},   // 8665
+    {  2,  7,619,  0,  0,  0},   // 8666
+    {  3,107,  0,  0,  0,  0},   // 8667
+    {  2, 11,197,  0,  0,  0},   // 8668
+    {  0,  0,  0,  0,  0,  0},   // 8669
+    {  2,  3,  5, 17,  0,  0},   // 8670
+    { 13, 23, 29,  0,  0,  0},   // 8671
+    {  2,271,  0,  0,  0,  0},   // 8672
+    {  3,  7, 59,  0,  0,  0},   // 8673
+    {  2,4337,  0,  0,  0,  0},   // 8674
+    {  5,347,  0,  0,  0,  0},   // 8675
+    {  2,  3,241,  0,  0,  0},   // 8676
+    {  0,  0,  0,  0,  0,  0},   // 8677
+    {  2,4339,  0,  0,  0,  0},   // 8678
+    {  3, 11,263,  0,  0,  0},   // 8679
+    {  2,  5,  7, 31,  0,  0},   // 8680
+    {  0,  0,  0,  0,  0,  0},   // 8681
+    {  2,  3,1447,  0,  0,  0},   // 8682
+    { 19,457,  0,  0,  0,  0},   // 8683
+    {  2, 13,167,  0,  0,  0},   // 8684
+    {  3,  5,193,  0,  0,  0},   // 8685
+    {  2, 43,101,  0,  0,  0},   // 8686
+    {  7, 17, 73,  0,  0,  0},   // 8687
+    {  2,  3,181,  0,  0,  0},   // 8688
+    {  0,  0,  0,  0,  0,  0},   // 8689
+    {  2,  5, 11, 79,  0,  0},   // 8690
+    {  3,2897,  0,  0,  0,  0},   // 8691
+    {  2, 41, 53,  0,  0,  0},   // 8692
+    {  0,  0,  0,  0,  0,  0},   // 8693
+    {  2,  3,  7, 23,  0,  0},   // 8694
+    {  5, 37, 47,  0,  0,  0},   // 8695
+    {  2,1087,  0,  0,  0,  0},   // 8696
+    {  3, 13,223,  0,  0,  0},   // 8697
+    {  2,4349,  0,  0,  0,  0},   // 8698
+    {  0,  0,  0,  0,  0,  0},   // 8699
+    {  2,  3,  5, 29,  0,  0},   // 8700
+    {  7, 11,113,  0,  0,  0},   // 8701
+    {  2, 19,229,  0,  0,  0},   // 8702
+    {  3,967,  0,  0,  0,  0},   // 8703
+    {  2, 17,  0,  0,  0,  0},   // 8704
+    {  5,1741,  0,  0,  0,  0},   // 8705
+    {  2,  3,1451,  0,  0,  0},   // 8706
+    {  0,  0,  0,  0,  0,  0},   // 8707
+    {  2,  7,311,  0,  0,  0},   // 8708
+    {  3,2903,  0,  0,  0,  0},   // 8709
+    {  2,  5, 13, 67,  0,  0},   // 8710
+    { 31,281,  0,  0,  0,  0},   // 8711
+    {  2,  3, 11,  0,  0,  0},   // 8712
+    {  0,  0,  0,  0,  0,  0},   // 8713
+    {  2,4357,  0,  0,  0,  0},   // 8714
+    {  3,  5,  7, 83,  0,  0},   // 8715
+    {  2,2179,  0,  0,  0,  0},   // 8716
+    { 23,379,  0,  0,  0,  0},   // 8717
+    {  2,  3,1453,  0,  0,  0},   // 8718
+    {  0,  0,  0,  0,  0,  0},   // 8719
+    {  2,  5,109,  0,  0,  0},   // 8720
+    {  3, 17, 19,  0,  0,  0},   // 8721
+    {  2,  7, 89,  0,  0,  0},   // 8722
+    { 11, 13, 61,  0,  0,  0},   // 8723
+    {  2,  3,727,  0,  0,  0},   // 8724
+    {  5,349,  0,  0,  0,  0},   // 8725
+    {  2,4363,  0,  0,  0,  0},   // 8726
+    {  3,2909,  0,  0,  0,  0},   // 8727
+    {  2,1091,  0,  0,  0,  0},   // 8728
+    {  7, 29, 43,  0,  0,  0},   // 8729
+    {  2,  3,  5, 97,  0,  0},   // 8730
+    {  0,  0,  0,  0,  0,  0},   // 8731
+    {  2, 37, 59,  0,  0,  0},   // 8732
+    {  3, 41, 71,  0,  0,  0},   // 8733
+    {  2, 11,397,  0,  0,  0},   // 8734
+    {  5,1747,  0,  0,  0,  0},   // 8735
+    {  2,  3,  7, 13,  0,  0},   // 8736
+    {  0,  0,  0,  0,  0,  0},   // 8737
+    {  2, 17,257,  0,  0,  0},   // 8738
+    {  3,971,  0,  0,  0,  0},   // 8739
+    {  2,  5, 19, 23,  0,  0},   // 8740
+    {  0,  0,  0,  0,  0,  0},   // 8741
+    {  2,  3, 31, 47,  0,  0},   // 8742
+    {  7,1249,  0,  0,  0,  0},   // 8743
+    {  2,1093,  0,  0,  0,  0},   // 8744
+    {  3,  5, 11, 53,  0,  0},   // 8745
+    {  2,4373,  0,  0,  0,  0},   // 8746
+    {  0,  0,  0,  0,  0,  0},   // 8747
+    {  2,  3,  0,  0,  0,  0},   // 8748
+    { 13,673,  0,  0,  0,  0},   // 8749
+    {  2,  5,  7,  0,  0,  0},   // 8750
+    {  3,2917,  0,  0,  0,  0},   // 8751
+    {  2,547,  0,  0,  0,  0},   // 8752
+    {  0,  0,  0,  0,  0,  0},   // 8753
+    {  2,  3,1459,  0,  0,  0},   // 8754
+    {  5, 17,103,  0,  0,  0},   // 8755
+    {  2, 11,199,  0,  0,  0},   // 8756
+    {  3,  7,139,  0,  0,  0},   // 8757
+    {  2, 29,151,  0,  0,  0},   // 8758
+    { 19,461,  0,  0,  0,  0},   // 8759
+    {  2,  3,  5, 73,  0,  0},   // 8760
+    {  0,  0,  0,  0,  0,  0},   // 8761
+    {  2, 13,337,  0,  0,  0},   // 8762
+    {  3, 23,127,  0,  0,  0},   // 8763
+    {  2,  7,313,  0,  0,  0},   // 8764
+    {  5,1753,  0,  0,  0,  0},   // 8765
+    {  2,  3,487,  0,  0,  0},   // 8766
+    { 11,797,  0,  0,  0,  0},   // 8767
+    {  2,137,  0,  0,  0,  0},   // 8768
+    {  3, 37, 79,  0,  0,  0},   // 8769
+    {  2,  5,877,  0,  0,  0},   // 8770
+    {  7,179,  0,  0,  0,  0},   // 8771
+    {  2,  3, 17, 43,  0,  0},   // 8772
+    { 31,283,  0,  0,  0,  0},   // 8773
+    {  2, 41,107,  0,  0,  0},   // 8774
+    {  3,  5, 13,  0,  0,  0},   // 8775
+    {  2,1097,  0,  0,  0,  0},   // 8776
+    { 67,131,  0,  0,  0,  0},   // 8777
+    {  2,  3,  7, 11, 19,  0},   // 8778
+    {  0,  0,  0,  0,  0,  0},   // 8779
+    {  2,  5,439,  0,  0,  0},   // 8780
+    {  3,2927,  0,  0,  0,  0},   // 8781
+    {  2,4391,  0,  0,  0,  0},   // 8782
+    {  0,  0,  0,  0,  0,  0},   // 8783
+    {  2,  3, 61,  0,  0,  0},   // 8784
+    {  5,  7,251,  0,  0,  0},   // 8785
+    {  2, 23,191,  0,  0,  0},   // 8786
+    {  3, 29,101,  0,  0,  0},   // 8787
+    {  2, 13,  0,  0,  0,  0},   // 8788
+    { 11, 17, 47,  0,  0,  0},   // 8789
+    {  2,  3,  5,293,  0,  0},   // 8790
+    { 59,149,  0,  0,  0,  0},   // 8791
+    {  2,  7,157,  0,  0,  0},   // 8792
+    {  3,977,  0,  0,  0,  0},   // 8793
+    {  2,4397,  0,  0,  0,  0},   // 8794
+    {  5,1759,  0,  0,  0,  0},   // 8795
+    {  2,  3,733,  0,  0,  0},   // 8796
+    { 19,463,  0,  0,  0,  0},   // 8797
+    {  2, 53, 83,  0,  0,  0},   // 8798
+    {  3,  7,419,  0,  0,  0},   // 8799
+    {  2,  5, 11,  0,  0,  0},   // 8800
+    { 13,677,  0,  0,  0,  0},   // 8801
+    {  2,  3,163,  0,  0,  0},   // 8802
+    {  0,  0,  0,  0,  0,  0},   // 8803
+    {  2, 31, 71,  0,  0,  0},   // 8804
+    {  3,  5,587,  0,  0,  0},   // 8805
+    {  2,  7, 17, 37,  0,  0},   // 8806
+    {  0,  0,  0,  0,  0,  0},   // 8807
+    {  2,  3,367,  0,  0,  0},   // 8808
+    { 23,383,  0,  0,  0,  0},   // 8809
+    {  2,  5,881,  0,  0,  0},   // 8810
+    {  3, 11, 89,  0,  0,  0},   // 8811
+    {  2,2203,  0,  0,  0,  0},   // 8812
+    {  7,1259,  0,  0,  0,  0},   // 8813
+    {  2,  3, 13,113,  0,  0},   // 8814
+    {  5, 41, 43,  0,  0,  0},   // 8815
+    {  2, 19, 29,  0,  0,  0},   // 8816
+    {  3,2939,  0,  0,  0,  0},   // 8817
+    {  2,4409,  0,  0,  0,  0},   // 8818
+    {  0,  0,  0,  0,  0,  0},   // 8819
+    {  2,  3,  5,  7,  0,  0},   // 8820
+    {  0,  0,  0,  0,  0,  0},   // 8821
+    {  2, 11,401,  0,  0,  0},   // 8822
+    {  3, 17,173,  0,  0,  0},   // 8823
+    {  2,1103,  0,  0,  0,  0},   // 8824
+    {  5,353,  0,  0,  0,  0},   // 8825
+    {  2,  3,1471,  0,  0,  0},   // 8826
+    {  7, 13, 97,  0,  0,  0},   // 8827
+    {  2,2207,  0,  0,  0,  0},   // 8828
+    {  3,109,  0,  0,  0,  0},   // 8829
+    {  2,  5,883,  0,  0,  0},   // 8830
+    {  0,  0,  0,  0,  0,  0},   // 8831
+    {  2,  3, 23,  0,  0,  0},   // 8832
+    { 11, 73,  0,  0,  0,  0},   // 8833
+    {  2,  7,631,  0,  0,  0},   // 8834
+    {  3,  5, 19, 31,  0,  0},   // 8835
+    {  2, 47,  0,  0,  0,  0},   // 8836
+    {  0,  0,  0,  0,  0,  0},   // 8837
+    {  2,  3,491,  0,  0,  0},   // 8838
+    {  0,  0,  0,  0,  0,  0},   // 8839
+    {  2,  5, 13, 17,  0,  0},   // 8840
+    {  3,  7,421,  0,  0,  0},   // 8841
+    {  2,4421,  0,  0,  0,  0},   // 8842
+    { 37,239,  0,  0,  0,  0},   // 8843
+    {  2,  3, 11, 67,  0,  0},   // 8844
+    {  5, 29, 61,  0,  0,  0},   // 8845
+    {  2,4423,  0,  0,  0,  0},   // 8846
+    {  3,983,  0,  0,  0,  0},   // 8847
+    {  2,  7, 79,  0,  0,  0},   // 8848
+    {  0,  0,  0,  0,  0,  0},   // 8849
+    {  2,  3,  5, 59,  0,  0},   // 8850
+    { 53,167,  0,  0,  0,  0},   // 8851
+    {  2,2213,  0,  0,  0,  0},   // 8852
+    {  3, 13,227,  0,  0,  0},   // 8853
+    {  2, 19,233,  0,  0,  0},   // 8854
+    {  5,  7, 11, 23,  0,  0},   // 8855
+    {  2,  3, 41,  0,  0,  0},   // 8856
+    { 17,521,  0,  0,  0,  0},   // 8857
+    {  2, 43,103,  0,  0,  0},   // 8858
+    {  3,2953,  0,  0,  0,  0},   // 8859
+    {  2,  5,443,  0,  0,  0},   // 8860
+    {  0,  0,  0,  0,  0,  0},   // 8861
+    {  2,  3,  7,211,  0,  0},   // 8862
+    {  0,  0,  0,  0,  0,  0},   // 8863
+    {  2,277,  0,  0,  0,  0},   // 8864
+    {  3,  5,197,  0,  0,  0},   // 8865
+    {  2, 11, 13, 31,  0,  0},   // 8866
+    {  0,  0,  0,  0,  0,  0},   // 8867
+    {  2,  3,739,  0,  0,  0},   // 8868
+    {  7,181,  0,  0,  0,  0},   // 8869
+    {  2,  5,887,  0,  0,  0},   // 8870
+    {  3,2957,  0,  0,  0,  0},   // 8871
+    {  2,1109,  0,  0,  0,  0},   // 8872
+    { 19,467,  0,  0,  0,  0},   // 8873
+    {  2,  3, 17, 29,  0,  0},   // 8874
+    {  5, 71,  0,  0,  0,  0},   // 8875
+    {  2,  7,317,  0,  0,  0},   // 8876
+    {  3, 11,269,  0,  0,  0},   // 8877
+    {  2, 23,193,  0,  0,  0},   // 8878
+    { 13,683,  0,  0,  0,  0},   // 8879
+    {  2,  3,  5, 37,  0,  0},   // 8880
+    { 83,107,  0,  0,  0,  0},   // 8881
+    {  2,4441,  0,  0,  0,  0},   // 8882
+    {  3,  7, 47,  0,  0,  0},   // 8883
+    {  2,2221,  0,  0,  0,  0},   // 8884
+    {  5,1777,  0,  0,  0,  0},   // 8885
+    {  2,  3,1481,  0,  0,  0},   // 8886
+    {  0,  0,  0,  0,  0,  0},   // 8887
+    {  2, 11,101,  0,  0,  0},   // 8888
+    {  3,2963,  0,  0,  0,  0},   // 8889
+    {  2,  5,  7,127,  0,  0},   // 8890
+    { 17,523,  0,  0,  0,  0},   // 8891
+    {  2,  3, 13, 19,  0,  0},   // 8892
+    {  0,  0,  0,  0,  0,  0},   // 8893
+    {  2,4447,  0,  0,  0,  0},   // 8894
+    {  3,  5,593,  0,  0,  0},   // 8895
+    {  2,139,  0,  0,  0,  0},   // 8896
+    {  7, 31, 41,  0,  0,  0},   // 8897
+    {  2,  3,1483,  0,  0,  0},   // 8898
+    { 11,809,  0,  0,  0,  0},   // 8899
+    {  2,  5, 89,  0,  0,  0},   // 8900
+    {  3, 23, 43,  0,  0,  0},   // 8901
+    {  2,4451,  0,  0,  0,  0},   // 8902
+    { 29,307,  0,  0,  0,  0},   // 8903
+    {  2,  3,  7, 53,  0,  0},   // 8904
+    {  5, 13,137,  0,  0,  0},   // 8905
+    {  2, 61, 73,  0,  0,  0},   // 8906
+    {  3,2969,  0,  0,  0,  0},   // 8907
+    {  2, 17,131,  0,  0,  0},   // 8908
+    { 59,151,  0,  0,  0,  0},   // 8909
+    {  2,  3,  5, 11,  0,  0},   // 8910
+    {  7, 19, 67,  0,  0,  0},   // 8911
+    {  2,557,  0,  0,  0,  0},   // 8912
+    {  3,2971,  0,  0,  0,  0},   // 8913
+    {  2,4457,  0,  0,  0,  0},   // 8914
+    {  5,1783,  0,  0,  0,  0},   // 8915
+    {  2,  3,743,  0,  0,  0},   // 8916
+    { 37,241,  0,  0,  0,  0},   // 8917
+    {  2,  7, 13,  0,  0,  0},   // 8918
+    {  3,991,  0,  0,  0,  0},   // 8919
+    {  2,  5,223,  0,  0,  0},   // 8920
+    { 11,811,  0,  0,  0,  0},   // 8921
+    {  2,  3,1487,  0,  0,  0},   // 8922
+    {  0,  0,  0,  0,  0,  0},   // 8923
+    {  2, 23, 97,  0,  0,  0},   // 8924
+    {  3,  5,  7, 17,  0,  0},   // 8925
+    {  2,4463,  0,  0,  0,  0},   // 8926
+    { 79,113,  0,  0,  0,  0},   // 8927
+    {  2,  3, 31,  0,  0,  0},   // 8928
+    {  0,  0,  0,  0,  0,  0},   // 8929
+    {  2,  5, 19, 47,  0,  0},   // 8930
+    {  3, 13,229,  0,  0,  0},   // 8931
+    {  2,  7, 11, 29,  0,  0},   // 8932
+    {  0,  0,  0,  0,  0,  0},   // 8933
+    {  2,  3,1489,  0,  0,  0},   // 8934
+    {  5,1787,  0,  0,  0,  0},   // 8935
+    {  2,1117,  0,  0,  0,  0},   // 8936
+    {  3,331,  0,  0,  0,  0},   // 8937
+    {  2, 41,109,  0,  0,  0},   // 8938
+    {  7,1277,  0,  0,  0,  0},   // 8939
+    {  2,  3,  5,149,  0,  0},   // 8940
+    {  0,  0,  0,  0,  0,  0},   // 8941
+    {  2, 17,263,  0,  0,  0},   // 8942
+    {  3, 11,271,  0,  0,  0},   // 8943
+    {  2, 13, 43,  0,  0,  0},   // 8944
+    {  5,1789,  0,  0,  0,  0},   // 8945
+    {  2,  3,  7, 71,  0,  0},   // 8946
+    { 23,389,  0,  0,  0,  0},   // 8947
+    {  2,2237,  0,  0,  0,  0},   // 8948
+    {  3, 19,157,  0,  0,  0},   // 8949
+    {  2,  5,179,  0,  0,  0},   // 8950
+    {  0,  0,  0,  0,  0,  0},   // 8951
+    {  2,  3,373,  0,  0,  0},   // 8952
+    {  7,1279,  0,  0,  0,  0},   // 8953
+    {  2, 11, 37,  0,  0,  0},   // 8954
+    {  3,  5,199,  0,  0,  0},   // 8955
+    {  2,2239,  0,  0,  0,  0},   // 8956
+    { 13, 53,  0,  0,  0,  0},   // 8957
+    {  2,  3,1493,  0,  0,  0},   // 8958
+    { 17, 31,  0,  0,  0,  0},   // 8959
+    {  2,  5,  7,  0,  0,  0},   // 8960
+    {  3, 29,103,  0,  0,  0},   // 8961
+    {  2,4481,  0,  0,  0,  0},   // 8962
+    {  0,  0,  0,  0,  0,  0},   // 8963
+    {  2,  3, 83,  0,  0,  0},   // 8964
+    {  5, 11,163,  0,  0,  0},   // 8965
+    {  2,4483,  0,  0,  0,  0},   // 8966
+    {  3,  7, 61,  0,  0,  0},   // 8967
+    {  2, 19, 59,  0,  0,  0},   // 8968
+    {  0,  0,  0,  0,  0,  0},   // 8969
+    {  2,  3,  5, 13, 23,  0},   // 8970
+    {  0,  0,  0,  0,  0,  0},   // 8971
+    {  2,2243,  0,  0,  0,  0},   // 8972
+    {  3,997,  0,  0,  0,  0},   // 8973
+    {  2,  7,641,  0,  0,  0},   // 8974
+    {  5,359,  0,  0,  0,  0},   // 8975
+    {  2,  3, 11, 17,  0,  0},   // 8976
+    { 47,191,  0,  0,  0,  0},   // 8977
+    {  2, 67,  0,  0,  0,  0},   // 8978
+    {  3, 41, 73,  0,  0,  0},   // 8979
+    {  2,  5,449,  0,  0,  0},   // 8980
+    {  7,1283,  0,  0,  0,  0},   // 8981
+    {  2,  3,499,  0,  0,  0},   // 8982
+    { 13,691,  0,  0,  0,  0},   // 8983
+    {  2,1123,  0,  0,  0,  0},   // 8984
+    {  3,  5,599,  0,  0,  0},   // 8985
+    {  2,4493,  0,  0,  0,  0},   // 8986
+    { 11, 19, 43,  0,  0,  0},   // 8987
+    {  2,  3,  7,107,  0,  0},   // 8988
+    { 89,101,  0,  0,  0,  0},   // 8989
+    {  2,  5, 29, 31,  0,  0},   // 8990
+    {  3, 37,  0,  0,  0,  0},   // 8991
+    {  2,281,  0,  0,  0,  0},   // 8992
+    { 17, 23,  0,  0,  0,  0},   // 8993
+    {  2,  3,1499,  0,  0,  0},   // 8994
+    {  5,  7,257,  0,  0,  0},   // 8995
+    {  2, 13,173,  0,  0,  0},   // 8996
+    {  3,2999,  0,  0,  0,  0},   // 8997
+    {  2, 11,409,  0,  0,  0},   // 8998
+    {  0,  0,  0,  0,  0,  0},   // 8999
+    {  2,  3,  5,  0,  0,  0},   // 9000
+    {  0,  0,  0,  0,  0,  0},   // 9001
+    {  2,  7,643,  0,  0,  0},   // 9002
+    {  3,3001,  0,  0,  0,  0},   // 9003
+    {  2,2251,  0,  0,  0,  0},   // 9004
+    {  5,1801,  0,  0,  0,  0},   // 9005
+    {  2,  3, 19, 79,  0,  0},   // 9006
+    {  0,  0,  0,  0,  0,  0},   // 9007
+    {  2,563,  0,  0,  0,  0},   // 9008
+    {  3,  7, 11, 13,  0,  0},   // 9009
+    {  2,  5, 17, 53,  0,  0},   // 9010
+    {  0,  0,  0,  0,  0,  0},   // 9011
+    {  2,  3,751,  0,  0,  0},   // 9012
+    {  0,  0,  0,  0,  0,  0},   // 9013
+    {  2,4507,  0,  0,  0,  0},   // 9014
+    {  3,  5,601,  0,  0,  0},   // 9015
+    {  2,  7, 23,  0,  0,  0},   // 9016
+    { 71,127,  0,  0,  0,  0},   // 9017
+    {  2,  3,167,  0,  0,  0},   // 9018
+    { 29,311,  0,  0,  0,  0},   // 9019
+    {  2,  5, 11, 41,  0,  0},   // 9020
+    {  3, 31, 97,  0,  0,  0},   // 9021
+    {  2, 13,347,  0,  0,  0},   // 9022
+    {  7,1289,  0,  0,  0,  0},   // 9023
+    {  2,  3, 47,  0,  0,  0},   // 9024
+    {  5, 19,  0,  0,  0,  0},   // 9025
+    {  2,4513,  0,  0,  0,  0},   // 9026
+    {  3, 17, 59,  0,  0,  0},   // 9027
+    {  2, 37, 61,  0,  0,  0},   // 9028
+    {  0,  0,  0,  0,  0,  0},   // 9029
+    {  2,  3,  5,  7, 43,  0},   // 9030
+    { 11,821,  0,  0,  0,  0},   // 9031
+    {  2,1129,  0,  0,  0,  0},   // 9032
+    {  3,3011,  0,  0,  0,  0},   // 9033
+    {  2,4517,  0,  0,  0,  0},   // 9034
+    {  5, 13,139,  0,  0,  0},   // 9035
+    {  2,  3,251,  0,  0,  0},   // 9036
+    {  7,1291,  0,  0,  0,  0},   // 9037
+    {  2,4519,  0,  0,  0,  0},   // 9038
+    {  3, 23,131,  0,  0,  0},   // 9039
+    {  2,  5,113,  0,  0,  0},   // 9040
+    {  0,  0,  0,  0,  0,  0},   // 9041
+    {  2,  3, 11,137,  0,  0},   // 9042
+    {  0,  0,  0,  0,  0,  0},   // 9043
+    {  2,  7, 17, 19,  0,  0},   // 9044
+    {  3,  5, 67,  0,  0,  0},   // 9045
+    {  2,4523,  0,  0,  0,  0},   // 9046
+    { 83,109,  0,  0,  0,  0},   // 9047
+    {  2,  3, 13, 29,  0,  0},   // 9048
+    {  0,  0,  0,  0,  0,  0},   // 9049
+    {  2,  5,181,  0,  0,  0},   // 9050
+    {  3,  7,431,  0,  0,  0},   // 9051
+    {  2, 31, 73,  0,  0,  0},   // 9052
+    { 11,823,  0,  0,  0,  0},   // 9053
+    {  2,  3,503,  0,  0,  0},   // 9054
+    {  5,1811,  0,  0,  0,  0},   // 9055
+    {  2,283,  0,  0,  0,  0},   // 9056
+    {  3,3019,  0,  0,  0,  0},   // 9057
+    {  2,  7,647,  0,  0,  0},   // 9058
+    {  0,  0,  0,  0,  0,  0},   // 9059
+    {  2,  3,  5,151,  0,  0},   // 9060
+    { 13, 17, 41,  0,  0,  0},   // 9061
+    {  2, 23,197,  0,  0,  0},   // 9062
+    {  3, 19, 53,  0,  0,  0},   // 9063
+    {  2, 11,103,  0,  0,  0},   // 9064
+    {  5,  7, 37,  0,  0,  0},   // 9065
+    {  2,  3,1511,  0,  0,  0},   // 9066
+    {  0,  0,  0,  0,  0,  0},   // 9067
+    {  2,2267,  0,  0,  0,  0},   // 9068
+    {  3,3023,  0,  0,  0,  0},   // 9069
+    {  2,  5,907,  0,  0,  0},   // 9070
+    { 47,193,  0,  0,  0,  0},   // 9071
+    {  2,  3,  7,  0,  0,  0},   // 9072
+    { 43,211,  0,  0,  0,  0},   // 9073
+    {  2, 13,349,  0,  0,  0},   // 9074
+    {  3,  5, 11,  0,  0,  0},   // 9075
+    {  2,2269,  0,  0,  0,  0},   // 9076
+    { 29,313,  0,  0,  0,  0},   // 9077
+    {  2,  3, 17, 89,  0,  0},   // 9078
+    {  7,1297,  0,  0,  0,  0},   // 9079
+    {  2,  5,227,  0,  0,  0},   // 9080
+    {  3,1009,  0,  0,  0,  0},   // 9081
+    {  2, 19,239,  0,  0,  0},   // 9082
+    { 31,293,  0,  0,  0,  0},   // 9083
+    {  2,  3,757,  0,  0,  0},   // 9084
+    {  5, 23, 79,  0,  0,  0},   // 9085
+    {  2,  7, 11, 59,  0,  0},   // 9086
+    {  3, 13,233,  0,  0,  0},   // 9087
+    {  2, 71,  0,  0,  0,  0},   // 9088
+    { 61,149,  0,  0,  0,  0},   // 9089
+    {  2,  3,  5,101,  0,  0},   // 9090
+    {  0,  0,  0,  0,  0,  0},   // 9091
+    {  2,2273,  0,  0,  0,  0},   // 9092
+    {  3,  7,433,  0,  0,  0},   // 9093
+    {  2,4547,  0,  0,  0,  0},   // 9094
+    {  5, 17,107,  0,  0,  0},   // 9095
+    {  2,  3,379,  0,  0,  0},   // 9096
+    { 11,827,  0,  0,  0,  0},   // 9097
+    {  2,4549,  0,  0,  0,  0},   // 9098
+    {  3,337,  0,  0,  0,  0},   // 9099
+    {  2,  5,  7, 13,  0,  0},   // 9100
+    { 19,479,  0,  0,  0,  0},   // 9101
+    {  2,  3, 37, 41,  0,  0},   // 9102
+    {  0,  0,  0,  0,  0,  0},   // 9103
+    {  2,569,  0,  0,  0,  0},   // 9104
+    {  3,  5,607,  0,  0,  0},   // 9105
+    {  2, 29,157,  0,  0,  0},   // 9106
+    {  7,1301,  0,  0,  0,  0},   // 9107
+    {  2,  3, 11, 23,  0,  0},   // 9108
+    {  0,  0,  0,  0,  0,  0},   // 9109
+    {  2,  5,911,  0,  0,  0},   // 9110
+    {  3,3037,  0,  0,  0,  0},   // 9111
+    {  2, 17, 67,  0,  0,  0},   // 9112
+    { 13,701,  0,  0,  0,  0},   // 9113
+    {  2,  3,  7, 31,  0,  0},   // 9114
+    {  5,1823,  0,  0,  0,  0},   // 9115
+    {  2, 43, 53,  0,  0,  0},   // 9116
+    {  3,1013,  0,  0,  0,  0},   // 9117
+    {  2, 47, 97,  0,  0,  0},   // 9118
+    { 11,829,  0,  0,  0,  0},   // 9119
+    {  2,  3,  5, 19,  0,  0},   // 9120
+    {  7,1303,  0,  0,  0,  0},   // 9121
+    {  2,4561,  0,  0,  0,  0},   // 9122
+    {  3,3041,  0,  0,  0,  0},   // 9123
+    {  2,2281,  0,  0,  0,  0},   // 9124
+    {  5, 73,  0,  0,  0,  0},   // 9125
+    {  2,  3, 13,  0,  0,  0},   // 9126
+    {  0,  0,  0,  0,  0,  0},   // 9127
+    {  2,  7,163,  0,  0,  0},   // 9128
+    {  3, 17,179,  0,  0,  0},   // 9129
+    {  2,  5, 11, 83,  0,  0},   // 9130
+    { 23,397,  0,  0,  0,  0},   // 9131
+    {  2,  3,761,  0,  0,  0},   // 9132
+    {  0,  0,  0,  0,  0,  0},   // 9133
+    {  2,4567,  0,  0,  0,  0},   // 9134
+    {  3,  5,  7, 29,  0,  0},   // 9135
+    {  2,571,  0,  0,  0,  0},   // 9136
+    {  0,  0,  0,  0,  0,  0},   // 9137
+    {  2,  3,1523,  0,  0,  0},   // 9138
+    { 13, 19, 37,  0,  0,  0},   // 9139
+    {  2,  5,457,  0,  0,  0},   // 9140
+    {  3, 11,277,  0,  0,  0},   // 9141
+    {  2,  7,653,  0,  0,  0},   // 9142
+    { 41,223,  0,  0,  0,  0},   // 9143
+    {  2,  3,127,  0,  0,  0},   // 9144
+    {  5, 31, 59,  0,  0,  0},   // 9145
+    {  2, 17,269,  0,  0,  0},   // 9146
+    {  3,3049,  0,  0,  0,  0},   // 9147
+    {  2,2287,  0,  0,  0,  0},   // 9148
+    {  7,1307,  0,  0,  0,  0},   // 9149
+    {  2,  3,  5, 61,  0,  0},   // 9150
+    {  0,  0,  0,  0,  0,  0},   // 9151
+    {  2, 11, 13,  0,  0,  0},   // 9152
+    {  3,113,  0,  0,  0,  0},   // 9153
+    {  2, 23,199,  0,  0,  0},   // 9154
+    {  5,1831,  0,  0,  0,  0},   // 9155
+    {  2,  3,  7,109,  0,  0},   // 9156
+    {  0,  0,  0,  0,  0,  0},   // 9157
+    {  2, 19,241,  0,  0,  0},   // 9158
+    {  3, 43, 71,  0,  0,  0},   // 9159
+    {  2,  5,229,  0,  0,  0},   // 9160
+    {  0,  0,  0,  0,  0,  0},   // 9161
+    {  2,  3,509,  0,  0,  0},   // 9162
+    {  7, 11, 17,  0,  0,  0},   // 9163
+    {  2, 29, 79,  0,  0,  0},   // 9164
+    {  3,  5, 13, 47,  0,  0},   // 9165
+    {  2,4583,  0,  0,  0,  0},   // 9166
+    { 89,103,  0,  0,  0,  0},   // 9167
+    {  2,  3,191,  0,  0,  0},   // 9168
+    { 53,173,  0,  0,  0,  0},   // 9169
+    {  2,  5,  7,131,  0,  0},   // 9170
+    {  3,1019,  0,  0,  0,  0},   // 9171
+    {  2,2293,  0,  0,  0,  0},   // 9172
+    {  0,  0,  0,  0,  0,  0},   // 9173
+    {  2,  3, 11,139,  0,  0},   // 9174
+    {  5,367,  0,  0,  0,  0},   // 9175
+    {  2, 31, 37,  0,  0,  0},   // 9176
+    {  3,  7, 19, 23,  0,  0},   // 9177
+    {  2, 13,353,  0,  0,  0},   // 9178
+    { 67,137,  0,  0,  0,  0},   // 9179
+    {  2,  3,  5, 17,  0,  0},   // 9180
+    {  0,  0,  0,  0,  0,  0},   // 9181
+    {  2,4591,  0,  0,  0,  0},   // 9182
+    {  3,3061,  0,  0,  0,  0},   // 9183
+    {  2,  7, 41,  0,  0,  0},   // 9184
+    {  5, 11,167,  0,  0,  0},   // 9185
+    {  2,  3,1531,  0,  0,  0},   // 9186
+    {  0,  0,  0,  0,  0,  0},   // 9187
+    {  2,2297,  0,  0,  0,  0},   // 9188
+    {  3,1021,  0,  0,  0,  0},   // 9189
+    {  2,  5,919,  0,  0,  0},   // 9190
+    {  7, 13,101,  0,  0,  0},   // 9191
+    {  2,  3,383,  0,  0,  0},   // 9192
+    { 29,317,  0,  0,  0,  0},   // 9193
+    {  2,4597,  0,  0,  0,  0},   // 9194
+    {  3,  5,613,  0,  0,  0},   // 9195
+    {  2, 11, 19,  0,  0,  0},   // 9196
+    { 17,541,  0,  0,  0,  0},   // 9197
+    {  2,  3,  7, 73,  0,  0},   // 9198
+    {  0,  0,  0,  0,  0,  0},   // 9199
+    {  2,  5, 23,  0,  0,  0},   // 9200
+    {  3,3067,  0,  0,  0,  0},   // 9201
+    {  2, 43,107,  0,  0,  0},   // 9202
+    {  0,  0,  0,  0,  0,  0},   // 9203
+    {  2,  3, 13, 59,  0,  0},   // 9204
+    {  5,  7,263,  0,  0,  0},   // 9205
+    {  2,4603,  0,  0,  0,  0},   // 9206
+    {  3, 11, 31,  0,  0,  0},   // 9207
+    {  2,1151,  0,  0,  0,  0},   // 9208
+    {  0,  0,  0,  0,  0,  0},   // 9209
+    {  2,  3,  5,307,  0,  0},   // 9210
+    { 61,151,  0,  0,  0,  0},   // 9211
+    {  2,  7, 47,  0,  0,  0},   // 9212
+    {  3, 37, 83,  0,  0,  0},   // 9213
+    {  2, 17,271,  0,  0,  0},   // 9214
+    {  5, 19, 97,  0,  0,  0},   // 9215
+    {  2,  3,  0,  0,  0,  0},   // 9216
+    { 13,709,  0,  0,  0,  0},   // 9217
+    {  2, 11,419,  0,  0,  0},   // 9218
+    {  3,  7,439,  0,  0,  0},   // 9219
+    {  2,  5,461,  0,  0,  0},   // 9220
+    {  0,  0,  0,  0,  0,  0},   // 9221
+    {  2,  3, 29, 53,  0,  0},   // 9222
+    { 23,401,  0,  0,  0,  0},   // 9223
+    {  2,1153,  0,  0,  0,  0},   // 9224
+    {  3,  5, 41,  0,  0,  0},   // 9225
+    {  2,  7,659,  0,  0,  0},   // 9226
+    {  0,  0,  0,  0,  0,  0},   // 9227
+    {  2,  3,769,  0,  0,  0},   // 9228
+    { 11,839,  0,  0,  0,  0},   // 9229
+    {  2,  5, 13, 71,  0,  0},   // 9230
+    {  3, 17,181,  0,  0,  0},   // 9231
+    {  2,577,  0,  0,  0,  0},   // 9232
+    {  7,1319,  0,  0,  0,  0},   // 9233
+    {  2,  3, 19,  0,  0,  0},   // 9234
+    {  5,1847,  0,  0,  0,  0},   // 9235
+    {  2,2309,  0,  0,  0,  0},   // 9236
+    {  3,3079,  0,  0,  0,  0},   // 9237
+    {  2, 31,149,  0,  0,  0},   // 9238
+    {  0,  0,  0,  0,  0,  0},   // 9239
+    {  2,  3,  5,  7, 11,  0},   // 9240
+    {  0,  0,  0,  0,  0,  0},   // 9241
+    {  2,4621,  0,  0,  0,  0},   // 9242
+    {  3, 13, 79,  0,  0,  0},   // 9243
+    {  2,2311,  0,  0,  0,  0},   // 9244
+    {  5, 43,  0,  0,  0,  0},   // 9245
+    {  2,  3, 23, 67,  0,  0},   // 9246
+    {  7,1321,  0,  0,  0,  0},   // 9247
+    {  2, 17,  0,  0,  0,  0},   // 9248
+    {  3,3083,  0,  0,  0,  0},   // 9249
+    {  2,  5, 37,  0,  0,  0},   // 9250
+    { 11, 29,  0,  0,  0,  0},   // 9251
+    {  2,  3,257,  0,  0,  0},   // 9252
+    { 19,487,  0,  0,  0,  0},   // 9253
+    {  2,  7,661,  0,  0,  0},   // 9254
+    {  3,  5,617,  0,  0,  0},   // 9255
+    {  2, 13, 89,  0,  0,  0},   // 9256
+    {  0,  0,  0,  0,  0,  0},   // 9257
+    {  2,  3,1543,  0,  0,  0},   // 9258
+    { 47,197,  0,  0,  0,  0},   // 9259
+    {  2,  5,463,  0,  0,  0},   // 9260
+    {  3,  7,  0,  0,  0,  0},   // 9261
+    {  2, 11,421,  0,  0,  0},   // 9262
+    { 59,157,  0,  0,  0,  0},   // 9263
+    {  2,  3,193,  0,  0,  0},   // 9264
+    {  5, 17,109,  0,  0,  0},   // 9265
+    {  2, 41,113,  0,  0,  0},   // 9266
+    {  3,3089,  0,  0,  0,  0},   // 9267
+    {  2,  7,331,  0,  0,  0},   // 9268
+    { 13, 23, 31,  0,  0,  0},   // 9269
+    {  2,  3,  5,103,  0,  0},   // 9270
+    { 73,127,  0,  0,  0,  0},   // 9271
+    {  2, 19, 61,  0,  0,  0},   // 9272
+    {  3, 11,281,  0,  0,  0},   // 9273
+    {  2,4637,  0,  0,  0,  0},   // 9274
+    {  5,  7, 53,  0,  0,  0},   // 9275
+    {  2,  3,773,  0,  0,  0},   // 9276
+    {  0,  0,  0,  0,  0,  0},   // 9277
+    {  2,4639,  0,  0,  0,  0},   // 9278
+    {  3,1031,  0,  0,  0,  0},   // 9279
+    {  2,  5, 29,  0,  0,  0},   // 9280
+    {  0,  0,  0,  0,  0,  0},   // 9281
+    {  2,  3,  7, 13, 17,  0},   // 9282
+    {  0,  0,  0,  0,  0,  0},   // 9283
+    {  2, 11,211,  0,  0,  0},   // 9284
+    {  3,  5,619,  0,  0,  0},   // 9285
+    {  2,4643,  0,  0,  0,  0},   // 9286
+    { 37,251,  0,  0,  0,  0},   // 9287
+    {  2,  3, 43,  0,  0,  0},   // 9288
+    {  7,1327,  0,  0,  0,  0},   // 9289
+    {  2,  5,929,  0,  0,  0},   // 9290
+    {  3, 19,163,  0,  0,  0},   // 9291
+    {  2, 23,101,  0,  0,  0},   // 9292
+    {  0,  0,  0,  0,  0,  0},   // 9293
+    {  2,  3,1549,  0,  0,  0},   // 9294
+    {  5, 11, 13,  0,  0,  0},   // 9295
+    {  2,  7, 83,  0,  0,  0},   // 9296
+    {  3,1033,  0,  0,  0,  0},   // 9297
+    {  2,4649,  0,  0,  0,  0},   // 9298
+    { 17,547,  0,  0,  0,  0},   // 9299
+    {  2,  3,  5, 31,  0,  0},   // 9300
+    { 71,131,  0,  0,  0,  0},   // 9301
+    {  2,4651,  0,  0,  0,  0},   // 9302
+    {  3,  7,443,  0,  0,  0},   // 9303
+    {  2,1163,  0,  0,  0,  0},   // 9304
+    {  5,1861,  0,  0,  0,  0},   // 9305
+    {  2,  3, 11, 47,  0,  0},   // 9306
+    { 41,227,  0,  0,  0,  0},   // 9307
+    {  2, 13,179,  0,  0,  0},   // 9308
+    {  3, 29,107,  0,  0,  0},   // 9309
+    {  2,  5,  7, 19,  0,  0},   // 9310
+    {  0,  0,  0,  0,  0,  0},   // 9311
+    {  2,  3, 97,  0,  0,  0},   // 9312
+    { 67,139,  0,  0,  0,  0},   // 9313
+    {  2,4657,  0,  0,  0,  0},   // 9314
+    {  3,  5, 23,  0,  0,  0},   // 9315
+    {  2, 17,137,  0,  0,  0},   // 9316
+    {  7, 11,  0,  0,  0,  0},   // 9317
+    {  2,  3,1553,  0,  0,  0},   // 9318
+    {  0,  0,  0,  0,  0,  0},   // 9319
+    {  2,  5,233,  0,  0,  0},   // 9320
+    {  3, 13,239,  0,  0,  0},   // 9321
+    {  2, 59, 79,  0,  0,  0},   // 9322
+    {  0,  0,  0,  0,  0,  0},   // 9323
+    {  2,  3,  7, 37,  0,  0},   // 9324
+    {  5,373,  0,  0,  0,  0},   // 9325
+    {  2,4663,  0,  0,  0,  0},   // 9326
+    {  3,3109,  0,  0,  0,  0},   // 9327
+    {  2, 11, 53,  0,  0,  0},   // 9328
+    { 19,491,  0,  0,  0,  0},   // 9329
+    {  2,  3,  5,311,  0,  0},   // 9330
+    {  7, 31, 43,  0,  0,  0},   // 9331
+    {  2,2333,  0,  0,  0,  0},   // 9332
+    {  3, 17, 61,  0,  0,  0},   // 9333
+    {  2, 13,359,  0,  0,  0},   // 9334
+    {  5,1867,  0,  0,  0,  0},   // 9335
+    {  2,  3,389,  0,  0,  0},   // 9336
+    {  0,  0,  0,  0,  0,  0},   // 9337
+    {  2,  7, 23, 29,  0,  0},   // 9338
+    {  3, 11,283,  0,  0,  0},   // 9339
+    {  2,  5,467,  0,  0,  0},   // 9340
+    {  0,  0,  0,  0,  0,  0},   // 9341
+    {  2,  3,173,  0,  0,  0},   // 9342
+    {  0,  0,  0,  0,  0,  0},   // 9343
+    {  2, 73,  0,  0,  0,  0},   // 9344
+    {  3,  5,  7, 89,  0,  0},   // 9345
+    {  2,4673,  0,  0,  0,  0},   // 9346
+    { 13,719,  0,  0,  0,  0},   // 9347
+    {  2,  3, 19, 41,  0,  0},   // 9348
+    {  0,  0,  0,  0,  0,  0},   // 9349
+    {  2,  5, 11, 17,  0,  0},   // 9350
+    {  3,1039,  0,  0,  0,  0},   // 9351
+    {  2,  7,167,  0,  0,  0},   // 9352
+    { 47,199,  0,  0,  0,  0},   // 9353
+    {  2,  3,1559,  0,  0,  0},   // 9354
+    {  5,1871,  0,  0,  0,  0},   // 9355
+    {  2,2339,  0,  0,  0,  0},   // 9356
+    {  3,3119,  0,  0,  0,  0},   // 9357
+    {  2,4679,  0,  0,  0,  0},   // 9358
+    {  7,191,  0,  0,  0,  0},   // 9359
+    {  2,  3,  5, 13,  0,  0},   // 9360
+    { 11, 23, 37,  0,  0,  0},   // 9361
+    {  2, 31,151,  0,  0,  0},   // 9362
+    {  3,3121,  0,  0,  0,  0},   // 9363
+    {  2,2341,  0,  0,  0,  0},   // 9364
+    {  5,1873,  0,  0,  0,  0},   // 9365
+    {  2,  3,  7,223,  0,  0},   // 9366
+    { 17, 19, 29,  0,  0,  0},   // 9367
+    {  2,1171,  0,  0,  0,  0},   // 9368
+    {  3,347,  0,  0,  0,  0},   // 9369
+    {  2,  5,937,  0,  0,  0},   // 9370
+    {  0,  0,  0,  0,  0,  0},   // 9371
+    {  2,  3, 11, 71,  0,  0},   // 9372
+    {  7, 13,103,  0,  0,  0},   // 9373
+    {  2, 43,109,  0,  0,  0},   // 9374
+    {  3,  5,  0,  0,  0,  0},   // 9375
+    {  2,293,  0,  0,  0,  0},   // 9376
+    {  0,  0,  0,  0,  0,  0},   // 9377
+    {  2,  3,521,  0,  0,  0},   // 9378
+    { 83,113,  0,  0,  0,  0},   // 9379
+    {  2,  5,  7, 67,  0,  0},   // 9380
+    {  3, 53, 59,  0,  0,  0},   // 9381
+    {  2,4691,  0,  0,  0,  0},   // 9382
+    { 11,853,  0,  0,  0,  0},   // 9383
+    {  2,  3, 17, 23,  0,  0},   // 9384
+    {  5,1877,  0,  0,  0,  0},   // 9385
+    {  2, 13, 19,  0,  0,  0},   // 9386
+    {  3,  7,149,  0,  0,  0},   // 9387
+    {  2,2347,  0,  0,  0,  0},   // 9388
+    { 41,229,  0,  0,  0,  0},   // 9389
+    {  2,  3,  5,313,  0,  0},   // 9390
+    {  0,  0,  0,  0,  0,  0},   // 9391
+    {  2,587,  0,  0,  0,  0},   // 9392
+    {  3, 31,101,  0,  0,  0},   // 9393
+    {  2,  7, 11, 61,  0,  0},   // 9394
+    {  5,1879,  0,  0,  0,  0},   // 9395
+    {  2,  3, 29,  0,  0,  0},   // 9396
+    {  0,  0,  0,  0,  0,  0},   // 9397
+    {  2, 37,127,  0,  0,  0},   // 9398
+    {  3, 13,241,  0,  0,  0},   // 9399
+    {  2,  5, 47,  0,  0,  0},   // 9400
+    {  7, 17, 79,  0,  0,  0},   // 9401
+    {  2,  3,1567,  0,  0,  0},   // 9402
+    {  0,  0,  0,  0,  0,  0},   // 9403
+    {  2,2351,  0,  0,  0,  0},   // 9404
+    {  3,  5, 11, 19,  0,  0},   // 9405
+    {  2,4703,  0,  0,  0,  0},   // 9406
+    { 23,409,  0,  0,  0,  0},   // 9407
+    {  2,  3,  7,  0,  0,  0},   // 9408
+    { 97,  0,  0,  0,  0,  0},   // 9409
+    {  2,  5,941,  0,  0,  0},   // 9410
+    {  3,3137,  0,  0,  0,  0},   // 9411
+    {  2, 13,181,  0,  0,  0},   // 9412
+    {  0,  0,  0,  0,  0,  0},   // 9413
+    {  2,  3,523,  0,  0,  0},   // 9414
+    {  5,  7,269,  0,  0,  0},   // 9415
+    {  2, 11,107,  0,  0,  0},   // 9416
+    {  3, 43, 73,  0,  0,  0},   // 9417
+    {  2, 17,277,  0,  0,  0},   // 9418
+    {  0,  0,  0,  0,  0,  0},   // 9419
+    {  2,  3,  5,157,  0,  0},   // 9420
+    {  0,  0,  0,  0,  0,  0},   // 9421
+    {  2,  7,673,  0,  0,  0},   // 9422
+    {  3,349,  0,  0,  0,  0},   // 9423
+    {  2, 19, 31,  0,  0,  0},   // 9424
+    {  5, 13, 29,  0,  0,  0},   // 9425
+    {  2,  3,1571,  0,  0,  0},   // 9426
+    { 11,857,  0,  0,  0,  0},   // 9427
+    {  2,2357,  0,  0,  0,  0},   // 9428
+    {  3,  7,449,  0,  0,  0},   // 9429
+    {  2,  5, 23, 41,  0,  0},   // 9430
+    {  0,  0,  0,  0,  0,  0},   // 9431
+    {  2,  3,131,  0,  0,  0},   // 9432
+    {  0,  0,  0,  0,  0,  0},   // 9433
+    {  2, 53, 89,  0,  0,  0},   // 9434
+    {  3,  5, 17, 37,  0,  0},   // 9435
+    {  2,  7,337,  0,  0,  0},   // 9436
+    {  0,  0,  0,  0,  0,  0},   // 9437
+    {  2,  3, 11, 13,  0,  0},   // 9438
+    {  0,  0,  0,  0,  0,  0},   // 9439
+    {  2,  5, 59,  0,  0,  0},   // 9440
+    {  3,1049,  0,  0,  0,  0},   // 9441
+    {  2,4721,  0,  0,  0,  0},   // 9442
+    {  7, 19, 71,  0,  0,  0},   // 9443
+    {  2,  3,787,  0,  0,  0},   // 9444
+    {  5,1889,  0,  0,  0,  0},   // 9445
+    {  2,4723,  0,  0,  0,  0},   // 9446
+    {  3, 47, 67,  0,  0,  0},   // 9447
+    {  2,1181,  0,  0,  0,  0},   // 9448
+    { 11,859,  0,  0,  0,  0},   // 9449
+    {  2,  3,  5,  7,  0,  0},   // 9450
+    { 13,727,  0,  0,  0,  0},   // 9451
+    {  2, 17,139,  0,  0,  0},   // 9452
+    {  3, 23,137,  0,  0,  0},   // 9453
+    {  2, 29,163,  0,  0,  0},   // 9454
+    {  5, 31, 61,  0,  0,  0},   // 9455
+    {  2,  3,197,  0,  0,  0},   // 9456
+    {  7,193,  0,  0,  0,  0},   // 9457
+    {  2,4729,  0,  0,  0,  0},   // 9458
+    {  3,1051,  0,  0,  0,  0},   // 9459
+    {  2,  5, 11, 43,  0,  0},   // 9460
+    {  0,  0,  0,  0,  0,  0},   // 9461
+    {  2,  3, 19, 83,  0,  0},   // 9462
+    {  0,  0,  0,  0,  0,  0},   // 9463
+    {  2,  7, 13,  0,  0,  0},   // 9464
+    {  3,  5,631,  0,  0,  0},   // 9465
+    {  2,4733,  0,  0,  0,  0},   // 9466
+    {  0,  0,  0,  0,  0,  0},   // 9467
+    {  2,  3,263,  0,  0,  0},   // 9468
+    { 17,557,  0,  0,  0,  0},   // 9469
+    {  2,  5,947,  0,  0,  0},   // 9470
+    {  3,  7, 11, 41,  0,  0},   // 9471
+    {  2, 37,  0,  0,  0,  0},   // 9472
+    {  0,  0,  0,  0,  0,  0},   // 9473
+    {  2,  3,1579,  0,  0,  0},   // 9474
+    {  5,379,  0,  0,  0,  0},   // 9475
+    {  2, 23,103,  0,  0,  0},   // 9476
+    {  3, 13,  0,  0,  0,  0},   // 9477
+    {  2,  7,677,  0,  0,  0},   // 9478
+    {  0,  0,  0,  0,  0,  0},   // 9479
+    {  2,  3,  5, 79,  0,  0},   // 9480
+    { 19,499,  0,  0,  0,  0},   // 9481
+    {  2, 11,431,  0,  0,  0},   // 9482
+    {  3, 29,109,  0,  0,  0},   // 9483
+    {  2,2371,  0,  0,  0,  0},   // 9484
+    {  5,  7,271,  0,  0,  0},   // 9485
+    {  2,  3, 17, 31,  0,  0},   // 9486
+    { 53,179,  0,  0,  0,  0},   // 9487
+    {  2,593,  0,  0,  0,  0},   // 9488
+    {  3,3163,  0,  0,  0,  0},   // 9489
+    {  2,  5, 13, 73,  0,  0},   // 9490
+    {  0,  0,  0,  0,  0,  0},   // 9491
+    {  2,  3,  7,113,  0,  0},   // 9492
+    { 11,863,  0,  0,  0,  0},   // 9493
+    {  2, 47,101,  0,  0,  0},   // 9494
+    {  3,  5,211,  0,  0,  0},   // 9495
+    {  2,1187,  0,  0,  0,  0},   // 9496
+    {  0,  0,  0,  0,  0,  0},   // 9497
+    {  2,  3,1583,  0,  0,  0},   // 9498
+    {  7, 23, 59,  0,  0,  0},   // 9499
+    {  2,  5, 19,  0,  0,  0},   // 9500
+    {  3,3167,  0,  0,  0,  0},   // 9501
+    {  2,4751,  0,  0,  0,  0},   // 9502
+    { 13, 17, 43,  0,  0,  0},   // 9503
+    {  2,  3, 11,  0,  0,  0},   // 9504
+    {  5,1901,  0,  0,  0,  0},   // 9505
+    {  2,  7, 97,  0,  0,  0},   // 9506
+    {  3,3169,  0,  0,  0,  0},   // 9507
+    {  2,2377,  0,  0,  0,  0},   // 9508
+    { 37,257,  0,  0,  0,  0},   // 9509
+    {  2,  3,  5,317,  0,  0},   // 9510
+    {  0,  0,  0,  0,  0,  0},   // 9511
+    {  2, 29, 41,  0,  0,  0},   // 9512
+    {  3,  7,151,  0,  0,  0},   // 9513
+    {  2, 67, 71,  0,  0,  0},   // 9514
+    {  5, 11,173,  0,  0,  0},   // 9515
+    {  2,  3, 13, 61,  0,  0},   // 9516
+    { 31,307,  0,  0,  0,  0},   // 9517
+    {  2,4759,  0,  0,  0,  0},   // 9518
+    {  3, 19,167,  0,  0,  0},   // 9519
+    {  2,  5,  7, 17,  0,  0},   // 9520
+    {  0,  0,  0,  0,  0,  0},   // 9521
+    {  2,  3, 23,  0,  0,  0},   // 9522
+    { 89,107,  0,  0,  0,  0},   // 9523
+    {  2,2381,  0,  0,  0,  0},   // 9524
+    {  3,  5,127,  0,  0,  0},   // 9525
+    {  2, 11,433,  0,  0,  0},   // 9526
+    {  7,1361,  0,  0,  0,  0},   // 9527
+    {  2,  3,397,  0,  0,  0},   // 9528
+    { 13,733,  0,  0,  0,  0},   // 9529
+    {  2,  5,953,  0,  0,  0},   // 9530
+    {  3,353,  0,  0,  0,  0},   // 9531
+    {  2,2383,  0,  0,  0,  0},   // 9532
+    {  0,  0,  0,  0,  0,  0},   // 9533
+    {  2,  3,  7,227,  0,  0},   // 9534
+    {  5,1907,  0,  0,  0,  0},   // 9535
+    {  2,149,  0,  0,  0,  0},   // 9536
+    {  3, 11, 17,  0,  0,  0},   // 9537
+    {  2, 19,251,  0,  0,  0},   // 9538
+    {  0,  0,  0,  0,  0,  0},   // 9539
+    {  2,  3,  5, 53,  0,  0},   // 9540
+    {  7, 29, 47,  0,  0,  0},   // 9541
+    {  2, 13,367,  0,  0,  0},   // 9542
+    {  3,3181,  0,  0,  0,  0},   // 9543
+    {  2,1193,  0,  0,  0,  0},   // 9544
+    {  5, 23, 83,  0,  0,  0},   // 9545
+    {  2,  3, 37, 43,  0,  0},   // 9546
+    {  0,  0,  0,  0,  0,  0},   // 9547
+    {  2,  7, 11, 31,  0,  0},   // 9548
+    {  3,1061,  0,  0,  0,  0},   // 9549
+    {  2,  5,191,  0,  0,  0},   // 9550
+    {  0,  0,  0,  0,  0,  0},   // 9551
+    {  2,  3,199,  0,  0,  0},   // 9552
+    { 41,233,  0,  0,  0,  0},   // 9553
+    {  2, 17,281,  0,  0,  0},   // 9554
+    {  3,  5,  7, 13,  0,  0},   // 9555
+    {  2,2389,  0,  0,  0,  0},   // 9556
+    { 19,503,  0,  0,  0,  0},   // 9557
+    {  2,  3, 59,  0,  0,  0},   // 9558
+    { 11, 79,  0,  0,  0,  0},   // 9559
+    {  2,  5,239,  0,  0,  0},   // 9560
+    {  3,3187,  0,  0,  0,  0},   // 9561
+    {  2,  7,683,  0,  0,  0},   // 9562
+    { 73,131,  0,  0,  0,  0},   // 9563
+    {  2,  3,797,  0,  0,  0},   // 9564
+    {  5,1913,  0,  0,  0,  0},   // 9565
+    {  2,4783,  0,  0,  0,  0},   // 9566
+    {  3,1063,  0,  0,  0,  0},   // 9567
+    {  2, 13, 23,  0,  0,  0},   // 9568
+    {  7,1367,  0,  0,  0,  0},   // 9569
+    {  2,  3,  5, 11, 29,  0},   // 9570
+    { 17,563,  0,  0,  0,  0},   // 9571
+    {  2,2393,  0,  0,  0,  0},   // 9572
+    {  3,3191,  0,  0,  0,  0},   // 9573
+    {  2,4787,  0,  0,  0,  0},   // 9574
+    {  5,383,  0,  0,  0,  0},   // 9575
+    {  2,  3,  7, 19,  0,  0},   // 9576
+    { 61,157,  0,  0,  0,  0},   // 9577
+    {  2,4789,  0,  0,  0,  0},   // 9578
+    {  3, 31,103,  0,  0,  0},   // 9579
+    {  2,  5,479,  0,  0,  0},   // 9580
+    { 11, 13, 67,  0,  0,  0},   // 9581
+    {  2,  3,1597,  0,  0,  0},   // 9582
+    {  7, 37,  0,  0,  0,  0},   // 9583
+    {  2,599,  0,  0,  0,  0},   // 9584
+    {  3,  5, 71,  0,  0,  0},   // 9585
+    {  2,4793,  0,  0,  0,  0},   // 9586
+    {  0,  0,  0,  0,  0,  0},   // 9587
+    {  2,  3, 17, 47,  0,  0},   // 9588
+    { 43,223,  0,  0,  0,  0},   // 9589
+    {  2,  5,  7,137,  0,  0},   // 9590
+    {  3, 23,139,  0,  0,  0},   // 9591
+    {  2, 11,109,  0,  0,  0},   // 9592
+    { 53,181,  0,  0,  0,  0},   // 9593
+    {  2,  3, 13, 41,  0,  0},   // 9594
+    {  5, 19,101,  0,  0,  0},   // 9595
+    {  2,2399,  0,  0,  0,  0},   // 9596
+    {  3,  7,457,  0,  0,  0},   // 9597
+    {  2,4799,  0,  0,  0,  0},   // 9598
+    { 29,331,  0,  0,  0,  0},   // 9599
+    {  2,  3,  5,  0,  0,  0},   // 9600
+    {  0,  0,  0,  0,  0,  0},   // 9601
+    {  2,4801,  0,  0,  0,  0},   // 9602
+    {  3, 11, 97,  0,  0,  0},   // 9603
+    {  2,  7,  0,  0,  0,  0},   // 9604
+    {  5, 17,113,  0,  0,  0},   // 9605
+    {  2,  3,1601,  0,  0,  0},   // 9606
+    { 13,739,  0,  0,  0,  0},   // 9607
+    {  2,1201,  0,  0,  0,  0},   // 9608
+    {  3,3203,  0,  0,  0,  0},   // 9609
+    {  2,  5, 31,  0,  0,  0},   // 9610
+    {  7,1373,  0,  0,  0,  0},   // 9611
+    {  2,  3, 89,  0,  0,  0},   // 9612
+    {  0,  0,  0,  0,  0,  0},   // 9613
+    {  2, 11, 19, 23,  0,  0},   // 9614
+    {  3,  5,641,  0,  0,  0},   // 9615
+    {  2,601,  0,  0,  0,  0},   // 9616
+    { 59,163,  0,  0,  0,  0},   // 9617
+    {  2,  3,  7,229,  0,  0},   // 9618
+    {  0,  0,  0,  0,  0,  0},   // 9619
+    {  2,  5, 13, 37,  0,  0},   // 9620
+    {  3,1069,  0,  0,  0,  0},   // 9621
+    {  2, 17,283,  0,  0,  0},   // 9622
+    {  0,  0,  0,  0,  0,  0},   // 9623
+    {  2,  3,401,  0,  0,  0},   // 9624
+    {  5,  7, 11,  0,  0,  0},   // 9625
+    {  2,4813,  0,  0,  0,  0},   // 9626
+    {  3,3209,  0,  0,  0,  0},   // 9627
+    {  2, 29, 83,  0,  0,  0},   // 9628
+    {  0,  0,  0,  0,  0,  0},   // 9629
+    {  2,  3,  5,107,  0,  0},   // 9630
+    {  0,  0,  0,  0,  0,  0},   // 9631
+    {  2,  7, 43,  0,  0,  0},   // 9632
+    {  3, 13, 19,  0,  0,  0},   // 9633
+    {  2,4817,  0,  0,  0,  0},   // 9634
+    {  5, 41, 47,  0,  0,  0},   // 9635
+    {  2,  3, 11, 73,  0,  0},   // 9636
+    { 23,419,  0,  0,  0,  0},   // 9637
+    {  2, 61, 79,  0,  0,  0},   // 9638
+    {  3,  7, 17,  0,  0,  0},   // 9639
+    {  2,  5,241,  0,  0,  0},   // 9640
+    { 31,311,  0,  0,  0,  0},   // 9641
+    {  2,  3,1607,  0,  0,  0},   // 9642
+    {  0,  0,  0,  0,  0,  0},   // 9643
+    {  2,2411,  0,  0,  0,  0},   // 9644
+    {  3,  5,643,  0,  0,  0},   // 9645
+    {  2,  7, 13, 53,  0,  0},   // 9646
+    { 11,877,  0,  0,  0,  0},   // 9647
+    {  2,  3, 67,  0,  0,  0},   // 9648
+    {  0,  0,  0,  0,  0,  0},   // 9649
+    {  2,  5,193,  0,  0,  0},   // 9650
+    {  3,3217,  0,  0,  0,  0},   // 9651
+    {  2, 19,127,  0,  0,  0},   // 9652
+    {  7,197,  0,  0,  0,  0},   // 9653
+    {  2,  3,1609,  0,  0,  0},   // 9654
+    {  5,1931,  0,  0,  0,  0},   // 9655
+    {  2, 17, 71,  0,  0,  0},   // 9656
+    {  3, 29, 37,  0,  0,  0},   // 9657
+    {  2, 11,439,  0,  0,  0},   // 9658
+    { 13,743,  0,  0,  0,  0},   // 9659
+    {  2,  3,  5,  7, 23,  0},   // 9660
+    {  0,  0,  0,  0,  0,  0},   // 9661
+    {  2,4831,  0,  0,  0,  0},   // 9662
+    {  3,3221,  0,  0,  0,  0},   // 9663
+    {  2,151,  0,  0,  0,  0},   // 9664
+    {  5,1933,  0,  0,  0,  0},   // 9665
+    {  2,  3,179,  0,  0,  0},   // 9666
+    {  7,1381,  0,  0,  0,  0},   // 9667
+    {  2,2417,  0,  0,  0,  0},   // 9668
+    {  3, 11,293,  0,  0,  0},   // 9669
+    {  2,  5,967,  0,  0,  0},   // 9670
+    { 19,509,  0,  0,  0,  0},   // 9671
+    {  2,  3, 13, 31,  0,  0},   // 9672
+    { 17,569,  0,  0,  0,  0},   // 9673
+    {  2,  7,691,  0,  0,  0},   // 9674
+    {  3,  5, 43,  0,  0,  0},   // 9675
+    {  2, 41, 59,  0,  0,  0},   // 9676
+    {  0,  0,  0,  0,  0,  0},   // 9677
+    {  2,  3,1613,  0,  0,  0},   // 9678
+    {  0,  0,  0,  0,  0,  0},   // 9679
+    {  2,  5, 11,  0,  0,  0},   // 9680
+    {  3,  7,461,  0,  0,  0},   // 9681
+    {  2, 47,103,  0,  0,  0},   // 9682
+    { 23,421,  0,  0,  0,  0},   // 9683
+    {  2,  3,269,  0,  0,  0},   // 9684
+    {  5, 13,149,  0,  0,  0},   // 9685
+    {  2, 29,167,  0,  0,  0},   // 9686
+    {  3,3229,  0,  0,  0,  0},   // 9687
+    {  2,  7,173,  0,  0,  0},   // 9688
+    {  0,  0,  0,  0,  0,  0},   // 9689
+    {  2,  3,  5, 17, 19,  0},   // 9690
+    { 11,881,  0,  0,  0,  0},   // 9691
+    {  2,2423,  0,  0,  0,  0},   // 9692
+    {  3,359,  0,  0,  0,  0},   // 9693
+    {  2, 37,131,  0,  0,  0},   // 9694
+    {  5,  7,277,  0,  0,  0},   // 9695
+    {  2,  3,101,  0,  0,  0},   // 9696
+    {  0,  0,  0,  0,  0,  0},   // 9697
+    {  2, 13,373,  0,  0,  0},   // 9698
+    {  3, 53, 61,  0,  0,  0},   // 9699
+    {  2,  5, 97,  0,  0,  0},   // 9700
+    { 89,109,  0,  0,  0,  0},   // 9701
+    {  2,  3,  7, 11,  0,  0},   // 9702
+    { 31,313,  0,  0,  0,  0},   // 9703
+    {  2,1213,  0,  0,  0,  0},   // 9704
+    {  3,  5,647,  0,  0,  0},   // 9705
+    {  2, 23,211,  0,  0,  0},   // 9706
+    { 17,571,  0,  0,  0,  0},   // 9707
+    {  2,  3,809,  0,  0,  0},   // 9708
+    {  7, 19, 73,  0,  0,  0},   // 9709
+    {  2,  5,971,  0,  0,  0},   // 9710
+    {  3, 13, 83,  0,  0,  0},   // 9711
+    {  2,607,  0,  0,  0,  0},   // 9712
+    { 11,883,  0,  0,  0,  0},   // 9713
+    {  2,  3,1619,  0,  0,  0},   // 9714
+    {  5, 29, 67,  0,  0,  0},   // 9715
+    {  2,  7,347,  0,  0,  0},   // 9716
+    {  3, 41, 79,  0,  0,  0},   // 9717
+    {  2, 43,113,  0,  0,  0},   // 9718
+    {  0,  0,  0,  0,  0,  0},   // 9719
+    {  2,  3,  5,  0,  0,  0},   // 9720
+    {  0,  0,  0,  0,  0,  0},   // 9721
+    {  2,4861,  0,  0,  0,  0},   // 9722
+    {  3,  7,463,  0,  0,  0},   // 9723
+    {  2, 11, 13, 17,  0,  0},   // 9724
+    {  5,389,  0,  0,  0,  0},   // 9725
+    {  2,  3,1621,  0,  0,  0},   // 9726
+    { 71,137,  0,  0,  0,  0},   // 9727
+    {  2, 19,  0,  0,  0,  0},   // 9728
+    {  3, 23, 47,  0,  0,  0},   // 9729
+    {  2,  5,  7,139,  0,  0},   // 9730
+    { 37,263,  0,  0,  0,  0},   // 9731
+    {  2,  3,811,  0,  0,  0},   // 9732
+    {  0,  0,  0,  0,  0,  0},   // 9733
+    {  2, 31,157,  0,  0,  0},   // 9734
+    {  3,  5, 11, 59,  0,  0},   // 9735
+    {  2,1217,  0,  0,  0,  0},   // 9736
+    {  7, 13,107,  0,  0,  0},   // 9737
+    {  2,  3,541,  0,  0,  0},   // 9738
+    {  0,  0,  0,  0,  0,  0},   // 9739
+    {  2,  5,487,  0,  0,  0},   // 9740
+    {  3, 17,191,  0,  0,  0},   // 9741
+    {  2,4871,  0,  0,  0,  0},   // 9742
+    {  0,  0,  0,  0,  0,  0},   // 9743
+    {  2,  3,  7, 29,  0,  0},   // 9744
+    {  5,1949,  0,  0,  0,  0},   // 9745
+    {  2, 11,443,  0,  0,  0},   // 9746
+    {  3, 19,  0,  0,  0,  0},   // 9747
+    {  2,2437,  0,  0,  0,  0},   // 9748
+    {  0,  0,  0,  0,  0,  0},   // 9749
+    {  2,  3,  5, 13,  0,  0},   // 9750
+    {  7,199,  0,  0,  0,  0},   // 9751
+    {  2, 23, 53,  0,  0,  0},   // 9752
+    {  3,3251,  0,  0,  0,  0},   // 9753
+    {  2,4877,  0,  0,  0,  0},   // 9754
+    {  5,1951,  0,  0,  0,  0},   // 9755
+    {  2,  3,271,  0,  0,  0},   // 9756
+    { 11,887,  0,  0,  0,  0},   // 9757
+    {  2,  7, 17, 41,  0,  0},   // 9758
+    {  3,3253,  0,  0,  0,  0},   // 9759
+    {  2,  5, 61,  0,  0,  0},   // 9760
+    { 43,227,  0,  0,  0,  0},   // 9761
+    {  2,  3,1627,  0,  0,  0},   // 9762
+    { 13,751,  0,  0,  0,  0},   // 9763
+    {  2,2441,  0,  0,  0,  0},   // 9764
+    {  3,  5,  7, 31,  0,  0},   // 9765
+    {  2, 19,257,  0,  0,  0},   // 9766
+    {  0,  0,  0,  0,  0,  0},   // 9767
+    {  2,  3, 11, 37,  0,  0},   // 9768
+    {  0,  0,  0,  0,  0,  0},   // 9769
+    {  2,  5,977,  0,  0,  0},   // 9770
+    {  3,3257,  0,  0,  0,  0},   // 9771
+    {  2,  7,349,  0,  0,  0},   // 9772
+    { 29,337,  0,  0,  0,  0},   // 9773
+    {  2,  3,181,  0,  0,  0},   // 9774
+    {  5, 17, 23,  0,  0,  0},   // 9775
+    {  2, 13, 47,  0,  0,  0},   // 9776
+    {  3,3259,  0,  0,  0,  0},   // 9777
+    {  2,4889,  0,  0,  0,  0},   // 9778
+    {  7, 11,127,  0,  0,  0},   // 9779
+    {  2,  3,  5,163,  0,  0},   // 9780
+    {  0,  0,  0,  0,  0,  0},   // 9781
+    {  2, 67, 73,  0,  0,  0},   // 9782
+    {  3,1087,  0,  0,  0,  0},   // 9783
+    {  2,1223,  0,  0,  0,  0},   // 9784
+    {  5, 19,103,  0,  0,  0},   // 9785
+    {  2,  3,  7,233,  0,  0},   // 9786
+    {  0,  0,  0,  0,  0,  0},   // 9787
+    {  2,2447,  0,  0,  0,  0},   // 9788
+    {  3, 13,251,  0,  0,  0},   // 9789
+    {  2,  5, 11, 89,  0,  0},   // 9790
+    {  0,  0,  0,  0,  0,  0},   // 9791
+    {  2,  3, 17,  0,  0,  0},   // 9792
+    {  7,1399,  0,  0,  0,  0},   // 9793
+    {  2, 59, 83,  0,  0,  0},   // 9794
+    {  3,  5,653,  0,  0,  0},   // 9795
+    {  2, 31, 79,  0,  0,  0},   // 9796
+    { 97,101,  0,  0,  0,  0},   // 9797
+    {  2,  3, 23, 71,  0,  0},   // 9798
+    { 41,239,  0,  0,  0,  0},   // 9799
+    {  2,  5,  7,  0,  0,  0},   // 9800
+    {  3, 11,  0,  0,  0,  0},   // 9801
+    {  2, 13, 29,  0,  0,  0},   // 9802
+    {  0,  0,  0,  0,  0,  0},   // 9803
+    {  2,  3, 19, 43,  0,  0},   // 9804
+    {  5, 37, 53,  0,  0,  0},   // 9805
+    {  2,4903,  0,  0,  0,  0},   // 9806
+    {  3,  7,467,  0,  0,  0},   // 9807
+    {  2,613,  0,  0,  0,  0},   // 9808
+    { 17,577,  0,  0,  0,  0},   // 9809
+    {  2,  3,  5,109,  0,  0},   // 9810
+    {  0,  0,  0,  0,  0,  0},   // 9811
+    {  2, 11,223,  0,  0,  0},   // 9812
+    {  3,3271,  0,  0,  0,  0},   // 9813
+    {  2,  7,701,  0,  0,  0},   // 9814
+    {  5, 13,151,  0,  0,  0},   // 9815
+    {  2,  3,409,  0,  0,  0},   // 9816
+    {  0,  0,  0,  0,  0,  0},   // 9817
+    {  2,4909,  0,  0,  0,  0},   // 9818
+    {  3,1091,  0,  0,  0,  0},   // 9819
+    {  2,  5,491,  0,  0,  0},   // 9820
+    {  7, 23, 61,  0,  0,  0},   // 9821
+    {  2,  3,1637,  0,  0,  0},   // 9822
+    { 11, 19, 47,  0,  0,  0},   // 9823
+    {  2,307,  0,  0,  0,  0},   // 9824
+    {  3,  5,131,  0,  0,  0},   // 9825
+    {  2, 17,  0,  0,  0,  0},   // 9826
+    { 31,317,  0,  0,  0,  0},   // 9827
+    {  2,  3,  7, 13,  0,  0},   // 9828
+    {  0,  0,  0,  0,  0,  0},   // 9829
+    {  2,  5,983,  0,  0,  0},   // 9830
+    {  3, 29,113,  0,  0,  0},   // 9831
+    {  2,1229,  0,  0,  0,  0},   // 9832
+    {  0,  0,  0,  0,  0,  0},   // 9833
+    {  2,  3, 11,149,  0,  0},   // 9834
+    {  5,  7,281,  0,  0,  0},   // 9835
+    {  2,2459,  0,  0,  0,  0},   // 9836
+    {  3,1093,  0,  0,  0,  0},   // 9837
+    {  2,4919,  0,  0,  0,  0},   // 9838
+    {  0,  0,  0,  0,  0,  0},   // 9839
+    {  2,  3,  5, 41,  0,  0},   // 9840
+    { 13,757,  0,  0,  0,  0},   // 9841
+    {  2,  7, 19, 37,  0,  0},   // 9842
+    {  3, 17,193,  0,  0,  0},   // 9843
+    {  2, 23,107,  0,  0,  0},   // 9844
+    {  5, 11,179,  0,  0,  0},   // 9845
+    {  2,  3,547,  0,  0,  0},   // 9846
+    { 43,229,  0,  0,  0,  0},   // 9847
+    {  2,1231,  0,  0,  0,  0},   // 9848
+    {  3,  7, 67,  0,  0,  0},   // 9849
+    {  2,  5,197,  0,  0,  0},   // 9850
+    {  0,  0,  0,  0,  0,  0},   // 9851
+    {  2,  3,821,  0,  0,  0},   // 9852
+    { 59,167,  0,  0,  0,  0},   // 9853
+    {  2, 13,379,  0,  0,  0},   // 9854
+    {  3,  5, 73,  0,  0,  0},   // 9855
+    {  2,  7, 11,  0,  0,  0},   // 9856
+    {  0,  0,  0,  0,  0,  0},   // 9857
+    {  2,  3, 31, 53,  0,  0},   // 9858
+    {  0,  0,  0,  0,  0,  0},   // 9859
+    {  2,  5, 17, 29,  0,  0},   // 9860
+    {  3, 19,173,  0,  0,  0},   // 9861
+    {  2,4931,  0,  0,  0,  0},   // 9862
+    {  7,1409,  0,  0,  0,  0},   // 9863
+    {  2,  3,137,  0,  0,  0},   // 9864
+    {  5,1973,  0,  0,  0,  0},   // 9865
+    {  2,4933,  0,  0,  0,  0},   // 9866
+    {  3, 11, 13, 23,  0,  0},   // 9867
+    {  2,2467,  0,  0,  0,  0},   // 9868
+    { 71,139,  0,  0,  0,  0},   // 9869
+    {  2,  3,  5,  7, 47,  0},   // 9870
+    {  0,  0,  0,  0,  0,  0},   // 9871
+    {  2,617,  0,  0,  0,  0},   // 9872
+    {  3,1097,  0,  0,  0,  0},   // 9873
+    {  2,4937,  0,  0,  0,  0},   // 9874
+    {  5, 79,  0,  0,  0,  0},   // 9875
+    {  2,  3,823,  0,  0,  0},   // 9876
+    {  7, 17, 83,  0,  0,  0},   // 9877
+    {  2, 11,449,  0,  0,  0},   // 9878
+    {  3, 37, 89,  0,  0,  0},   // 9879
+    {  2,  5, 13, 19,  0,  0},   // 9880
+    { 41,241,  0,  0,  0,  0},   // 9881
+    {  2,  3, 61,  0,  0,  0},   // 9882
+    {  0,  0,  0,  0,  0,  0},   // 9883
+    {  2,  7,353,  0,  0,  0},   // 9884
+    {  3,  5,659,  0,  0,  0},   // 9885
+    {  2,4943,  0,  0,  0,  0},   // 9886
+    {  0,  0,  0,  0,  0,  0},   // 9887
+    {  2,  3,103,  0,  0,  0},   // 9888
+    { 11, 29, 31,  0,  0,  0},   // 9889
+    {  2,  5, 23, 43,  0,  0},   // 9890
+    {  3,  7,157,  0,  0,  0},   // 9891
+    {  2,2473,  0,  0,  0,  0},   // 9892
+    { 13,761,  0,  0,  0,  0},   // 9893
+    {  2,  3, 17, 97,  0,  0},   // 9894
+    {  5,1979,  0,  0,  0,  0},   // 9895
+    {  2,1237,  0,  0,  0,  0},   // 9896
+    {  3,3299,  0,  0,  0,  0},   // 9897
+    {  2,  7,101,  0,  0,  0},   // 9898
+    { 19,521,  0,  0,  0,  0},   // 9899
+    {  2,  3,  5, 11,  0,  0},   // 9900
+    {  0,  0,  0,  0,  0,  0},   // 9901
+    {  2,4951,  0,  0,  0,  0},   // 9902
+    {  3,3301,  0,  0,  0,  0},   // 9903
+    {  2,619,  0,  0,  0,  0},   // 9904
+    {  5,  7,283,  0,  0,  0},   // 9905
+    {  2,  3, 13,127,  0,  0},   // 9906
+    {  0,  0,  0,  0,  0,  0},   // 9907
+    {  2,2477,  0,  0,  0,  0},   // 9908
+    {  3,367,  0,  0,  0,  0},   // 9909
+    {  2,  5,991,  0,  0,  0},   // 9910
+    { 11, 17, 53,  0,  0,  0},   // 9911
+    {  2,  3,  7, 59,  0,  0},   // 9912
+    { 23,431,  0,  0,  0,  0},   // 9913
+    {  2,4957,  0,  0,  0,  0},   // 9914
+    {  3,  5,661,  0,  0,  0},   // 9915
+    {  2, 37, 67,  0,  0,  0},   // 9916
+    { 47,211,  0,  0,  0,  0},   // 9917
+    {  2,  3, 19, 29,  0,  0},   // 9918
+    {  7, 13,109,  0,  0,  0},   // 9919
+    {  2,  5, 31,  0,  0,  0},   // 9920
+    {  3,3307,  0,  0,  0,  0},   // 9921
+    {  2, 11, 41,  0,  0,  0},   // 9922
+    {  0,  0,  0,  0,  0,  0},   // 9923
+    {  2,  3,827,  0,  0,  0},   // 9924
+    {  5,397,  0,  0,  0,  0},   // 9925
+    {  2,  7,709,  0,  0,  0},   // 9926
+    {  3,1103,  0,  0,  0,  0},   // 9927
+    {  2, 17, 73,  0,  0,  0},   // 9928
+    {  0,  0,  0,  0,  0,  0},   // 9929
+    {  2,  3,  5,331,  0,  0},   // 9930
+    {  0,  0,  0,  0,  0,  0},   // 9931
+    {  2, 13,191,  0,  0,  0},   // 9932
+    {  3,  7, 11, 43,  0,  0},   // 9933
+    {  2,4967,  0,  0,  0,  0},   // 9934
+    {  5,1987,  0,  0,  0,  0},   // 9935
+    {  2,  3, 23,  0,  0,  0},   // 9936
+    { 19,523,  0,  0,  0,  0},   // 9937
+    {  2,4969,  0,  0,  0,  0},   // 9938
+    {  3,3313,  0,  0,  0,  0},   // 9939
+    {  2,  5,  7, 71,  0,  0},   // 9940
+    {  0,  0,  0,  0,  0,  0},   // 9941
+    {  2,  3,1657,  0,  0,  0},   // 9942
+    { 61,163,  0,  0,  0,  0},   // 9943
+    {  2, 11,113,  0,  0,  0},   // 9944
+    {  3,  5, 13, 17,  0,  0},   // 9945
+    {  2,4973,  0,  0,  0,  0},   // 9946
+    {  7, 29,  0,  0,  0,  0},   // 9947
+    {  2,  3,829,  0,  0,  0},   // 9948
+    {  0,  0,  0,  0,  0,  0},   // 9949
+    {  2,  5,199,  0,  0,  0},   // 9950
+    {  3, 31,107,  0,  0,  0},   // 9951
+    {  2,311,  0,  0,  0,  0},   // 9952
+    { 37,269,  0,  0,  0,  0},   // 9953
+    {  2,  3,  7, 79,  0,  0},   // 9954
+    {  5, 11,181,  0,  0,  0},   // 9955
+    {  2, 19,131,  0,  0,  0},   // 9956
+    {  3,3319,  0,  0,  0,  0},   // 9957
+    {  2, 13,383,  0,  0,  0},   // 9958
+    { 23,433,  0,  0,  0,  0},   // 9959
+    {  2,  3,  5, 83,  0,  0},   // 9960
+    {  7,1423,  0,  0,  0,  0},   // 9961
+    {  2, 17,293,  0,  0,  0},   // 9962
+    {  3, 41,  0,  0,  0,  0},   // 9963
+    {  2, 47, 53,  0,  0,  0},   // 9964
+    {  5,1993,  0,  0,  0,  0},   // 9965
+    {  2,  3, 11,151,  0,  0},   // 9966
+    {  0,  0,  0,  0,  0,  0},   // 9967
+    {  2,  7, 89,  0,  0,  0},   // 9968
+    {  3,3323,  0,  0,  0,  0},   // 9969
+    {  2,  5,997,  0,  0,  0},   // 9970
+    { 13, 59,  0,  0,  0,  0},   // 9971
+    {  2,  3,277,  0,  0,  0},   // 9972
+    {  0,  0,  0,  0,  0,  0},   // 9973
+    {  2,4987,  0,  0,  0,  0},   // 9974
+    {  3,  5,  7, 19,  0,  0},   // 9975
+    {  2, 29, 43,  0,  0,  0},   // 9976
+    { 11,907,  0,  0,  0,  0},   // 9977
+    {  2,  3,1663,  0,  0,  0},   // 9978
+    { 17,587,  0,  0,  0,  0},   // 9979
+    {  2,  5,499,  0,  0,  0},   // 9980
+    {  3,1109,  0,  0,  0,  0},   // 9981
+    {  2,  7, 23, 31,  0,  0},   // 9982
+    { 67,149,  0,  0,  0,  0},   // 9983
+    {  2,  3, 13,  0,  0,  0},   // 9984
+    {  5,1997,  0,  0,  0,  0},   // 9985
+    {  2,4993,  0,  0,  0,  0},   // 9986
+    {  3,3329,  0,  0,  0,  0},   // 9987
+    {  2, 11,227,  0,  0,  0},   // 9988
+    {  7,1427,  0,  0,  0,  0},   // 9989
+    {  2,  3,  5, 37,  0,  0},   // 9990
+    { 97,103,  0,  0,  0,  0},   // 9991
+    {  2,1249,  0,  0,  0,  0},   // 9992
+    {  3,3331,  0,  0,  0,  0},   // 9993
+    {  2, 19,263,  0,  0,  0},   // 9994
+    {  5,1999,  0,  0,  0,  0},   // 9995
+    {  2,  3,  7, 17,  0,  0},   // 9996
+    { 13,769,  0,  0,  0,  0},   // 9997
+    {  2,4999,  0,  0,  0,  0},   // 9998
+    {  3, 11,101,  0,  0,  0},   // 9999
+    {  2,  5,  0,  0,  0,  0}    // 10000
+  };
+#endif
diff --git a/print_container.h b/print_container.h
new file mode 100644
index 0000000..5fac745
--- /dev/null
+++ b/print_container.h
@@ -0,0 +1,70 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef PRINT_CONTAINER_H
+#define PRINT_CONTAINER_H
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <set>
+#include <list>
+#include <map>
+
+template <typename T, typename S>
+std::ostream& operator<<(std::ostream &os, std::pair<T,S> p)
+{
+  os << p.first << "=>" << p.second;
+  return os;
+}
+
+
+template <typename T>
+void print_container(std::ostream &os, T it, T it_end,
+		     const char *pre, const char *delim, const char *post)
+{
+  if (it == it_end)
+    return;
+
+  os << pre;
+  os << *it;
+  ++it;
+  while (it != it_end)
+  {
+    os << delim << *it;
+    ++it;
+  }
+  os << post;
+}
+
+template<typename T>
+void print_container(std::ostream &os, T c,
+		     const char *pre, const char *delim, const char *post)
+{
+  print_container(os, c.begin(), c.end(), pre, delim, post);
+}
+
+#endif
diff --git a/range_functions.h b/range_functions.h
new file mode 100644
index 0000000..8a3e8d8
--- /dev/null
+++ b/range_functions.h
@@ -0,0 +1,1625 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef RANGE_FUNCTIONS_H
+#define RANGE_FUNCTIONS_H
+
+#include <iostream>
+#include <list>
+#include <cstdlib>
+#include "faststring2.h"
+#include <cerrno>
+#include <iterator>
+#include <vector>
+
+#define MACRO_MAX(x,y) ((x)<(y) ? (y) : (x))
+#define MACRO_MIN(x,y) ((x)<(y) ? (x) : (y))
+
+// This is a range class for unsigned numbers not for double numbers, which would
+// be interesting in its own right.
+// In principle one could make a template class out of this.
+
+
+//
+// General conventions:
+//  - ranges are undirected
+//  - start <= end
+//  - end is position after last position in range
+//  - ranges can be 0 or 1 based. Be careful!!!!
+//  - the preferred way to represent a vanishing range is (0,0).
+// TODO: See comments in functions for which this convention does not apply.
+// TODO: Several funcions work independent of a convention here.
+//
+
+
+
+
+class  CRangeList;
+
+class Crange
+{
+
+  friend class CRangeList;
+
+  unsigned b;
+  unsigned e;
+
+ public:
+
+ Crange(unsigned pb, unsigned pe):b(pb), e(pe) 
+  {
+    order();
+  }
+
+  void order() // According to the conventions above: b <= e
+  {
+    if (b > e)
+    {
+      unsigned tmp = b;
+      b   = e;
+      e   = tmp;
+    }
+  }
+
+
+  friend unsigned overlap(Crange r1, Crange r2)
+  {
+    unsigned overlap_start = MACRO_MAX(r1.b, r2.b);
+    unsigned overlap_end   = MACRO_MIN(r1.e, r2.e);
+    
+    if (overlap_end > overlap_start)
+      return overlap_end - overlap_start;
+    else
+      return 0;
+  }
+  
+  friend Crange overlap_range(Crange r1, Crange r2)
+  {
+    unsigned overlap_start = MACRO_MAX(r1.b, r2.b);
+    unsigned overlap_end   = MACRO_MIN(r1.e, r2.e);
+    
+    if (overlap_end > overlap_start)
+    {
+      Crange res(overlap_start, overlap_end);
+      return res;
+    }
+    else
+      return Crange(0,0);
+  }
+  
+  friend void overlap_range(Crange r1, Crange r2, Crange &res1, Crange &res_over, Crange &res2)
+  {
+    unsigned overlap_start = MACRO_MAX(r1.b, r2.b);
+    unsigned overlap_end   = MACRO_MIN(r1.e, r2.e);
+    unsigned res1_start    = MACRO_MIN(r1.b, r2.b);
+    unsigned res2_end      = MACRO_MAX(r1.e, r2.e);
+
+    if (overlap_end > overlap_start)
+    {
+      res_over.assign(overlap_start, overlap_end);
+      res1.assign(res1_start, overlap_start);
+      res2.assign(overlap_end, res2_end);
+    }
+    else
+    {
+      res_over.assign(0, 0);
+      if (r1 < r2)
+      {
+	res1 = r1;
+	res2 = r2;
+      }
+      else
+      {
+	res1 = r2;
+	res2 = r1;
+      }
+    }
+  }
+
+  friend double overlap_proportion(Crange r1, Crange r2)
+  {
+    unsigned overlap_start = MACRO_MAX(r1.b, r2.b);
+    unsigned overlap_end   = MACRO_MIN(r1.e, r2.e);
+
+    if (overlap_end > overlap_start)
+    {
+      double overl = overlap_end - overlap_start;
+      double l     = MACRO_MIN(r1.len(), r2.len());
+
+      return (overl/l);
+    }
+    else
+      return 0.0;
+  }
+
+
+  friend bool adjacent_or_overlap(Crange r1, Crange r2)
+  {
+    unsigned overlap_start = MACRO_MAX(r1.b, r2.b);
+    unsigned overlap_end   = MACRO_MIN(r1.e, r2.e);
+    
+    if (overlap_end >= overlap_start)
+      return true;    // == means they are adjacent 
+    else
+      return false;
+  }
+
+  Crange()
+  {
+    b = e = 0;
+  }
+
+  friend void swap(Crange &r1, Crange &r2)
+  {
+    Crange tmp = r2;
+    r2 = r1;
+    r1 = tmp;
+  }
+
+  friend void swap(Crange *r1, Crange *r2)
+  {
+    Crange tmp = *r2;
+    *r2 = *r1;
+    *r1 = tmp;
+  }
+
+  bool empty() const
+  {
+    return (b == e);
+  }
+
+  void limit_to_range(Crange limit_r)
+  {
+    // Nothing to be done in this case:
+    if (is_r2_Subrange_of_r1(limit_r, *this) )
+      return;
+
+    b = MACRO_MAX(limit_r.b, b);
+    e = MACRO_MIN(limit_r.e, e);
+    if (b >= e)
+      b = e = 0;
+  }
+
+  friend bool operator==(Crange r1, Crange r2)
+  {
+    return (r1.b == r2.b && r1.e == r2.e);
+  }
+
+  void assign(unsigned pb, unsigned pe)
+  {
+    b = pb;
+    e = pe;
+    order();
+  }
+
+  // true if r1 starts before r2
+  // true if r1 starts with r2 and if r1 is shorter
+  // r1    *******
+  // r2    ***********   r1 < r2 is true
+  friend bool operator<(Crange r1, Crange r2)
+  {
+    if (r1.b != r2.b)
+      return r1.b < r2.b;
+    return r1.e < r2.e;
+  }
+
+  friend bool equalRange(Crange r1, Crange r2)
+  {
+    return (r1 == r2);
+  }
+
+
+  friend bool is_r2_Subrange_of_r1(Crange r1, Crange r2)
+  {
+    return (r2.b >= r1.b && r2.e <= r1.e);
+  }
+
+  friend Crange range_intersection(Crange r1, Crange r2)
+  {
+    Crange res( MACRO_MAX(r1.b,r2.b), MACRO_MIN(r1.e,r2.e));
+    if (res.b >= res.e)
+      res.e = res.b = 0;
+
+    return res;
+  }
+
+  friend bool before(Crange r1, Crange r2)
+  {
+    return r1.e <= r2.b;
+  }
+
+  friend bool after(Crange r1, Crange r2)
+  {
+    return r1.b >= r2.e;
+  }
+
+  // formerly called range_union, which was a misnomer.
+  //  friend  ......
+
+  friend Crange range_span(Crange r1, Crange r2)
+  {
+    Crange res( MACRO_MIN(r1.b,r2.b), MACRO_MAX(r1.e,r2.e));
+    return res;
+  }
+
+
+  void shift (unsigned s)
+  {
+    b +=s;
+    e +=s;
+  }
+
+  unsigned begin() const
+  {
+    return b;
+  }
+
+  unsigned end() const
+  {
+    return e;
+  }
+
+  unsigned inclusive_end() const
+  {
+    return e-1;
+  }
+
+  unsigned len() const
+  {
+    return e-b;
+  }
+
+  bool point_is_in_range(unsigned x) const
+  {
+    if (x>=b && x < e)
+      return true;
+    else
+      return false;
+  }
+
+  bool point_is_behind_range(unsigned x) const
+  {
+    if (x >= e)
+      return true;
+    else
+      return false;
+  }
+
+  bool point_is_before_range(unsigned x) const
+  {
+    if (x < b)
+      return true;
+    else
+      return false;
+  }
+
+  void print_with_brackets(std::ostream &os) const
+  {
+    os << "(" << b << "," << e << ")"; 
+  }
+
+  void print_with_brackets_inclusive_end(std::ostream &os) const
+  {
+    os << "(" << b << "," << (e-1) << ")"; 
+  }
+
+  void print_minus_deliminated_inclusive_end(std::ostream &os) const
+  {
+    os << b << "-" << (e-1); 
+  }
+
+  void transform_start_end(int mult_start, int add_start, int mult_end, int add_end)
+  {
+    b = b*mult_start + add_start;
+    e = e*mult_end   + add_end;
+  }
+
+  void transform_coord(std::vector<unsigned> &coord_trans)
+  {
+    // We subtract 1 from e before we look up this index in the field, since the end index of a range is 1 behind its last element.
+    if ( e-1 >= coord_trans.size() )
+    {
+      std::cerr << "Index out of range: " << e << std::endl;
+      exit(-33);
+    }
+
+    b = coord_trans[b];
+    e = coord_trans[e-1]+1;   // We transform the coord of the last element and add 1.
+  }
+
+
+}; // class Crange
+
+
+
+
+/* class CRangeList_array */
+/* { */
+/*   Crange      limit; */
+/*   faststring  rl_array; */
+
+/*   CRangeList_array(Crang l):limit(l), faststring('\0', l.end()-l.begin()+1) */
+/*   {} */
+
+/*   Crange   get_limit() */
+/*   { */
+/*     return limit; */
+/*   } */
+
+/*   unsigned get_limit_begin() */
+/*   { */
+/*     return limit.begin(); */
+/*   } */
+
+/*   unsigned get_limit_end() */
+/*   { */
+/*     return limit.end(); */
+/*   } */
+  
+
+
+/* }; */
+
+
+
+
+// NOTE: Code referring to array is either experimental or unfinished.
+//
+//
+
+class CRangeList
+{
+  std::list<Crange> rl;
+  bool              sorted;
+  unsigned          lower_bound;
+  unsigned          upper_bound; // Accoring to the convetion this position comes after the last position in this list of ranges.
+  unsigned          count; // Introduced since the empty() function could be
+                           // via size()==0, whereas size could be O(n)
+                           // which might be very inefficient.
+  // rl_array is not fully implemented: In the future it could be used to store "in" and "out of" the range list
+  // by setting chars to 1 or 0, which would make many functions more efficient.
+  faststring        *rl_array;
+
+
+ public:
+  typedef std::list<Crange>::iterator CRangeList_iterator;
+  typedef std::list<Crange>::const_iterator CRangeList_iterator_const;
+
+  // Default constructor:
+  // Caution: lower_bound and upper_bound are set to 0, since they are needed by
+  //          some functions. This is better than arbitrary values.
+  //          even though one could say the values are not correct.
+  //          But arbitrary values are not more correct than 0. 
+  //          Take care that all member functions set these variables
+  //          if the first element of a list is added.
+
+ CRangeList():sorted(false), lower_bound(0), upper_bound(0), count(0), rl_array(NULL)
+  {}
+
+  // Copy constructor
+ CRangeList(const CRangeList &a):rl(a.rl), lower_bound(a.lower_bound), upper_bound(a.upper_bound), count(a.count), rl_array(NULL)
+  {
+    if (a.rl_array != NULL)
+    {
+      rl_array = new faststring(*a.rl_array);
+    }
+  }
+
+  void  clear_rl_array()
+  {
+    if (rl_array)
+    {
+      delete rl_array;
+      rl_array = NULL;
+    }
+  }
+
+  ~CRangeList()
+  {
+    clear_rl_array();
+  }
+
+
+ public:
+  void add(unsigned pb, unsigned pe)
+  {
+    Crange new_r (pb, pe);
+
+    if (new_r.empty())
+      return;
+
+    clear_rl_array();
+
+    // If the new element is > than the last element in the list,
+    // sorting is not affected, otherwise "it is false".
+    // Note: We cannot set sorted to true, if the rest of the list is not sorted.
+
+    if (count == 0)
+    {
+      sorted = true;
+      lower_bound = new_r.b;
+      upper_bound = new_r.e;
+      rl.push_back(new_r);
+    }
+    else
+    {
+      if ( !(rl.back() < new_r) )
+	sorted = false;
+      // else - do not change sorted status
+
+      if (lower_bound > new_r.b)
+	lower_bound = new_r.b;
+      if (upper_bound < new_r.e)
+	upper_bound = new_r.e;
+
+      rl.push_back(new_r);
+    }
+    ++count;
+  }
+
+  CRangeList_iterator_const begin() const
+  {
+    return rl.begin();
+  } 
+
+  CRangeList_iterator_const begin()
+  {
+    return rl.begin();
+  } 
+
+  CRangeList_iterator_const end() const 
+  {
+    return rl.end();
+  } 
+
+  CRangeList_iterator_const end()
+  {
+    return rl.end();
+  } 
+
+  void create_reset_rl_array()
+  {
+    if (rl_array)
+    {
+      rl_array->assign(upper_bound-lower_bound, '\0');
+    }
+    else
+    {
+      rl_array = new faststring('\0', upper_bound-lower_bound);      
+    }
+  }
+
+
+  void fill_rl_array()
+  {
+    if (rl_array == NULL)
+      create_reset_rl_array();
+
+    CRangeList_iterator_const it     = rl.begin();
+    CRangeList_iterator_const it_end = rl.end();
+
+    unsigned pos1, pos2;
+
+    // foreach range:
+    while (it != it_end)
+    {
+      pos1 = it->begin();
+      pos2 = it->end();
+
+      while (pos1 < pos2)
+      {
+	rl_array[pos1] = 1;
+	++pos1;
+      }
+      ++it;
+    }
+  }
+
+  void add(Crange new_r)
+  {
+    // If the new element is > than the last element in the list,
+    // sorting is not affected, otherwise "it is false".
+    // Note: We cannot set sorted to true, if the rest of the list is not sorted.
+
+    clear_rl_array();
+
+    if (new_r.empty())
+      return;
+
+    if (count == 0)
+    {
+      sorted = true;
+      lower_bound = new_r.b;
+      upper_bound = new_r.e;
+      rl.push_back(new_r);
+    }
+    else
+    {
+      if ( !(rl.back() < new_r) )
+	sorted = false;
+      // else - do not change sorted status
+
+      if (lower_bound > new_r.b)
+	lower_bound = new_r.b;
+      if (upper_bound < new_r.e)
+	upper_bound = new_r.e;
+
+      rl.push_back(new_r);
+    }
+    ++count;
+  }
+
+
+  void add(const CRangeList &a)
+  {
+    CRangeList_iterator_const it     = a.rl.begin();
+    CRangeList_iterator_const it_end = a.rl.end();
+
+    while (it != it_end)
+    {
+      if ( !it->empty() )
+	add(*it);
+      ++it;
+    }
+  }
+
+  bool add(faststring str)
+  {
+    size_t pos1=0, pos2, len=str.size();
+    unsigned c1,c2;
+
+    while (pos1 < len && str[pos1] != ';')
+    {
+      str.skip_symbol(pos1,' ');
+
+      errno = 0;
+      c1 = str.ToUnsigned(pos1, pos2);
+      //      std::cerr << "c1 " << c1 << std::endl;
+      if (errno != 0)
+      {
+	return false;
+      }
+      str.skip_symbol(pos2,' ');
+
+      if (str[pos2] == ',' || str[pos2] == ';') // One number range.
+      {
+	add(c1,c1+1);
+      }
+      else if (str[pos2] == '-') // Two number range
+      {
+	pos1 = pos2+1;  // Be careful '-' is read as minus
+	str.skip_symbol(pos1,' ');
+	//	std::cerr << "pos1 " << pos1 << std::endl;
+	errno = 0;
+	c2 = str.ToUnsigned(pos1, pos2);
+	//	std::cerr << "c2 " << c2 << std::endl;
+	if (errno != 0)
+	{
+	  return false;
+	}
+	//	std::cerr << "pos2 " << pos2 << std::endl;
+	str.skip_symbol(pos2,' ');
+	if (str[pos2] > '\0' && str[pos2] <= '\7')
+	{
+	  unsigned tmp = c1;
+	  unsigned delta = str[pos2]-'\0';
+	  if (errno != 0)
+	  {
+	    return false;
+	  }
+	  ++pos2;
+	  str.skip_symbol(pos2,' ');
+	  
+	  while (tmp < c2)
+	  {
+	    add(tmp, tmp+1);
+	    tmp += delta;
+	  }
+	}
+	else
+	{
+	  add(c1, c2+1);
+	}
+      }
+      else
+      {
+	return false;
+      }
+      pos1 = pos2;
+      
+      if (str[pos1] == ',') // we are not done yet - the list continues
+      {
+	++pos1;
+	str.skip_symbol(pos1,' ');
+	if (str[pos1] == ';')
+
+	  return false;
+      }
+    }
+    return true;
+  }
+
+
+  unsigned size() const
+  {
+    return count;
+  }
+
+  // Assignment operator: Use standard assigment operator. No pointer content needs to be copied
+  //                      This is still true since rl_array is not ready to use yet.
+  //                      Currently there is no need/no plan to implement it.
+         
+  void clear()
+  {
+    rl.clear(); // Will call the destructor for all objects.
+    sorted = false;
+    clear_rl_array();
+    // I am not sure this is the best way to assign values to the bounds.
+    // Bounds are not well defined for an empty list.
+    lower_bound = upper_bound = 0;
+    count = 0;
+  }
+
+
+  void sort()
+  {
+    if (!sorted)
+    {
+      rl.sort();
+      sorted = true;
+    }
+  }
+
+
+  // We expect the use to check for count == 0
+  Crange bounds()
+  {
+    // There is one problem here: The last entry need to have the "highest coordinate"
+    // 100-150, 200-400, 250-300
+
+    Crange res(lower_bound, upper_bound);
+    return res;
+  }
+
+  // We expect the use to check for count == 0
+  unsigned get_lower_bound()
+  {
+    return lower_bound;
+  }
+
+  // We expect the use to check for count == 0
+  unsigned get_upper_bound()
+  {
+    return upper_bound;
+  }
+
+
+  // Find an island of overlaping ranges, starting at it_beg.
+  // The initial value of it_end (the second parameter) is overwritten,
+  // and is therefore irrelevant.
+  // When leaving this function, it_end points to the range behind the island.
+  // This is also true, if the island is the last island in the list.
+  // In this case, it_end == to list_of_sat_ptr.end()
+
+  unsigned findOverlappingIsland(CRangeList_iterator_const  it_beg,
+                                 CRangeList_iterator_const &it_end) const
+  {
+    unsigned count=1;
+
+    it_end = it_beg;
+    ++it_end;
+
+    while (it_end != rl.end())
+    {
+      if (overlap(*it_beg, *it_end))   // If they overlap, we move it_end,                                                                                
+      {
+        ++count;
+        ++it_end;
+      }
+      else // if they do not overlap any more, we need not be out of the island.                                                                            
+      {    // Let us move it_beg, which should now be behind or equal to it_end.                                                                            
+        ++it_beg;
+        if (it_beg == it_end) // this is the case of the last two sats do not overlap                                                                       
+          break;              // In this case it_end points one behind the last island.                                                                     
+      }
+    }
+    return count;
+  }
+
+  unsigned findAdjacentIsland(CRangeList_iterator_const  it_beg,
+			      CRangeList_iterator_const &it_end) const
+  {
+    unsigned count=1; // The current range is the Nr 1.
+
+    it_end = it_beg;
+    ++it_end;
+
+    while (it_end != rl.end())
+    {
+      if (adjacent_or_overlap(*it_beg, *it_end))   // If they overlap, we move it_end,                                                                                
+      {
+        ++count;
+        ++it_end;
+      }
+      else // if they do not overlap any more, we need not be out of the island.                                                                            
+      {    // Let us move it_beg, which should now be behind or equal to it_end.                                                                            
+        ++it_beg;
+        if (it_beg == it_end) // this is the case of the last two sats do not overlap                                                                       
+          break;              // In this case it_end points one behind the last island.                                                                     
+      }
+    }
+    return count;
+  }
+
+
+  void findRangeWithMaxExtToRight(CRangeList_iterator_const  it_beg,
+				  CRangeList_iterator_const  it_end,
+				  CRangeList_iterator_const &it_extends_most) const
+  {
+    it_extends_most = it_beg;
+    if (it_beg == it_end)
+      return;
+
+    ++it_beg;
+    while (it_beg != it_end)
+    {
+      if ((*it_beg).e > (*it_extends_most).e )
+        it_extends_most = it_beg;
+      ++it_beg;
+    }
+  }
+
+
+  Crange range_of_island(CRangeList_iterator_const    it_beg,
+			 CRangeList_iterator_const   &it_end_of_island)
+  {
+    Crange res;
+    CRangeList_iterator_const  it_extends_most;
+
+    if (!sorted)
+    {
+      std::cerr << "Error: range_of_island requires the list of ranges to be sorted." << std::endl;
+      exit(0);
+    }
+
+    res.b = it_beg->b;
+
+    findOverlappingIsland(it_beg, it_end_of_island);
+    findRangeWithMaxExtToRight(it_beg, it_end_of_island, it_extends_most);
+    
+    res.e = it_extends_most->e;
+
+    return res;
+  }
+
+  Crange range_of_adjacentisland(CRangeList_iterator_const   it_beg,
+				 CRangeList_iterator_const   &it_end_of_island)
+  {
+    Crange                     res;
+    CRangeList_iterator_const  it_extends_most;
+
+    if (!sorted)
+    {
+      std::cerr << "Internal error: range_of_adjacentisland requires the list of ranges to be sorted." << std::endl;
+      exit(0);
+    }
+
+    res.b = it_beg->b;
+
+    findAdjacentIsland(it_beg, it_end_of_island);
+    findRangeWithMaxExtToRight(it_beg, it_end_of_island, it_extends_most);
+    
+    res.e = it_extends_most->e;
+
+    return res;
+  }
+
+
+  // coverage_len allows to specify a range - double check that feature.
+  double coverage_rel(Crange bds)
+  {
+    CRangeList rl_tmp(*this);
+
+    rl_tmp.limit_to_range(bds);
+
+    double bds_len = bds.len();
+    
+    return rl_tmp.coverage_len(bds)/bds_len;
+  }
+
+  unsigned coverage_len2(Crange bds)
+  {
+    CRangeList rl2;
+    get_consolidated_range_list(rl2);
+
+    rl2.limit_to_range(bds);
+    return rl2.coverage_raw();
+  }
+
+  unsigned coverage_raw()
+  {
+    unsigned count=0;
+
+    CRangeList_iterator_const it, it_end;
+
+    it     = rl.begin();
+    it_end = rl.end();
+
+    while (it != it_end)
+    {
+      count += it->len();
+      ++it;
+    }
+    return count;
+  }
+
+  // Side effect: *this will be sorted
+  unsigned coverage_len(Crange bds) // bounds in which to compute the coverage
+  {
+    unsigned cover = 0;
+
+    CRangeList_iterator_const it, it_end, end_island;
+    Crange r1, r2;
+
+    //    std::cerr << "Computing coverage for this: " << std::endl;
+    //    print_bracketed_list(std::cerr);
+    //    std::cerr << std::endl;
+
+    sort();
+
+    it     = rl.begin();
+    it_end = rl.end();
+
+    while (it != it_end && it->e < bds.b)
+      ++it;
+
+    if (it == it_end)
+      return 0;
+
+    // it points to first range after start of bds
+    r1 = range_of_island(it, end_island);
+    cover += overlap(r1, bds);
+    it = end_island;
+    //    std::cerr << "First overlap: " << cover << std::endl;
+
+    while (it != it_end && it->b < bds.e)
+    {
+      r1 = range_of_island(it, end_island);
+      it = end_island;
+      if (r1.e > bds.e)
+      {
+	cover += overlap(r1, bds);
+	break;
+      }
+      else
+	cover += r1.len();
+      //      std::cerr << "next value: " << cover << std::endl;
+    }
+
+    return cover;
+  }
+
+  // Side effect: *this will be sorted
+  unsigned coverage_len() //  without bounds
+  {
+    unsigned cover = 0;
+
+    CRangeList_iterator_const it, it_end, end_island;
+    Crange r1;
+
+    //    std::cerr << "Computing coverage for this: " << std::endl;
+    //    print_bracketed_list(std::cerr);
+    //    std::cerr << std::endl;
+
+    sort();
+
+    it     = rl.begin();
+    it_end = rl.end();
+
+    while (it != it_end)
+    {
+      r1 = range_of_island(it, end_island);
+      it = end_island;
+
+      cover += r1.len();
+      //      std::cerr << "next value: " << cover << std::endl;
+    }
+
+    return cover;
+  }
+
+  unsigned coverage_len_loop() //  without bounds
+  {
+    unsigned cover = 0;
+    Crange r1, b;
+
+    //    std::cerr << "Computing coverage for this: " << std::endl;
+    //    print_bracketed_list(std::cerr);
+    //    std::cerr << std::endl;
+
+    if (count == 0)
+      return 0;
+
+    // Required by point_is_in_RangeList
+    sort();
+
+    CRangeList_iterator_const it1 = rl.begin();
+
+    b = bounds(); //Upper bound of this range is element after range.
+    unsigned i, b_end;
+
+    b_end = b.end();
+    for (i=b.begin(); i<b_end; ++i)
+    {
+      if (point_is_in_RangeList(i, it1) )
+      {
+	++cover;
+      }
+    }
+    return cover;
+  }
+
+
+
+  void test1()
+  {
+    CRangeList_iterator_const  it1 = rl.begin();
+    CRangeList_iterator_const  it2 = rl.end();
+    CRangeList_iterator_const  it3, it4;
+ 
+    while (it1 != it2)
+    {
+      Crange r = range_of_island(it1, it3);
+
+      it1 = it3;
+
+      std::cout << "Next range: " << std::endl;
+      r.print_with_brackets(std::cout);
+      std::cout << std::endl;
+    }
+  }
+
+  void print_bracketed_list(std::ostream &os) const
+  {
+    CRangeList_iterator_const  it_beg = rl.begin();
+    CRangeList_iterator_const  it_end = rl.end();
+
+    if (it_beg == it_end)
+      return;
+
+    while (1) //(it_beg != it_end)
+    {
+      it_beg->print_with_brackets(os);
+      ++it_beg;
+      if (it_beg == it_end)
+	return;
+      os << ",";
+    }
+  }
+
+  void print_bracketed_list_inclusive_ends(std::ostream &os) const
+  {
+    CRangeList_iterator_const  it_beg = rl.begin();
+    CRangeList_iterator_const  it_end = rl.end();
+
+    if (it_beg == it_end)
+      return;
+
+    while (1) //(it_beg != it_end)
+    {
+      it_beg->print_with_brackets_inclusive_end(os);
+      ++it_beg;
+      if (it_beg == it_end)
+	return;
+      os << ",";
+    }
+  }
+
+
+  void print_deliminated_inclusive_end(std::ostream &os, const char *delim) const
+  {
+    CRangeList_iterator_const  it_beg = rl.begin();
+    CRangeList_iterator_const  it_end = rl.end();
+
+    if (it_beg == it_end)
+      return;
+
+    while (1) //(it_beg != it_end)
+    {
+      it_beg->print_minus_deliminated_inclusive_end(os);
+      ++it_beg;
+      if (it_beg == it_end)
+	return;
+      os << delim;
+    }
+  }
+
+  void print_deliminated_inclusive_end(std::ostream &os, char delim= ',') const
+  {
+    CRangeList_iterator_const  it_beg = rl.begin();
+    CRangeList_iterator_const  it_end = rl.end();
+
+    if (it_beg == it_end)
+      return;
+
+    while (1) //(it_beg != it_end)
+    {
+      it_beg->print_minus_deliminated_inclusive_end(os);
+      ++it_beg;
+      if (it_beg == it_end)
+	return;
+      os << delim;
+    }
+  }
+
+
+  // For this CRangeList compute a consolidated range list:
+  // Adjacent or overlapping ranges are merged in the consolidated list
+  void get_consolidated_range_list(CRangeList &crl)
+  {
+    sort();
+    crl.clear();
+
+    CRangeList_iterator_const  it1, it2;
+
+    it1 = it2 = rl.begin();
+
+    while (it2 != rl.end() )
+    {
+      crl.add(range_of_adjacentisland(it1, it2) );
+      //      crl.sort();
+      it1 = it2;
+    }
+  }
+
+
+  void remove_empty()  // Now we try to avoid to add empty ranges in the first place
+  {
+    CRangeList_iterator  it1;
+
+    it1 = rl.begin();
+    
+    while (it1 != rl.end() )
+    {	
+      if ( it1->empty() )
+      {
+	it1 = rl.erase(it1);
+	--count;
+      }
+      else
+	++it1;
+    }
+  }
+
+
+  // Side effect: Removes empty ranges form list:
+  void limit_to_range(Crange limit_r)
+  {
+    CRangeList_iterator  it1;
+
+    clear_rl_array();
+
+    it1 = rl.begin();
+    
+    if (sorted)
+    {
+      //      std::cout << "sorted mode" << std::endl;
+      while (it1 != rl.end() && before(*it1, limit_r) )
+      {	
+	// remove ranges before limiting range:
+	++it1;
+      }
+      if (it1 != rl.begin())
+	rl.erase(rl.begin(), it1);
+      // count will be reset at the end!!
+
+      while (it1 != rl.end() && !after(*it1, limit_r) )
+      {
+	it1->limit_to_range(limit_r);
+	
+	if ( it1->empty() )
+	{
+	  it1 = rl.erase(it1);
+	  // count will be reset at the end!!
+	}
+	else
+	  ++it1;
+      }
+
+      if (it1 != rl.end() )
+      {	
+	// remove ranges after limiting range:
+	rl.erase(it1, rl.end());
+	// count will be reset at the end!!
+      }
+    }
+    else
+    {
+      while (it1 != rl.end() )
+      {
+	it1->limit_to_range(limit_r);
+	
+	if ( it1->empty() )
+	{
+	  it1 = rl.erase(it1);
+	  // count will be reset at the end!!
+	}
+	else
+	  ++it1;
+      }
+    }
+    // This could be made a bit more efficient.
+    // This solution however is most secure.
+    count = rl.size();
+  }
+
+
+  friend CRangeList range_union(Crange a, Crange b)
+  {
+    CRangeList tmp, res;
+
+    tmp.add(a);
+    tmp.add(b);
+
+    tmp.get_consolidated_range_list(res);
+    
+    return res;
+  }
+
+  friend CRangeList cut_out_range(Crange a, Crange b)
+  {
+    Crange r1, r2, r3;
+    CRangeList res;
+
+    overlap_range(a,b,r1, r2, r3);
+
+    res.add(r1);
+    res.add(r3);
+    return res;
+  }
+
+
+  void set_to_range_list_union(const CRangeList &a, const CRangeList &b)
+  {
+    CRangeList tmp(a);
+    tmp.add(b);
+
+    clear();
+    tmp.get_consolidated_range_list(*this);
+  }
+
+  void set_to_range_list_intersection(CRangeList &a, CRangeList &b)
+  {
+    clear();
+
+    CRangeList ca, cb;
+
+    a.get_consolidated_range_list(ca);
+    b.get_consolidated_range_list(cb);
+
+    CRangeList_iterator_const it_a, it_b;
+
+    it_a = ca.rl.begin();
+    it_b = cb.rl.begin();
+
+    while (it_a != ca.rl.end() )
+    {
+      // While the range it_b lies before it_a:
+      while ( it_b != cb.rl.end() && before(*it_b, *it_a) )
+      {
+	++it_b;
+      }
+      // While the range it_a overlaps with it_b:
+      while ( it_b != cb.rl.end() && overlap(*it_a, *it_b) )
+      {
+	add(range_intersection(*it_a, *it_b) );
+	++it_b;
+      }
+      if (it_b != cb.rl.begin())
+	--it_b;
+      ++it_a;
+    }
+  }
+
+  // Side effect: list of ranges will be sorted
+  bool point_is_in_RangeList(unsigned x)
+  {
+    sort();
+    CRangeList_iterator_const it1, it2;
+
+    it1 = rl.begin();
+    it2 = rl.end();
+
+    // Skip all ranges which have an end value that lies before x
+    while (it1 != it2 && x >= it1->e)
+    {
+      ++it1;
+    }
+
+    // Test all ranges which have a beginning that lies before x
+    while (it1 != it2 && x >= it1->b)
+    {
+      if (it1->point_is_in_range(x))
+	return true;
+      ++it1;
+    }
+    // All remaining ranges have a beginning that lies behind x:
+    return false;
+  }
+
+  // Requirement: list of ranges must be sorted
+  bool point_is_in_RangeList(unsigned x, CRangeList_iterator_const &it1) const
+  {
+    if (!sorted)
+    {
+      std::cerr << "When calling point_is_in_RangeList, the range list must be sorted." << std::endl;
+      exit(-11);
+    }
+
+    CRangeList_iterator_const it2;
+    it2 = rl.end();
+
+    // Skip all ranges which have an end value that lies before x
+    while (it1 != it2 && x >= it1->e)
+    {
+      ++it1;
+    }
+
+    // Test all ranges which have a beginning that lies before x
+    while (it1 != it2 && x >= it1->b)
+    {
+      if (it1->point_is_in_range(x))
+	return true;
+      ++it1;
+    }
+    if (it1 != rl.begin() )
+      --it1; // We might have moved too far.
+
+    // All remaining ranges have a beginning that lies behind x:
+    return false;
+  }
+
+
+  void export_as_gff(std::ostream &os, const char *seq, const char* source, const char *type, char direction)
+  {
+    CRangeList_iterator_const it     = rl.begin();
+    CRangeList_iterator_const it_end = rl.end();
+
+    while (it != it_end)
+    {
+      os << seq    << "\t"
+	 << source << "\t"
+	 << type   << "\t"
+	 << it->b  << "\t"
+	 << it->e  << "\t"
+	 << ".\t"
+	 << direction << "\t"
+	 << ".\t"
+	 << "ID=" << seq << "_" << it->b << "_" << it->e << std::endl;
+      ++it;
+    }
+  }
+
+  // Side effect: CRangeList rl is being sorted and set to a consolidated list.
+  void set_to_complement_of(CRangeList &rl, Crange limit)
+  {
+    CRangeList crl;
+    Crange r1, r2, r3;
+
+    // Clear this CRangeList. Otherwise we add to a probably non empty list.
+    clear();
+
+    rl.get_consolidated_range_list(crl);
+
+    crl.sort(); // Should already be sorted. Just to be sure.
+    crl.limit_to_range(limit);
+
+    CRangeList_iterator_const it     = crl.rl.begin();
+    CRangeList_iterator_const it_end = crl.rl.end();
+
+    r3 = limit;
+    while (it != it_end)
+    {
+      // r2 is just a dummy for the overlapping part.
+      overlap_range(r3, *it, r1, r2, r3);
+      //      std::cerr << "Adding "; r1.print_with_brackets(std::cerr); std::cerr << std::endl;
+      add(r1);
+      ++it;
+    }
+    add(r3);
+  }
+
+
+  unsigned* get_range_list_field()
+  {
+    unsigned* p = new unsigned [2*count];
+
+    CRangeList_iterator_const it     = rl.begin();
+    CRangeList_iterator_const it_end = rl.end();
+    unsigned i=0;
+   
+    sort();
+
+    while (it != it_end)
+    {
+      p[i]   = it->begin();
+      p[i+1] = it->end();
+      ++i;
+      ++it;
+    }
+    return p;
+  }
+
+  friend bool less_than_CRangeList(const CRangeList &a, const CRangeList &b)
+  {
+     CRangeList_iterator_const it_a     = a.rl.begin();
+     CRangeList_iterator_const it_b     = b.rl.begin();
+     CRangeList_iterator_const it_a_end = a.rl.end();
+     CRangeList_iterator_const it_b_end = b.rl.end();
+
+
+     while (it_a != it_a_end && it_b != it_b_end && *it_a == *it_b )
+     {
+       ++it_a;
+       ++it_b;
+     }
+     // return true if a is shorter than b
+     if (it_a != it_a_end || it_b != it_b_end)
+       return a.size() < b.size();
+
+     return (*it_a < *it_b);
+  }
+
+  friend bool less_than_CRangeList_pointer(const CRangeList *a, const CRangeList *b)
+  {
+    return less_than_CRangeList(*a, *b);
+  }
+
+  void  transform_start_end(int mult_start, int add_start, int mult_end, int add_end)
+  {
+    CRangeList_iterator it     = rl.begin();
+    CRangeList_iterator it_end = rl.end();
+
+    while (it != it_end)
+    {
+      it->transform_start_end(mult_start, add_start, mult_end, add_end);
+      ++it;
+    }
+  }
+
+  void transform_coord(std::vector<unsigned> &coord_trans)
+  {
+    CRangeList_iterator it     = rl.begin();
+    CRangeList_iterator it_end = rl.end();
+
+    while (it != it_end)
+    {
+      it->transform_coord(coord_trans);
+      ++it;
+    }
+  }
+
+}; // End class CRangeList
+
+
+
+inline void coverage_values_loop(Crange limit,
+				 CRangeList &rl1,
+				 CRangeList &rl2,
+				 CRangeList &rl3,
+				 CRangeList &rl4,
+
+				 unsigned &len_gff1,
+				 unsigned &len_gff2,
+				 unsigned &len_gff3,
+				 unsigned &len_gff4,
+				 unsigned &in1not3not4,
+				 unsigned &in2not3not4,
+				 unsigned &in1in2not3not4,
+				 unsigned &in3in4not1not2)
+{
+  unsigned i;
+  bool    in1, in2, in3, in4;
+
+  len_gff1=0;
+  len_gff2=0;
+  len_gff3=0;
+  len_gff4=0;
+  in1not3not4=0;
+  in2not3not4=0;
+  in1in2not3not4=0;
+  in3in4not1not2=0;
+
+  unsigned en=limit.end();
+
+  CRangeList::CRangeList_iterator_const it1, it2, it3, it4;
+
+  it1 = rl1.begin();
+  it2 = rl2.begin();
+  it3 = rl3.begin();
+  it4 = rl4.begin();
+  
+  rl1.sort();
+  rl2.sort();
+  rl3.sort();
+  rl4.sort();
+
+  for (i=limit.begin(); i < en; ++i)
+  {
+    //    std::cerr << "Checking " << i << std::endl;
+
+    in1 = rl1.point_is_in_RangeList(i, it1);
+    in2 = rl2.point_is_in_RangeList(i, it2);
+    in3 = rl3.point_is_in_RangeList(i, it3);
+    in4 = rl4.point_is_in_RangeList(i, it4);
+
+    if (in1) ++len_gff1;
+    if (in2) ++len_gff2;
+    if (in3) ++len_gff3;
+    if (in4) ++len_gff4;
+
+    if (in1 && !in3 && !in4)         ++in1not3not4;
+    if (in2 && !in3 && !in4)         ++in2not3not4;
+
+    if ( in1 &&  in2 && !in3 && !in4)  ++in1in2not3not4;
+    if (!in1 && !in2 &&  in3 &&  in4)  ++in3in4not1not2;
+  }
+}
+
+
+
+// This function is basically used for testing purposes. Its logic is straight forward.
+
+inline  void coverage_values_loop(Crange limit,
+				  CRangeList rl1,  // no side effect
+				  CRangeList rl2,  // no side effect
+				  unsigned &limit_len,
+				  unsigned &len_rl1,
+				  unsigned &len_rl2,
+				  unsigned &len_union,
+				  unsigned &len_intersection)
+{
+  unsigned i;
+  bool    in1, in2;
+
+  len_rl1 = 0;
+  len_rl2 = 0;
+  len_intersection = 0;
+  len_union        = 0;
+  limit_len = limit.end() - limit.begin();
+
+  unsigned en=limit.end();
+
+  CRangeList::CRangeList_iterator_const it1, it2;
+
+  it1 = rl1.begin();
+  it2 = rl2.begin();
+
+  rl1.sort();
+  rl2.sort();
+
+  for (i=limit.begin(); i < en; ++i)
+  {
+    //    std::cerr << "Checking " << i << std::endl;
+
+    in1 = rl1.point_is_in_RangeList(i, it1);
+    in2 = rl2.point_is_in_RangeList(i, it2);
+
+    if (in1)
+    {
+      ++len_rl1;
+      ++len_union;
+      if (in2)
+      {
+	--len_union;
+	++len_intersection;
+      }
+    }
+    if (in2)
+    {
+      ++len_rl2;
+      ++len_union;
+    }
+  }
+}
+
+inline  void coverage_values(Crange limit,
+			     CRangeList rl1,  // no side effect
+			     CRangeList rl2,  // no side effect
+			     unsigned &limit_len,
+			     unsigned &len_rl1,
+			     unsigned &len_rl2,
+			     unsigned &len_union,
+			     unsigned &len_intersection)
+{
+  rl1.limit_to_range(limit);
+  rl2.limit_to_range(limit);
+
+  //  std::cout << "DEBUG: ";
+  //  rl1.print_bracketed_list(std::cout);
+  //  std::cout << std::endl;
+
+  CRangeList un, inter;
+  
+  un.set_to_range_list_union(rl1,rl2);
+  inter.set_to_range_list_intersection(rl1,rl2);
+  limit_len = limit.len();
+
+  len_rl1   = rl1.coverage_len();
+  len_rl2   = rl2.coverage_len();
+  len_union = un.coverage_len();
+  len_intersection = inter.coverage_len();
+}
+
+
+inline unsigned overlap(unsigned a1, unsigned a2,
+		 unsigned b1, unsigned b2)
+{
+  unsigned overlap_start = MACRO_MAX(a1, b1);
+  unsigned overlap_end   = MACRO_MIN(a2, b2);
+ 
+  if (overlap_end > overlap_start)
+    return overlap_end - overlap_start;
+  else
+    return 0;
+}
+
+
+inline bool equalRange(unsigned a1, unsigned a2,
+		unsigned b1, unsigned b2)
+{
+  return (a1 == b1 && a2 == b2);
+}
+
+
+inline bool is_r2_Subrange_of_r1(unsigned a1, unsigned a2, unsigned b1, unsigned b2)
+{
+  return (b1 >= a1 && b2 <= a2);
+}
+
+
+inline void range_intersection(unsigned a1, unsigned a2,
+			unsigned b1, unsigned b2,
+			unsigned &c1, unsigned &c2)
+{
+  c1 = MACRO_MAX(a1,b1);
+  c2 = MACRO_MIN(a2,b2);
+  if (c1 > c2)  // Empty intersection
+    c1=c2=0;
+}
+
+// formerly called range_union. Only if the ranges overlap we have the true union.
+inline void range_span(unsigned a1, unsigned a2,      // First range
+		       unsigned b1, unsigned b2,      // Second range
+		       unsigned &c1, unsigned &c2)    // Result range
+{
+  c1 = MACRO_MIN(a1,b1);
+  c2 = MACRO_MAX(a2,b2);
+}
+
+
+
+#endif
diff --git a/scoring-matrices/.DS_Store b/scoring-matrices/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/scoring-matrices/.DS_Store differ
diff --git a/scoring-matrices/CScoreMatrix.h b/scoring-matrices/CScoreMatrix.h
new file mode 100644
index 0000000..db23a50
--- /dev/null
+++ b/scoring-matrices/CScoreMatrix.h
@@ -0,0 +1,319 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef CSCOREMATRIX_H
+
+#define CSCOREMATRIX_H
+
+
+#include <iostream>
+#include <fstream>
+#include "../faststring2.h"
+#include <climits>
+#include <sstream>
+
+class CScoreMatrix
+{
+ private:
+  faststring     alphabet;
+  unsigned char  alphabet_to_index[256];
+
+  unsigned char num_sym;
+
+  int gap_open;
+  int gap_ext;
+
+
+  short **score_mat;
+
+  char type;
+
+
+ public:
+/*   int alphabet_index(char base) */
+/*   {     */
+/*     return 0; */
+/*   } */
+  
+  CScoreMatrix (const char *filename)
+  {
+    faststring line;
+    std::ifstream ifs;
+
+    ifs.open(filename);
+
+    if (!ifs.fail())
+    {
+      read_from_file(ifs);
+      ifs.close();
+    }
+    else
+    {
+      std::cerr << "INFORMATION: Could not find the file with alignment parameters: " << filename << std::endl;
+      std::cerr << "The following default values will be assumed as alignment parameters:" << std::endl;
+
+      std::stringstream stringst;
+      stringst << ";D standard DNA scoring matrix\n 1 45 80 5 6 80 4\n -0 -3\n* @ 0 1 2 \nACGTRYMWSKDHVBN\n0  1  2  3  0  1  0  0  1  2  0  0  0  1  0\n 1 \n-2  1 \n-2 -2  1 \n-2 -2 -2  1 \n 1 -2  1 -2  1 \n-2  1 -2  1 -2  1 \n 1  1 -2 -2 -2 -2  1 \n 1 -2 -2  1 -2 -2 -2  1 \n-2  1  1 -2 -2 -2 -2 -2  1 \n-2 -2  1  1 -2 -2 -2 -2 -2  1 \n 1 -2  1  1  1 -2 -2  1 -2  1  1 \n 1  1 -2  1 -2  1  1  1 -2 -2 -2  1 \n 1  1  1 -2  1 -2  1 -2  1 -2 -2 -2  1 \n-2  1  1  1 -2  1 -2 -2  1  1 -2 -2 -2  1 [...]
+      read_from_file(stringst);
+
+      std::ios_base::fmtflags f = std::cerr.flags();
+      std::cerr.flags(std::ios::right);
+      std::cerr << "Gap openening penalty:     ";      std::cerr.width(3);      std::cerr << gap_open << std::endl;
+      std::cerr << "Gap extension penalty:     ";      std::cerr.width(3);      std::cerr << gap_ext  << std::endl;
+      std::cerr << "Match score:               ";      std::cerr.width(3);      std::cerr  << score_compare_symbols('A', 'A') << std::endl;
+      std::cerr << "Mismatch score:            ";      std::cerr.width(3);      std::cerr  << score_compare_symbols('A', 'C') << std::endl;
+      std::cerr << "Score against N:           ";      std::cerr.width(3);      std::cerr  << score_compare_symbols('A', 'N') << std::endl;
+      std::cerr << "Scores against other ambigs: match or mismatch score" << std::endl;
+      std::cerr.setf(f);
+    }
+  }
+
+  ~CScoreMatrix()
+  {
+    delete [] score_mat;
+  }
+
+
+  int get_Gap_open_score()
+  {
+    return gap_open;
+  }
+
+  int get_Gap_ext_score()
+  {
+    return gap_ext;
+  }
+
+  double get_mean_matchscore_of_first_N_symbols(unsigned N)
+  {
+    unsigned i;
+    double   sum=0;
+    for (i=0; i<N; ++i)
+    {
+      sum += score_mat[i][i];
+    }
+    return sum/N;
+  }
+
+  char get_Type()
+  {
+    return type;
+  }
+  
+  int get_NumbrOfSymbols()
+  {
+    return num_sym;
+  }
+
+  // Expects an existing file that is openend and reading pointer
+  // pointing to the beginning of the file.
+  void read_from_file(std::istream &is)
+  {
+    faststring line;
+
+    // First line
+    getline(is, line);
+    if (line[0] != ';')
+    {
+      // Error - must be a ';'
+    }
+    if (toupper(line[1]) == 'P') // protein
+    {
+      type = 'P';
+    }
+    else if (toupper(line[1]) == 'D') // DNA  
+    {
+      type = 'D';
+    }
+    else
+    {
+      // Error, must be either 'D' or 'P'
+
+    }
+
+    // Second line
+    getline(is, line); // Unused data
+    
+    // Third line
+    is >> gap_open >> gap_ext;
+    getline(is, line); // Read newline of this line.
+
+    // Fourth line
+    getline(is, line); // Unused data
+
+    int i;
+
+    for (i=0; i<256; ++i)
+      alphabet_to_index[i] = UCHAR_MAX;
+
+
+    // Fifth line
+    unsigned char c = is.get();
+    num_sym = 0;
+    while (c!= '\n')
+    {
+      if (!isspace(c))
+      {
+	alphabet.push_back(c);
+	alphabet_to_index[c] = num_sym;
+	++num_sym;
+      }
+      c = is.get();
+    }
+    
+    // Sixth line:
+    getline(is, line); // Unused data - Hashkeys
+
+    // Now we read the matrix:
+    // Indices:
+    // First  index: row
+    // Second index: col
+
+    score_mat = new short* [num_sym];
+    
+    for (i=0; i< num_sym; ++i)
+    {
+      score_mat[i] = new short[num_sym];
+    }
+    
+    int num_entries = num_sym*(num_sym+1)/2;
+
+    i = 0;
+    int ind1 = 0;
+    int ind2 = 0;
+
+    short entry;
+
+    while (i < num_entries)
+    {
+      is >> entry;
+      
+      score_mat[ind2][ind1] = entry;
+      score_mat[ind1][ind2] = entry;
+
+      if (ind1 == ind2)
+      {
+	++ind2;
+	ind1=0;
+      }
+      else
+      {
+	++ind1;
+      }
+      ++i;
+    }
+
+    if (!is)
+    {
+      std::cerr << "Error while reading the matrix in the alignment parameter file. The file seems to be damaged. Please revert to a working version of this file." << std::endl;
+      exit(10);
+    }
+  }
+
+  void debug_out(std::ostream &os)
+  {
+    os << "Data stored in scoring matrix:" << std::endl;
+    os << "Type: " << type << std::endl;
+    os << "number of symbols: " << (int) num_sym << std::endl;
+    os << "Alphabet: " << std::endl;
+
+    int i = 0;
+    while (i<num_sym)
+    {
+      os << i << " " << alphabet.get_unckecked(i) << " " << (int)alphabet_to_index[(unsigned char)alphabet.get_unckecked(i)] << std::endl;
+      ++i;
+    }
+    os << std::endl;
+    os << "gap open " << gap_open << " gap_ext " << gap_ext << std::endl;
+
+    int j;
+
+    for (i=0; i< num_sym; ++i) // rows
+    {
+      for(j=0; j<=i; ++j) // cols
+      {
+	os << score_mat[i][j] << " ";
+      }
+      os << std::endl;
+    }
+  }
+
+  void convert_sym_to_index(unsigned char *beg, unsigned char *end)
+  {
+    while (beg != end)
+    {
+      *beg = alphabet_to_index[*beg];
+      ++beg;
+    }
+  }
+
+  void convert_sym_to_index(unsigned char *beg)
+  {
+    while (*beg)
+    {
+      *beg = alphabet_to_index[*beg];
+      ++beg;
+    }
+    *beg = UCHAR_MAX; // UCHAR_MAX indicates the end of the string.
+  }
+
+  void convert_index_to_sym(unsigned char *beg, unsigned char*end)
+  {
+    while (beg != end)
+    {
+      *beg = alphabet.get_unckecked(*beg);
+      ++beg;
+    }
+  }
+
+  void convert_to_index_to_sym(unsigned char *beg)
+  {
+    while (*beg != UCHAR_MAX)
+    {
+      *beg = alphabet.get_unckecked(*beg);
+      ++beg;
+    }
+    *beg = 0; // Convert UCHAR_MAX to 0 to indicate the end of the string.
+  }
+
+
+
+  int score_compare_indizes(unsigned char i, unsigned char j)
+  {
+    return score_mat[j][i]; // From i to j, col index (i) to row index (j)
+  }
+
+  int score_compare_symbols(unsigned char a, unsigned char b)
+  {
+    return score_mat[alphabet_to_index[b]][alphabet_to_index[a]];
+  }
+  
+
+
+};
+
+
+#endif
diff --git a/simpledna_N0.mat b/simpledna_N0.mat
new file mode 100755
index 0000000..3e2f24f
--- /dev/null
+++ b/simpledna_N0.mat
@@ -0,0 +1,23 @@
+;D standard DNA scoring matrix
+ 1 45 80 5 6 80 4
+ -0 -3
+* @ 0 1 2 
+ACGTRYMWSKDHVBN
+0  1  2  3  0  1  0  0  1  2  0  0  0  1  0
+ 1 
+-2  1 
+-2 -2  1 
+-2 -2 -2  1 
+ 1 -2  1 -2  1 
+-2  1 -2  1 -2  1 
+ 1  1 -2 -2 -2 -2  1 
+ 1 -2 -2  1 -2 -2 -2  1 
+-2  1  1 -2 -2 -2 -2 -2  1 
+-2 -2  1  1 -2 -2 -2 -2 -2  1 
+ 1 -2  1  1  1 -2 -2  1 -2  1  1 
+ 1  1 -2  1 -2  1  1  1 -2 -2 -2  1 
+ 1  1  1 -2  1 -2  1 -2  1 -2 -2 -2  1 
+-2  1  1  1 -2  1 -2 -2  1  1 -2 -2 -2  1 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
+
+
diff --git a/statistic_functions.h b/statistic_functions.h
new file mode 100644
index 0000000..12ad1e7
--- /dev/null
+++ b/statistic_functions.h
@@ -0,0 +1,466 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+#ifndef STATISTIC_FUNCTIONS_H
+#define STATISTIC_FUNCTIONS_H
+
+#include <iostream>
+#include <vector>
+#include <map>
+#include <cmath>
+#include <cctype>
+#include <iterator>
+#include <cstdlib>
+#include <algorithm>
+#include <climits>
+
+#define EPSS  0.00000000001;
+
+
+#define macro_min(x,y) ((x)<(y) ? (x) : (y))
+#define macro_max(x,y) ((x)>(y) ? (x) : (y))
+#define macro_mean_double(x,y) (((x)+(y))/2.0)
+
+
+template<typename T>
+size_t vec_mean_sd(const std::vector<T> &vec,
+		   double &mean, double &sd)
+{
+  size_t     i, n=vec.size();
+  double  sum_x  = 0;
+  double  sum_xx = 0;
+
+  if (n==0)
+    return 0;
+
+  for (i=0; i<n; ++i)
+  {
+    sum_x  +=  (double)vec[i];
+    sum_xx +=  (double)vec[i]*vec[i];
+  }
+  if (n!=0)
+    mean = sum_x/(double)n;
+  else
+    mean = 0;
+  if (n>1)
+    sd   = sqrt( (sum_xx-sum_x*mean)/(double)(n-1.0) );
+  else
+    sd   = 0;
+  if (sd < 0.000001)
+    sd = 0;
+  return n;
+}
+
+template<typename T>
+size_t vec_mean_sd(const std::vector<T> &vec,
+		   double &mean, double &sd,
+		   T &sum, T &sum_of_squares)
+{
+  size_t     i, n=vec.size();
+  T  sum_x  = 0;
+  T  sum_xx = 0;
+  T  elem;
+
+  if (n==0)
+    return 0;
+
+  for (i=0; i<n; ++i)
+  {
+    elem = vec[i];
+    sum_x  +=  elem;
+    sum_xx +=  elem*elem;
+  }
+  mean = (double)sum_x/(double)n;
+  if (n>1)
+    sd   = sqrt( (sum_xx-sum_x*mean)/(double)(n-1.0) );
+  else
+    sd   = 0;
+  if (sd < 0.000001)
+    sd = 0;
+
+  sum            = sum_x;
+  sum_of_squares = sum_xx;
+
+  return n;
+}
+
+template<typename T>
+void median_range(std::vector<T> &vec, size_t f, size_t l, double &median, size_t &index, bool &is_datum)
+{
+  size_t s = f+l;
+  size_t m = s/2;
+
+  if (s%2 == 0)
+  {
+    median   = vec[m];
+    index    = m;
+    is_datum = true;
+  }
+  else
+  {
+    median   = (vec[m]+vec[m+1])/2;
+    index    = m;
+    is_datum = false;
+  }
+}
+
+// Method 2 routines:
+
+// Prerequisite: Type T must be a type for which it makes sense to multiply it with a double to obtain a double.
+// Compute quartiles:
+// First quartile, second quartile=median, and third quartile
+template<typename T>
+size_t vec_median_quartile_sort_method2(std::vector<T> &vec, double &Q1, double &Q2, double &Q3)
+{
+  size_t     n=vec.size();
+  size_t     index, dummy;
+  bool       is_datum;
+
+  std::sort(vec.begin(), vec.end());
+
+  median_range(vec, 0, n-1, Q2, index, is_datum);
+
+  if (is_datum)
+  {
+    median_range(vec, 0,     index, Q1, dummy, is_datum);
+    median_range(vec, index, n-1,   Q3, dummy, is_datum);
+  }
+  else
+  {
+    median_range(vec, 0,       index, Q1, dummy, is_datum);
+    median_range(vec, index+1, n-1,   Q3, dummy, is_datum);
+  }
+  return n;
+}
+
+template<typename T>
+size_t vec_median_quartile_method2(std::vector<T> vec, double &Q1, double &Q2, double &Q3)
+{
+  return vec_median_quartile_sort_method2(vec, Q1, Q2, Q3);
+}
+
+//
+// Computes outlier bounds for a vector.
+// Side effect: vec gets sorted. More efficient than copying the vector.
+template<typename T>
+size_t vec_median_quartile_outlier_bounds_sort_method2(std::vector<T> &vec, double &Q1, double &Q2, double &Q3, double &O_lower, double &O_upper)
+{
+  int    res = vec_median_quartile_sort_method2(vec, Q1, Q2, Q3);
+  double IQR = Q3 - Q1;
+    
+  O_lower = Q1 - 1.5 * IQR;
+  O_upper = Q3 + 1.5 * IQR;
+
+  return res;
+}
+
+// Computes outlier bounds for a vector.
+// Same vec_median_quartile_outlier_bounds_sort but without sorting the vector. Slighly slower, since the vector has to be copied.
+template<typename T>
+size_t vec_median_quartile_outlier_bounds_method2(std::vector<T> vec, double &Q1, double &Q2, double &Q3, double &O_lower, double &O_upper)
+{
+  int    res = vec_median_quartile_sort_method2(vec, Q1, Q2, Q3);
+  double IQR = Q3 - Q1;
+    
+  O_lower = Q1 - 1.5 * IQR;
+  O_upper = Q3 + 1.5 * IQR;
+
+  return res;
+}
+
+template<typename T>
+void vec_mark_outlier_mehod2(std::vector<T> &vec, std::vector<bool> &outlier)
+{
+  outlier.clear();
+
+  double Q1, Q2, Q3, O_lower, O_upper;
+  vec_median_quartile_outlier_bounds_method2(vec, Q1, Q2, Q3, O_lower, O_upper);
+
+  unsigned i, N = vec.size();
+  outlier.reserve(N);
+  for (i=0; i<N; ++i)
+  {
+    if (vec[i] < O_lower || vec[i] > O_upper)
+      outlier.push_back(true);
+    else
+      outlier.push_back(false);
+  }
+  std::cout << "Qi: "  << Q1 << " " << Q2 << " " << Q3 << std::endl;
+  std::cout << "Bounds: "  << O_lower << " " << O_upper << std::endl;
+}
+
+// Method 3 routines:
+
+// Prerequisite: Type T must be a type for which it makes sense to multiply it with a double to obtain a double.
+// Compute quartiles:
+// First quartile, second quartile=median, and third quartile
+template<typename T>
+size_t vec_median_quartile_sort_method3(std::vector<T> &vec, double &Q1, double &Q2, double &Q3)
+{
+  size_t     n=vec.size();
+  size_t     m = n/4;
+  size_t     r = n%4;
+
+  std::sort(vec.begin(), vec.end());
+
+  if (n==0)
+    return 0;
+
+  if (n==1)
+  {
+    Q1 = vec[0];
+    Q2 = vec[0];
+    Q3 = vec[0];
+    return 1;
+  }
+
+  if (r == 0)
+  {
+    Q1 = 0.5*vec[  m-1] + 0.5*vec[  m];
+    Q2 = 0.5*vec[2*m-1] + 0.5*vec[2*m];
+    Q3 = 0.5*vec[3*m-1] + 0.5*vec[3*m];
+  }
+  else if (r == 1)
+  {
+    //    std::cerr << "m: " << m << std::endl;
+
+    Q1 = 0.25*vec[ m-1] + 0.75*vec[  m];
+    Q2 = vec[2*m];
+    Q3 = 0.75*vec[ 3*m] + 0.25*vec[3*m+1];
+  }
+  else if (r == 2)
+  {
+    //    std::cerr << "m: " << m << std::endl;
+
+    Q1 = vec[m];
+    Q2 = 0.50*vec[2*m] + 0.50*vec[2*m+1];
+    Q3 = vec[3*m+1];
+  }
+  else // if (r == 3)
+  {
+    //    std::cerr << "m: " << m << std::endl;
+
+    Q1 = 0.75*vec[  m] + 0.25*vec[  m+1];
+    Q2 = vec[2*m+1];
+    Q3 = 0.25*vec[3*m+1] + 0.75*vec[3*m+2];
+  }
+  return n;
+}
+
+template<typename T>
+size_t vec_median_quartile_method3(std::vector<T> vec, double &Q1, double &Q2, double &Q3)
+{
+  return vec_median_quartile_sort_method3(vec, Q1, Q2, Q3);
+}
+
+// Computes outlier bounds for a vector.
+// Side effect: vec gets sorted. More efficient than copying the vector.
+template<typename T>
+size_t vec_median_quartile_outlier_bounds_sort_method3(std::vector<T> &vec, double &Q1, double &Q2, double &Q3, double &O_lower, double &O_upper)
+{
+  int    res = vec_median_quartile_sort_method3(vec, Q1, Q2, Q3);
+  double IQR = Q3 - Q1;
+    
+  O_lower = Q1 - 1.5 * IQR;
+  O_upper = Q3 + 1.5 * IQR;
+
+  return res;
+}
+
+// Computes outlier bounds for a vector.
+// Same vec_median_quartile_outlier_bounds_sort but without sorting the vector. Slighly slower, since the vector has to be copied.
+template<typename T>
+size_t vec_median_quartile_outlier_bounds_method3(std::vector<T> vec, double &Q1, double &Q2, double &Q3, double &O_lower, double &O_upper)
+{
+  int    res = vec_median_quartile_sort_method3(vec, Q1, Q2, Q3);
+  double IQR = Q3 - Q1;
+    
+  O_lower = Q1 - 1.5 * IQR;
+  O_upper = Q3 + 1.5 * IQR;
+
+  return res;
+}
+
+template<typename T>
+void vec_mark_outlier_mehod3(std::vector<T> &vec, std::vector<bool> &outlier)
+{
+  outlier.clear();
+
+  double Q1, Q2, Q3, O_lower, O_upper;
+  vec_median_quartile_outlier_bounds_method3(vec, Q1, Q2, Q3, O_lower, O_upper);
+
+  unsigned i, N = vec.size();
+  outlier.reserve(N);
+  for (i=0; i<N; ++i)
+  {
+    if (vec[i] < O_lower || vec[i] > O_upper)
+      outlier.push_back(true);
+    else
+      outlier.push_back(false);
+  }
+  std::cout << "Qi: "  << Q1 << " " << Q2 << " " << Q3 << std::endl;
+  std::cout << "Bounds: "  << O_lower << " " << O_upper << std::endl;
+}
+
+template<typename T>
+size_t vec_min_max(const std::vector<T> &vec, T &min, T &max)
+{
+  size_t  i, n=vec.size();
+
+  if (n==0)
+    return 0;
+
+  max = min = vec[0];
+
+  for (i=0; i<n; ++i)
+  {
+    if (vec[i] < min)
+      min = vec[i];
+
+    if (vec[i] > max)
+      max = vec[i];
+  }
+  return n;
+}
+
+
+// Determines the mean and sd for a range.
+template <typename T>
+size_t range_mean_sd(T it_beg,
+		     T it_end,
+		     double &mean, double &sd)
+{
+  double  sum_x  = 0;
+  double  sum_xx = 0;
+  size_t n=0;
+  
+  if (it_beg == it_end)
+  {
+    return 0;
+  }
+
+  while (it_end != it_beg)
+  {
+    sum_x  +=  (double)*it_beg;
+    sum_xx +=  (double)*it_beg* *it_beg;
+    ++it_beg;
+    ++n;
+  }
+  mean = sum_x/(double)n;
+  if (n>1)
+    sd   = sqrt( (sum_xx-sum_x*mean)/(double)(n-1.0) );
+  else // if (n==1)
+    sd   = 0;
+  if (sd < 0.000001)
+    sd = 0;
+  return n;
+}
+
+
+template<typename T>
+size_t range_min_max(T it_beg,
+		     T it_end,
+		     double &min, double &max)
+{
+  size_t  n=0;
+
+  if (it_beg == it_end)
+    return 0;
+
+  max = min = *it_beg;
+
+  while (it_end != it_beg)
+  {
+    if (*it_beg< min)
+      min = *it_beg;
+
+    if (*it_beg > max)
+      max = *it_beg;
+    ++n;
+    ++it_beg;
+  }
+  return n;
+}
+
+template <typename T>
+void vec_sum_sum_squares(std::vector<T> v, T& sum, T&sum_squares)
+{
+  sum=0;
+  sum_squares=0;
+
+  unsigned i, n=v.size();
+
+  for (i=0; i<n; ++i)
+  {
+    sum         += v[i];
+    sum_squares += v[i]*v[i];
+  }
+}
+
+// More functions: Single result as return value, using pointers to specify ranges. 
+template <typename T>
+T minimum(T*b, T*e)
+{
+  T m;
+  if (b>=e)
+    return INT_MIN;
+  m = *b;
+  ++b;
+  while (b!=e)
+  {
+    if (*b < m)
+    {
+      m = *b;
+    }
+    ++b;
+  }
+  return m;
+}
+
+template <typename T>
+T maximum(T*b, T*e)
+{
+  T m;
+  if (b>=e)
+    return INT_MIN;
+  m = *b;
+  ++b;
+  while (b!=e)
+  {
+    if (*b > m)
+    {
+      m = *b;
+    }
+    ++b;
+  }
+  return m;
+}
+
+
+
+
+
+#endif
diff --git a/tclap/Arg.h b/tclap/Arg.h
new file mode 100644
index 0000000..b28eef1
--- /dev/null
+++ b/tclap/Arg.h
@@ -0,0 +1,692 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/******************************************************************************
+ *
+ *  file:  Arg.h
+ *
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno .
+ *  All rights reverved.
+ *
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+
+#ifndef TCLAP_ARGUMENT_H
+#define TCLAP_ARGUMENT_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#define HAVE_SSTREAM
+#endif
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <iomanip>
+#include <cstdio>
+
+#if defined(HAVE_SSTREAM)
+#include <sstream>
+typedef std::istringstream istringstream;
+#elif defined(HAVE_STRSTREAM)
+#include <strstream>
+typedef std::istrstream istringstream;
+#else
+#error "Need a stringstream (sstream or strstream) to compile!"
+#endif
+
+#include <tclap/ArgException.h>
+#include <tclap/Visitor.h>
+#include <tclap/CmdLineInterface.h>
+#include <tclap/ArgTraits.h>
+#include <tclap/StandardTraits.h>
+
+namespace TCLAP {
+
+/**
+ * A virtual base class that defines the essential data for all arguments.
+ * This class, or one of its existing children, must be subclassed to do
+ * anything.
+ */
+class Arg
+{
+	private:
+		/**
+		 * Prevent accidental copying.
+		 */
+		Arg(const Arg& rhs);
+
+		/**
+		 * Prevent accidental copying.
+		 */
+		Arg& operator=(const Arg& rhs);
+
+		/**
+		 * Indicates whether the rest of the arguments should be ignored.
+		 */
+		static bool& ignoreRestRef() { static bool ign = false; return ign; }
+
+		/**
+		 * The delimiter that separates an argument flag/name from the
+		 * value.
+		 */
+		static char& delimiterRef() { static char delim = ' '; return delim; }
+
+	protected:
+
+		/**
+		 * The single char flag used to identify the argument.
+		 * This value (preceded by a dash {-}), can be used to identify
+		 * an argument on the command line.  The _flag can be blank,
+		 * in fact this is how unlabeled args work.  Unlabeled args must
+		 * override appropriate functions to get correct handling. Note
+		 * that the _flag does NOT include the dash as part of the flag.
+		 */
+		std::string _flag;
+
+		/**
+		 * A single work namd indentifying the argument.
+		 * This value (preceded by two dashed {--}) can also be used
+		 * to identify an argument on the command line.  Note that the
+		 * _name does NOT include the two dashes as part of the _name. The
+		 * _name cannot be blank.
+		 */
+		std::string _name;
+
+		/**
+		 * Description of the argument.
+		 */
+		std::string _description;
+
+		/**
+		 * Indicating whether the argument is required.
+		 */
+		bool _required;
+
+		/**
+		 * Label to be used in usage description.  Normally set to
+		 * "required", but can be changed when necessary.
+		 */
+		std::string _requireLabel;
+
+		/**
+		 * Indicates whether a value is required for the argument.
+		 * Note that the value may be required but the argument/value
+		 * combination may not be, as specified by _required.
+		 */
+		bool _valueRequired;
+
+		/**
+		 * Indicates whether the argument has been set.
+		 * Indicates that a value on the command line has matched the
+		 * name/flag of this argument and the values have been set accordingly.
+		 */
+		bool _alreadySet;
+
+		/**
+		 * A pointer to a vistitor object.
+		 * The visitor allows special handling to occur as soon as the
+		 * argument is matched.  This defaults to NULL and should not
+		 * be used unless absolutely necessary.
+		 */
+		Visitor* _visitor;
+
+		/**
+		 * Whether this argument can be ignored, if desired.
+		 */
+		bool _ignoreable;
+
+		/**
+		 * Indicates that the arg was set as part of an XOR and not on the
+		 * command line.
+		 */
+		bool _xorSet;
+
+		bool _acceptsMultipleValues;
+
+		/**
+		 * Performs the special handling described by the Vistitor.
+		 */
+		void _checkWithVisitor() const;
+
+		/**
+		 * Primary constructor. YOU (yes you) should NEVER construct an Arg
+		 * directly, this is a base class that is extended by various children
+		 * that are meant to be used.  Use SwitchArg, ValueArg, MultiArg,
+		 * UnlabeledValueArg, or UnlabeledMultiArg instead.
+		 *
+		 * \param flag - The flag identifying the argument.
+		 * \param name - The name identifying the argument.
+		 * \param desc - The description of the argument, used in the usage.
+		 * \param req - Whether the argument is required.
+		 * \param valreq - Whether the a value is required for the argument.
+		 * \param v - The visitor checked by the argument. Defaults to NULL.
+		 */
+ 		Arg( const std::string& flag,
+			 const std::string& name,
+			 const std::string& desc,
+			 bool req,
+			 bool valreq,
+			 Visitor* v = NULL );
+
+	public:
+		/**
+		 * Destructor.
+		 */
+		virtual ~Arg();
+
+		/**
+		 * Adds this to the specified list of Args.
+		 * \param argList - The list to add this to.
+		 */
+		virtual void addToList( std::list<Arg*>& argList ) const;
+
+		/**
+		 * Begin ignoring arguments since the "--" argument was specified.
+		 */
+		static void beginIgnoring() { ignoreRestRef() = true; }
+
+		/**
+		 * Whether to ignore the rest.
+		 */
+		static bool ignoreRest() { return ignoreRestRef(); }
+
+		/**
+		 * The delimiter that separates an argument flag/name from the
+		 * value.
+		 */
+		static char delimiter() { return delimiterRef(); }
+
+		/**
+		 * The char used as a place holder when SwitchArgs are combined.
+		 * Currently set to the bell char (ASCII 7).
+		 */
+		static char blankChar() { return (char)7; }
+
+		/**
+		 * The char that indicates the beginning of a flag.  Defaults to '-', but
+		 * clients can define TCLAP_FLAGSTARTCHAR to override.
+		 */
+#ifndef TCLAP_FLAGSTARTCHAR
+#define TCLAP_FLAGSTARTCHAR '-'
+#endif
+		static char flagStartChar() { return TCLAP_FLAGSTARTCHAR; }
+
+		/**
+		 * The sting that indicates the beginning of a flag.  Defaults to "-", but
+		 * clients can define TCLAP_FLAGSTARTSTRING to override. Should be the same
+		 * as TCLAP_FLAGSTARTCHAR.
+		 */
+#ifndef TCLAP_FLAGSTARTSTRING
+#define TCLAP_FLAGSTARTSTRING "-"
+#endif
+		static const std::string flagStartString() { return TCLAP_FLAGSTARTSTRING; }
+
+		/**
+		 * The sting that indicates the beginning of a name.  Defaults to "--", but
+		 *  clients can define TCLAP_NAMESTARTSTRING to override.
+		 */
+#ifndef TCLAP_NAMESTARTSTRING
+#define TCLAP_NAMESTARTSTRING "--"
+#endif
+		static const std::string nameStartString() { return TCLAP_NAMESTARTSTRING; }
+
+		/**
+		 * The name used to identify the ignore rest argument.
+		 */
+		static const std::string ignoreNameString() { return "ignore_rest"; }
+
+		/**
+		 * Sets the delimiter for all arguments.
+		 * \param c - The character that delimits flags/names from values.
+		 */
+		static void setDelimiter( char c ) { delimiterRef() = c; }
+
+		/**
+		 * Pure virtual method meant to handle the parsing and value assignment
+		 * of the string on the command line.
+		 * \param i - Pointer the the current argument in the list.
+		 * \param args - Mutable list of strings. What is
+		 * passed in from main.
+		 */
+		virtual bool processArg(int *i, std::vector<std::string>& args) = 0;
+
+		/**
+		 * Operator ==.
+		 * Equality operator. Must be virtual to handle unlabeled args.
+		 * \param a - The Arg to be compared to this.
+		 */
+		virtual bool operator==(const Arg& a) const;
+
+		/**
+		 * Returns the argument flag.
+		 */
+		const std::string& getFlag() const;
+
+		/**
+		 * Returns the argument name.
+		 */
+		const std::string& getName() const;
+
+		/**
+		 * Returns the argument description.
+		 */
+		std::string getDescription() const;
+
+		/**
+		 * Indicates whether the argument is required.
+		 */
+		virtual bool isRequired() const;
+
+		/**
+		 * Sets _required to true. This is used by the XorHandler.
+		 * You really have no reason to ever use it.
+		 */
+		void forceRequired();
+
+		/**
+		 * Sets the _alreadySet value to true.  This is used by the XorHandler.
+		 * You really have no reason to ever use it.
+		 */
+		void xorSet();
+
+		/**
+		 * Indicates whether a value must be specified for argument.
+		 */
+		bool isValueRequired() const;
+
+		/**
+		 * Indicates whether the argument has already been set.  Only true
+		 * if the arg has been matched on the command line.
+		 */
+		bool isSet() const;
+
+		/**
+		 * Indicates whether the argument can be ignored, if desired.
+		 */
+		bool isIgnoreable() const;
+
+		/**
+		 * A method that tests whether a string matches this argument.
+		 * This is generally called by the processArg() method.  This
+		 * method could be re-implemented by a child to change how
+		 * arguments are specified on the command line.
+		 * \param s - The string to be compared to the flag/name to determine
+		 * whether the arg matches.
+		 */
+		virtual bool argMatches( const std::string& s ) const;
+
+		/**
+		 * Returns a simple string representation of the argument.
+		 * Primarily for debugging.
+		 */
+		virtual std::string toString() const;
+
+		/**
+		 * Returns a short ID for the usage.
+		 * \param valueId - The value used in the id.
+		 */
+		virtual std::string shortID( const std::string& valueId = "val" ) const;
+
+		/**
+		 * Returns a long ID for the usage.
+		 * \param valueId - The value used in the id.
+		 */
+		virtual std::string longID( const std::string& valueId = "val" ) const;
+
+		/**
+		 * Trims a value off of the flag.
+		 * \param flag - The string from which the flag and value will be
+		 * trimmed. Contains the flag once the value has been trimmed.
+		 * \param value - Where the value trimmed from the string will
+		 * be stored.
+		 */
+		virtual void trimFlag( std::string& flag, std::string& value ) const;
+
+		/**
+		 * Checks whether a given string has blank chars, indicating that
+		 * it is a combined SwitchArg.  If so, return true, otherwise return
+		 * false.
+		 * \param s - string to be checked.
+		 */
+		bool _hasBlanks( const std::string& s ) const;
+
+		/**
+		 * Sets the requireLabel. Used by XorHandler.  You shouldn't ever
+		 * use this.
+		 * \param s - Set the requireLabel to this value.
+		 */
+		void setRequireLabel( const std::string& s );
+
+		/**
+		 * Used for MultiArgs and XorHandler to determine whether args
+		 * can still be set.
+		 */
+		virtual bool allowMore();
+
+		/**
+		 * Use by output classes to determine whether an Arg accepts
+		 * multiple values.
+		 */
+		virtual bool acceptsMultipleValues();
+
+		/**
+		 * Clears the Arg object and allows it to be reused by new
+		 * command lines.
+		 */
+		 virtual void reset();
+};
+
+/**
+ * Typedef of an Arg list iterator.
+ */
+typedef std::list<Arg*>::iterator ArgListIterator;
+
+/**
+ * Typedef of an Arg vector iterator.
+ */
+typedef std::vector<Arg*>::iterator ArgVectorIterator;
+
+/**
+ * Typedef of a Visitor list iterator.
+ */
+typedef std::list<Visitor*>::iterator VisitorListIterator;
+
+/*
+ * Extract a value of type T from it's string representation contained
+ * in strVal. The ValueLike parameter used to select the correct
+ * specialization of ExtractValue depending on the value traits of T.
+ * ValueLike traits use operator>> to assign the value from strVal.
+ */
+template<typename T> void
+ExtractValue(T &destVal, const std::string& strVal, ValueLike vl)
+{
+    static_cast<void>(vl); // Avoid warning about unused vl
+    std::istringstream is(strVal);
+
+    int valuesRead = 0;
+    while ( is.good() ) {
+	if ( is.peek() != EOF )
+#ifdef TCLAP_SETBASE_ZERO
+	    is >> std::setbase(0) >> destVal;
+#else
+	    is >> destVal;
+#endif
+	else
+	    break;
+
+	valuesRead++;
+    }
+
+    if ( is.fail() )
+	throw( ArgParseException("Couldn't read argument value "
+				 "from string '" + strVal + "'"));
+
+
+    if ( valuesRead > 1 )
+	throw( ArgParseException("More than one valid value parsed from "
+				 "string '" + strVal + "'"));
+
+}
+
+/*
+ * Extract a value of type T from it's string representation contained
+ * in strVal. The ValueLike parameter used to select the correct
+ * specialization of ExtractValue depending on the value traits of T.
+ * StringLike uses assignment (operator=) to assign from strVal.
+ */
+template<typename T> void
+ExtractValue(T &destVal, const std::string& strVal, StringLike sl)
+{
+    static_cast<void>(sl); // Avoid warning about unused sl
+    SetString(destVal, strVal);
+}
+
+//////////////////////////////////////////////////////////////////////
+//BEGIN Arg.cpp
+//////////////////////////////////////////////////////////////////////
+
+inline Arg::Arg(const std::string& flag,
+         const std::string& name,
+         const std::string& desc,
+         bool req,
+         bool valreq,
+         Visitor* v) :
+  _flag(flag),
+  _name(name),
+  _description(desc),
+  _required(req),
+  _requireLabel("required"),
+  _valueRequired(valreq),
+  _alreadySet(false),
+  _visitor( v ),
+  _ignoreable(true),
+  _xorSet(false),
+  _acceptsMultipleValues(false)
+{
+	if ( _flag.length() > 1 )
+		throw(SpecificationException(
+				"Argument flag can only be one character long", toString() ) );
+
+	if ( _name != ignoreNameString() &&
+		 ( _flag == Arg::flagStartString() ||
+		   _flag == Arg::nameStartString() ||
+		   _flag == " " ) )
+		throw(SpecificationException("Argument flag cannot be either '" +
+							Arg::flagStartString() + "' or '" +
+							Arg::nameStartString() + "' or a space.",
+							toString() ) );
+
+	if ( ( _name.substr( 0, Arg::flagStartString().length() ) == Arg::flagStartString() ) ||
+		 ( _name.substr( 0, Arg::nameStartString().length() ) == Arg::nameStartString() ) ||
+		 ( _name.find( " ", 0 ) != std::string::npos ) )
+		throw(SpecificationException("Argument name begin with either '" +
+							Arg::flagStartString() + "' or '" +
+							Arg::nameStartString() + "' or space.",
+							toString() ) );
+
+}
+
+inline Arg::~Arg() { }
+
+inline std::string Arg::shortID( const std::string& valueId ) const
+{
+	std::string id = "";
+
+	if ( _flag != "" )
+		id = Arg::flagStartString() + _flag;
+	else
+		id = Arg::nameStartString() + _name;
+
+	if ( _valueRequired )
+		id += std::string( 1, Arg::delimiter() ) + "<" + valueId  + ">";
+
+	if ( !_required )
+		id = "[" + id + "]";
+
+	return id;
+}
+
+inline std::string Arg::longID( const std::string& valueId ) const
+{
+	std::string id = "";
+
+	if ( _flag != "" )
+	{
+		id += Arg::flagStartString() + _flag;
+
+		if ( _valueRequired )
+			id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">";
+
+		id += ",  ";
+	}
+
+	id += Arg::nameStartString() + _name;
+
+	if ( _valueRequired )
+		id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">";
+
+	return id;
+
+}
+
+inline bool Arg::operator==(const Arg& a) const
+{
+	if ( ( _flag != "" && _flag == a._flag ) || _name == a._name)
+		return true;
+	else
+		return false;
+}
+
+inline std::string Arg::getDescription() const
+{
+	std::string desc = "";
+	if ( _required )
+		desc = "(" + _requireLabel + ")  ";
+
+//	if ( _valueRequired )
+//		desc += "(value required)  ";
+
+	desc += _description;
+	return desc;
+}
+
+inline const std::string& Arg::getFlag() const { return _flag; }
+
+inline const std::string& Arg::getName() const { return _name; }
+
+inline bool Arg::isRequired() const { return _required; }
+
+inline bool Arg::isValueRequired() const { return _valueRequired; }
+
+inline bool Arg::isSet() const
+{
+	if ( _alreadySet && !_xorSet )
+		return true;
+	else
+		return false;
+}
+
+inline bool Arg::isIgnoreable() const { return _ignoreable; }
+
+inline void Arg::setRequireLabel( const std::string& s)
+{
+	_requireLabel = s;
+}
+
+inline bool Arg::argMatches( const std::string& argFlag ) const
+{
+	if ( ( argFlag == Arg::flagStartString() + _flag && _flag != "" ) ||
+	       argFlag == Arg::nameStartString() + _name )
+		return true;
+	else
+		return false;
+}
+
+inline std::string Arg::toString() const
+{
+	std::string s = "";
+
+	if ( _flag != "" )
+		s += Arg::flagStartString() + _flag + " ";
+
+	s += "(" + Arg::nameStartString() + _name + ")";
+
+	return s;
+}
+
+inline void Arg::_checkWithVisitor() const
+{
+	if ( _visitor != NULL )
+		_visitor->visit();
+}
+
+/**
+ * Implementation of trimFlag.
+ */
+inline void Arg::trimFlag(std::string& flag, std::string& value) const
+{
+	int stop = 0;
+	for ( int i = 0; static_cast<unsigned int>(i) < flag.length(); i++ )
+		if ( flag[i] == Arg::delimiter() )
+		{
+			stop = i;
+			break;
+		}
+
+	if ( stop > 1 )
+	{
+		value = flag.substr(stop+1);
+		flag = flag.substr(0,stop);
+	}
+
+}
+
+/**
+ * Implementation of _hasBlanks.
+ */
+inline bool Arg::_hasBlanks( const std::string& s ) const
+{
+	for ( int i = 1; static_cast<unsigned int>(i) < s.length(); i++ )
+		if ( s[i] == Arg::blankChar() )
+			return true;
+
+	return false;
+}
+
+inline void Arg::forceRequired()
+{
+	_required = true;
+}
+
+inline void Arg::xorSet()
+{
+	_alreadySet = true;
+	_xorSet = true;
+}
+
+/**
+ * Overridden by Args that need to added to the end of the list.
+ */
+inline void Arg::addToList( std::list<Arg*>& argList ) const
+{
+	argList.push_front( const_cast<Arg*>(this) );
+}
+
+inline bool Arg::allowMore()
+{
+	return false;
+}
+
+inline bool Arg::acceptsMultipleValues()
+{
+	return _acceptsMultipleValues;
+}
+
+inline void Arg::reset()
+{
+	_xorSet = false;
+	_alreadySet = false;
+}
+
+//////////////////////////////////////////////////////////////////////
+//END Arg.cpp
+//////////////////////////////////////////////////////////////////////
+
+} //namespace TCLAP
+
+#endif
+
diff --git a/tclap/ArgException.h b/tclap/ArgException.h
new file mode 100644
index 0000000..3411aa9
--- /dev/null
+++ b/tclap/ArgException.h
@@ -0,0 +1,200 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/****************************************************************************** 
+ * 
+ *  file:  ArgException.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_ARG_EXCEPTION_H
+#define TCLAP_ARG_EXCEPTION_H
+
+#include <string>
+#include <exception>
+
+namespace TCLAP {
+
+/**
+ * A simple class that defines and argument exception.  Should be caught
+ * whenever a CmdLine is created and parsed.
+ */
+class ArgException : public std::exception
+{
+	public:
+	
+		/**
+		 * Constructor.
+		 * \param text - The text of the exception.
+		 * \param id - The text identifying the argument source.
+		 * \param td - Text describing the type of ArgException it is.
+		 * of the exception.
+		 */
+		ArgException( const std::string& text = "undefined exception", 
+					  const std::string& id = "undefined",
+					  const std::string& td = "Generic ArgException")
+			: std::exception(), 
+			  _errorText(text), 
+			  _argId( id ), 
+			  _typeDescription(td)
+		{ } 
+		
+		/**
+		 * Destructor.
+		 */
+		virtual ~ArgException() throw() { }
+
+		/**
+		 * Returns the error text.
+		 */
+		std::string error() const { return ( _errorText ); }
+
+		/**
+		 * Returns the argument id.
+		 */
+		std::string argId() const  
+		{ 
+			if ( _argId == "undefined" )
+				return " ";
+			else
+				return ( "Argument: " + _argId ); 
+		}
+
+		/**
+		 * Returns the arg id and error text. 
+		 */
+		const char* what() const throw() 
+		{
+			static std::string ex; 
+			ex = _argId + " -- " + _errorText;
+			return ex.c_str();
+		}
+
+		/**
+		 * Returns the type of the exception.  Used to explain and distinguish
+		 * between different child exceptions.
+		 */
+		std::string typeDescription() const
+		{
+			return _typeDescription; 
+		}
+
+
+	private:
+
+		/**
+		 * The text of the exception message.
+		 */
+		std::string _errorText;
+
+		/**
+		 * The argument related to this exception.
+		 */
+		std::string _argId;
+
+		/**
+		 * Describes the type of the exception.  Used to distinguish
+		 * between different child exceptions.
+		 */
+		std::string _typeDescription;
+
+};
+
+/**
+ * Thrown from within the child Arg classes when it fails to properly
+ * parse the argument it has been passed.
+ */
+class ArgParseException : public ArgException
+{ 
+	public:
+		/**
+		 * Constructor.
+		 * \param text - The text of the exception.
+		 * \param id - The text identifying the argument source 
+		 * of the exception.
+		 */
+		ArgParseException( const std::string& text = "undefined exception", 
+					       const std::string& id = "undefined" )
+			: ArgException( text, 
+			                id, 
+							std::string( "Exception found while parsing " ) + 
+							std::string( "the value the Arg has been passed." ))
+			{ }
+};
+
+/**
+ * Thrown from CmdLine when the arguments on the command line are not
+ * properly specified, e.g. too many arguments, required argument missing, etc.
+ */
+class CmdLineParseException : public ArgException
+{
+	public:
+		/**
+		 * Constructor.
+		 * \param text - The text of the exception.
+		 * \param id - The text identifying the argument source 
+		 * of the exception.
+		 */
+		CmdLineParseException( const std::string& text = "undefined exception", 
+					           const std::string& id = "undefined" )
+			: ArgException( text, 
+			                id,
+							std::string( "Exception found when the values ") +
+							std::string( "on the command line do not meet ") +
+							std::string( "the requirements of the defined ") +
+							std::string( "Args." ))
+		{ }
+};
+
+/**
+ * Thrown from Arg and CmdLine when an Arg is improperly specified, e.g. 
+ * same flag as another Arg, same name, etc.
+ */
+class SpecificationException : public ArgException
+{
+	public:
+		/**
+		 * Constructor.
+		 * \param text - The text of the exception.
+		 * \param id - The text identifying the argument source 
+		 * of the exception.
+		 */
+		SpecificationException( const std::string& text = "undefined exception",
+					            const std::string& id = "undefined" )
+			: ArgException( text, 
+			                id,
+							std::string("Exception found when an Arg object ")+
+							std::string("is improperly defined by the ") +
+							std::string("developer." )) 
+		{ }
+
+};
+
+class ExitException {
+public:
+	ExitException(int estat) : _estat(estat) {}
+
+	int getExitStatus() const { return _estat; }
+
+private:
+	int _estat;
+};
+
+} // namespace TCLAP
+
+#endif
+
diff --git a/tclap/ArgTraits.h b/tclap/ArgTraits.h
new file mode 100644
index 0000000..0b2c18f
--- /dev/null
+++ b/tclap/ArgTraits.h
@@ -0,0 +1,87 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/******************************************************************************
+ *
+ *  file:  ArgTraits.h
+ *
+ *  Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
+ *  All rights reverved.
+ *
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+// This is an internal tclap file, you should probably not have to
+// include this directly
+
+#ifndef TCLAP_ARGTRAITS_H
+#define TCLAP_ARGTRAITS_H
+
+namespace TCLAP {
+
+// We use two empty structs to get compile type specialization
+// function to work
+
+/**
+ * A value like argument value type is a value that can be set using
+ * operator>>. This is the default value type.
+ */
+struct ValueLike {
+    typedef ValueLike ValueCategory;
+	virtual ~ValueLike() {}
+};
+
+/**
+ * A string like argument value type is a value that can be set using
+ * operator=(string). Usefull if the value type contains spaces which
+ * will be broken up into individual tokens by operator>>.
+ */
+struct StringLike {
+	virtual ~StringLike() {}
+};
+
+/**
+ * A class can inherit from this object to make it have string like
+ * traits. This is a compile time thing and does not add any overhead
+ * to the inherenting class.
+ */
+struct StringLikeTrait {
+    typedef StringLike ValueCategory;
+	virtual ~StringLikeTrait() {}
+};
+
+/**
+ * A class can inherit from this object to make it have value like
+ * traits. This is a compile time thing and does not add any overhead
+ * to the inherenting class.
+ */
+struct ValueLikeTrait {
+    typedef ValueLike ValueCategory;
+	virtual ~ValueLikeTrait() {}
+};
+
+/**
+ * Arg traits are used to get compile type specialization when parsing
+ * argument values. Using an ArgTraits you can specify the way that
+ * values gets assigned to any particular type during parsing. The two
+ * supported types are StringLike and ValueLike.
+ */
+template<typename T>
+struct ArgTraits {
+    typedef typename T::ValueCategory ValueCategory;
+	virtual ~ArgTraits() {}
+    //typedef ValueLike ValueCategory;
+};
+
+#endif
+
+} // namespace
diff --git a/tclap/CmdLine.h b/tclap/CmdLine.h
new file mode 100644
index 0000000..0fec8d8
--- /dev/null
+++ b/tclap/CmdLine.h
@@ -0,0 +1,633 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/******************************************************************************
+ *
+ *  file:  CmdLine.h
+ *
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ *
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+#ifndef TCLAP_CMDLINE_H
+#define TCLAP_CMDLINE_H
+
+#include <tclap/SwitchArg.h>
+#include <tclap/MultiSwitchArg.h>
+#include <tclap/UnlabeledValueArg.h>
+#include <tclap/UnlabeledMultiArg.h>
+
+#include <tclap/XorHandler.h>
+#include <tclap/HelpVisitor.h>
+#include <tclap/VersionVisitor.h>
+#include <tclap/IgnoreRestVisitor.h>
+
+#include <tclap/CmdLineOutput.h>
+#include <tclap/StdOutput.h>
+
+#include <tclap/Constraint.h>
+#include <tclap/ValuesConstraint.h>
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <iomanip>
+#include <algorithm>
+#include <stdlib.h> // Needed for exit(), which isn't defined in some envs.
+
+namespace TCLAP {
+
+template<typename T> void DelPtr(T ptr)
+{
+	delete ptr;
+}
+
+template<typename C> void ClearContainer(C &c)
+{
+	typedef typename C::value_type value_type;
+	std::for_each(c.begin(), c.end(), DelPtr<value_type>);
+	c.clear();
+}
+
+
+/**
+ * The base class that manages the command line definition and passes
+ * along the parsing to the appropriate Arg classes.
+ */
+class CmdLine : public CmdLineInterface
+{
+	protected:
+
+		/**
+		 * The list of arguments that will be tested against the
+		 * command line.
+		 */
+		std::list<Arg*> _argList;
+
+		/**
+		 * The name of the program.  Set to argv[0].
+		 */
+		std::string _progName;
+
+		/**
+		 * A message used to describe the program.  Used in the usage output.
+		 */
+		std::string _message;
+
+		/**
+		 * The version to be displayed with the --version switch.
+		 */
+		std::string _version;
+
+		/**
+		 * The number of arguments that are required to be present on
+		 * the command line. This is set dynamically, based on the
+		 * Args added to the CmdLine object.
+		 */
+		int _numRequired;
+
+		/**
+		 * The character that is used to separate the argument flag/name
+		 * from the value.  Defaults to ' ' (space).
+		 */
+		char _delimiter;
+
+		/**
+		 * The handler that manages xoring lists of args.
+		 */
+		XorHandler _xorHandler;
+
+		/**
+		 * A list of Args to be explicitly deleted when the destructor
+		 * is called.  At the moment, this only includes the three default
+		 * Args.
+		 */
+		std::list<Arg*> _argDeleteOnExitList;
+
+		/**
+		 * A list of Visitors to be explicitly deleted when the destructor
+		 * is called.  At the moment, these are the Vistors created for the
+		 * default Args.
+		 */
+		std::list<Visitor*> _visitorDeleteOnExitList;
+
+		/**
+		 * Object that handles all output for the CmdLine.
+		 */
+		CmdLineOutput* _output;
+
+		/**
+		 * Should CmdLine handle parsing exceptions internally?
+		 */
+		bool _handleExceptions;
+
+		/**
+		 * Throws an exception listing the missing args.
+		 */
+		void missingArgsException();
+
+		/**
+		 * Checks whether a name/flag string matches entirely matches
+		 * the Arg::blankChar.  Used when multiple switches are combined
+		 * into a single argument.
+		 * \param s - The message to be used in the usage.
+		 */
+		bool _emptyCombined(const std::string& s);
+
+		/**
+		 * Perform a delete ptr; operation on ptr when this object is deleted.
+		 */
+		void deleteOnExit(Arg* ptr);
+
+		/**
+		 * Perform a delete ptr; operation on ptr when this object is deleted.
+		 */
+		void deleteOnExit(Visitor* ptr);
+
+private:
+
+		/**
+		 * Prevent accidental copying.
+		 */
+		CmdLine(const CmdLine& rhs);
+		CmdLine& operator=(const CmdLine& rhs);
+
+		/**
+		 * Encapsulates the code common to the constructors
+		 * (which is all of it).
+		 */
+		void _constructor();
+
+
+		/**
+		 * Is set to true when a user sets the output object. We use this so
+		 * that we don't delete objects that are created outside of this lib.
+		 */
+		bool _userSetOutput;
+
+		/**
+		 * Whether or not to automatically create help and version switches.
+		 */
+		bool _helpAndVersion;
+
+	public:
+
+		/**
+		 * Command line constructor. Defines how the arguments will be
+		 * parsed.
+		 * \param message - The message to be used in the usage
+		 * output.
+		 * \param delimiter - The character that is used to separate
+		 * the argument flag/name from the value.  Defaults to ' ' (space).
+		 * \param version - The version number to be used in the
+		 * --version switch.
+		 * \param helpAndVersion - Whether or not to create the Help and
+		 * Version switches. Defaults to true.
+		 */
+		CmdLine(const std::string& message,
+				const char delimiter = ' ',
+				const std::string& version = "none",
+				bool helpAndVersion = true);
+
+		/**
+		 * Deletes any resources allocated by a CmdLine object.
+		 */
+		virtual ~CmdLine();
+
+		/**
+		 * Adds an argument to the list of arguments to be parsed.
+		 * \param a - Argument to be added.
+		 */
+		void add( Arg& a );
+
+		/**
+		 * An alternative add.  Functionally identical.
+		 * \param a - Argument to be added.
+		 */
+		void add( Arg* a );
+
+		/**
+		 * Add two Args that will be xor'd.  If this method is used, add does
+		 * not need to be called.
+		 * \param a - Argument to be added and xor'd.
+		 * \param b - Argument to be added and xor'd.
+		 */
+		void xorAdd( Arg& a, Arg& b );
+
+		/**
+		 * Add a list of Args that will be xor'd.  If this method is used,
+		 * add does not need to be called.
+		 * \param xors - List of Args to be added and xor'd.
+		 */
+		void xorAdd( std::vector<Arg*>& xors );
+
+		/**
+		 * Parses the command line.
+		 * \param argc - Number of arguments.
+		 * \param argv - Array of arguments.
+		 */
+		void parse(int argc, const char * const * argv);
+
+		/**
+		 * Parses the command line.
+		 * \param args - A vector of strings representing the args.
+		 * args[0] is still the program name.
+		 */
+		void parse(std::vector<std::string>& args);
+
+		/**
+		 *
+		 */
+		CmdLineOutput* getOutput();
+
+		/**
+		 *
+		 */
+		void setOutput(CmdLineOutput* co);
+
+		/**
+		 *
+		 */
+		std::string& getVersion();
+
+		/**
+		 *
+		 */
+		std::string& getProgramName();
+
+		/**
+		 *
+		 */
+		std::list<Arg*>& getArgList();
+
+		/**
+		 *
+		 */
+		XorHandler& getXorHandler();
+
+		/**
+		 *
+		 */
+		char getDelimiter();
+
+		/**
+		 *
+		 */
+		std::string& getMessage();
+
+		/**
+		 *
+		 */
+		bool hasHelpAndVersion();
+
+		/**
+		 * Disables or enables CmdLine's internal parsing exception handling.
+		 *
+		 * @param state Should CmdLine handle parsing exceptions internally?
+		 */
+		void setExceptionHandling(const bool state);
+
+		/**
+		 * Returns the current state of the internal exception handling.
+		 *
+		 * @retval true Parsing exceptions are handled internally.
+		 * @retval false Parsing exceptions are propagated to the caller.
+		 */
+		bool getExceptionHandling() const;
+
+		/**
+		 * Allows the CmdLine object to be reused.
+		 */
+		void reset();
+
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+//Begin CmdLine.cpp
+///////////////////////////////////////////////////////////////////////////////
+
+inline CmdLine::CmdLine(const std::string& m,
+                        char delim,
+                        const std::string& v,
+                        bool help )
+    :
+  _argList(std::list<Arg*>()),
+  _progName("not_set_yet"),
+  _message(m),
+  _version(v),
+  _numRequired(0),
+  _delimiter(delim),
+  _xorHandler(XorHandler()),
+  _argDeleteOnExitList(std::list<Arg*>()),
+  _visitorDeleteOnExitList(std::list<Visitor*>()),
+  _output(0),
+  _handleExceptions(true),
+  _userSetOutput(false),
+  _helpAndVersion(help)
+{
+	_constructor();
+}
+
+inline CmdLine::~CmdLine()
+{
+	ClearContainer(_argDeleteOnExitList);
+	ClearContainer(_visitorDeleteOnExitList);
+
+	if ( !_userSetOutput ) {
+		delete _output;
+		_output = 0;
+	}
+}
+
+inline void CmdLine::_constructor()
+{
+	_output = new StdOutput;
+
+	Arg::setDelimiter( _delimiter );
+
+	Visitor* v;
+
+	if ( _helpAndVersion )
+	{
+		v = new HelpVisitor( this, &_output );
+		SwitchArg* help = new SwitchArg("h","help",
+		                      "Displays usage information and exits.",
+		                      false, v);
+		add( help );
+		deleteOnExit(help);
+		deleteOnExit(v);
+
+		v = new VersionVisitor( this, &_output );
+		SwitchArg* vers = new SwitchArg("","version",
+		                      "Displays version information and exits.",
+		                      false, v);
+		add( vers );
+		deleteOnExit(vers);
+		deleteOnExit(v);
+	}
+
+	v = new IgnoreRestVisitor();
+	SwitchArg* ignore  = new SwitchArg(Arg::flagStartString(),
+	          Arg::ignoreNameString(),
+	          "Ignores the rest of the labeled arguments following this flag.",
+	          false, v);
+	add( ignore );
+	deleteOnExit(ignore);
+	deleteOnExit(v);
+}
+
+inline void CmdLine::xorAdd( std::vector<Arg*>& ors )
+{
+	_xorHandler.add( ors );
+
+	for (ArgVectorIterator it = ors.begin(); it != ors.end(); it++)
+	{
+		(*it)->forceRequired();
+		(*it)->setRequireLabel( "OR required" );
+		add( *it );
+	}
+}
+
+inline void CmdLine::xorAdd( Arg& a, Arg& b )
+{
+	std::vector<Arg*> ors;
+	ors.push_back( &a );
+	ors.push_back( &b );
+	xorAdd( ors );
+}
+
+inline void CmdLine::add( Arg& a )
+{
+	add( &a );
+}
+
+inline void CmdLine::add( Arg* a )
+{
+	for( ArgListIterator it = _argList.begin(); it != _argList.end(); it++ )
+		if ( *a == *(*it) )
+			throw( SpecificationException(
+			        "Argument with same flag/name already exists!",
+			        a->longID() ) );
+
+	a->addToList( _argList );
+
+	if ( a->isRequired() )
+		_numRequired++;
+}
+
+
+inline void CmdLine::parse(int argc, const char * const * argv)
+{
+		// this step is necessary so that we have easy access to
+		// mutable strings.
+		std::vector<std::string> args;
+		for (int i = 0; i < argc; i++)
+			args.push_back(argv[i]);
+
+		parse(args);
+}
+
+inline void CmdLine::parse(std::vector<std::string>& args)
+{
+	bool shouldExit = false;
+	int estat = 0;
+
+	try {
+		_progName = args.front();
+		args.erase(args.begin());
+
+		int requiredCount = 0;
+
+		for (int i = 0; static_cast<unsigned int>(i) < args.size(); i++) 
+		{
+			bool matched = false;
+			for (ArgListIterator it = _argList.begin();
+			     it != _argList.end(); it++) {
+				if ( (*it)->processArg( &i, args ) )
+				{
+					requiredCount += _xorHandler.check( *it );
+					matched = true;
+					break;
+				}
+			}
+
+			// checks to see if the argument is an empty combined
+			// switch and if so, then we've actually matched it
+			if ( !matched && _emptyCombined( args[i] ) )
+				matched = true;
+
+			if ( !matched && !Arg::ignoreRest() )
+				throw(CmdLineParseException("Couldn't find match "
+				                            "for argument",
+				                            args[i]));
+		}
+
+		if ( requiredCount < _numRequired )
+			missingArgsException();
+
+		if ( requiredCount > _numRequired )
+			throw(CmdLineParseException("Too many arguments!"));
+
+	} catch ( ArgException& e ) {
+		// If we're not handling the exceptions, rethrow.
+		if ( !_handleExceptions) {
+			throw;
+		}
+
+		try {
+			_output->failure(*this,e);
+		} catch ( ExitException &ee ) {
+			estat = ee.getExitStatus();
+			shouldExit = true;
+		}
+	} catch (ExitException &ee) {
+		// If we're not handling the exceptions, rethrow.
+		if ( !_handleExceptions) {
+			throw;
+		}
+
+		estat = ee.getExitStatus();
+		shouldExit = true;
+	}
+
+	if (shouldExit)
+		exit(estat);
+}
+
+inline bool CmdLine::_emptyCombined(const std::string& s)
+{
+	if ( s.length() > 0 && s[0] != Arg::flagStartChar() )
+		return false;
+
+	for ( int i = 1; static_cast<unsigned int>(i) < s.length(); i++ )
+		if ( s[i] != Arg::blankChar() )
+			return false;
+
+	return true;
+}
+
+inline void CmdLine::missingArgsException()
+{
+		int count = 0;
+
+		std::string missingArgList;
+		for (ArgListIterator it = _argList.begin(); it != _argList.end(); it++)
+		{
+			if ( (*it)->isRequired() && !(*it)->isSet() )
+			{
+				missingArgList += (*it)->getName();
+				missingArgList += ", ";
+				count++;
+			}
+		}
+		missingArgList = missingArgList.substr(0,missingArgList.length()-2);
+
+		std::string msg;
+		if ( count > 1 )
+			msg = "Required arguments missing: ";
+		else
+			msg = "Required argument missing: ";
+
+		msg += missingArgList;
+
+		throw(CmdLineParseException(msg));
+}
+
+inline void CmdLine::deleteOnExit(Arg* ptr)
+{
+	_argDeleteOnExitList.push_back(ptr);
+}
+
+inline void CmdLine::deleteOnExit(Visitor* ptr)
+{
+	_visitorDeleteOnExitList.push_back(ptr);
+}
+
+inline CmdLineOutput* CmdLine::getOutput()
+{
+	return _output;
+}
+
+inline void CmdLine::setOutput(CmdLineOutput* co)
+{
+	if ( !_userSetOutput )
+		delete _output;
+	_userSetOutput = true;
+	_output = co;
+}
+
+inline std::string& CmdLine::getVersion()
+{
+	return _version;
+}
+
+inline std::string& CmdLine::getProgramName()
+{
+	return _progName;
+}
+
+inline std::list<Arg*>& CmdLine::getArgList()
+{
+	return _argList;
+}
+
+inline XorHandler& CmdLine::getXorHandler()
+{
+	return _xorHandler;
+}
+
+inline char CmdLine::getDelimiter()
+{
+	return _delimiter;
+}
+
+inline std::string& CmdLine::getMessage()
+{
+	return _message;
+}
+
+inline bool CmdLine::hasHelpAndVersion()
+{
+	return _helpAndVersion;
+}
+
+inline void CmdLine::setExceptionHandling(const bool state)
+{
+	_handleExceptions = state;
+}
+
+inline bool CmdLine::getExceptionHandling() const
+{
+	return _handleExceptions;
+}
+
+inline void CmdLine::reset()
+{
+	for( ArgListIterator it = _argList.begin(); it != _argList.end(); it++ )
+		(*it)->reset();
+	
+	_progName.clear();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//End CmdLine.cpp
+///////////////////////////////////////////////////////////////////////////////
+
+
+
+} //namespace TCLAP
+#endif
diff --git a/tclap/CmdLineInterface.h b/tclap/CmdLineInterface.h
new file mode 100644
index 0000000..1b25e9b
--- /dev/null
+++ b/tclap/CmdLineInterface.h
@@ -0,0 +1,150 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  CmdLineInterface.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ *
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_COMMANDLINE_INTERFACE_H
+#define TCLAP_COMMANDLINE_INTERFACE_H
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <algorithm>
+
+
+namespace TCLAP {
+     
+class Arg;
+class CmdLineOutput;
+class XorHandler;
+
+/**
+ * The base class that manages the command line definition and passes
+ * along the parsing to the appropriate Arg classes.
+ */
+class CmdLineInterface
+{
+	public:
+
+		/**
+		 * Destructor
+		 */
+		virtual ~CmdLineInterface() {}
+
+		/**
+		 * Adds an argument to the list of arguments to be parsed.
+		 * \param a - Argument to be added. 
+		 */
+		virtual void add( Arg& a )=0;
+
+		/**
+		 * An alternative add.  Functionally identical.
+		 * \param a - Argument to be added. 
+		 */
+		virtual void add( Arg* a )=0;
+
+		/**
+		 * Add two Args that will be xor'd.  
+		 * If this method is used, add does
+		 * not need to be called.
+		 * \param a - Argument to be added and xor'd. 
+		 * \param b - Argument to be added and xor'd. 
+		 */
+		virtual void xorAdd( Arg& a, Arg& b )=0;
+
+		/**
+		 * Add a list of Args that will be xor'd.  If this method is used, 
+		 * add does not need to be called.
+		 * \param xors - List of Args to be added and xor'd. 
+		 */
+		virtual void xorAdd( std::vector<Arg*>& xors )=0;
+
+		/**
+		 * Parses the command line.
+		 * \param argc - Number of arguments.
+		 * \param argv - Array of arguments.
+		 */
+		virtual void parse(int argc, const char * const * argv)=0;
+
+        /**
+         * Parses the command line.
+         * \param args - A vector of strings representing the args. 
+         * args[0] is still the program name.
+         */
+        void parse(std::vector<std::string>& args);
+
+		/**
+		 * Returns the CmdLineOutput object.
+		 */
+		virtual CmdLineOutput* getOutput()=0;
+
+		/**
+		 * \param co - CmdLineOutput object that we want to use instead. 
+		 */
+		virtual void setOutput(CmdLineOutput* co)=0;
+
+		/**
+		 * Returns the version string.
+		 */
+		virtual std::string& getVersion()=0;
+
+		/**
+		 * Returns the program name string.
+		 */
+		virtual std::string& getProgramName()=0;
+
+		/**
+		 * Returns the argList. 
+		 */
+		virtual std::list<Arg*>& getArgList()=0;
+
+		/**
+		 * Returns the XorHandler. 
+		 */
+		virtual XorHandler& getXorHandler()=0;
+
+		/**
+		 * Returns the delimiter string.
+		 */
+		virtual char getDelimiter()=0;
+
+		/**
+		 * Returns the message string.
+		 */
+		virtual std::string& getMessage()=0;
+
+		/**
+		 * Indicates whether or not the help and version switches were created
+		 * automatically.
+		 */
+		virtual bool hasHelpAndVersion()=0;
+
+		/** 
+		 * Resets the instance as if it had just been constructed so that the
+		 * instance can be reused. 
+		 */
+		virtual void reset()=0;
+};
+
+} //namespace
+
+
+#endif 
diff --git a/tclap/CmdLineOutput.h b/tclap/CmdLineOutput.h
new file mode 100644
index 0000000..71ee5a3
--- /dev/null
+++ b/tclap/CmdLineOutput.h
@@ -0,0 +1,74 @@
+
+
+/****************************************************************************** 
+ * 
+ *  file:  CmdLineOutput.h
+ * 
+ *  Copyright (c) 2004, Michael E. Smoot
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_CMDLINEOUTPUT_H
+#define TCLAP_CMDLINEOUTPUT_H
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <iomanip>
+#include <algorithm>
+
+namespace TCLAP {
+
+class CmdLineInterface;
+class ArgException;
+
+/**
+ * The interface that any output object must implement.
+ */
+class CmdLineOutput 
+{
+
+	public:
+
+		/**
+		 * Virtual destructor.
+		 */
+		virtual ~CmdLineOutput() {}
+
+		/**
+		 * Generates some sort of output for the USAGE. 
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void usage(CmdLineInterface& c)=0;
+
+		/**
+		 * Generates some sort of output for the version. 
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void version(CmdLineInterface& c)=0;
+
+		/**
+		 * Generates some sort of output for a failure. 
+		 * \param c - The CmdLine object the output is generated for. 
+		 * \param e - The ArgException that caused the failure. 
+		 */
+		virtual void failure( CmdLineInterface& c, 
+						      ArgException& e )=0;
+
+};
+
+} //namespace TCLAP
+#endif 
diff --git a/tclap/Constraint.h b/tclap/Constraint.h
new file mode 100644
index 0000000..a92acf9
--- /dev/null
+++ b/tclap/Constraint.h
@@ -0,0 +1,68 @@
+
+/******************************************************************************
+ *
+ *  file:  Constraint.h
+ *
+ *  Copyright (c) 2005, Michael E. Smoot
+ *  All rights reverved.
+ *
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+#ifndef TCLAP_CONSTRAINT_H
+#define TCLAP_CONSTRAINT_H
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <iomanip>
+#include <algorithm>
+
+namespace TCLAP {
+
+/**
+ * The interface that defines the interaction between the Arg and Constraint.
+ */
+template<class T>
+class Constraint
+{
+
+	public:
+		/**
+		 * Returns a description of the Constraint.
+		 */
+		virtual std::string description() const =0;
+
+		/**
+		 * Returns the short ID for the Constraint.
+		 */
+		virtual std::string shortID() const =0;
+
+		/**
+		 * The method used to verify that the value parsed from the command
+		 * line meets the constraint.
+		 * \param value - The value that will be checked.
+		 */
+		virtual bool check(const T& value) const =0;
+
+		/**
+		 * Destructor.
+		 * Silences warnings about Constraint being a base class with virtual
+		 * functions but without a virtual destructor.
+		 */
+		virtual ~Constraint() { ; }
+};
+
+} //namespace TCLAP
+#endif
diff --git a/tclap/DocBookOutput.h b/tclap/DocBookOutput.h
new file mode 100644
index 0000000..a42ca27
--- /dev/null
+++ b/tclap/DocBookOutput.h
@@ -0,0 +1,299 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/****************************************************************************** 
+ * 
+ *  file:  DocBookOutput.h
+ * 
+ *  Copyright (c) 2004, Michael E. Smoot
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_DOCBOOKOUTPUT_H
+#define TCLAP_DOCBOOKOUTPUT_H
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <algorithm>
+
+#include <tclap/CmdLineInterface.h>
+#include <tclap/CmdLineOutput.h>
+#include <tclap/XorHandler.h>
+#include <tclap/Arg.h>
+
+namespace TCLAP {
+
+/**
+ * A class that generates DocBook output for usage() method for the 
+ * given CmdLine and its Args.
+ */
+class DocBookOutput : public CmdLineOutput
+{
+
+	public:
+
+		/**
+		 * Prints the usage to stdout.  Can be overridden to 
+		 * produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void usage(CmdLineInterface& c);
+
+		/**
+		 * Prints the version to stdout. Can be overridden 
+		 * to produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void version(CmdLineInterface& c);
+
+		/**
+		 * Prints (to stderr) an error message, short usage 
+		 * Can be overridden to produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 * \param e - The ArgException that caused the failure. 
+		 */
+		virtual void failure(CmdLineInterface& c, 
+						     ArgException& e );
+
+	protected:
+
+		/**
+		 * Substitutes the char r for string x in string s.
+		 * \param s - The string to operate on. 
+		 * \param r - The char to replace. 
+		 * \param x - What to replace r with. 
+		 */
+		void substituteSpecialChars( std::string& s, char r, std::string& x );
+		void removeChar( std::string& s, char r);
+		void basename( std::string& s );
+
+		void printShortArg(Arg* it);
+		void printLongArg(Arg* it);
+
+		char theDelimiter;
+};
+
+
+inline void DocBookOutput::version(CmdLineInterface& _cmd) 
+{ 
+	std::cout << _cmd.getVersion() << std::endl;
+}
+
+inline void DocBookOutput::usage(CmdLineInterface& _cmd ) 
+{
+	std::list<Arg*> argList = _cmd.getArgList();
+	std::string progName = _cmd.getProgramName();
+	std::string xversion = _cmd.getVersion();
+	theDelimiter = _cmd.getDelimiter();
+	XorHandler xorHandler = _cmd.getXorHandler();
+	std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
+	basename(progName);
+
+	std::cout << "<?xml version='1.0'?>" << std::endl;
+	std::cout << "<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\"" << std::endl;
+	std::cout << "\t\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\">" << std::endl << std::endl;
+
+	std::cout << "<refentry>" << std::endl;
+
+	std::cout << "<refmeta>" << std::endl;
+	std::cout << "<refentrytitle>" << progName << "</refentrytitle>" << std::endl;
+	std::cout << "<manvolnum>1</manvolnum>" << std::endl;
+	std::cout << "</refmeta>" << std::endl;
+
+	std::cout << "<refnamediv>" << std::endl;
+	std::cout << "<refname>" << progName << "</refname>" << std::endl;
+	std::cout << "<refpurpose>" << _cmd.getMessage() << "</refpurpose>" << std::endl;
+	std::cout << "</refnamediv>" << std::endl;
+
+	std::cout << "<refsynopsisdiv>" << std::endl;
+	std::cout << "<cmdsynopsis>" << std::endl;
+
+	std::cout << "<command>" << progName << "</command>" << std::endl;
+
+	// xor
+	for ( int i = 0; (unsigned int)i < xorList.size(); i++ )
+	{
+		std::cout << "<group choice='req'>" << std::endl;
+		for ( ArgVectorIterator it = xorList[i].begin(); 
+						it != xorList[i].end(); it++ )
+			printShortArg((*it));
+
+		std::cout << "</group>" << std::endl;
+	}
+	
+	// rest of args
+	for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
+		if ( !xorHandler.contains( (*it) ) )
+			printShortArg((*it));
+
+ 	std::cout << "</cmdsynopsis>" << std::endl;
+	std::cout << "</refsynopsisdiv>" << std::endl;
+
+	std::cout << "<refsect1>" << std::endl;
+	std::cout << "<title>Description</title>" << std::endl;
+	std::cout << "<para>" << std::endl;
+	std::cout << _cmd.getMessage() << std::endl; 
+	std::cout << "</para>" << std::endl;
+	std::cout << "</refsect1>" << std::endl;
+
+	std::cout << "<refsect1>" << std::endl;
+	std::cout << "<title>Options</title>" << std::endl;
+
+	std::cout << "<variablelist>" << std::endl;
+	
+	for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
+		printLongArg((*it));
+
+	std::cout << "</variablelist>" << std::endl;
+	std::cout << "</refsect1>" << std::endl;
+
+	std::cout << "<refsect1>" << std::endl;
+	std::cout << "<title>Version</title>" << std::endl;
+	std::cout << "<para>" << std::endl;
+	std::cout << xversion << std::endl; 
+	std::cout << "</para>" << std::endl;
+	std::cout << "</refsect1>" << std::endl;
+	
+	std::cout << "</refentry>" << std::endl;
+
+}
+
+inline void DocBookOutput::failure( CmdLineInterface& _cmd,
+				    ArgException& e ) 
+{ 
+	static_cast<void>(_cmd); // unused
+	std::cout << e.what() << std::endl;
+	throw ExitException(1);
+}
+
+inline void DocBookOutput::substituteSpecialChars( std::string& s,
+				                                   char r,
+												   std::string& x )
+{
+	size_t p;
+	while ( (p = s.find_first_of(r)) != std::string::npos )
+	{
+		s.erase(p,1);
+		s.insert(p,x);
+	}
+}
+
+inline void DocBookOutput::removeChar( std::string& s, char r)
+{
+	size_t p;
+	while ( (p = s.find_first_of(r)) != std::string::npos )
+	{
+		s.erase(p,1);
+	}
+}
+
+inline void DocBookOutput::basename( std::string& s )
+{
+	size_t p = s.find_last_of('/');
+	if ( p != std::string::npos )
+	{
+		s.erase(0, p + 1);
+	}
+}
+
+inline void DocBookOutput::printShortArg(Arg* a)
+{
+	std::string lt = "<"; 
+	std::string gt = ">"; 
+
+	std::string id = a->shortID();
+	substituteSpecialChars(id,'<',lt);
+	substituteSpecialChars(id,'>',gt);
+	removeChar(id,'[');
+	removeChar(id,']');
+	
+	std::string choice = "opt";
+	if ( a->isRequired() )
+		choice = "plain";
+
+	std::cout << "<arg choice='" << choice << '\'';
+	if ( a->acceptsMultipleValues() )
+		std::cout << " rep='repeat'";
+
+
+	std::cout << '>';
+	if ( !a->getFlag().empty() )
+		std::cout << a->flagStartChar() << a->getFlag();
+	else
+		std::cout << a->nameStartString() << a->getName();
+	if ( a->isValueRequired() )
+	{
+		std::string arg = a->shortID();
+		removeChar(arg,'[');
+		removeChar(arg,']');
+		removeChar(arg,'<');
+		removeChar(arg,'>');
+		arg.erase(0, arg.find_last_of(theDelimiter) + 1);
+		std::cout << theDelimiter;
+		std::cout << "<replaceable>" << arg << "</replaceable>";
+	}
+	std::cout << "</arg>" << std::endl;
+
+}
+
+inline void DocBookOutput::printLongArg(Arg* a)
+{
+	std::string lt = "<"; 
+	std::string gt = ">"; 
+
+	std::string desc = a->getDescription();
+	substituteSpecialChars(desc,'<',lt);
+	substituteSpecialChars(desc,'>',gt);
+
+	std::cout << "<varlistentry>" << std::endl;
+
+	if ( !a->getFlag().empty() )
+	{
+		std::cout << "<term>" << std::endl;
+		std::cout << "<option>";
+		std::cout << a->flagStartChar() << a->getFlag();
+		std::cout << "</option>" << std::endl;
+		std::cout << "</term>" << std::endl;
+	}
+
+	std::cout << "<term>" << std::endl;
+	std::cout << "<option>";
+	std::cout << a->nameStartString() << a->getName();
+	if ( a->isValueRequired() )
+	{
+		std::string arg = a->shortID();
+		removeChar(arg,'[');
+		removeChar(arg,']');
+		removeChar(arg,'<');
+		removeChar(arg,'>');
+		arg.erase(0, arg.find_last_of(theDelimiter) + 1);
+		std::cout << theDelimiter;
+		std::cout << "<replaceable>" << arg << "</replaceable>";
+	}
+	std::cout << "</option>" << std::endl;
+	std::cout << "</term>" << std::endl;
+
+	std::cout << "<listitem>" << std::endl;
+	std::cout << "<para>" << std::endl;
+	std::cout << desc << std::endl;
+	std::cout << "</para>" << std::endl;
+	std::cout << "</listitem>" << std::endl;
+
+	std::cout << "</varlistentry>" << std::endl;
+}
+
+} //namespace TCLAP
+#endif 
diff --git a/tclap/HelpVisitor.h b/tclap/HelpVisitor.h
new file mode 100644
index 0000000..cc3bd07
--- /dev/null
+++ b/tclap/HelpVisitor.h
@@ -0,0 +1,76 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  HelpVisitor.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_HELP_VISITOR_H
+#define TCLAP_HELP_VISITOR_H
+
+#include <tclap/CmdLineInterface.h>
+#include <tclap/CmdLineOutput.h>
+#include <tclap/Visitor.h>
+
+namespace TCLAP {
+
+/**
+ * A Visitor object that calls the usage method of the given CmdLineOutput
+ * object for the specified CmdLine object.
+ */
+class HelpVisitor: public Visitor
+{
+	private:
+		/**
+		 * Prevent accidental copying.
+		 */
+		HelpVisitor(const HelpVisitor& rhs);
+		HelpVisitor& operator=(const HelpVisitor& rhs);
+
+	protected:
+
+		/**
+		 * The CmdLine the output will be generated for. 
+		 */
+		CmdLineInterface* _cmd;
+
+		/**
+		 * The output object. 
+		 */
+		CmdLineOutput** _out;
+
+	public:
+
+		/**
+		 * Constructor.
+		 * \param cmd - The CmdLine the output will be generated for.
+		 * \param out - The type of output. 
+		 */
+		HelpVisitor(CmdLineInterface* cmd, CmdLineOutput** out) 
+				: Visitor(), _cmd( cmd ), _out( out ) { }
+
+		/**
+		 * Calls the usage method of the CmdLineOutput for the 
+		 * specified CmdLine.
+		 */
+		void visit() { (*_out)->usage(*_cmd); throw ExitException(0); }
+		
+};
+
+}
+
+#endif
diff --git a/tclap/IgnoreRestVisitor.h b/tclap/IgnoreRestVisitor.h
new file mode 100644
index 0000000..e328649
--- /dev/null
+++ b/tclap/IgnoreRestVisitor.h
@@ -0,0 +1,52 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  IgnoreRestVisitor.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_IGNORE_REST_VISITOR_H
+#define TCLAP_IGNORE_REST_VISITOR_H
+
+#include <tclap/Visitor.h>
+#include <tclap/Arg.h>
+
+namespace TCLAP {
+
+/**
+ * A Vistor that tells the CmdLine to begin ignoring arguments after
+ * this one is parsed.
+ */
+class IgnoreRestVisitor: public Visitor
+{
+	public:
+
+		/**
+		 * Constructor.
+		 */
+		IgnoreRestVisitor() : Visitor() {}
+
+		/**
+		 * Sets Arg::_ignoreRest.
+		 */
+		void visit() { Arg::beginIgnoring();  }
+};
+
+}
+
+#endif
diff --git a/tclap/Makefile.am b/tclap/Makefile.am
new file mode 100644
index 0000000..0e247bf
--- /dev/null
+++ b/tclap/Makefile.am
@@ -0,0 +1,28 @@
+
+libtclapincludedir = $(includedir)/tclap
+
+libtclapinclude_HEADERS = \
+			 CmdLineInterface.h \
+			 ArgException.h \
+			 CmdLine.h \
+			 XorHandler.h \
+			 MultiArg.h \
+			 UnlabeledMultiArg.h \
+			 ValueArg.h \
+			 UnlabeledValueArg.h \
+			 Visitor.h Arg.h \
+			 HelpVisitor.h \
+			 SwitchArg.h \
+			 MultiSwitchArg.h \
+			 VersionVisitor.h \
+			 IgnoreRestVisitor.h \
+			 CmdLineOutput.h \
+			 StdOutput.h \
+			 DocBookOutput.h \
+			 ZshCompletionOutput.h \
+			 OptionalUnlabeledTracker.h \
+			 Constraint.h \
+			 ValuesConstraint.h \
+			 ArgTraits.h \
+			 StandardTraits.h
+
diff --git a/tclap/Makefile.in b/tclap/Makefile.in
new file mode 100644
index 0000000..65ef251
--- /dev/null
+++ b/tclap/Makefile.in
@@ -0,0 +1,403 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = include/tclap
+DIST_COMMON = $(libtclapinclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \
+	$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
+	$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
+	$(top_srcdir)/config/ac_cxx_namespaces.m4 \
+	$(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \
+	$(top_srcdir)/config/bb_enable_doxygen.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libtclapincludedir)"
+libtclapincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(libtclapinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOT = @DOT@
+DOXYGEN = @DOXYGEN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@
+WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+libtclapincludedir = $(includedir)/tclap
+libtclapinclude_HEADERS = \
+			 CmdLineInterface.h \
+			 ArgException.h \
+			 CmdLine.h \
+			 XorHandler.h \
+			 MultiArg.h \
+			 UnlabeledMultiArg.h \
+			 ValueArg.h \
+			 UnlabeledValueArg.h \
+			 Visitor.h Arg.h \
+			 HelpVisitor.h \
+			 SwitchArg.h \
+			 MultiSwitchArg.h \
+			 VersionVisitor.h \
+			 IgnoreRestVisitor.h \
+			 CmdLineOutput.h \
+			 StdOutput.h \
+			 DocBookOutput.h \
+			 ZshCompletionOutput.h \
+			 OptionalUnlabeledTracker.h \
+			 Constraint.h \
+			 ValuesConstraint.h \
+			 ArgTraits.h \
+			 StandardTraits.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  include/tclap/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  include/tclap/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libtclapincludeHEADERS: $(libtclapinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(libtclapincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libtclapincludedir)"
+	@list='$(libtclapinclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(libtclapincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libtclapincludedir)/$$f'"; \
+	  $(libtclapincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libtclapincludedir)/$$f"; \
+	done
+
+uninstall-libtclapincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(libtclapinclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(libtclapincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(libtclapincludedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(libtclapincludedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libtclapincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libtclapincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	ctags distclean distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-libtclapincludeHEADERS \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+	uninstall uninstall-am uninstall-libtclapincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tclap/MultiArg.h b/tclap/MultiArg.h
new file mode 100644
index 0000000..34bb2d7
--- /dev/null
+++ b/tclap/MultiArg.h
@@ -0,0 +1,433 @@
+/****************************************************************************** 
+ * 
+ *  file:  MultiArg.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/
+
+
+#ifndef TCLAP_MULTIPLE_ARGUMENT_H
+#define TCLAP_MULTIPLE_ARGUMENT_H
+
+#include <string>
+#include <vector>
+
+#include <tclap/Arg.h>
+#include <tclap/Constraint.h>
+
+namespace TCLAP {
+/**
+ * An argument that allows multiple values of type T to be specified.  Very
+ * similar to a ValueArg, except a vector of values will be returned
+ * instead of just one.
+ */
+template<class T>
+class MultiArg : public Arg
+{
+public:
+	typedef std::vector<T> container_type;	
+	typedef typename container_type::iterator iterator;
+	typedef typename container_type::const_iterator const_iterator;
+
+protected:
+
+	/**
+	 * The list of values parsed from the CmdLine.
+	 */
+	std::vector<T> _values;
+
+	/**
+	 * The description of type T to be used in the usage.
+	 */
+	std::string _typeDesc;
+
+	/**
+	 * A list of constraint on this Arg. 
+	 */
+	Constraint<T>* _constraint;
+
+	/**
+	 * Extracts the value from the string.
+	 * Attempts to parse string as type T, if this fails an exception
+	 * is thrown.
+	 * \param val - The string to be read.
+	 */
+	void _extractValue( const std::string& val );
+
+	/**
+	 * Used by XorHandler to decide whether to keep parsing for this arg.
+	 */
+	bool _allowMore;
+
+public:
+
+	/**
+	 * Constructor.
+	 * \param flag - The one character flag that identifies this
+	 * argument on the command line.
+	 * \param name - A one word name for the argument.  Can be
+	 * used as a long flag on the command line.
+	 * \param desc - A description of what the argument is for or
+	 * does.
+	 * \param req - Whether the argument is required on the command
+	 * line.
+	 * \param typeDesc - A short, human readable description of the
+	 * type that this object expects.  This is used in the generation
+	 * of the USAGE statement.  The goal is to be helpful to the end user
+	 * of the program.
+	 * \param v - An optional visitor.  You probably should not
+	 * use this unless you have a very good reason.
+	 */
+	MultiArg( const std::string& flag,
+                  const std::string& name,
+                  const std::string& desc,
+                  bool req,
+                  const std::string& typeDesc,
+                  Visitor* v = NULL);
+
+	/**
+	 * Constructor.
+	 * \param flag - The one character flag that identifies this
+	 * argument on the command line.
+	 * \param name - A one word name for the argument.  Can be
+	 * used as a long flag on the command line.
+	 * \param desc - A description of what the argument is for or
+	 * does.
+	 * \param req - Whether the argument is required on the command
+	 * line.
+	 * \param typeDesc - A short, human readable description of the
+	 * type that this object expects.  This is used in the generation
+	 * of the USAGE statement.  The goal is to be helpful to the end user
+	 * of the program.
+	 * \param parser - A CmdLine parser object to add this Arg to
+	 * \param v - An optional visitor.  You probably should not
+	 * use this unless you have a very good reason.
+	 */
+	MultiArg( const std::string& flag, 
+                  const std::string& name,
+                  const std::string& desc,
+                  bool req,
+                  const std::string& typeDesc,
+                  CmdLineInterface& parser,
+                  Visitor* v = NULL );
+
+	/**
+	 * Constructor.
+	 * \param flag - The one character flag that identifies this
+	 * argument on the command line.
+	 * \param name - A one word name for the argument.  Can be
+	 * used as a long flag on the command line.
+	 * \param desc - A description of what the argument is for or
+	 * does.
+	 * \param req - Whether the argument is required on the command
+	 * line.
+	 * \param constraint - A pointer to a Constraint object used
+	 * to constrain this Arg.
+	 * \param v - An optional visitor.  You probably should not
+	 * use this unless you have a very good reason.
+	 */
+	MultiArg( const std::string& flag,
+                  const std::string& name,
+                  const std::string& desc,
+                  bool req,
+                  Constraint<T>* constraint,
+                  Visitor* v = NULL );
+		  
+	/**
+	 * Constructor.
+	 * \param flag - The one character flag that identifies this
+	 * argument on the command line.
+	 * \param name - A one word name for the argument.  Can be
+	 * used as a long flag on the command line.
+	 * \param desc - A description of what the argument is for or
+	 * does.
+	 * \param req - Whether the argument is required on the command
+	 * line.
+	 * \param constraint - A pointer to a Constraint object used
+	 * to constrain this Arg.
+	 * \param parser - A CmdLine parser object to add this Arg to
+	 * \param v - An optional visitor.  You probably should not
+	 * use this unless you have a very good reason.
+	 */
+	MultiArg( const std::string& flag, 
+                  const std::string& name,
+                  const std::string& desc,
+                  bool req,
+                  Constraint<T>* constraint,
+                  CmdLineInterface& parser,
+                  Visitor* v = NULL );
+		  
+	/**
+	 * Handles the processing of the argument.
+	 * This re-implements the Arg version of this method to set the
+	 * _value of the argument appropriately.  It knows the difference
+	 * between labeled and unlabeled.
+	 * \param i - Pointer the the current argument in the list.
+	 * \param args - Mutable list of strings. Passed from main().
+	 */
+	virtual bool processArg(int* i, std::vector<std::string>& args); 
+
+	/**
+	 * Returns a vector of type T containing the values parsed from
+	 * the command line.
+	 */
+	const std::vector<T>& getValue();
+
+	/**
+	 * Returns an iterator over the values parsed from the command
+	 * line.
+	 */
+	const_iterator begin() const { return _values.begin(); }
+
+	/**
+	 * Returns the end of the values parsed from the command
+	 * line.
+	 */
+	const_iterator end() const { return _values.end(); }
+
+	/**
+	 * Returns the a short id string.  Used in the usage. 
+	 * \param val - value to be used.
+	 */
+	virtual std::string shortID(const std::string& val="val") const;
+
+	/**
+	 * Returns the a long id string.  Used in the usage. 
+	 * \param val - value to be used.
+	 */
+	virtual std::string longID(const std::string& val="val") const;
+
+	/**
+	 * Once we've matched the first value, then the arg is no longer
+	 * required.
+	 */
+	virtual bool isRequired() const;
+
+	virtual bool allowMore();
+	
+	virtual void reset();
+
+private:
+	/**
+	 * Prevent accidental copying
+	 */
+	MultiArg<T>(const MultiArg<T>& rhs);
+	MultiArg<T>& operator=(const MultiArg<T>& rhs);
+
+};
+
+template<class T>
+MultiArg<T>::MultiArg(const std::string& flag, 
+                      const std::string& name,
+                      const std::string& desc,
+                      bool req,
+                      const std::string& typeDesc,
+                      Visitor* v) :
+   Arg( flag, name, desc, req, true, v ),
+  _values(std::vector<T>()),
+  _typeDesc( typeDesc ),
+  _constraint( NULL ),
+  _allowMore(false)
+{ 
+	_acceptsMultipleValues = true;
+}
+
+template<class T>
+MultiArg<T>::MultiArg(const std::string& flag, 
+                      const std::string& name,
+                      const std::string& desc,
+                      bool req,
+                      const std::string& typeDesc,
+                      CmdLineInterface& parser,
+                      Visitor* v)
+: Arg( flag, name, desc, req, true, v ),
+  _values(std::vector<T>()),
+  _typeDesc( typeDesc ),
+  _constraint( NULL ),
+  _allowMore(false)
+{ 
+	parser.add( this );
+	_acceptsMultipleValues = true;
+}
+
+/**
+ *
+ */
+template<class T>
+MultiArg<T>::MultiArg(const std::string& flag, 
+                      const std::string& name,
+                      const std::string& desc,
+                      bool req,
+                      Constraint<T>* constraint,
+                      Visitor* v)
+: Arg( flag, name, desc, req, true, v ),
+  _values(std::vector<T>()),
+  _typeDesc( constraint->shortID() ),
+  _constraint( constraint ),
+  _allowMore(false)
+{ 
+	_acceptsMultipleValues = true;
+}
+
+template<class T>
+MultiArg<T>::MultiArg(const std::string& flag, 
+                      const std::string& name,
+                      const std::string& desc,
+                      bool req,
+                      Constraint<T>* constraint,
+                      CmdLineInterface& parser,
+                      Visitor* v)
+: Arg( flag, name, desc, req, true, v ),
+  _values(std::vector<T>()),
+  _typeDesc( constraint->shortID() ),
+  _constraint( constraint ),
+  _allowMore(false)
+{ 
+	parser.add( this );
+	_acceptsMultipleValues = true;
+}
+
+template<class T>
+const std::vector<T>& MultiArg<T>::getValue() { return _values; }
+
+template<class T>
+bool MultiArg<T>::processArg(int *i, std::vector<std::string>& args) 
+{
+ 	if ( _ignoreable && Arg::ignoreRest() )
+		return false;
+
+	if ( _hasBlanks( args[*i] ) )
+		return false;
+
+	std::string flag = args[*i];
+	std::string value = "";
+
+   	trimFlag( flag, value );
+
+   	if ( argMatches( flag ) )
+   	{
+   		if ( Arg::delimiter() != ' ' && value == "" )
+			throw( ArgParseException( 
+			           "Couldn't find delimiter for this argument!",
+					   toString() ) );
+
+		// always take the first one, regardless of start string
+		if ( value == "" )
+		{
+			(*i)++;
+			if ( static_cast<unsigned int>(*i) < args.size() )
+				_extractValue( args[*i] );
+			else
+				throw( ArgParseException("Missing a value for this argument!",
+                                         toString() ) );
+		} 
+		else
+			_extractValue( value );
+
+		/*
+		// continuing taking the args until we hit one with a start string 
+		while ( (unsigned int)(*i)+1 < args.size() &&
+				args[(*i)+1].find_first_of( Arg::flagStartString() ) != 0 &&
+		        args[(*i)+1].find_first_of( Arg::nameStartString() ) != 0 ) 
+				_extractValue( args[++(*i)] );
+		*/
+
+		_alreadySet = true;
+		_checkWithVisitor();
+
+		return true;
+	}
+	else
+		return false;
+}
+
+/**
+ *
+ */
+template<class T>
+std::string MultiArg<T>::shortID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return Arg::shortID(_typeDesc) + " ... ";
+}
+
+/**
+ *
+ */
+template<class T>
+std::string MultiArg<T>::longID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return Arg::longID(_typeDesc) + "  (accepted multiple times)";
+}
+
+/**
+ * Once we've matched the first value, then the arg is no longer
+ * required.
+ */
+template<class T>
+bool MultiArg<T>::isRequired() const
+{
+	if ( _required )
+	{
+		if ( _values.size() > 1 )
+			return false;
+		else
+			return true;
+   	}
+   	else
+		return false;
+
+}
+
+template<class T>
+void MultiArg<T>::_extractValue( const std::string& val ) 
+{
+    try {
+	T tmp;
+	ExtractValue(tmp, val, typename ArgTraits<T>::ValueCategory());
+	_values.push_back(tmp);
+    } catch( ArgParseException &e) {
+	throw ArgParseException(e.error(), toString());
+    }
+
+    if ( _constraint != NULL )
+	if ( ! _constraint->check( _values.back() ) )
+	    throw( CmdLineParseException( "Value '" + val +
+					  "' does not meet constraint: " +
+					  _constraint->description(), 
+					  toString() ) );
+}
+		
+template<class T>
+bool MultiArg<T>::allowMore()
+{
+	bool am = _allowMore;
+	_allowMore = true;
+	return am;
+}
+
+template<class T>
+void MultiArg<T>::reset()
+{
+	Arg::reset();
+	_values.clear();
+}
+
+} // namespace TCLAP
+
+#endif
diff --git a/tclap/MultiSwitchArg.h b/tclap/MultiSwitchArg.h
new file mode 100644
index 0000000..8820b64
--- /dev/null
+++ b/tclap/MultiSwitchArg.h
@@ -0,0 +1,216 @@
+
+/****************************************************************************** 
+*
+*  file:  MultiSwitchArg.h
+*
+*  Copyright (c) 2003, Michael E. Smoot .
+*  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+*  Copyright (c) 2005, Michael E. Smoot, Daniel Aarno, Erik Zeek.
+*  All rights reverved.
+*
+*  See the file COPYING in the top directory of this distribution for
+*  more information.
+*
+*  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+*  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+*  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+*  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+*  DEALINGS IN THE SOFTWARE.
+*
+*****************************************************************************/
+
+
+#ifndef TCLAP_MULTI_SWITCH_ARG_H
+#define TCLAP_MULTI_SWITCH_ARG_H
+
+#include <string>
+#include <vector>
+
+#include <tclap/SwitchArg.h>
+
+namespace TCLAP {
+
+/**
+* A multiple switch argument.  If the switch is set on the command line, then
+* the getValue method will return the number of times the switch appears.
+*/
+class MultiSwitchArg : public SwitchArg
+{
+	protected:
+
+		/**
+		 * The value of the switch.
+		 */
+		int _value;
+
+		/**
+		 * Used to support the reset() method so that ValueArg can be
+		 * reset to their constructed value.
+		 */
+		int _default;
+
+	public:
+
+		/**
+		 * MultiSwitchArg constructor.
+		 * \param flag - The one character flag that identifies this
+		 * argument on the command line.
+		 * \param name - A one word name for the argument.  Can be
+		 * used as a long flag on the command line.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param init - Optional. The initial/default value of this Arg. 
+		 * Defaults to 0.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		MultiSwitchArg(const std::string& flag, 
+				const std::string& name,
+				const std::string& desc,
+				int init = 0,
+				Visitor* v = NULL);
+
+
+		/**
+		 * MultiSwitchArg constructor.
+		 * \param flag - The one character flag that identifies this
+		 * argument on the command line.
+		 * \param name - A one word name for the argument.  Can be
+		 * used as a long flag on the command line.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param parser - A CmdLine parser object to add this Arg to
+		 * \param init - Optional. The initial/default value of this Arg. 
+		 * Defaults to 0.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		MultiSwitchArg(const std::string& flag, 
+				const std::string& name,
+				const std::string& desc,
+				CmdLineInterface& parser,
+				int init = 0,
+				Visitor* v = NULL);
+
+
+		/**
+		 * Handles the processing of the argument.
+		 * This re-implements the SwitchArg version of this method to set the
+		 * _value of the argument appropriately.
+		 * \param i - Pointer the the current argument in the list.
+		 * \param args - Mutable list of strings. Passed
+		 * in from main().
+		 */
+		virtual bool processArg(int* i, std::vector<std::string>& args); 
+
+		/**
+		 * Returns int, the number of times the switch has been set.
+		 */
+		int getValue();
+
+		/**
+		 * Returns the shortID for this Arg.
+		 */
+		std::string shortID(const std::string& val) const;
+
+		/**
+		 * Returns the longID for this Arg.
+		 */
+		std::string longID(const std::string& val) const;
+		
+		void reset();
+
+};
+
+//////////////////////////////////////////////////////////////////////
+//BEGIN MultiSwitchArg.cpp
+//////////////////////////////////////////////////////////////////////
+inline MultiSwitchArg::MultiSwitchArg(const std::string& flag,
+					const std::string& name,
+					const std::string& desc,
+					int init,
+					Visitor* v )
+: SwitchArg(flag, name, desc, false, v),
+_value( init ),
+_default( init )
+{ }
+
+inline MultiSwitchArg::MultiSwitchArg(const std::string& flag,
+					const std::string& name, 
+					const std::string& desc, 
+					CmdLineInterface& parser,
+					int init,
+					Visitor* v )
+: SwitchArg(flag, name, desc, false, v),
+_value( init ),
+_default( init )
+{ 
+	parser.add( this );
+}
+
+inline int MultiSwitchArg::getValue() { return _value; }
+
+inline bool MultiSwitchArg::processArg(int *i, std::vector<std::string>& args)
+{
+	if ( _ignoreable && Arg::ignoreRest() )
+		return false;
+
+	if ( argMatches( args[*i] ))
+	{
+		// so the isSet() method will work
+		_alreadySet = true;
+
+		// Matched argument: increment value.
+		++_value;
+
+		_checkWithVisitor();
+
+		return true;
+	}
+	else if ( combinedSwitchesMatch( args[*i] ) )
+	{
+		// so the isSet() method will work
+		_alreadySet = true;
+
+		// Matched argument: increment value.
+		++_value;
+
+		// Check for more in argument and increment value.
+		while ( combinedSwitchesMatch( args[*i] ) ) 
+			++_value;
+
+		_checkWithVisitor();
+
+		return false;
+	}
+	else
+		return false;
+}
+
+inline std::string 
+MultiSwitchArg::shortID(const std::string& val) const
+{
+	return Arg::shortID(val) + " ... ";
+}
+
+inline std::string 
+MultiSwitchArg::longID(const std::string& val) const
+{
+	return Arg::longID(val) + "  (accepted multiple times)";
+}
+
+inline void
+MultiSwitchArg::reset()
+{
+	MultiSwitchArg::_value = MultiSwitchArg::_default;
+}
+
+//////////////////////////////////////////////////////////////////////
+//END MultiSwitchArg.cpp
+//////////////////////////////////////////////////////////////////////
+
+} //namespace TCLAP
+
+#endif
diff --git a/tclap/OptionalUnlabeledTracker.h b/tclap/OptionalUnlabeledTracker.h
new file mode 100644
index 0000000..8174c5f
--- /dev/null
+++ b/tclap/OptionalUnlabeledTracker.h
@@ -0,0 +1,62 @@
+
+
+/****************************************************************************** 
+ * 
+ *  file:  OptionalUnlabeledTracker.h
+ * 
+ *  Copyright (c) 2005, Michael E. Smoot .
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_OPTIONAL_UNLABELED_TRACKER_H
+#define TCLAP_OPTIONAL_UNLABELED_TRACKER_H
+
+#include <string>
+
+namespace TCLAP {
+
+class OptionalUnlabeledTracker
+{
+
+	public:
+
+		static void check( bool req, const std::string& argName );
+
+		static void gotOptional() { alreadyOptionalRef() = true; }
+
+		static bool& alreadyOptional() { return alreadyOptionalRef(); } 
+
+	private:
+
+		static bool& alreadyOptionalRef() { static bool ct = false; return ct; }
+};
+
+
+inline void OptionalUnlabeledTracker::check( bool req, const std::string& argName )
+{
+    if ( OptionalUnlabeledTracker::alreadyOptional() )
+        throw( SpecificationException(
+	"You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg",
+	                argName ) );
+
+    if ( !req )
+        OptionalUnlabeledTracker::gotOptional();
+}
+
+
+} // namespace TCLAP
+
+#endif
diff --git a/tclap/StandardTraits.h b/tclap/StandardTraits.h
new file mode 100644
index 0000000..46d7f6f
--- /dev/null
+++ b/tclap/StandardTraits.h
@@ -0,0 +1,208 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/******************************************************************************
+ *
+ *  file:  StandardTraits.h
+ *
+ *  Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
+ *  All rights reverved.
+ *
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ *
+ *****************************************************************************/
+
+// This is an internal tclap file, you should probably not have to
+// include this directly
+
+#ifndef TCLAP_STANDARD_TRAITS_H
+#define TCLAP_STANDARD_TRAITS_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h> // To check for long long
+#endif
+
+// If Microsoft has already typedef'd wchar_t as an unsigned 
+// short, then compiles will break because it's as if we're
+// creating ArgTraits twice for unsigned short. Thus...
+#ifdef _MSC_VER
+#ifndef _NATIVE_WCHAR_T_DEFINED
+#define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
+#endif
+#endif
+
+namespace TCLAP {
+
+// ======================================================================
+// Integer types
+// ======================================================================
+
+/**
+ * longs have value-like semantics.
+ */
+template<>
+struct ArgTraits<long> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * ints have value-like semantics.
+ */
+template<>
+struct ArgTraits<int> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * shorts have value-like semantics.
+ */
+template<>
+struct ArgTraits<short> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * chars have value-like semantics.
+ */
+template<>
+struct ArgTraits<char> {
+    typedef ValueLike ValueCategory;
+};
+
+#ifdef HAVE_LONG_LONG
+/**
+ * long longs have value-like semantics.
+ */
+template<>
+struct ArgTraits<long long> {
+    typedef ValueLike ValueCategory;
+};
+#endif
+
+// ======================================================================
+// Unsigned integer types
+// ======================================================================
+
+/**
+ * unsigned longs have value-like semantics.
+ */
+template<>
+struct ArgTraits<unsigned long> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * unsigned ints have value-like semantics.
+ */
+template<>
+struct ArgTraits<unsigned int> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * unsigned shorts have value-like semantics.
+ */
+template<>
+struct ArgTraits<unsigned short> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * unsigned chars have value-like semantics.
+ */
+template<>
+struct ArgTraits<unsigned char> {
+    typedef ValueLike ValueCategory;
+};
+
+// Microsoft implements size_t awkwardly. 
+#if defined(_MSC_VER) && defined(_M_X64)
+/**
+ * size_ts have value-like semantics.
+ */
+template<>
+struct ArgTraits<size_t> {
+    typedef ValueLike ValueCategory;
+};
+#endif
+
+
+#ifdef HAVE_LONG_LONG
+/**
+ * unsigned long longs have value-like semantics.
+ */
+template<>
+struct ArgTraits<unsigned long long> {
+    typedef ValueLike ValueCategory;
+};
+#endif
+
+// ======================================================================
+// Float types
+// ======================================================================
+
+/**
+ * floats have value-like semantics.
+ */
+template<>
+struct ArgTraits<float> {
+    typedef ValueLike ValueCategory;
+};
+
+/**
+ * doubles have value-like semantics.
+ */
+template<>
+struct ArgTraits<double> {
+    typedef ValueLike ValueCategory;
+};
+
+// ======================================================================
+// Other types
+// ======================================================================
+
+/**
+ * bools have value-like semantics.
+ */
+template<>
+struct ArgTraits<bool> {
+    typedef ValueLike ValueCategory;
+};
+
+
+/**
+ * wchar_ts have value-like semantics.
+ */
+#ifndef TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
+template<>
+struct ArgTraits<wchar_t> {
+    typedef ValueLike ValueCategory;
+};
+#endif
+
+/**
+ * Strings have string like argument traits.
+ */
+template<>
+struct ArgTraits<std::string> {
+    typedef StringLike ValueCategory;
+};
+
+template<typename T>
+void SetString(T &dst, const std::string &src)
+{
+    dst = src;
+}
+
+} // namespace
+
+#endif
+
diff --git a/tclap/StdOutput.h b/tclap/StdOutput.h
new file mode 100644
index 0000000..35f7b99
--- /dev/null
+++ b/tclap/StdOutput.h
@@ -0,0 +1,298 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/****************************************************************************** 
+ * 
+ *  file:  StdOutput.h
+ * 
+ *  Copyright (c) 2004, Michael E. Smoot
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_STDCMDLINEOUTPUT_H
+#define TCLAP_STDCMDLINEOUTPUT_H
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <algorithm>
+
+#include <tclap/CmdLineInterface.h>
+#include <tclap/CmdLineOutput.h>
+#include <tclap/XorHandler.h>
+#include <tclap/Arg.h>
+
+namespace TCLAP {
+
+/**
+ * A class that isolates any output from the CmdLine object so that it
+ * may be easily modified.
+ */
+class StdOutput : public CmdLineOutput
+{
+
+	public:
+
+		/**
+		 * Prints the usage to stdout.  Can be overridden to 
+		 * produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void usage(CmdLineInterface& c);
+
+		/**
+		 * Prints the version to stdout. Can be overridden 
+		 * to produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void version(CmdLineInterface& c);
+
+		/**
+		 * Prints (to stderr) an error message, short usage 
+		 * Can be overridden to produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 * \param e - The ArgException that caused the failure. 
+		 */
+		virtual void failure(CmdLineInterface& c, 
+				     ArgException& e );
+
+	protected:
+
+        /**
+         * Writes a brief usage message with short args.
+		 * \param c - The CmdLine object the output is generated for. 
+         * \param os - The stream to write the message to.
+         */
+        void _shortUsage( CmdLineInterface& c, std::ostream& os ) const;
+
+        /**
+		 * Writes a longer usage message with long and short args, 
+		 * provides descriptions and prints message.
+		 * \param c - The CmdLine object the output is generated for. 
+		 * \param os - The stream to write the message to.
+		 */
+		void _longUsage( CmdLineInterface& c, std::ostream& os ) const;
+
+		/**
+		 * This function inserts line breaks and indents long strings 
+		 * according the  params input. It will only break lines at spaces, 
+		 * commas and pipes.
+		 * \param os - The stream to be printed to.
+		 * \param s - The string to be printed.
+		 * \param maxWidth - The maxWidth allowed for the output line. 
+		 * \param indentSpaces - The number of spaces to indent the first line. 
+		 * \param secondLineOffset - The number of spaces to indent the second
+		 * and all subsequent lines in addition to indentSpaces.
+		 */
+		void spacePrint( std::ostream& os, 
+						 const std::string& s, 
+						 int maxWidth, 
+						 int indentSpaces, 
+						 int secondLineOffset ) const;
+
+};
+
+
+inline void StdOutput::version(CmdLineInterface& _cmd) 
+{
+	std::string progName = _cmd.getProgramName();
+	std::string xversion = _cmd.getVersion();
+
+	std::cout << std::endl << progName << "  version: " 
+			  << xversion << std::endl << std::endl;
+}
+
+inline void StdOutput::usage(CmdLineInterface& _cmd ) 
+{
+	std::cout << std::endl << "USAGE: " << std::endl << std::endl; 
+
+	_shortUsage( _cmd, std::cout );
+
+	std::cout << std::endl << std::endl << "Where: " << std::endl << std::endl;
+
+	_longUsage( _cmd, std::cout );
+
+	std::cout << std::endl; 
+
+}
+
+inline void StdOutput::failure( CmdLineInterface& _cmd,
+								ArgException& e ) 
+{
+	std::string progName = _cmd.getProgramName();
+
+	std::cerr << "PARSE ERROR: " << e.argId() << std::endl
+		      << "             " << e.error() << std::endl << std::endl;
+
+	if ( _cmd.hasHelpAndVersion() )
+		{
+			std::cerr << "Brief USAGE: " << std::endl;
+
+			_shortUsage( _cmd, std::cerr );	
+
+			std::cerr << std::endl << "For complete USAGE and HELP type: " 
+					  << std::endl << "   " << progName << " --help" 
+					  << std::endl << std::endl;
+		}
+	else
+		usage(_cmd);
+
+	throw ExitException(1);
+}
+
+inline void 
+StdOutput::_shortUsage( CmdLineInterface& _cmd, 
+						std::ostream& os ) const
+{
+	std::list<Arg*> argList = _cmd.getArgList();
+	std::string progName = _cmd.getProgramName();
+	XorHandler xorHandler = _cmd.getXorHandler();
+	std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
+
+	std::string s = progName + " ";
+
+	// first the xor
+	for ( int i = 0; static_cast<unsigned int>(i) < xorList.size(); i++ )
+		{
+			s += " {";
+			for ( ArgVectorIterator it = xorList[i].begin(); 
+				  it != xorList[i].end(); it++ )
+				s += (*it)->shortID() + "|";
+
+			s[s.length()-1] = '}';
+		}
+
+	// then the rest
+	for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
+		if ( !xorHandler.contains( (*it) ) )
+			s += " " + (*it)->shortID();
+
+	// if the program name is too long, then adjust the second line offset 
+	int secondLineOffset = static_cast<int>(progName.length()) + 2;
+	if ( secondLineOffset > 75/2 )
+		secondLineOffset = static_cast<int>(75/2);
+
+	spacePrint( os, s, 75, 3, secondLineOffset );
+}
+
+inline void 
+StdOutput::_longUsage( CmdLineInterface& _cmd, 
+					   std::ostream& os ) const
+{
+	std::list<Arg*> argList = _cmd.getArgList();
+	std::string message = _cmd.getMessage();
+	XorHandler xorHandler = _cmd.getXorHandler();
+	std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
+
+	// first the xor 
+	for ( int i = 0; static_cast<unsigned int>(i) < xorList.size(); i++ )
+		{
+			for ( ArgVectorIterator it = xorList[i].begin(); 
+				  it != xorList[i].end(); 
+				  it++ )
+				{
+					spacePrint( os, (*it)->longID(), 75, 3, 3 );
+					spacePrint( os, (*it)->getDescription(), 75, 5, 0 );
+
+					if ( it+1 != xorList[i].end() )
+						spacePrint(os, "-- OR --", 75, 9, 0);
+				}
+			os << std::endl << std::endl;
+		}
+
+	// then the rest
+	for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
+		if ( !xorHandler.contains( (*it) ) )
+			{
+				spacePrint( os, (*it)->longID(), 75, 3, 3 ); 
+				spacePrint( os, (*it)->getDescription(), 75, 5, 0 ); 
+				os << std::endl;
+			}
+
+	os << std::endl;
+
+	spacePrint( os, message, 75, 3, 0 );
+}
+
+inline void StdOutput::spacePrint( std::ostream& os, 
+						           const std::string& s, 
+						           int maxWidth, 
+						           int indentSpaces, 
+						           int secondLineOffset ) const
+{
+	int len = static_cast<int>(s.length());
+
+	if ( (len + indentSpaces > maxWidth) && maxWidth > 0 )
+		{
+			int allowedLen = maxWidth - indentSpaces;
+			int start = 0;
+			while ( start < len )
+				{
+					// find the substring length
+					// int stringLen = std::min<int>( len - start, allowedLen );
+					// doing it this way to support a VisualC++ 2005 bug 
+					using namespace std; 
+					int stringLen = min<int>( len - start, allowedLen );
+
+					// trim the length so it doesn't end in middle of a word
+					if ( stringLen == allowedLen )
+						while ( stringLen >= 0 &&
+								s[stringLen+start] != ' ' && 
+								s[stringLen+start] != ',' &&
+								s[stringLen+start] != '|' ) 
+							stringLen--;
+	
+					// ok, the word is longer than the line, so just split 
+					// wherever the line ends
+					if ( stringLen <= 0 )
+						stringLen = allowedLen;
+
+					// check for newlines
+					for ( int i = 0; i < stringLen; i++ )
+						if ( s[start+i] == '\n' )
+							stringLen = i+1;
+
+					// print the indent	
+					for ( int i = 0; i < indentSpaces; i++ )
+						os << " ";
+
+					if ( start == 0 )
+						{
+							// handle second line offsets
+							indentSpaces += secondLineOffset;
+
+							// adjust allowed len
+							allowedLen -= secondLineOffset;
+						}
+
+					os << s.substr(start,stringLen) << std::endl;
+
+					// so we don't start a line with a space
+					while ( s[stringLen+start] == ' ' && start < len )
+						start++;
+			
+					start += stringLen;
+				}
+		}
+	else
+		{
+			for ( int i = 0; i < indentSpaces; i++ )
+				os << " ";
+			os << s << std::endl;
+		}
+}
+
+} //namespace TCLAP
+#endif 
diff --git a/tclap/SwitchArg.h b/tclap/SwitchArg.h
new file mode 100644
index 0000000..3916109
--- /dev/null
+++ b/tclap/SwitchArg.h
@@ -0,0 +1,266 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  SwitchArg.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_SWITCH_ARG_H
+#define TCLAP_SWITCH_ARG_H
+
+#include <string>
+#include <vector>
+
+#include <tclap/Arg.h>
+
+namespace TCLAP {
+
+/**
+ * A simple switch argument.  If the switch is set on the command line, then
+ * the getValue method will return the opposite of the default value for the
+ * switch.
+ */
+class SwitchArg : public Arg
+{
+	protected:
+
+		/**
+		 * The value of the switch.
+		 */
+		bool _value;
+
+		/**
+		 * Used to support the reset() method so that ValueArg can be
+		 * reset to their constructed value.
+		 */
+        bool _default;
+
+	public:
+
+        /**
+		 * SwitchArg constructor.
+		 * \param flag - The one character flag that identifies this
+		 * argument on the command line.
+		 * \param name - A one word name for the argument.  Can be
+		 * used as a long flag on the command line.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param def - The default value for this Switch. 
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		SwitchArg(const std::string& flag, 
+			      const std::string& name, 
+			      const std::string& desc,
+			      bool def = false,
+				  Visitor* v = NULL);
+
+				  
+		/**
+		 * SwitchArg constructor.
+		 * \param flag - The one character flag that identifies this
+		 * argument on the command line.
+		 * \param name - A one word name for the argument.  Can be
+		 * used as a long flag on the command line.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param parser - A CmdLine parser object to add this Arg to
+		 * \param def - The default value for this Switch.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		SwitchArg(const std::string& flag, 
+			      const std::string& name, 
+			      const std::string& desc,
+				  CmdLineInterface& parser,
+			      bool def = false,
+				  Visitor* v = NULL);
+				  
+				  
+        /**
+		 * Handles the processing of the argument.
+		 * This re-implements the Arg version of this method to set the
+		 * _value of the argument appropriately.
+		 * \param i - Pointer the the current argument in the list.
+		 * \param args - Mutable list of strings. Passed
+		 * in from main().
+		 */
+		virtual bool processArg(int* i, std::vector<std::string>& args); 
+
+		/**
+		 * Checks a string to see if any of the chars in the string
+		 * match the flag for this Switch.
+		 */
+		bool combinedSwitchesMatch(std::string& combined);
+
+		/**
+		 * Returns bool, whether or not the switch has been set.
+		 */
+		bool getValue();
+		
+		virtual void reset();
+
+	private:
+		/**
+		 * Checks to see if we've found the last match in
+		 * a combined string.
+		 */
+		bool lastCombined(std::string& combined);
+
+		/**
+		 * Does the common processing of processArg.
+		 */
+		void commonProcessing();
+};
+
+//////////////////////////////////////////////////////////////////////
+//BEGIN SwitchArg.cpp
+//////////////////////////////////////////////////////////////////////
+inline SwitchArg::SwitchArg(const std::string& flag, 
+                            const std::string& name, 
+                            const std::string& desc, 
+                            bool default_val,
+                            Visitor* v )
+: Arg(flag, name, desc, false, false, v),
+  _value( default_val ),
+  _default( default_val )
+{ }
+
+inline SwitchArg::SwitchArg(const std::string& flag, 
+                            const std::string& name, 
+                            const std::string& desc, 
+                            CmdLineInterface& parser,
+                            bool default_val,
+                            Visitor* v )
+: Arg(flag, name, desc, false, false, v),
+  _value( default_val ),
+  _default(default_val)
+{ 
+	parser.add( this );
+}
+
+inline bool SwitchArg::getValue() { return _value; }
+
+inline bool SwitchArg::lastCombined(std::string& combinedSwitches ) 
+{
+	for ( unsigned int i = 1; i < combinedSwitches.length(); i++ )
+		if ( combinedSwitches[i] != Arg::blankChar() )
+			return false;
+	
+	return true;
+}
+
+inline bool SwitchArg::combinedSwitchesMatch(std::string& combinedSwitches )
+{
+	// make sure this is actually a combined switch
+	if ( combinedSwitches.length() > 0 &&
+	     combinedSwitches[0] != Arg::flagStartString()[0] )
+		return false;
+
+	// make sure it isn't a long name 
+	if ( combinedSwitches.substr( 0, Arg::nameStartString().length() ) == 
+	     Arg::nameStartString() )
+		return false;
+
+	// make sure the delimiter isn't in the string 
+	if ( combinedSwitches.find_first_of( Arg::delimiter() ) != std::string::npos )
+		return false;
+
+	// ok, we're not specifying a ValueArg, so we know that we have
+	// a combined switch list.  
+	for ( unsigned int i = 1; i < combinedSwitches.length(); i++ )
+		if ( _flag.length() > 0 && 
+		     combinedSwitches[i] == _flag[0] &&
+		     _flag[0] != Arg::flagStartString()[0] ) 
+		{
+			// update the combined switches so this one is no longer present
+			// this is necessary so that no unlabeled args are matched
+			// later in the processing.
+			//combinedSwitches.erase(i,1);
+			combinedSwitches[i] = Arg::blankChar(); 
+			return true;
+		}
+
+	// none of the switches passed in the list match. 
+	return false;	
+}
+
+inline void SwitchArg::commonProcessing()
+{
+	if ( _xorSet )
+		throw(CmdLineParseException(
+		      "Mutually exclusive argument already set!", toString()));
+
+	if ( _alreadySet ) 
+		throw(CmdLineParseException("Argument already set!", toString()));
+
+	_alreadySet = true;
+
+	if ( _value == true )
+		_value = false;
+	else
+		_value = true;
+
+	_checkWithVisitor();
+}
+
+inline bool SwitchArg::processArg(int *i, std::vector<std::string>& args)
+{
+	if ( _ignoreable && Arg::ignoreRest() )
+		return false;
+
+	// if the whole string matches the flag or name string
+	if ( argMatches( args[*i] ) )
+	{
+		commonProcessing();
+
+		return true;
+	}
+	// if a substring matches the flag as part of a combination
+	else if ( combinedSwitchesMatch( args[*i] ) )
+	{
+		// check again to ensure we don't misinterpret 
+		// this as a MultiSwitchArg 
+		if ( combinedSwitchesMatch( args[*i] ) )
+			throw(CmdLineParseException("Argument already set!", 
+			                            toString()));
+
+		commonProcessing();
+
+		// We only want to return true if we've found the last combined
+		// match in the string, otherwise we return true so that other 
+		// switches in the combination will have a chance to match.
+		return lastCombined( args[*i] );
+	}
+	else
+		return false;
+}
+
+inline void SwitchArg::reset()
+{
+	Arg::reset();
+	_value = _default;  
+}
+//////////////////////////////////////////////////////////////////////
+//End SwitchArg.cpp
+//////////////////////////////////////////////////////////////////////
+
+} //namespace TCLAP
+
+#endif
diff --git a/tclap/UnlabeledMultiArg.h b/tclap/UnlabeledMultiArg.h
new file mode 100644
index 0000000..d5e1781
--- /dev/null
+++ b/tclap/UnlabeledMultiArg.h
@@ -0,0 +1,301 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  UnlabeledMultiArg.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot.
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_MULTIPLE_UNLABELED_ARGUMENT_H
+#define TCLAP_MULTIPLE_UNLABELED_ARGUMENT_H
+
+#include <string>
+#include <vector>
+
+#include <tclap/MultiArg.h>
+#include <tclap/OptionalUnlabeledTracker.h>
+
+namespace TCLAP {
+
+/**
+ * Just like a MultiArg, except that the arguments are unlabeled.  Basically,
+ * this Arg will slurp up everything that hasn't been matched to another 
+ * Arg.
+ */
+template<class T>
+class UnlabeledMultiArg : public MultiArg<T>
+{
+
+	// If compiler has two stage name lookup (as gcc >= 3.4 does)
+	// this is requried to prevent undef. symbols
+	using MultiArg<T>::_ignoreable;
+	using MultiArg<T>::_hasBlanks;
+	using MultiArg<T>::_extractValue;
+	using MultiArg<T>::_typeDesc;
+	using MultiArg<T>::_name;
+	using MultiArg<T>::_description;
+	using MultiArg<T>::_alreadySet;
+	using MultiArg<T>::toString;
+
+	public:
+		
+		/**
+		 * Constructor.  
+		 * \param name - The name of the Arg. Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 *  line.
+		 * \param typeDesc - A short, human readable description of the
+		 * type that this object expects.  This is used in the generation
+		 * of the USAGE statement.  The goal is to be helpful to the end user
+		 * of the program.
+		 * \param ignoreable - Whether or not this argument can be ignored
+		 * using the "--" flag.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		UnlabeledMultiArg( const std::string& name,
+				           const std::string& desc,
+						   bool req,
+				           const std::string& typeDesc,
+						   bool ignoreable = false,
+				           Visitor* v = NULL );
+		/**
+		 * Constructor.  
+		 * \param name - The name of the Arg. Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 *  line.
+		 * \param typeDesc - A short, human readable description of the
+		 * type that this object expects.  This is used in the generation
+		 * of the USAGE statement.  The goal is to be helpful to the end user
+		 * of the program.
+		 * \param parser - A CmdLine parser object to add this Arg to
+		 * \param ignoreable - Whether or not this argument can be ignored
+		 * using the "--" flag.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		UnlabeledMultiArg( const std::string& name,
+				           const std::string& desc,
+						   bool req,
+				           const std::string& typeDesc,
+						   CmdLineInterface& parser,
+						   bool ignoreable = false,
+				           Visitor* v = NULL );
+						 
+		/**
+		 * Constructor.  
+		 * \param name - The name of the Arg. Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 *  line.
+		 * \param constraint - A pointer to a Constraint object used
+		 * to constrain this Arg.
+		 * \param ignoreable - Whether or not this argument can be ignored
+		 * using the "--" flag.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		UnlabeledMultiArg( const std::string& name,
+						   const std::string& desc,
+						   bool req,
+						   Constraint<T>* constraint,
+						   bool ignoreable = false,
+						   Visitor* v = NULL );
+
+		/**
+		 * Constructor.  
+		 * \param name - The name of the Arg. Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 *  line.
+		 * \param constraint - A pointer to a Constraint object used
+		 * to constrain this Arg.
+		 * \param parser - A CmdLine parser object to add this Arg to
+		 * \param ignoreable - Whether or not this argument can be ignored
+		 * using the "--" flag.
+		 * \param v - An optional visitor.  You probably should not
+		 * use this unless you have a very good reason.
+		 */
+		UnlabeledMultiArg( const std::string& name, 
+						   const std::string& desc, 
+						   bool req,
+						   Constraint<T>* constraint,
+						   CmdLineInterface& parser,
+						   bool ignoreable = false,
+						   Visitor* v = NULL );
+						 
+		/**
+		 * Handles the processing of the argument.
+		 * This re-implements the Arg version of this method to set the
+		 * _value of the argument appropriately.  It knows the difference
+		 * between labeled and unlabeled.
+		 * \param i - Pointer the the current argument in the list.
+		 * \param args - Mutable list of strings. Passed from main().
+		 */
+		virtual bool processArg(int* i, std::vector<std::string>& args); 
+
+		/**
+		 * Returns the a short id string.  Used in the usage.
+		 * \param val - value to be used.
+		 */
+		virtual std::string shortID(const std::string& val="val") const;
+
+		/**
+		 * Returns the a long id string.  Used in the usage.
+		 * \param val - value to be used.
+		 */
+		virtual std::string longID(const std::string& val="val") const;
+
+		/**
+		 * Opertor ==.
+		 * \param a - The Arg to be compared to this.
+		 */
+		virtual bool operator==(const Arg& a) const;
+
+		/**
+		 * Pushes this to back of list rather than front.
+		 * \param argList - The list this should be added to.
+		 */
+		virtual void addToList( std::list<Arg*>& argList ) const;
+};
+
+template<class T>
+UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name, 
+				                        const std::string& desc, 
+										bool req,
+					                    const std::string& typeDesc,
+										bool ignoreable,
+					                    Visitor* v)
+: MultiArg<T>("", name, desc,  req, typeDesc, v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(true, toString());
+}
+
+template<class T>
+UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name, 
+				                        const std::string& desc, 
+										bool req,
+					                    const std::string& typeDesc,
+										CmdLineInterface& parser,
+										bool ignoreable,
+					                    Visitor* v)
+: MultiArg<T>("", name, desc,  req, typeDesc, v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(true, toString());
+	parser.add( this );
+}
+
+
+template<class T>
+UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name, 
+				                        const std::string& desc, 
+										bool req,
+					                    Constraint<T>* constraint,
+										bool ignoreable,
+					                    Visitor* v)
+: MultiArg<T>("", name, desc,  req, constraint, v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(true, toString());
+}
+
+template<class T>
+UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name, 
+				                        const std::string& desc, 
+										bool req,
+					                    Constraint<T>* constraint,
+										CmdLineInterface& parser,
+										bool ignoreable,
+					                    Visitor* v)
+: MultiArg<T>("", name, desc,  req, constraint, v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(true, toString());
+	parser.add( this );
+}
+
+
+template<class T>
+bool UnlabeledMultiArg<T>::processArg(int *i, std::vector<std::string>& args) 
+{
+
+	if ( _hasBlanks( args[*i] ) )
+		return false;
+
+	// never ignore an unlabeled multi arg
+
+
+	// always take the first value, regardless of the start string 
+	_extractValue( args[(*i)] );
+
+	/*
+	// continue taking args until we hit the end or a start string 
+	while ( (unsigned int)(*i)+1 < args.size() &&
+			args[(*i)+1].find_first_of( Arg::flagStartString() ) != 0 &&
+            args[(*i)+1].find_first_of( Arg::nameStartString() ) != 0 ) 
+		_extractValue( args[++(*i)] );
+	*/
+
+	_alreadySet = true;
+
+	return true;
+}
+
+template<class T>
+std::string UnlabeledMultiArg<T>::shortID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return std::string("<") + _typeDesc + "> ...";
+}
+
+template<class T>
+std::string UnlabeledMultiArg<T>::longID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return std::string("<") + _typeDesc + ">  (accepted multiple times)";
+}
+
+template<class T>
+bool UnlabeledMultiArg<T>::operator==(const Arg& a) const
+{
+	if ( _name == a.getName() || _description == a.getDescription() )
+		return true;
+	else
+		return false;
+}
+
+template<class T>
+void UnlabeledMultiArg<T>::addToList( std::list<Arg*>& argList ) const
+{
+	argList.push_back( const_cast<Arg*>(static_cast<const Arg* const>(this)) );
+}
+
+}
+
+#endif
diff --git a/tclap/UnlabeledValueArg.h b/tclap/UnlabeledValueArg.h
new file mode 100644
index 0000000..5721d61
--- /dev/null
+++ b/tclap/UnlabeledValueArg.h
@@ -0,0 +1,340 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  UnlabeledValueArg.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_UNLABELED_VALUE_ARGUMENT_H
+#define TCLAP_UNLABELED_VALUE_ARGUMENT_H
+
+#include <string>
+#include <vector>
+
+#include <tclap/ValueArg.h>
+#include <tclap/OptionalUnlabeledTracker.h>
+
+
+namespace TCLAP {
+
+/**
+ * The basic unlabeled argument that parses a value.
+ * This is a template class, which means the type T defines the type
+ * that a given object will attempt to parse when an UnlabeledValueArg
+ * is reached in the list of args that the CmdLine iterates over.
+ */
+template<class T>
+class UnlabeledValueArg : public ValueArg<T>
+{
+
+	// If compiler has two stage name lookup (as gcc >= 3.4 does)
+	// this is requried to prevent undef. symbols
+	using ValueArg<T>::_ignoreable;
+	using ValueArg<T>::_hasBlanks;
+	using ValueArg<T>::_extractValue;
+	using ValueArg<T>::_typeDesc;
+	using ValueArg<T>::_name;
+	using ValueArg<T>::_description;
+	using ValueArg<T>::_alreadySet;
+	using ValueArg<T>::toString;
+
+	public:
+
+		/**
+		 * UnlabeledValueArg constructor.
+		 * \param name - A one word name for the argument.  Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 * line.
+		 * \param value - The default value assigned to this argument if it
+		 * is not present on the command line.
+		 * \param typeDesc - A short, human readable description of the
+		 * type that this object expects.  This is used in the generation
+		 * of the USAGE statement.  The goal is to be helpful to the end user
+		 * of the program.
+		 * \param ignoreable - Allows you to specify that this argument can be
+		 * ignored if the '--' flag is set.  This defaults to false (cannot
+		 * be ignored) and should  generally stay that way unless you have 
+		 * some special need for certain arguments to be ignored.
+		 * \param v - Optional Vistor.  You should leave this blank unless
+		 * you have a very good reason.
+		 */
+		UnlabeledValueArg( const std::string& name, 
+			               const std::string& desc, 
+						   bool req,
+				           T value,
+				           const std::string& typeDesc,
+						   bool ignoreable = false,
+				           Visitor* v = NULL); 
+
+		/**
+		 * UnlabeledValueArg constructor.
+		 * \param name - A one word name for the argument.  Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 * line.
+		 * \param value - The default value assigned to this argument if it
+		 * is not present on the command line.
+		 * \param typeDesc - A short, human readable description of the
+		 * type that this object expects.  This is used in the generation
+		 * of the USAGE statement.  The goal is to be helpful to the end user
+		 * of the program.
+		 * \param parser - A CmdLine parser object to add this Arg to
+		 * \param ignoreable - Allows you to specify that this argument can be
+		 * ignored if the '--' flag is set.  This defaults to false (cannot
+		 * be ignored) and should  generally stay that way unless you have 
+		 * some special need for certain arguments to be ignored.
+		 * \param v - Optional Vistor.  You should leave this blank unless
+		 * you have a very good reason.
+		 */
+		UnlabeledValueArg( const std::string& name, 
+			               const std::string& desc, 
+						   bool req,
+				           T value,
+				           const std::string& typeDesc,
+						   CmdLineInterface& parser,
+						   bool ignoreable = false,
+				           Visitor* v = NULL ); 					
+						
+		/**
+		 * UnlabeledValueArg constructor.
+		 * \param name - A one word name for the argument.  Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 * line.
+		 * \param value - The default value assigned to this argument if it
+		 * is not present on the command line.
+		 * \param constraint - A pointer to a Constraint object used
+		 * to constrain this Arg.
+		 * \param ignoreable - Allows you to specify that this argument can be
+		 * ignored if the '--' flag is set.  This defaults to false (cannot
+		 * be ignored) and should  generally stay that way unless you have 
+		 * some special need for certain arguments to be ignored.
+		 * \param v - Optional Vistor.  You should leave this blank unless
+		 * you have a very good reason.
+		 */
+		UnlabeledValueArg( const std::string& name, 
+			               const std::string& desc, 
+						   bool req,
+				           T value,
+				           Constraint<T>* constraint,
+						   bool ignoreable = false,
+				           Visitor* v = NULL ); 
+
+		
+		/**
+		 * UnlabeledValueArg constructor.
+		 * \param name - A one word name for the argument.  Note that this is used for
+		 * identification, not as a long flag.
+		 * \param desc - A description of what the argument is for or
+		 * does.
+		 * \param req - Whether the argument is required on the command
+		 * line.
+		 * \param value - The default value assigned to this argument if it
+		 * is not present on the command line.
+		 * \param constraint - A pointer to a Constraint object used
+		 * to constrain this Arg.
+		 * \param parser - A CmdLine parser object to add this Arg to
+		 * \param ignoreable - Allows you to specify that this argument can be
+		 * ignored if the '--' flag is set.  This defaults to false (cannot
+		 * be ignored) and should  generally stay that way unless you have 
+		 * some special need for certain arguments to be ignored.
+		 * \param v - Optional Vistor.  You should leave this blank unless
+		 * you have a very good reason.
+		 */
+		UnlabeledValueArg( const std::string& name, 
+			               const std::string& desc, 
+						   bool req,
+				           T value,
+				           Constraint<T>* constraint,
+						   CmdLineInterface& parser,
+						   bool ignoreable = false,
+				           Visitor* v = NULL);
+						
+		/**
+		 * Handles the processing of the argument.
+		 * This re-implements the Arg version of this method to set the
+		 * _value of the argument appropriately.  Handling specific to
+		 * unlabled arguments.
+		 * \param i - Pointer the the current argument in the list.
+		 * \param args - Mutable list of strings. 
+		 */
+		virtual bool processArg(int* i, std::vector<std::string>& args); 
+
+		/**
+		 * Overrides shortID for specific behavior.
+		 */
+		virtual std::string shortID(const std::string& val="val") const;
+
+		/**
+		 * Overrides longID for specific behavior.
+		 */
+		virtual std::string longID(const std::string& val="val") const;
+
+		/**
+		 * Overrides operator== for specific behavior.
+		 */
+		virtual bool operator==(const Arg& a ) const;
+
+		/**
+		 * Instead of pushing to the front of list, push to the back.
+		 * \param argList - The list to add this to.
+		 */
+		virtual void addToList( std::list<Arg*>& argList ) const;
+
+};
+
+/**
+ * Constructor implemenation.
+ */
+template<class T>
+UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name, 
+					                    const std::string& desc, 
+										bool req,
+					                    T val,
+					                    const std::string& typeDesc,
+					                    bool ignoreable,
+					                    Visitor* v)
+: ValueArg<T>("", name, desc, req, val, typeDesc, v)
+{ 
+	_ignoreable = ignoreable;
+
+	OptionalUnlabeledTracker::check(req, toString());
+
+}
+
+template<class T>
+UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name, 
+					                    const std::string& desc, 
+										bool req,
+					                    T val,
+					                    const std::string& typeDesc,
+					                    CmdLineInterface& parser,
+					                    bool ignoreable,
+					                    Visitor* v)
+: ValueArg<T>("", name, desc, req, val, typeDesc, v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(req, toString());
+	parser.add( this );
+}
+
+/**
+ * Constructor implemenation.
+ */
+template<class T>
+UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name, 
+                                        const std::string& desc, 
+										bool req,
+                                        T val,
+                                        Constraint<T>* constraint,
+                                        bool ignoreable,
+                                        Visitor* v)
+: ValueArg<T>("", name, desc, req, val, constraint, v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(req, toString());
+}
+
+template<class T>
+UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name, 
+					                    const std::string& desc, 
+										bool req,
+					                    T val,
+					                    Constraint<T>* constraint,
+					                    CmdLineInterface& parser,
+					                    bool ignoreable,
+					                    Visitor* v)
+: ValueArg<T>("", name, desc, req, val, constraint,  v)
+{ 
+	_ignoreable = ignoreable;
+	OptionalUnlabeledTracker::check(req, toString());
+	parser.add( this );
+}
+
+/**
+ * Implementation of processArg().
+ */
+template<class T>
+bool UnlabeledValueArg<T>::processArg(int *i, std::vector<std::string>& args) 
+{
+	
+	if ( _alreadySet )
+		return false;
+	
+	if ( _hasBlanks( args[*i] ) )
+		return false;
+
+	// never ignore an unlabeled arg
+	
+	_extractValue( args[*i] );
+	_alreadySet = true;
+	return true;
+}
+
+/**
+ * Overriding shortID for specific output.
+ */
+template<class T>
+std::string UnlabeledValueArg<T>::shortID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return std::string("<") + _typeDesc + ">";
+}
+
+/**
+ * Overriding longID for specific output.
+ */
+template<class T>
+std::string UnlabeledValueArg<T>::longID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+
+	// Ideally we would like to be able to use RTTI to return the name
+	// of the type required for this argument.  However, g++ at least, 
+	// doesn't appear to return terribly useful "names" of the types.  
+	return std::string("<") + _typeDesc + ">";
+}
+
+/**
+ * Overriding operator== for specific behavior.
+ */
+template<class T>
+bool UnlabeledValueArg<T>::operator==(const Arg& a ) const
+{
+	if ( _name == a.getName() || _description == a.getDescription() )
+		return true;
+	else
+		return false;
+}
+
+template<class T>
+void UnlabeledValueArg<T>::addToList( std::list<Arg*>& argList ) const
+{
+	argList.push_back( const_cast<Arg*>(static_cast<const Arg* const>(this)) );
+}
+
+}
+#endif
diff --git a/tclap/ValueArg.h b/tclap/ValueArg.h
new file mode 100644
index 0000000..7ac2952
--- /dev/null
+++ b/tclap/ValueArg.h
@@ -0,0 +1,425 @@
+/****************************************************************************** 
+ * 
+ *  file:  ValueArg.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_VALUE_ARGUMENT_H
+#define TCLAP_VALUE_ARGUMENT_H
+
+#include <string>
+#include <vector>
+
+#include <tclap/Arg.h>
+#include <tclap/Constraint.h>
+
+namespace TCLAP {
+
+/**
+ * The basic labeled argument that parses a value.
+ * This is a template class, which means the type T defines the type
+ * that a given object will attempt to parse when the flag/name is matched
+ * on the command line.  While there is nothing stopping you from creating
+ * an unflagged ValueArg, it is unwise and would cause significant problems.
+ * Instead use an UnlabeledValueArg.
+ */
+template<class T>
+class ValueArg : public Arg 
+{
+    protected:
+
+        /**
+         * The value parsed from the command line.
+         * Can be of any type, as long as the >> operator for the type
+         * is defined.
+         */
+        T _value;
+
+		/**
+		 * Used to support the reset() method so that ValueArg can be
+		 * reset to their constructed value.
+		 */
+        T _default;
+
+        /**
+         * A human readable description of the type to be parsed.
+         * This is a hack, plain and simple.  Ideally we would use RTTI to
+         * return the name of type T, but until there is some sort of
+         * consistent support for human readable names, we are left to our
+         * own devices.
+         */
+        std::string _typeDesc;
+
+        /**
+         * A Constraint this Arg must conform to. 
+         */
+        Constraint<T>* _constraint;
+
+        /**
+         * Extracts the value from the string.
+         * Attempts to parse string as type T, if this fails an exception
+         * is thrown.
+         * \param val - value to be parsed. 
+         */
+        void _extractValue( const std::string& val );
+
+	public:
+
+        /**
+         * Labeled ValueArg constructor.
+         * You could conceivably call this constructor with a blank flag, 
+         * but that would make you a bad person.  It would also cause
+         * an exception to be thrown.   If you want an unlabeled argument, 
+         * use the other constructor.
+         * \param flag - The one character flag that identifies this
+         * argument on the command line.
+         * \param name - A one word name for the argument.  Can be
+         * used as a long flag on the command line.
+         * \param desc - A description of what the argument is for or
+         * does.
+         * \param req - Whether the argument is required on the command
+         * line.
+         * \param value - The default value assigned to this argument if it
+         * is not present on the command line.
+         * \param typeDesc - A short, human readable description of the
+         * type that this object expects.  This is used in the generation
+         * of the USAGE statement.  The goal is to be helpful to the end user
+         * of the program.
+         * \param v - An optional visitor.  You probably should not
+         * use this unless you have a very good reason.
+         */
+        ValueArg( const std::string& flag, 
+                  const std::string& name, 
+                  const std::string& desc, 
+                  bool req, 
+                  T value,
+                  const std::string& typeDesc,
+                  Visitor* v = NULL);
+				 
+				 
+        /**
+         * Labeled ValueArg constructor.
+         * You could conceivably call this constructor with a blank flag, 
+         * but that would make you a bad person.  It would also cause
+         * an exception to be thrown.   If you want an unlabeled argument, 
+         * use the other constructor.
+         * \param flag - The one character flag that identifies this
+         * argument on the command line.
+         * \param name - A one word name for the argument.  Can be
+         * used as a long flag on the command line.
+         * \param desc - A description of what the argument is for or
+         * does.
+         * \param req - Whether the argument is required on the command
+         * line.
+         * \param value - The default value assigned to this argument if it
+         * is not present on the command line.
+         * \param typeDesc - A short, human readable description of the
+         * type that this object expects.  This is used in the generation
+         * of the USAGE statement.  The goal is to be helpful to the end user
+         * of the program.
+         * \param parser - A CmdLine parser object to add this Arg to
+         * \param v - An optional visitor.  You probably should not
+         * use this unless you have a very good reason.
+         */
+        ValueArg( const std::string& flag, 
+                  const std::string& name, 
+                  const std::string& desc, 
+                  bool req, 
+                  T value,
+                  const std::string& typeDesc,
+                  CmdLineInterface& parser,
+                  Visitor* v = NULL );
+ 
+        /**
+         * Labeled ValueArg constructor.
+         * You could conceivably call this constructor with a blank flag, 
+         * but that would make you a bad person.  It would also cause
+         * an exception to be thrown.   If you want an unlabeled argument, 
+         * use the other constructor.
+         * \param flag - The one character flag that identifies this
+         * argument on the command line.
+         * \param name - A one word name for the argument.  Can be
+         * used as a long flag on the command line.
+         * \param desc - A description of what the argument is for or
+         * does.
+         * \param req - Whether the argument is required on the command
+         * line.
+         * \param value - The default value assigned to this argument if it
+         * is not present on the command line.
+         * \param constraint - A pointer to a Constraint object used
+		 * to constrain this Arg.
+         * \param parser - A CmdLine parser object to add this Arg to.
+         * \param v - An optional visitor.  You probably should not
+         * use this unless you have a very good reason.
+         */
+        ValueArg( const std::string& flag, 
+                  const std::string& name, 
+                  const std::string& desc, 
+                  bool req, 
+                  T value,
+                  Constraint<T>* constraint,
+                  CmdLineInterface& parser,
+                  Visitor* v = NULL );
+	  
+        /**
+         * Labeled ValueArg constructor.
+         * You could conceivably call this constructor with a blank flag, 
+         * but that would make you a bad person.  It would also cause
+         * an exception to be thrown.   If you want an unlabeled argument, 
+         * use the other constructor.
+         * \param flag - The one character flag that identifies this
+         * argument on the command line.
+         * \param name - A one word name for the argument.  Can be
+         * used as a long flag on the command line.
+         * \param desc - A description of what the argument is for or
+         * does.
+         * \param req - Whether the argument is required on the command
+         * line.
+         * \param value - The default value assigned to this argument if it
+         * is not present on the command line.
+         * \param constraint - A pointer to a Constraint object used
+		 * to constrain this Arg.
+         * \param v - An optional visitor.  You probably should not
+         * use this unless you have a very good reason.
+         */
+        ValueArg( const std::string& flag, 
+                  const std::string& name, 
+                  const std::string& desc, 
+                  bool req, 
+                  T value,
+                  Constraint<T>* constraint,
+                  Visitor* v = NULL );
+
+        /**
+         * Handles the processing of the argument.
+         * This re-implements the Arg version of this method to set the
+         * _value of the argument appropriately.  It knows the difference
+         * between labeled and unlabeled.
+         * \param i - Pointer the the current argument in the list.
+         * \param args - Mutable list of strings. Passed 
+         * in from main().
+         */
+        virtual bool processArg(int* i, std::vector<std::string>& args); 
+
+        /**
+         * Returns the value of the argument.
+         */
+        T& getValue() ;
+
+        /**
+         * Specialization of shortID.
+         * \param val - value to be used.
+         */
+        virtual std::string shortID(const std::string& val = "val") const;
+
+        /**
+         * Specialization of longID.
+         * \param val - value to be used.
+         */
+        virtual std::string longID(const std::string& val = "val") const;
+        
+        virtual void reset() ;
+
+private:
+       /**
+        * Prevent accidental copying
+        */
+       ValueArg<T>(const ValueArg<T>& rhs);
+       ValueArg<T>& operator=(const ValueArg<T>& rhs);
+};
+
+
+/**
+ * Constructor implementation.
+ */
+template<class T>
+ValueArg<T>::ValueArg(const std::string& flag, 
+                      const std::string& name, 
+                      const std::string& desc, 
+                      bool req, 
+                      T val,
+                      const std::string& typeDesc,
+                      Visitor* v)
+: Arg(flag, name, desc, req, true, v),
+  _value( val ),
+  _default( val ),
+  _typeDesc( typeDesc ),
+  _constraint( NULL )
+{ }
+
+template<class T>
+ValueArg<T>::ValueArg(const std::string& flag, 
+                      const std::string& name, 
+                      const std::string& desc, 
+                      bool req, 
+                      T val,
+                      const std::string& typeDesc,
+                      CmdLineInterface& parser,
+                      Visitor* v)
+: Arg(flag, name, desc, req, true, v),
+  _value( val ),
+  _default( val ),
+  _typeDesc( typeDesc ),
+  _constraint( NULL )
+{ 
+    parser.add( this );
+}
+
+template<class T>
+ValueArg<T>::ValueArg(const std::string& flag, 
+                      const std::string& name, 
+                      const std::string& desc, 
+                      bool req, 
+                      T val,
+                      Constraint<T>* constraint,
+                      Visitor* v)
+: Arg(flag, name, desc, req, true, v),
+  _value( val ),
+  _default( val ),
+  _typeDesc( constraint->shortID() ),
+  _constraint( constraint )
+{ }
+
+template<class T>
+ValueArg<T>::ValueArg(const std::string& flag, 
+                      const std::string& name, 
+                      const std::string& desc, 
+                      bool req, 
+                      T val,
+                      Constraint<T>* constraint,
+                      CmdLineInterface& parser,
+                      Visitor* v)
+: Arg(flag, name, desc, req, true, v),
+  _value( val ),
+  _default( val ),
+  _typeDesc( constraint->shortID() ),
+  _constraint( constraint )
+{ 
+    parser.add( this );
+}
+
+
+/**
+ * Implementation of getValue().
+ */
+template<class T>
+T& ValueArg<T>::getValue() { return _value; }
+
+/**
+ * Implementation of processArg().
+ */
+template<class T>
+bool ValueArg<T>::processArg(int *i, std::vector<std::string>& args)
+{
+    if ( _ignoreable && Arg::ignoreRest() )
+		return false;
+
+    if ( _hasBlanks( args[*i] ) )
+		return false;
+
+    std::string flag = args[*i];
+
+    std::string value = "";
+    trimFlag( flag, value );
+
+    if ( argMatches( flag ) )
+    {
+        if ( _alreadySet )
+		{
+			if ( _xorSet )
+				throw( CmdLineParseException(
+				       "Mutually exclusive argument already set!", 
+				                             toString()) );
+			else
+				throw( CmdLineParseException("Argument already set!", 
+				                             toString()) );
+		}
+
+        if ( Arg::delimiter() != ' ' && value == "" )
+			throw( ArgParseException( 
+							"Couldn't find delimiter for this argument!",
+                             toString() ) );
+
+        if ( value == "" )
+        {
+            (*i)++;
+            if ( static_cast<unsigned int>(*i) < args.size() ) 
+				_extractValue( args[*i] );
+            else
+				throw( ArgParseException("Missing a value for this argument!",
+                                                    toString() ) );
+        }
+        else
+			_extractValue( value );
+				
+        _alreadySet = true;
+        _checkWithVisitor();
+        return true;
+    }	
+    else
+		return false;
+}
+
+/**
+ * Implementation of shortID.
+ */
+template<class T>
+std::string ValueArg<T>::shortID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return Arg::shortID( _typeDesc ); 
+}
+
+/**
+ * Implementation of longID.
+ */
+template<class T>
+std::string ValueArg<T>::longID(const std::string& val) const
+{
+	static_cast<void>(val); // Ignore input, don't warn
+	return Arg::longID( _typeDesc ); 
+}
+
+template<class T>
+void ValueArg<T>::_extractValue( const std::string& val ) 
+{
+    try {
+	ExtractValue(_value, val, typename ArgTraits<T>::ValueCategory());
+    } catch( ArgParseException &e) {
+	throw ArgParseException(e.error(), toString());
+    }
+    
+    if ( _constraint != NULL )
+	if ( ! _constraint->check( _value ) )
+	    throw( CmdLineParseException( "Value '" + val + 
+					  + "' does not meet constraint: " 
+					  + _constraint->description(),
+					  toString() ) );
+}
+
+template<class T>
+void ValueArg<T>::reset()
+{
+	Arg::reset();
+	_value = _default;
+}
+
+} // namespace TCLAP
+
+#endif
diff --git a/tclap/ValuesConstraint.h b/tclap/ValuesConstraint.h
new file mode 100644
index 0000000..cb41f64
--- /dev/null
+++ b/tclap/ValuesConstraint.h
@@ -0,0 +1,148 @@
+
+
+/****************************************************************************** 
+ * 
+ *  file:  ValuesConstraint.h
+ * 
+ *  Copyright (c) 2005, Michael E. Smoot
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_VALUESCONSTRAINT_H
+#define TCLAP_VALUESCONSTRAINT_H
+
+#include <string>
+#include <vector>
+#include <tclap/Constraint.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#define HAVE_SSTREAM
+#endif
+
+#if defined(HAVE_SSTREAM)
+#include <sstream>
+#elif defined(HAVE_STRSTREAM)
+#include <strstream>
+#else
+#error "Need a stringstream (sstream or strstream) to compile!"
+#endif
+
+namespace TCLAP {
+
+/**
+ * A Constraint that constrains the Arg to only those values specified
+ * in the constraint.
+ */
+template<class T>
+class ValuesConstraint : public Constraint<T>
+{
+
+	public:
+
+		/**
+		 * Constructor. 
+		 * \param allowed - vector of allowed values. 
+		 */
+		ValuesConstraint(std::vector<T>& allowed);	
+
+		/**
+		 * Virtual destructor.
+		 */
+		virtual ~ValuesConstraint() {}
+
+		/**
+		 * Returns a description of the Constraint. 
+		 */
+		virtual std::string description() const;
+
+		/**
+		 * Returns the short ID for the Constraint.
+		 */
+		virtual std::string shortID() const;
+
+		/**
+		 * The method used to verify that the value parsed from the command
+		 * line meets the constraint.
+		 * \param value - The value that will be checked. 
+		 */
+		virtual bool check(const T& value) const;
+	
+	protected:
+
+		/**
+		 * The list of valid values. 
+		 */
+		std::vector<T> _allowed;
+
+		/**
+		 * The string used to describe the allowed values of this constraint.
+		 */
+		std::string _typeDesc;
+
+};
+
+template<class T>
+ValuesConstraint<T>::ValuesConstraint(std::vector<T>& allowed)
+: _allowed(allowed),
+  _typeDesc("")
+{ 
+    for ( unsigned int i = 0; i < _allowed.size(); i++ )
+    {
+
+#if defined(HAVE_SSTREAM)
+        std::ostringstream os;
+#elif defined(HAVE_STRSTREAM)
+        std::ostrstream os;
+#else
+#error "Need a stringstream (sstream or strstream) to compile!"
+#endif
+
+        os << _allowed[i];
+
+        std::string temp( os.str() ); 
+
+        if ( i > 0 )
+			_typeDesc += "|";
+        _typeDesc += temp;
+    }
+}
+
+template<class T>
+bool ValuesConstraint<T>::check( const T& val ) const
+{
+	if ( std::find(_allowed.begin(),_allowed.end(),val) == _allowed.end() )
+		return false;
+	else 
+		return true;
+}
+
+template<class T>
+std::string ValuesConstraint<T>::shortID() const
+{
+    return _typeDesc;	
+}
+
+template<class T>
+std::string ValuesConstraint<T>::description() const
+{
+    return _typeDesc;	
+}
+
+
+} //namespace TCLAP
+#endif 
+
diff --git a/tclap/Version b/tclap/Version
new file mode 100644
index 0000000..ac6d0a4
--- /dev/null
+++ b/tclap/Version
@@ -0,0 +1,2 @@
+This is version 1.2.1 of tclap.
+This file was added by Christoph Mayer
diff --git a/tclap/VersionVisitor.h b/tclap/VersionVisitor.h
new file mode 100644
index 0000000..c110d4f
--- /dev/null
+++ b/tclap/VersionVisitor.h
@@ -0,0 +1,81 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/****************************************************************************** 
+ * 
+ *  file:  VersionVisitor.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_VERSION_VISITOR_H
+#define TCLAP_VERSION_VISITOR_H
+
+#include <tclap/CmdLineInterface.h>
+#include <tclap/CmdLineOutput.h>
+#include <tclap/Visitor.h>
+
+namespace TCLAP {
+
+/**
+ * A Vistor that will call the version method of the given CmdLineOutput
+ * for the specified CmdLine object and then exit.
+ */
+class VersionVisitor: public Visitor
+{
+	private:
+		/**
+		 * Prevent accidental copying
+		 */
+		VersionVisitor(const VersionVisitor& rhs);
+		VersionVisitor& operator=(const VersionVisitor& rhs);
+
+	protected:
+
+		/**
+		 * The CmdLine of interest.
+		 */
+		CmdLineInterface* _cmd;
+
+		/**
+		 * The output object. 
+		 */
+		CmdLineOutput** _out;
+
+	public:
+
+		/**
+		 * Constructor.
+		 * \param cmd - The CmdLine the output is generated for. 
+		 * \param out - The type of output. 
+		 */
+		VersionVisitor( CmdLineInterface* cmd, CmdLineOutput** out ) 
+				: Visitor(), _cmd( cmd ), _out( out ) { }
+
+		/**
+		 * Calls the version method of the output object using the
+		 * specified CmdLine.
+		 */
+		void visit() { 
+		    (*_out)->version(*_cmd); 
+		    throw ExitException(0); 
+		}
+
+};
+
+}
+
+#endif
diff --git a/tclap/Visitor.h b/tclap/Visitor.h
new file mode 100644
index 0000000..38ddcbd
--- /dev/null
+++ b/tclap/Visitor.h
@@ -0,0 +1,53 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  Visitor.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+
+#ifndef TCLAP_VISITOR_H
+#define TCLAP_VISITOR_H
+
+namespace TCLAP {
+
+/**
+ * A base class that defines the interface for visitors.
+ */
+class Visitor
+{
+	public:
+
+		/**
+		 * Constructor. Does nothing.
+		 */
+		Visitor() { }
+
+		/**
+		 * Destructor. Does nothing.
+		 */
+		virtual ~Visitor() { }
+
+		/**
+		 * Does nothing. Should be overridden by child.
+		 */
+		virtual void visit() { }
+};
+
+}
+
+#endif
diff --git a/tclap/XorHandler.h b/tclap/XorHandler.h
new file mode 100644
index 0000000..d9dfad3
--- /dev/null
+++ b/tclap/XorHandler.h
@@ -0,0 +1,166 @@
+
+/****************************************************************************** 
+ * 
+ *  file:  XorHandler.h
+ * 
+ *  Copyright (c) 2003, Michael E. Smoot .
+ *  Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.  
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_XORHANDLER_H
+#define TCLAP_XORHANDLER_H
+
+#include <tclap/Arg.h>
+#include <string>
+#include <vector>
+#include <algorithm>
+#include <iostream>
+
+namespace TCLAP {
+
+/**
+ * This class handles lists of Arg's that are to be XOR'd on the command
+ * line.  This is used by CmdLine and you shouldn't ever use it.
+ */
+class XorHandler
+{
+	protected:
+
+		/**
+		 * The list of of lists of Arg's to be or'd together.
+		 */
+		std::vector< std::vector<Arg*> > _orList;
+
+	public:
+
+		/**
+		 * Constructor.  Does nothing.
+		 */
+		XorHandler( ) : _orList(std::vector< std::vector<Arg*> >()) {}
+
+		/**
+		 * Add a list of Arg*'s that will be orred together.
+		 * \param ors - list of Arg* that will be xor'd.
+		 */
+		void add( std::vector<Arg*>& ors );
+			
+		/**
+		 * Checks whether the specified Arg is in one of the xor lists and
+		 * if it does match one, returns the size of the xor list that the
+		 * Arg matched.  If the Arg matches, then it also sets the rest of
+		 * the Arg's in the list. You shouldn't use this.  
+		 * \param a - The Arg to be checked.
+		 */
+		int check( const Arg* a );
+
+		/**
+		 * Returns the XOR specific short usage.
+		 */
+		std::string shortUsage();
+
+		/**
+		 * Prints the XOR specific long usage.
+		 * \param os - Stream to print to.
+		 */
+		void printLongUsage(std::ostream& os);
+
+		/**
+		 * Simply checks whether the Arg is contained in one of the arg
+		 * lists.
+		 * \param a - The Arg to be checked.
+		 */
+		bool contains( const Arg* a );
+
+		std::vector< std::vector<Arg*> >& getXorList(); 
+
+};
+
+
+//////////////////////////////////////////////////////////////////////
+//BEGIN XOR.cpp
+//////////////////////////////////////////////////////////////////////
+inline void XorHandler::add( std::vector<Arg*>& ors )
+{ 
+	_orList.push_back( ors );
+}
+
+inline int XorHandler::check( const Arg* a ) 
+{
+	// iterate over each XOR list
+	for ( int i = 0; static_cast<unsigned int>(i) < _orList.size(); i++ )
+	{
+		// if the XOR list contains the arg..
+		ArgVectorIterator ait = std::find( _orList[i].begin(), 
+		                                   _orList[i].end(), a );
+		if ( ait != _orList[i].end() )
+		{
+			// first check to see if a mutually exclusive switch
+			// has not already been set
+			for ( ArgVectorIterator it = _orList[i].begin(); 
+				  it != _orList[i].end(); 
+				  it++ )
+				if ( a != (*it) && (*it)->isSet() )
+					throw(CmdLineParseException(
+					      "Mutually exclusive argument already set!",
+					      (*it)->toString()));
+
+			// go through and set each arg that is not a
+			for ( ArgVectorIterator it = _orList[i].begin(); 
+				  it != _orList[i].end(); 
+				  it++ )
+				if ( a != (*it) )
+					(*it)->xorSet();
+
+			// return the number of required args that have now been set
+			if ( (*ait)->allowMore() )
+				return 0;
+			else
+				return static_cast<int>(_orList[i].size());
+		}
+	}
+
+	if ( a->isRequired() )
+		return 1;
+	else
+		return 0;
+}
+
+inline bool XorHandler::contains( const Arg* a )
+{
+	for ( int i = 0; static_cast<unsigned int>(i) < _orList.size(); i++ )
+		for ( ArgVectorIterator it = _orList[i].begin(); 
+			  it != _orList[i].end(); 
+			  it++ )	
+			if ( a == (*it) )
+				return true;
+
+	return false;
+}
+
+inline std::vector< std::vector<Arg*> >& XorHandler::getXorList() 
+{
+	return _orList;
+}
+
+
+
+//////////////////////////////////////////////////////////////////////
+//END XOR.cpp
+//////////////////////////////////////////////////////////////////////
+
+} //namespace TCLAP
+
+#endif 
diff --git a/tclap/ZshCompletionOutput.h b/tclap/ZshCompletionOutput.h
new file mode 100644
index 0000000..0b37fc7
--- /dev/null
+++ b/tclap/ZshCompletionOutput.h
@@ -0,0 +1,323 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
+/****************************************************************************** 
+ * 
+ *  file:  ZshCompletionOutput.h
+ * 
+ *  Copyright (c) 2006, Oliver Kiddle
+ *  All rights reverved.
+ * 
+ *  See the file COPYING in the top directory of this distribution for
+ *  more information.
+ *  
+ *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ *  DEALINGS IN THE SOFTWARE.
+ *  
+ *****************************************************************************/ 
+
+#ifndef TCLAP_ZSHCOMPLETIONOUTPUT_H
+#define TCLAP_ZSHCOMPLETIONOUTPUT_H
+
+#include <string>
+#include <vector>
+#include <list>
+#include <iostream>
+#include <map>
+
+#include <tclap/CmdLineInterface.h>
+#include <tclap/CmdLineOutput.h>
+#include <tclap/XorHandler.h>
+#include <tclap/Arg.h>
+
+namespace TCLAP {
+
+/**
+ * A class that generates a Zsh completion function as output from the usage()
+ * method for the given CmdLine and its Args.
+ */
+class ZshCompletionOutput : public CmdLineOutput
+{
+
+	public:
+
+		ZshCompletionOutput();
+
+		/**
+		 * Prints the usage to stdout.  Can be overridden to 
+		 * produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void usage(CmdLineInterface& c);
+
+		/**
+		 * Prints the version to stdout. Can be overridden 
+		 * to produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 */
+		virtual void version(CmdLineInterface& c);
+
+		/**
+		 * Prints (to stderr) an error message, short usage 
+		 * Can be overridden to produce alternative behavior.
+		 * \param c - The CmdLine object the output is generated for. 
+		 * \param e - The ArgException that caused the failure. 
+		 */
+		virtual void failure(CmdLineInterface& c,
+						     ArgException& e );
+
+	protected:
+
+		void basename( std::string& s );
+		void quoteSpecialChars( std::string& s );
+
+		std::string getMutexList( CmdLineInterface& _cmd, Arg* a );
+		void printOption( Arg* it, std::string mutex );
+		void printArg( Arg* it );
+
+		std::map<std::string, std::string> common;
+		char theDelimiter;
+};
+
+ZshCompletionOutput::ZshCompletionOutput()
+: common(std::map<std::string, std::string>()),
+  theDelimiter('=')
+{
+	common["host"] = "_hosts";
+	common["hostname"] = "_hosts";
+	common["file"] = "_files";
+	common["filename"] = "_files";
+	common["user"] = "_users";
+	common["username"] = "_users";
+	common["directory"] = "_directories";
+	common["path"] = "_directories";
+	common["url"] = "_urls";
+}
+
+inline void ZshCompletionOutput::version(CmdLineInterface& _cmd)
+{
+	std::cout << _cmd.getVersion() << std::endl;
+}
+
+inline void ZshCompletionOutput::usage(CmdLineInterface& _cmd )
+{
+	std::list<Arg*> argList = _cmd.getArgList();
+	std::string progName = _cmd.getProgramName();
+	std::string xversion = _cmd.getVersion();
+	theDelimiter = _cmd.getDelimiter();
+	basename(progName);
+
+	std::cout << "#compdef " << progName << std::endl << std::endl <<
+		"# " << progName << " version " << _cmd.getVersion() << std::endl << std::endl <<
+		"_arguments -s -S";
+
+	for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
+	{
+		if ( (*it)->shortID().at(0) == '<' )
+			printArg((*it));
+		else if ( (*it)->getFlag() != "-" )
+			printOption((*it), getMutexList(_cmd, *it));
+	}
+
+	std::cout << std::endl;
+}
+
+inline void ZshCompletionOutput::failure( CmdLineInterface& _cmd,
+				                ArgException& e )
+{
+	static_cast<void>(_cmd); // unused
+	std::cout << e.what() << std::endl;
+}
+
+inline void ZshCompletionOutput::quoteSpecialChars( std::string& s )
+{
+	size_t idx = s.find_last_of(':');
+	while ( idx != std::string::npos )
+	{
+		s.insert(idx, 1, '\\');
+		idx = s.find_last_of(':', idx);
+	}
+	idx = s.find_last_of('\'');
+	while ( idx != std::string::npos )
+	{
+		s.insert(idx, "'\\'");
+		if (idx == 0)
+			idx = std::string::npos;
+		else
+			idx = s.find_last_of('\'', --idx);
+	}
+}
+
+inline void ZshCompletionOutput::basename( std::string& s )
+{
+	size_t p = s.find_last_of('/');
+	if ( p != std::string::npos )
+	{
+		s.erase(0, p + 1);
+	}
+}
+
+inline void ZshCompletionOutput::printArg(Arg* a)
+{
+	static int count = 1;
+
+	std::cout << " \\" << std::endl << "  '";
+	if ( a->acceptsMultipleValues() )
+		std::cout << '*';
+	else
+		std::cout << count++;
+	std::cout << ':';
+	if ( !a->isRequired() )
+		std::cout << ':';
+
+	std::cout << a->getName() << ':';
+	std::map<std::string, std::string>::iterator compArg = common.find(a->getName());
+	if ( compArg != common.end() )
+	{
+		std::cout << compArg->second;
+	}
+	else
+	{
+		std::cout << "_guard \"^-*\" " << a->getName();
+	}
+	std::cout << '\'';
+}
+
+inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex)
+{
+	std::string flag = a->flagStartChar() + a->getFlag();
+	std::string name = a->nameStartString() + a->getName();
+	std::string desc = a->getDescription();
+
+	// remove full stop and capitalisation from description as
+	// this is the convention for zsh function
+	if (!desc.compare(0, 12, "(required)  "))
+	{
+		desc.erase(0, 12);
+	}
+	if (!desc.compare(0, 15, "(OR required)  "))
+	{
+		desc.erase(0, 15);
+	}
+	size_t len = desc.length();
+	if (len && desc.at(--len) == '.')
+	{
+		desc.erase(len);
+	}
+	if (len)
+	{
+		desc.replace(0, 1, 1, tolower(desc.at(0)));
+	}
+
+	std::cout << " \\" << std::endl << "  '" << mutex;
+
+	if ( a->getFlag().empty() )
+	{
+		std::cout << name;
+	}
+	else
+	{
+		std::cout << "'{" << flag << ',' << name << "}'";
+	}
+	if ( theDelimiter == '=' && a->isValueRequired() )
+		std::cout << "=-";
+	quoteSpecialChars(desc);
+	std::cout << '[' << desc << ']';
+
+	if ( a->isValueRequired() )
+	{
+		std::string arg = a->shortID();
+		arg.erase(0, arg.find_last_of(theDelimiter) + 1);
+		if ( arg.at(arg.length()-1) == ']' )
+			arg.erase(arg.length()-1);
+		if ( arg.at(arg.length()-1) == ']' )
+		{
+			arg.erase(arg.length()-1);
+		}
+		if ( arg.at(0) == '<' )
+		{
+			arg.erase(arg.length()-1);
+			arg.erase(0, 1);
+		}
+		size_t p = arg.find('|');
+		if ( p != std::string::npos )
+		{
+			do
+			{
+				arg.replace(p, 1, 1, ' ');
+			}
+			while ( (p = arg.find_first_of('|', p)) != std::string::npos );
+			quoteSpecialChars(arg);
+			std::cout << ": :(" << arg << ')';
+		}
+		else
+		{
+			std::cout << ':' << arg;
+			std::map<std::string, std::string>::iterator compArg = common.find(arg);
+			if ( compArg != common.end() )
+			{
+				std::cout << ':' << compArg->second;
+			}
+		}
+	}
+
+	std::cout << '\'';
+}
+
+inline std::string ZshCompletionOutput::getMutexList( CmdLineInterface& _cmd, Arg* a)
+{
+	XorHandler xorHandler = _cmd.getXorHandler();
+	std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
+	
+	if (a->getName() == "help" || a->getName() == "version")
+	{
+		return "(-)";
+	}
+
+	std::ostringstream list;
+	if ( a->acceptsMultipleValues() )
+	{
+		list << '*';
+	}
+
+	for ( int i = 0; static_cast<unsigned int>(i) < xorList.size(); i++ )
+	{
+		for ( ArgVectorIterator it = xorList[i].begin();
+			it != xorList[i].end();
+			it++)
+		if ( a == (*it) )
+		{
+			list << '(';
+			for ( ArgVectorIterator iu = xorList[i].begin();
+				iu != xorList[i].end();
+				iu++ )
+			{
+				bool notCur = (*iu) != a;
+				bool hasFlag = !(*iu)->getFlag().empty();
+				if ( iu != xorList[i].begin() && (notCur || hasFlag) )
+					list << ' ';
+				if (hasFlag)
+					list << (*iu)->flagStartChar() << (*iu)->getFlag() << ' ';
+				if ( notCur || hasFlag )
+					list << (*iu)->nameStartString() << (*iu)->getName();
+			}
+			list << ')';
+			return list.str();
+		}
+	}
+	
+	// wasn't found in xor list
+	if (!a->getFlag().empty()) {
+		list << "(" << a->flagStartChar() << a->getFlag() << ' ' <<
+			a->nameStartString() << a->getName() << ')';
+	}
+	
+	return list.str();
+}
+
+} //namespace TCLAP
+#endif
diff --git a/typedefs.h b/typedefs.h
new file mode 100644
index 0000000..a91f664
--- /dev/null
+++ b/typedefs.h
@@ -0,0 +1,29 @@
+/*  BaitFisher (version 1.2.7) a program for designing DNA target enrichment baits
+ *  Copyright 2013-2016 by Christoph Mayer
+ *
+ *  This source file is part of the BaitFisher-package.
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with BaitFisher.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *  For any enquiries send an Email to Christoph Mayer
+ *  c.mayer.zfmk at uni-bonn.de
+ *
+ *  When publishing work that is based on the results please cite:
+ *  Mayer et al. 2016: BaitFisher: A software package for multi-species target DNA enrichment probe design
+ *  
+ */
+typedef std::map<unsigned, faststring>                            U_Faststring_map;
+typedef U_Faststring_map::iterator                       iterator_U_Faststring_map;
+typedef U_Faststring_map::const_iterator           const_iterator_U_Faststring_map;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/baitfisher.git



More information about the debian-med-commit mailing list