Index: src/Analysis/analysis_correlation.cpp
===================================================================
--- src/Analysis/analysis_correlation.cpp	(revision 1089686f4e347a12c5cb5f631aeaa4c165a9f3c0)
+++ src/Analysis/analysis_correlation.cpp	(revision e791dcfb33d9e278cc697cebebb3ec5731abcfe9)
@@ -295,5 +295,5 @@
   Info FunctionInfo(__func__);
   PairCorrelationMap *outmap = new PairCorrelationMap;
-  double distance = 0.;
+  //double distance = 0.;
   Box &domain = World::getInstance().getDomain();
 
@@ -391,6 +391,5 @@
     return outmap;
   }
-  for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++)
-    (*MolWalker)->doCountAtoms();
+
   outmap = new CorrelationToPointMap;
   for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++) {
@@ -437,6 +436,5 @@
     return outmap;
   }
-  for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++)
-    (*MolWalker)->doCountAtoms();
+
   outmap = new CorrelationToPointMap;
   for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++) {
@@ -492,6 +490,5 @@
     return outmap;
   }
-  for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++)
-    (*MolWalker)->doCountAtoms();
+
   outmap = new CorrelationToSurfaceMap;
   for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++) {
@@ -549,6 +546,5 @@
     return outmap;
   }
-  for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++)
-    (*MolWalker)->doCountAtoms();
+
   outmap = new CorrelationToSurfaceMap;
   double ShortestDistance = 0.;
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision 1089686f4e347a12c5cb5f631aeaa4c165a9f3c0)
+++ src/Fragmentation/Fragmentation.cpp	(revision e791dcfb33d9e278cc697cebebb3ec5731abcfe9)
@@ -456,6 +456,7 @@
     c = (ListOfBonds.size() > c) ? ListOfBonds.size() : c;
   }
-  FragmentCount = mol->NoNonHydrogen*(1 << (c*order));
-  LOG(1, "Upper limit for this subgraph is " << FragmentCount << " for " << mol->NoNonHydrogen << " non-H atoms with maximum bond degree of " << c << ".");
+  FragmentCount = mol->getNoNonHydrogen()*(1 << (c*order));
+  LOG(1, "Upper limit for this subgraph is " << FragmentCount << " for "
+      << mol->getNoNonHydrogen() << " non-H atoms with maximum bond degree of " << c << ".");
   return FragmentCount;
 };
Index: src/molecule.cpp
===================================================================
--- src/molecule.cpp	(revision 1089686f4e347a12c5cb5f631aeaa4c165a9f3c0)
+++ src/molecule.cpp	(revision e791dcfb33d9e278cc697cebebb3ec5731abcfe9)
@@ -58,10 +58,9 @@
   Observable("molecule"),
   MDSteps(0),
-  NoNonHydrogen(0),
   NoNonBonds(0),
   NoCyclicBonds(0),
   ActiveFlag(false),
   IndexNr(-1),
-  AtomCount(this,boost::bind(&molecule::doCountAtoms,this),"AtomCount"),
+  NoNonHydrogen(this,boost::bind(&molecule::doCountNoNonHydrogen,this),"NoNonHydrogen"),
   BondCount(this,boost::bind(&molecule::doCountBonds,this),"BondCount"),
   atomIdPool(1, 20, 100),
@@ -95,5 +94,9 @@
 
 int molecule::getAtomCount() const{
-  return *AtomCount;
+  return atomIds.size();
+}
+
+size_t molecule::getNoNonHydrogen() const{
+  return *NoNonHydrogen;
 }
 
@@ -236,6 +239,4 @@
   OBSERVE;
   if (pointer != NULL) {
-    if (pointer->getType()->getAtomicNumber() != 1)
-      NoNonHydrogen++;
     insert(pointer);
     pointer->setMolecule(this);
@@ -258,6 +259,4 @@
     walker->setNr(last_atom++);  // increase number within molecule
     insert(walker);
-    if ((pointer->getType() != NULL) && (pointer->getType()->getAtomicNumber() != 1))
-      NoNonHydrogen++;
     walker->setMolecule(this);
     retval=walker;
@@ -951,13 +950,12 @@
  * \param *out output stream for debugging
  */
-int molecule::doCountAtoms()
-{
-  int res = size();
-  NoNonHydrogen = 0;
+size_t molecule::doCountNoNonHydrogen() const
+{
+  int temp = 0;
   // go through atoms and look for new ones
   for (molecule::const_iterator iter = begin(); iter != end(); ++iter)
     if ((*iter)->getType()->getAtomicNumber() != 1) // count non-hydrogen atoms whilst at it
-      NoNonHydrogen++;
-  return res;
+      ++temp;
+  return temp;
 };
 
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision 1089686f4e347a12c5cb5f631aeaa4c165a9f3c0)
+++ src/molecule.hpp	(revision e791dcfb33d9e278cc697cebebb3ec5731abcfe9)
@@ -74,5 +74,4 @@
 
   int MDSteps; //!< The number of MD steps in Trajectories
-  mutable int NoNonHydrogen; //!< number of non-hydrogen atoms in molecule
   mutable int NoNonBonds; //!< number of non-hydrogen bonds in molecule
   mutable int NoCyclicBonds; //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()
@@ -83,5 +82,5 @@
 private:
   Formula formula;
-  Cacheable<int> AtomCount; //!< number of atoms, brought up-to-date by doCountAtoms()
+  Cacheable<size_t> NoNonHydrogen; //!< number of non-hydrogen atoms in molecule
   Cacheable<int> BondCount; //!< number of atoms, brought up-to-date by doCountBonds()
   moleculeId_t id;
@@ -98,5 +97,6 @@
   const std::string getName() const;
   int getAtomCount() const;
-  int doCountAtoms();
+  size_t doCountNoNonHydrogen() const;
+  size_t getNoNonHydrogen() const;
   int getBondCount() const;
   int doCountBonds() const;
