Index: src/analysis_correlation.cpp
===================================================================
--- src/analysis_correlation.cpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/analysis_correlation.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -370,5 +370,5 @@
 {
   Info FunctionInfo(__func__);
-  *file << "# BinStart\tCount" << endl;
+  *file << "BinStart\tCount" << endl;
   for (BinPairMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     *file << runner->first << "\t" << runner->second << endl;
@@ -383,5 +383,5 @@
 {
   Info FunctionInfo(__func__);
-  *file << "# BinStart\tAtom1\tAtom2" << endl;
+  *file << "BinStart\tAtom1\tAtom2" << endl;
   for (PairCorrelationMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     *file << runner->first << "\t" << *(runner->second.first) << "\t" << *(runner->second.second) << endl;
@@ -396,5 +396,5 @@
 {
   Info FunctionInfo(__func__);
-  *file << "# BinStart\tAtom::x[i]-point.x[i]" << endl;
+  *file << "BinStart\tAtom::x[i]-point.x[i]" << endl;
   for (CorrelationToPointMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     *file << runner->first;
@@ -412,5 +412,5 @@
 {
   Info FunctionInfo(__func__);
-  *file << "# BinStart\tTriangle" << endl;
+  *file << "BinStart\tTriangle" << endl;
   for (CorrelationToSurfaceMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     *file << runner->first << "\t" << *(runner->second.first) << "\t" << *(runner->second.second) << endl;
Index: src/analysis_correlation.hpp
===================================================================
--- src/analysis_correlation.hpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/analysis_correlation.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -90,5 +90,7 @@
 /** Puts given correlation data into bins of given size (histogramming).
  * Note that BinStart and BinEnd are desired to fill the complete range, even where Bins are zero. If this is
- * not desired, give equal BinStart and BinEnd and the map will contain only Bins where the count is one or greater.
+ * not desired, give equal BinStart and BinEnd and the map will contain only Bins where the count is one or greater. If a
+ * certain start value is desired, give BinStart and a BinEnd that is smaller than BinStart, then only BinEnd will be
+ * calculated automatically, i.e. BinStart = 0. and BinEnd = -1. .
  * Also note that the range is given inclusive, i.e. [ BinStart, BinEnd ].
  * \param *map map of doubles to count
@@ -114,5 +116,8 @@
   if (BinStart == BinEnd) { // if same, find range ourselves
     GetMinMax( map, start, end);
-  } else { // if not, initialise range to zero
+  } else if (BinEnd < BinStart) { // if BinEnd smaller, just look for new max
+    GetMinMax( map, start, end);
+    start = BinStart;
+  } else { // else take both values
     start = BinStart;
     end = BinEnd;
Index: src/atom_bondedparticle.cpp
===================================================================
--- src/atom_bondedparticle.cpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/atom_bondedparticle.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -56,5 +56,5 @@
  * \param *AdjacencyFile output stream
  */
-void BondedParticle::OutputAdjacency(ofstream *AdjacencyFile) const
+void BondedParticle::OutputAdjacency(ofstream * const AdjacencyFile) const
 {
   *AdjacencyFile << nr << "\t";
@@ -62,4 +62,15 @@
     *AdjacencyFile << (*Runner)->GetOtherAtom(this)->nr << "\t";
   *AdjacencyFile << endl;
+};
+
+/** Output of atom::nr along each bond partner per line.
+ * Only bonds are printed where atom::nr is smaller than the one of the bond partner.
+ * \param *AdjacencyFile output stream
+ */
+void BondedParticle::OutputBonds(ofstream * const BondFile) const
+{
+  for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); (++Runner))
+    if (nr < (*Runner)->GetOtherAtom(this)->nr)
+      *BondFile << nr << "\t" << (*Runner)->GetOtherAtom(this)->nr << "\n";
 };
 
Index: src/atom_bondedparticle.hpp
===================================================================
--- src/atom_bondedparticle.hpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/atom_bondedparticle.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -44,5 +44,6 @@
   int CorrectBondDegree();
   void OutputBondOfAtom() const;
-  void OutputAdjacency(ofstream *AdjacencyFile) const;
+  void OutputAdjacency(ofstream * const AdjacencyFile) const;
+  void OutputBonds(ofstream * const BondFile) const;
   void OutputOrder(ofstream *file) const;
 
Index: src/boundary.cpp
===================================================================
--- src/boundary.cpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/boundary.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -19,4 +19,5 @@
 
 #include<gsl/gsl_poly.h>
+#include<time.h>
 
 // ========================================== F U N C T I O N S =================================
@@ -840,4 +841,7 @@
   Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl;
 
+  // initialize seed of random number generator to current time
+  srand ( time(NULL) );
+
   // go over [0,1]^3 filler grid
   for (n[0] = 0; n[0] < N[0]; n[0]++)
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/builder.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -1308,4 +1308,6 @@
             Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;
             Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl;
+            Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl;
+            Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl;
             Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;
             Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
@@ -1594,6 +1596,6 @@
                 int ranges[NDIM] = {1,1,1};
                 CorrelationToSurfaceMap *surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges );
-                //OutputCorrelationToSurface(&output, surfacemap);
-                BinPairMap *binmap = BinData( surfacemap, 0.5, 0., 0. );
+                OutputCorrelationToSurface(&output, surfacemap);
+                BinPairMap *binmap = BinData( surfacemap, 0.5, 0., 20. );
                 OutputCorrelation ( &binoutput, binmap );
                 output.close();
@@ -1679,4 +1681,33 @@
               }
               break;
+
+            case 'J':
+              if (ExitFlag == 0) ExitFlag = 1;
+              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
+                ExitFlag =255;
+                eLog() << Verbose(0) << "Missing path of adjacency file: -j <path>" << endl;
+                performCriticalExit();
+              } else {
+                Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl;
+                configuration.BG->ConstructBondGraph(mol);
+                mol->StoreAdjacencyToFile(argv[argptr]);
+                argptr+=1;
+              }
+              break;
+
+            case 'j':
+              if (ExitFlag == 0) ExitFlag = 1;
+              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
+                ExitFlag =255;
+                eLog() << Verbose(0) << "Missing path of bonds file: -j <path>" << endl;
+                performCriticalExit();
+              } else {
+                Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl;
+                configuration.BG->ConstructBondGraph(mol);
+                mol->StoreBondsToFile(argv[argptr]);
+                argptr+=1;
+              }
+              break;
+
             case 'N':
               if (ExitFlag == 0) ExitFlag = 1;
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/molecule.hpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -277,4 +277,5 @@
   int FragmentMolecule(int Order, config *configuration);
   bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);
+  bool StoreBondsToFile(char *path);
   bool StoreAdjacencyToFile(char *path);
   bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms);
Index: src/molecule_graph.cpp
===================================================================
--- src/molecule_graph.cpp	(revision 520c8b507bae79bf8378d88c7c0636da4565faa5)
+++ src/molecule_graph.cpp	(revision a25aaef9d5e29b313b0a893b49836d905405be2b)
@@ -992,6 +992,36 @@
   Log() << Verbose(1) << "Saving adjacency list ... ";
   if (AdjacencyFile != NULL) {
+    AdjacencyFile << "m\tn" << endl;
     ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile);
     AdjacencyFile.close();
+    Log() << Verbose(1) << "done." << endl;
+  } else {
+    Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
+    status = false;
+  }
+
+  return status;
+}
+;
+
+/** Storing the bond structure of a molecule to file.
+ * Simply stores Atom::nr and then the Atom::nr of all bond partners, one per line.
+ * \param *out output stream for debugging
+ * \param *path path to file
+ * \return true - file written successfully, false - writing failed
+ */
+bool molecule::StoreBondsToFile(char *path)
+{
+  ofstream BondFile;
+  stringstream line;
+  bool status = true;
+
+  line << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
+  BondFile.open(line.str().c_str(), ios::out);
+  Log() << Verbose(1) << "Saving adjacency list ... ";
+  if (BondFile != NULL) {
+    BondFile << "m\tn" << endl;
+    ActOnAllAtoms(&atom::OutputBonds, &BondFile);
+    BondFile.close();
     Log() << Verbose(1) << "done." << endl;
   } else {
