Index: src/molecule_dynamics.cpp
===================================================================
--- src/molecule_dynamics.cpp	(revision 9879f6f8e5ad9364ccd32e2d6735f2ffc89cf18d)
+++ src/molecule_dynamics.cpp	(revision ea71760f1257d93e6396b87b269d71544d16a690)
@@ -213,5 +213,5 @@
 void FillDistanceList(molecule *mol, struct EvaluatePotential &Params)
 {
-  for (int i=mol->AtomCount; i--;) {
+  for (int i=mol->getAtomCount(); i--;) {
     Params.DistanceList[i] = new DistanceMap;    // is the distance sorted target list per atom
     Params.DistanceList[i]->clear();
@@ -287,5 +287,5 @@
   }
   while ((Potential) > Params.PenaltyConstants[2]) {
-    PrintPermutationMap(mol->AtomCount, Params);
+    PrintPermutationMap(mol->getAtomCount(), Params);
     iter++;
     if (iter == mol->end()) // round-robin at the end
@@ -296,5 +296,5 @@
     Potential = TryNextNearestNeighbourForInjectivePermutation(mol, (*iter), Potential, Params);
   }
-  for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1
+  for (int i=mol->getAtomCount(); i--;) // now each single entry in the DoubleList should be <=1
     if (Params.DoubleList[i] > 1) {
       eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;
@@ -335,9 +335,9 @@
   double Potential, OldPotential, OlderPotential;
   struct EvaluatePotential Params;
-  Params.PermutationMap = Calloc<atom*>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.**PermutationMap");
-  Params.DistanceList = Malloc<DistanceMap*>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.**DistanceList");
-  Params.DistanceIterators = Malloc<DistanceMap::iterator>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*DistanceIterators");
-  Params.DoubleList = Calloc<int>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*DoubleList");
-  Params.StepList = Malloc<DistanceMap::iterator>(AtomCount, "molecule::MinimiseConstrainedPotential: Params.*StepList");
+  Params.PermutationMap = Calloc<atom*>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.**PermutationMap");
+  Params.DistanceList = Malloc<DistanceMap*>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.**DistanceList");
+  Params.DistanceIterators = Malloc<DistanceMap::iterator>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*DistanceIterators");
+  Params.DoubleList = Calloc<int>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*DoubleList");
+  Params.StepList = Malloc<DistanceMap::iterator>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*StepList");
   int round;
   atom *Sprinter = NULL;
@@ -372,5 +372,5 @@
       iter = begin();
       for (; iter != end(); ++iter) {
-        PrintPermutationMap(AtomCount, Params);
+        PrintPermutationMap(getAtomCount(), Params);
         Sprinter = Params.DistanceIterators[(*iter)->nr]->second;   // store initial partner
         Strider = Params.DistanceIterators[(*iter)->nr];  //remember old iterator
@@ -400,5 +400,5 @@
             Params.PermutationMap[(*iter)->nr] = Params.DistanceIterators[(*iter)->nr]->second; // put next farther distance into PermutationMap
             Params.PermutationMap[(*runner)->nr] = Sprinter;  // and hand the old target to its respective owner
-            PrintPermutationMap(AtomCount, Params);
+            PrintPermutationMap(getAtomCount(), Params);
             // calculate the new potential
             //Log() << Verbose(2) << "Checking new potential ..." << endl;
@@ -438,5 +438,5 @@
 
   /// free memory and return with evaluated potential
-  for (int i=AtomCount; i--;)
+  for (int i=getAtomCount(); i--;)
     Params.DistanceList[i]->clear();
   Free(&Params.DistanceList);
@@ -483,5 +483,5 @@
     MinimiseConstrainedPotential(PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
   else {
-    PermutationMap = Malloc<atom *>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
+    PermutationMap = Malloc<atom *>(getAtomCount(), "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
     SetIndexedArrayForEachAtomTo( PermutationMap, &atom::nr );
   }
@@ -516,6 +516,6 @@
 
   // store the list to single step files
-  int *SortIndex = Malloc<int>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: *SortIndex");
-  for (int i=AtomCount; i--; )
+  int *SortIndex = Malloc<int>(getAtomCount(), "molecule::LinearInterpolationBetweenConfiguration: *SortIndex");
+  for (int i=getAtomCount(); i--; )
     SortIndex[i] = i;
   status = MoleculePerStep->OutputConfigForListOfFragments(&configuration, SortIndex);
@@ -561,6 +561,6 @@
       return false;
     }
-    if (Force.RowCounter[0] != AtomCount) {
-      eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;
+    if (Force.RowCounter[0] != getAtomCount()) {
+      eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << getAtomCount() << "." << endl;
       performCriticalExit();
       return false;
@@ -568,11 +568,11 @@
     // correct Forces
     Velocity.Zero();
-    for(int i=0;i<AtomCount;i++)
+    for(int i=0;i<getAtomCount();i++)
       for(int d=0;d<NDIM;d++) {
         Velocity.x[d] += Force.Matrix[0][i][d+5];
       }
-    for(int i=0;i<AtomCount;i++)
+    for(int i=0;i<getAtomCount();i++)
       for(int d=0;d<NDIM;d++) {
-        Force.Matrix[0][i][d+5] -= Velocity.x[d]/(double)AtomCount;
+        Force.Matrix[0][i][d+5] -= Velocity.x[d]/static_cast<double>(getAtomCount());
       }
     // solve a constrained potential if we are meant to
@@ -677,5 +677,5 @@
       delta_alpha = 0.;
       ActOnAllAtoms( &atom::Thermostat_NoseHoover_init, MDSteps, &delta_alpha );
-      delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
+      delta_alpha = (delta_alpha - (3.*getAtomCount()+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
       configuration.alpha += delta_alpha*configuration.Deltat;
       Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;
