Index: src/Fragmentation/SetValues/Fragment.cpp
===================================================================
--- src/Fragmentation/SetValues/Fragment.cpp	(revision c74fdb7d4752180ef951320937f2e2c2c36abd7f)
+++ src/Fragmentation/SetValues/Fragment.cpp	(revision c74fdb7d4752180ef951320937f2e2c2c36abd7f)
@@ -0,0 +1,110 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder 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 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Fragment.cpp
+ *
+ *  Created on: Aug 8, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Fragment.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+Fragment::Fragment()
+{}
+
+Fragment::Fragment(positions_t &_positions, charges_t &_charges)
+{
+  ASSERT( _positions.size() == _charges.size(),
+      "Fragment::Fragment() - given charges and positions don't match in size.");
+  positions_t::const_iterator piter = _positions.begin();
+  charges_t::const_iterator citer = _charges.begin();
+  for (;piter != _positions.end(); ++piter, ++citer)
+    nuclei.push_back( make_pair( *piter, *citer) );
+}
+
+
+Fragment& Fragment::operator+=(const Fragment &other)
+{
+  for (nuclei_t::const_iterator iter = other.nuclei.begin();
+      iter != other.nuclei.end(); ++iter) {
+    if (!containsNuclei(*iter)) {
+      nuclei.push_back(*iter);
+    }
+  }
+  return *this;
+}
+
+Fragment& Fragment::operator=(const Fragment &other)
+{
+  nuclei.clear();
+  nuclei = other.nuclei;
+  return *this;
+}
+
+Fragment& Fragment::operator-=(const Fragment &other)
+{
+  for (nuclei_t::const_iterator iter = other.nuclei.begin();
+      iter != other.nuclei.end(); ++iter)
+    removeNuclei(*iter);
+  return *this;
+}
+
+bool Fragment::containsNuclei(const nucleus_t &n) const
+{
+  for (nuclei_t::const_iterator iter = nuclei.begin();
+      iter != nuclei.end(); ++iter) {
+    if (((*iter).first == n.first) && ((*iter).second == n.second))
+      return true;
+  }
+  return false;
+}
+
+void Fragment::removeNuclei(const nucleus_t &n)
+{
+  for (nuclei_t::iterator iter = nuclei.begin();
+      iter != nuclei.end(); ++iter) {
+    if (((*iter).first == n.first) && ((*iter).second == n.second)) {
+      nuclei.erase(iter);
+      break;
+    }
+  }
+}
+
+template<> Fragment ZeroInstance<Fragment>()
+{
+  Fragment::positions_t positions;
+  Fragment::charges_t charges;
+  Fragment returnvalue(positions, charges);
+  return returnvalue;
+}
+
Index: src/Fragmentation/SetValues/Fragment.hpp
===================================================================
--- src/Fragmentation/SetValues/Fragment.hpp	(revision c74fdb7d4752180ef951320937f2e2c2c36abd7f)
+++ src/Fragmentation/SetValues/Fragment.hpp	(revision c74fdb7d4752180ef951320937f2e2c2c36abd7f)
@@ -0,0 +1,92 @@
+/*
+ * Fragment.hpp
+ *
+ *  Created on: Aug 8, 2012
+ *      Author: heber
+ */
+
+#ifndef FRAGMENT_HPP_
+#define FRAGMENT_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <vector>
+
+class Fragment {
+public:
+  typedef std::vector< std::vector<double> > positions_t;
+  typedef std::vector< double > charges_t;
+  typedef std::pair< std::vector<double>, double> nucleus_t;
+  typedef std::vector< nucleus_t > nuclei_t;
+
+  /** Default constructor of class Fragment.
+   *
+   */
+  Fragment();
+
+  /** Default constructor of class Fragment.
+   *
+   */
+  Fragment(const nuclei_t &_nuclei) :
+    nuclei(_nuclei)
+  {}
+
+  /** Constructor of class Fragment.
+   *
+   * @param _positions given positions
+   * @param _charges given charges
+   */
+  Fragment(std::vector< std::vector<double> > &_positions, std::vector< double > &_charges);
+
+  /** Adding another fragment onto this one.
+   *
+   * \note The operation is area-conserving, i.e. the new area is the sum of
+   * both areas.
+   *
+   * @param other other fragment
+   * @return ref to this instance
+   */
+  Fragment& operator+=(const Fragment &other);
+
+  /** Assignment operator.
+   *
+   * @param other other fragment to make ourselves equal to
+   * @return ref to this instance
+   */
+  Fragment& operator=(const Fragment &other);
+
+  /** Subtracting another fragment from this one.
+   *
+   * @param other other fragment
+   * @return ref to this instance
+   */
+  Fragment& operator-=(const Fragment &other);
+
+private:
+  /** Helper function that checks whether this nuclei is present.
+   *
+   * This operation is \f${\cal O}(n)\f$
+   *
+   * @param n nuclei to check
+   * @return true - is contained, false - is not contained
+   */
+  bool containsNuclei(const nucleus_t &n) const;
+
+  /** Seeks through all nuclei and removes matching one if found.
+   *
+   * @param n nuclei to remove
+   */
+  void removeNuclei(const nucleus_t &n);
+
+private:
+  nuclei_t nuclei;
+};
+
+template<typename T> T ZeroInstance();
+template<> Fragment ZeroInstance<Fragment>();
+
+#endif /* FRAGMENT_HPP_ */
Index: src/Fragmentation/SetValues/Makefile.am
===================================================================
--- src/Fragmentation/SetValues/Makefile.am	(revision 849cd8e107c07fa8b744cd0f691da136460b27f0)
+++ src/Fragmentation/SetValues/Makefile.am	(revision c74fdb7d4752180ef951320937f2e2c2c36abd7f)
@@ -3,8 +3,10 @@
 
 FRAGMENTATIONSETVALUESSOURCE = \
+	Fragmentation/SetValues/Fragment.cpp \
 	Fragmentation/SetValues/Histogram.cpp \
 	Fragmentation/SetValues/IndexedVectors.cpp
 
 FRAGMENTATIONSETVALUESHEADER = \
+	Fragmentation/SetValues/Fragment.hpp \
 	Fragmentation/SetValues/Histogram.hpp \
 	Fragmentation/SetValues/IndexedVectors.hpp
