diff --git a/Core/FormFactors/inc/IFormFactor.h b/Core/FormFactors/inc/IFormFactor.h
index 34b0045e34f5183971b86c78fd50ea976295cbbb..9da77c378f2826894774266a52881d342158591e 100644
--- a/Core/FormFactors/inc/IFormFactor.h
+++ b/Core/FormFactors/inc/IFormFactor.h
@@ -65,9 +65,9 @@ class IFormFactor : public ISample
         std::vector<IFormFactor *>& form_factors,
         std::vector<double>& probabilities,
         size_t nbr_samples) const {
-        (void)form_factors;   // to prevent unused-variable warning
-        (void)probabilities;  // to prevent unused-variable warning
-        (void)nbr_samples;    // to prevent unused-variable warning
+        (void)form_factors;
+        (void)probabilities;
+        (void)nbr_samples;
     }
 };
 
@@ -80,14 +80,12 @@ inline double IFormFactor::getVolume() const
 
 inline double IFormFactor::getHeight() const
 {
-    double result = std::pow(getVolume(), 1.0/3.0);
-    return result;
+    return std::pow(getVolume(), 1.0/3.0);
 }
 
 inline double IFormFactor::getRadius() const
 {
-    double result = std::sqrt(getVolume()/getHeight()/M_PI);
-    return result;
+    return std::sqrt(getVolume()/getHeight()/M_PI);
 }
 
 #endif // IFORMFACTOR_H
diff --git a/Core/Geometry/inc/ITransform3D.h b/Core/Geometry/inc/ITransform3D.h
index d0643bf873e3b3e8a2635cb2fb8c62eb2713a1cb..5c70797a281d921657933b8e32c30d8378d5816f 100644
--- a/Core/Geometry/inc/ITransform3D.h
+++ b/Core/Geometry/inc/ITransform3D.h
@@ -15,6 +15,7 @@
 #ifndef GEOMETRY_ITRANSFROM3D_H
 #define GEOMETRY_ITRANSFROM3D_H
 
+#include "Types.h"
 #include "BasicVector3D.h"
 #include <boost/shared_ptr.hpp>
 
@@ -51,6 +52,13 @@ class ITransform3D {
 
 };
 
+
+//class PTransform3DWrapper {
+//public:
+
+//    PTransform3D
+//};
+
 }  // namespace Geometry
 
 #endif /* GEOMETRY_ITRANSFROM3D_H */
diff --git a/Core/PythonAPI/inc/Beam.pypp.h b/Core/PythonAPI/inc/Beam.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..37d8b173c6ed6b483388312355ccec6424f0e4b9
--- /dev/null
+++ b/Core/PythonAPI/inc/Beam.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef Beam_hpp__pyplusplus_wrapper
+#define Beam_hpp__pyplusplus_wrapper
+
+void register_Beam_class();
+
+#endif//Beam_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/Bin1D.pypp.h b/Core/PythonAPI/inc/Bin1D.pypp.h
index 634334e6b0d722ba4ff0315017c9fb79c3c4cc06..5906944be9108d3e046cf29af6bf58dddb164d7a 100644
--- a/Core/PythonAPI/inc/Bin1D.pypp.h
+++ b/Core/PythonAPI/inc/Bin1D.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Bin1D_hpp__pyplusplus_wrapper
 #define Bin1D_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Bin1DCVector.pypp.h b/Core/PythonAPI/inc/Bin1DCVector.pypp.h
index 8e212a8e5bbea1565329bc88e70327c34fb5e539..7b0b21bce4e04056bf8a08f22e1238ee91c6a543 100644
--- a/Core/PythonAPI/inc/Bin1DCVector.pypp.h
+++ b/Core/PythonAPI/inc/Bin1DCVector.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Bin1DCVector_hpp__pyplusplus_wrapper
 #define Bin1DCVector_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Crystal.pypp.h b/Core/PythonAPI/inc/Crystal.pypp.h
index d159a60c5232a5f0a0877f605e66d3c5dff984c0..6880bdcff703aed02219f4fd8bc050ba1c6d6d7a 100644
--- a/Core/PythonAPI/inc/Crystal.pypp.h
+++ b/Core/PythonAPI/inc/Crystal.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Crystal_hpp__pyplusplus_wrapper
 #define Crystal_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Detector.pypp.h b/Core/PythonAPI/inc/Detector.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..37ad25ed76aef32c9af9106a5120154a77a98880
--- /dev/null
+++ b/Core/PythonAPI/inc/Detector.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef Detector_hpp__pyplusplus_wrapper
+#define Detector_hpp__pyplusplus_wrapper
+
+void register_Detector_class();
+
+#endif//Detector_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/DiffuseDWBASimulation.pypp.h b/Core/PythonAPI/inc/DiffuseDWBASimulation.pypp.h
deleted file mode 100644
index f52b60d3ba90844d68118d78c1753930ddc9b2b9..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/DiffuseDWBASimulation.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef DiffuseDWBASimulation_hpp__pyplusplus_wrapper
-#define DiffuseDWBASimulation_hpp__pyplusplus_wrapper
-
-void register_DiffuseDWBASimulation_class();
-
-#endif//DiffuseDWBASimulation_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/DiffuseParticleInfo.pypp.h b/Core/PythonAPI/inc/DiffuseParticleInfo.pypp.h
deleted file mode 100644
index 7d60c73943d3112d311254eca85eb60602422921..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/DiffuseParticleInfo.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef DiffuseParticleInfo_hpp__pyplusplus_wrapper
-#define DiffuseParticleInfo_hpp__pyplusplus_wrapper
-
-void register_DiffuseParticleInfo_class();
-
-#endif//DiffuseParticleInfo_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FTDistribution2DCauchy.pypp.h b/Core/PythonAPI/inc/FTDistribution2DCauchy.pypp.h
index 8d8a3b8b61737323d4f58395b33ea70fa242738e..e712c52a8557abead35789524c2a581b2b819784 100644
--- a/Core/PythonAPI/inc/FTDistribution2DCauchy.pypp.h
+++ b/Core/PythonAPI/inc/FTDistribution2DCauchy.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FTDistribution2DCauchy_hpp__pyplusplus_wrapper
 #define FTDistribution2DCauchy_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorBox.pypp.h b/Core/PythonAPI/inc/FormFactorBox.pypp.h
index b90f796eab2bf8758e47e7a105a2b532ce384919..9bee4feba6cf44c9f637e05baea61c4013f00576 100644
--- a/Core/PythonAPI/inc/FormFactorBox.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorBox.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorBox_hpp__pyplusplus_wrapper
 #define FormFactorBox_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorCone.pypp.h b/Core/PythonAPI/inc/FormFactorCone.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..00f92511aea4aea6d8e321065d1d57dedcf49842
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorCone.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorCone_hpp__pyplusplus_wrapper
+#define FormFactorCone_hpp__pyplusplus_wrapper
+
+void register_FormFactorCone_class();
+
+#endif//FormFactorCone_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorCrystal.pypp.h b/Core/PythonAPI/inc/FormFactorCrystal.pypp.h
index 3dd28108491ba0c4600ba68e1baa45c82c06d30b..67ebb1157cd417b07293250332cf49f170e65645 100644
--- a/Core/PythonAPI/inc/FormFactorCrystal.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorCrystal.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorCrystal_hpp__pyplusplus_wrapper
 #define FormFactorCrystal_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorCylinder.pypp.h b/Core/PythonAPI/inc/FormFactorCylinder.pypp.h
index 521ff8c71bf5e8b023b0a75c18a53556c66dcb05..5fd5da00da2623c1ba6e6b8980495676d3b6b265 100644
--- a/Core/PythonAPI/inc/FormFactorCylinder.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorCylinder.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorCylinder_hpp__pyplusplus_wrapper
 #define FormFactorCylinder_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorDecoratorDebyeWaller.pypp.h b/Core/PythonAPI/inc/FormFactorDecoratorDebyeWaller.pypp.h
index b1b83b363b242d903d505c023d99e2ad198346aa..aeeca5f348c03054b517d539fb6696e25647bc8f 100644
--- a/Core/PythonAPI/inc/FormFactorDecoratorDebyeWaller.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorDecoratorDebyeWaller.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorDecoratorDebyeWaller_hpp__pyplusplus_wrapper
 #define FormFactorDecoratorDebyeWaller_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorEllipsoid.pypp.h b/Core/PythonAPI/inc/FormFactorEllipsoid.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..e09e368c1ad264e1006797ca47138943eee8df3a
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorEllipsoid.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorEllipsoid_hpp__pyplusplus_wrapper
+#define FormFactorEllipsoid_hpp__pyplusplus_wrapper
+
+void register_FormFactorEllipsoid_class();
+
+#endif//FormFactorEllipsoid_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorFullSphere.pypp.h b/Core/PythonAPI/inc/FormFactorFullSphere.pypp.h
index 7cbdde5660312acff4f931fcf36b74b5ba2c5280..a7d6fa7df1b6d3aeec6061ac3e68da9af9e7184d 100644
--- a/Core/PythonAPI/inc/FormFactorFullSphere.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorFullSphere.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorFullSphere_hpp__pyplusplus_wrapper
 #define FormFactorFullSphere_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorFullSpheroid.pypp.h b/Core/PythonAPI/inc/FormFactorFullSpheroid.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..9d8c721c4374cb6dc7f32480fa9109b6560700ef
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorFullSpheroid.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorFullSpheroid_hpp__pyplusplus_wrapper
+#define FormFactorFullSpheroid_hpp__pyplusplus_wrapper
+
+void register_FormFactorFullSpheroid_class();
+
+#endif//FormFactorFullSpheroid_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorGauss.pypp.h b/Core/PythonAPI/inc/FormFactorGauss.pypp.h
index 25d007c2a7111e62d4086ec569d5edd6b522d0a9..81ae9e2a015ab177c16879d80e5d4cf150ce81a3 100644
--- a/Core/PythonAPI/inc/FormFactorGauss.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorGauss.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorGauss_hpp__pyplusplus_wrapper
 #define FormFactorGauss_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorHemiSpheroid.pypp.h b/Core/PythonAPI/inc/FormFactorHemiSpheroid.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..89657061d32a413409d1555c230646908b3a1de9
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorHemiSpheroid.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorHemiSpheroid_hpp__pyplusplus_wrapper
+#define FormFactorHemiSpheroid_hpp__pyplusplus_wrapper
+
+void register_FormFactorHemiSpheroid_class();
+
+#endif//FormFactorHemiSpheroid_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorLorentz.pypp.h b/Core/PythonAPI/inc/FormFactorLorentz.pypp.h
index 0d41660bd594b80cd2bf1e652daccb5065b8b2cf..1531566b4535a993f5b8ffdaff3f5651435dd26a 100644
--- a/Core/PythonAPI/inc/FormFactorLorentz.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorLorentz.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorLorentz_hpp__pyplusplus_wrapper
 #define FormFactorLorentz_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorParallelepiped.pypp.h b/Core/PythonAPI/inc/FormFactorParallelepiped.pypp.h
index dccf1fa20a5c5230b0b914f595a68d93b27c72d9..f6a7e48c69c6b5c33d26712d447127fa80437ca0 100644
--- a/Core/PythonAPI/inc/FormFactorParallelepiped.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorParallelepiped.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorParallelepiped_hpp__pyplusplus_wrapper
 #define FormFactorParallelepiped_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorPrism3.pypp.h b/Core/PythonAPI/inc/FormFactorPrism3.pypp.h
index ff9e38118582b61912329b7c50e4018b4c862019..091d27e9b6ebe0919a171b3dc3811299511d2203 100644
--- a/Core/PythonAPI/inc/FormFactorPrism3.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorPrism3.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorPrism3_hpp__pyplusplus_wrapper
 #define FormFactorPrism3_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorPrism6.pypp.h b/Core/PythonAPI/inc/FormFactorPrism6.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..94dbe8bae7727a7c01aa2ff2dba1f2604e2769be
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorPrism6.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorPrism6_hpp__pyplusplus_wrapper
+#define FormFactorPrism6_hpp__pyplusplus_wrapper
+
+void register_FormFactorPrism6_class();
+
+#endif//FormFactorPrism6_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorPyramid.pypp.h b/Core/PythonAPI/inc/FormFactorPyramid.pypp.h
index e88f4a39abb35cc2a0e7134eb9bbcbf52fe1be9f..64a6adfc4b7b76811d88dd3e9a00e6d7fae24452 100644
--- a/Core/PythonAPI/inc/FormFactorPyramid.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorPyramid.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorPyramid_hpp__pyplusplus_wrapper
 #define FormFactorPyramid_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/FormFactorSphere.pypp.h b/Core/PythonAPI/inc/FormFactorSphere.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..533ccb91fd521e8cd1b1d6b20915482ef9ed13c1
--- /dev/null
+++ b/Core/PythonAPI/inc/FormFactorSphere.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef FormFactorSphere_hpp__pyplusplus_wrapper
+#define FormFactorSphere_hpp__pyplusplus_wrapper
+
+void register_FormFactorSphere_class();
+
+#endif//FormFactorSphere_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h b/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h
index 09d5cefc4c1da70694cec92d0f6643a4c22f9a67..63a9fffacb374e08d5ee623df0c9edc9a496448e 100644
--- a/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h
+++ b/Core/PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FormFactorSphereGaussianRadius_hpp__pyplusplus_wrapper
 #define FormFactorSphereGaussianRadius_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/HomogeneousMaterial.pypp.h b/Core/PythonAPI/inc/HomogeneousMaterial.pypp.h
index 1f5efcb3acbbaea452aea2f5cfefa659945f4445..44e3777274485af539232ae701a086e6f38d2cd8 100644
--- a/Core/PythonAPI/inc/HomogeneousMaterial.pypp.h
+++ b/Core/PythonAPI/inc/HomogeneousMaterial.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef HomogeneousMaterial_hpp__pyplusplus_wrapper
 #define HomogeneousMaterial_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IAxis.pypp.h b/Core/PythonAPI/inc/IAxis.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..1fd6195512c5622fef0750559502f0d1682f9a9f
--- /dev/null
+++ b/Core/PythonAPI/inc/IAxis.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef IAxis_hpp__pyplusplus_wrapper
+#define IAxis_hpp__pyplusplus_wrapper
+
+void register_IAxis_class();
+
+#endif//IAxis_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/ICloneable.pypp.h b/Core/PythonAPI/inc/ICloneable.pypp.h
index 0d8af5830ffae000b94fdb45a86ac56fe9d8c213..dce283c94bdffab6229383baea32062b4d98f700 100644
--- a/Core/PythonAPI/inc/ICloneable.pypp.h
+++ b/Core/PythonAPI/inc/ICloneable.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ICloneable_hpp__pyplusplus_wrapper
 #define ICloneable_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IClusteredParticles.pypp.h b/Core/PythonAPI/inc/IClusteredParticles.pypp.h
index 74ecb1f27a5b6ff50d32c4fb3f7d073a190eeb87..ec3431ff23fdc9b3be9f89e4e9df42f88a919e5a 100644
--- a/Core/PythonAPI/inc/IClusteredParticles.pypp.h
+++ b/Core/PythonAPI/inc/IClusteredParticles.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IClusteredParticles_hpp__pyplusplus_wrapper
 #define IClusteredParticles_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ICompositeSample.pypp.h b/Core/PythonAPI/inc/ICompositeSample.pypp.h
index a3f0b6e669d724163f004f8a59db347f40ac7657..f581de2b6356865dabd22c40a7522cc856260cae 100644
--- a/Core/PythonAPI/inc/ICompositeSample.pypp.h
+++ b/Core/PythonAPI/inc/ICompositeSample.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ICompositeSample_hpp__pyplusplus_wrapper
 #define ICompositeSample_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IDecoration.pypp.h b/Core/PythonAPI/inc/IDecoration.pypp.h
index 833c9f470bd6389ad9eb270e135ee3f5a7ac0dad..b4d05431213d7bb1870aef99f2ed8eb2711ae899 100644
--- a/Core/PythonAPI/inc/IDecoration.pypp.h
+++ b/Core/PythonAPI/inc/IDecoration.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IDecoration_hpp__pyplusplus_wrapper
 #define IDecoration_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IDetectorResolution.pypp.h b/Core/PythonAPI/inc/IDetectorResolution.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..71b95267b10b6134acf253ae96fafcc104dc1f4b
--- /dev/null
+++ b/Core/PythonAPI/inc/IDetectorResolution.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef IDetectorResolution_hpp__pyplusplus_wrapper
+#define IDetectorResolution_hpp__pyplusplus_wrapper
+
+void register_IDetectorResolution_class();
+
+#endif//IDetectorResolution_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/IFTDistribution1D.pypp.h b/Core/PythonAPI/inc/IFTDistribution1D.pypp.h
deleted file mode 100644
index e7f75d2e51dcaeb69132d5ab2f29d4d95c4e133d..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/IFTDistribution1D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef IFTDistribution1D_hpp__pyplusplus_wrapper
-#define IFTDistribution1D_hpp__pyplusplus_wrapper
-
-void register_IFTDistribution1D_class();
-
-#endif//IFTDistribution1D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/IFTDistribution2D.pypp.h b/Core/PythonAPI/inc/IFTDistribution2D.pypp.h
index 289bff6fe13fd0a5ba4cb50b1ffeb5e177b894c3..bbe282ece6e357465654a9fb7348a70444dcc59c 100644
--- a/Core/PythonAPI/inc/IFTDistribution2D.pypp.h
+++ b/Core/PythonAPI/inc/IFTDistribution2D.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IFTDistribution2D_hpp__pyplusplus_wrapper
 #define IFTDistribution2D_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IFormFactor.pypp.h b/Core/PythonAPI/inc/IFormFactor.pypp.h
index 9ecb6e7b6f736937e48e8aab56938b2c57773213..06dc3529fc88abdc1c42bb5f00d316455c7162d8 100644
--- a/Core/PythonAPI/inc/IFormFactor.pypp.h
+++ b/Core/PythonAPI/inc/IFormFactor.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IFormFactor_hpp__pyplusplus_wrapper
 #define IFormFactor_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IFormFactorBorn.pypp.h b/Core/PythonAPI/inc/IFormFactorBorn.pypp.h
index 39b2c8218a993df7505577abdcd35f076d1961d4..84134b36442de426b67ad75abb8fe5efdf77c9b6 100644
--- a/Core/PythonAPI/inc/IFormFactorBorn.pypp.h
+++ b/Core/PythonAPI/inc/IFormFactorBorn.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IFormFactorBorn_hpp__pyplusplus_wrapper
 #define IFormFactorBorn_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h b/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h
index 4eaf35f1b4d396cf35c731b0be3461a61d94289d..5d1324ce162813beab4c3bdbe686d6b16826e06a 100644
--- a/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h
+++ b/Core/PythonAPI/inc/IFormFactorDecorator.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IFormFactorDecorator_hpp__pyplusplus_wrapper
 #define IFormFactorDecorator_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IInterferenceFunction.pypp.h b/Core/PythonAPI/inc/IInterferenceFunction.pypp.h
index b342412d819a8a9ae1d01e1e5091f3a12afeb68a..5fd4efcab10cb55d7f96f80418a68a0dae021d47 100644
--- a/Core/PythonAPI/inc/IInterferenceFunction.pypp.h
+++ b/Core/PythonAPI/inc/IInterferenceFunction.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IInterferenceFunction_hpp__pyplusplus_wrapper
 #define IInterferenceFunction_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IMaterial.pypp.h b/Core/PythonAPI/inc/IMaterial.pypp.h
index 67ec93159c4039ad46d54f4b05fbd84a578a418f..cdb168d4cd2fbdb0dd9b8b30c6810cab1383d895 100644
--- a/Core/PythonAPI/inc/IMaterial.pypp.h
+++ b/Core/PythonAPI/inc/IMaterial.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IMaterial_hpp__pyplusplus_wrapper
 #define IMaterial_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IParameterized.pypp.h b/Core/PythonAPI/inc/IParameterized.pypp.h
index 9611a2f2737bcffb7d8509ac422e33fe99dab1be..8c770871bc310170bb69b7d449aac1f5e72013ae 100644
--- a/Core/PythonAPI/inc/IParameterized.pypp.h
+++ b/Core/PythonAPI/inc/IParameterized.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IParameterized_hpp__pyplusplus_wrapper
 #define IParameterized_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/IResolutionFunction2D.pypp.h b/Core/PythonAPI/inc/IResolutionFunction2D.pypp.h
index b87be731d2fe2cbb58c013eeea180ba8f5706b3f..a0a593e142dee3f50fb6e53fd17606de46d1b72b 100644
--- a/Core/PythonAPI/inc/IResolutionFunction2D.pypp.h
+++ b/Core/PythonAPI/inc/IResolutionFunction2D.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IResolutionFunction2D_hpp__pyplusplus_wrapper
 #define IResolutionFunction2D_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ISample.pypp.h b/Core/PythonAPI/inc/ISample.pypp.h
index 7aa0216be7781636c0f335866d97114553cb2079..9cf955bf327acd07942fde017cc39af7cd40288e 100644
--- a/Core/PythonAPI/inc/ISample.pypp.h
+++ b/Core/PythonAPI/inc/ISample.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ISample_hpp__pyplusplus_wrapper
 #define ISample_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ISampleBuilder.pypp.h b/Core/PythonAPI/inc/ISampleBuilder.pypp.h
index 59d273865967d04226c9fcaae0d40903ee336eaf..7a4d3d64f3aef8deba3c78f24d574a8f4854a56b 100644
--- a/Core/PythonAPI/inc/ISampleBuilder.pypp.h
+++ b/Core/PythonAPI/inc/ISampleBuilder.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ISampleBuilder_hpp__pyplusplus_wrapper
 #define ISampleBuilder_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ISelectionRule.pypp.h b/Core/PythonAPI/inc/ISelectionRule.pypp.h
index a0b14e42b96a7aa05adbf014c9c96011e2257ba1..f3e1af57bad83ab1c5bf10dc813e37f7fda0e464 100644
--- a/Core/PythonAPI/inc/ISelectionRule.pypp.h
+++ b/Core/PythonAPI/inc/ISelectionRule.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ISelectionRule_hpp__pyplusplus_wrapper
 #define ISelectionRule_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ISimulation.pypp.h b/Core/PythonAPI/inc/ISimulation.pypp.h
deleted file mode 100644
index 75ad5e93e8fd7d0f50cd5b978064c5f59a582234..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/ISimulation.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef ISimulation_hpp__pyplusplus_wrapper
-#define ISimulation_hpp__pyplusplus_wrapper
-
-void register_ISimulation_class();
-
-#endif//ISimulation_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/IStochasticParameter.pypp.h b/Core/PythonAPI/inc/IStochasticParameter.pypp.h
deleted file mode 100644
index fc8a8d745547028c95b5828507ac06e8d37fb85f..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/IStochasticParameter.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef IStochasticParameter_hpp__pyplusplus_wrapper
-#define IStochasticParameter_hpp__pyplusplus_wrapper
-
-void register_IStochasticParameter_class();
-
-#endif//IStochasticParameter_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/ITransform3D.pypp.h b/Core/PythonAPI/inc/ITransform3D.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7def731f5ab4654072c30bed730bf25030c9baf
--- /dev/null
+++ b/Core/PythonAPI/inc/ITransform3D.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef ITransform3D_hpp__pyplusplus_wrapper
+#define ITransform3D_hpp__pyplusplus_wrapper
+
+void register_ITransform3D_class();
+
+#endif//ITransform3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/IndexVector3D.pypp.h b/Core/PythonAPI/inc/IndexVector3D.pypp.h
deleted file mode 100644
index 46800856e6b72c22a372fab9b556a98241fdd7b2..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/IndexVector3D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef IndexVector3D_hpp__pyplusplus_wrapper
-#define IndexVector3D_hpp__pyplusplus_wrapper
-
-void register_IndexVector3D_class();
-
-#endif//IndexVector3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/Instrument.pypp.h b/Core/PythonAPI/inc/Instrument.pypp.h
index 429287742013d5cd0cab049fbc665123e7e00847..a79d5125799eac6a06b246e0d821e139068a2d5d 100644
--- a/Core/PythonAPI/inc/Instrument.pypp.h
+++ b/Core/PythonAPI/inc/Instrument.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Instrument_hpp__pyplusplus_wrapper
 #define Instrument_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/InterferenceFunction1DParaCrystal.pypp.h b/Core/PythonAPI/inc/InterferenceFunction1DParaCrystal.pypp.h
index e740d8877824b2bdee413be7fa1bf01d46a763d0..94ca0793063e573728415cc9bbf25d8e4a10d0c6 100644
--- a/Core/PythonAPI/inc/InterferenceFunction1DParaCrystal.pypp.h
+++ b/Core/PythonAPI/inc/InterferenceFunction1DParaCrystal.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef InterferenceFunction1DParaCrystal_hpp__pyplusplus_wrapper
 #define InterferenceFunction1DParaCrystal_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/InterferenceFunction2DLattice.pypp.h b/Core/PythonAPI/inc/InterferenceFunction2DLattice.pypp.h
index dca4fea5d7746fd374591ab64a408e39e73a65f5..4ecf1a72f9b4d1950fe45a1d698320fa06c1839c 100644
--- a/Core/PythonAPI/inc/InterferenceFunction2DLattice.pypp.h
+++ b/Core/PythonAPI/inc/InterferenceFunction2DLattice.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef InterferenceFunction2DLattice_hpp__pyplusplus_wrapper
 #define InterferenceFunction2DLattice_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/InterferenceFunction2DParaCrystal.pypp.h b/Core/PythonAPI/inc/InterferenceFunction2DParaCrystal.pypp.h
index 599d61f1655d64dddc89669246f28a08a07fe847..0b91ed9e3c3040a0ecb2a8c0b20130d282c44e0b 100644
--- a/Core/PythonAPI/inc/InterferenceFunction2DParaCrystal.pypp.h
+++ b/Core/PythonAPI/inc/InterferenceFunction2DParaCrystal.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef InterferenceFunction2DParaCrystal_hpp__pyplusplus_wrapper
 #define InterferenceFunction2DParaCrystal_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/InterferenceFunctionNone.pypp.h b/Core/PythonAPI/inc/InterferenceFunctionNone.pypp.h
index 136a98e0ad779398a69105807542db8e0edb4fd9..11002cdb59ec2f16bee664624d4e3b52ba1770f0 100644
--- a/Core/PythonAPI/inc/InterferenceFunctionNone.pypp.h
+++ b/Core/PythonAPI/inc/InterferenceFunctionNone.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef InterferenceFunctionNone_hpp__pyplusplus_wrapper
 #define InterferenceFunctionNone_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Lattice.pypp.h b/Core/PythonAPI/inc/Lattice.pypp.h
index 1ac07fb310c592e5906fe2ceb696e7c7e00f5249..5a10b4cb4eeae5aa4684598bfb055a271a7d1aa7 100644
--- a/Core/PythonAPI/inc/Lattice.pypp.h
+++ b/Core/PythonAPI/inc/Lattice.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Lattice_hpp__pyplusplus_wrapper
 #define Lattice_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Lattice2DIFParameters.pypp.h b/Core/PythonAPI/inc/Lattice2DIFParameters.pypp.h
index 5b7c2effbfbd394864b0067414fc79e94893764b..de61da97bf522bb249838eb02e809ae9a73e54f1 100644
--- a/Core/PythonAPI/inc/Lattice2DIFParameters.pypp.h
+++ b/Core/PythonAPI/inc/Lattice2DIFParameters.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Lattice2DIFParameters_hpp__pyplusplus_wrapper
 #define Lattice2DIFParameters_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/LatticeBasis.pypp.h b/Core/PythonAPI/inc/LatticeBasis.pypp.h
index 780f8b4ba20a159eee8f338efaab36afdf2c9e88..9629b6c578a8441045770f17d2e10c4dc3d9f69a 100644
--- a/Core/PythonAPI/inc/LatticeBasis.pypp.h
+++ b/Core/PythonAPI/inc/LatticeBasis.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef LatticeBasis_hpp__pyplusplus_wrapper
 #define LatticeBasis_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Layer.pypp.h b/Core/PythonAPI/inc/Layer.pypp.h
index 4ebe659149ead9d9537455e7af4748a34e832d15..1b5b87a16c37d866d4727ab9f77d20a7deb893af 100644
--- a/Core/PythonAPI/inc/Layer.pypp.h
+++ b/Core/PythonAPI/inc/Layer.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Layer_hpp__pyplusplus_wrapper
 #define Layer_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/LayerDWBASimulation.pypp.h b/Core/PythonAPI/inc/LayerDWBASimulation.pypp.h
deleted file mode 100644
index cf1ee657300ebbcd36cd891db4bd2f8fc77f3259..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/LayerDWBASimulation.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef LayerDWBASimulation_hpp__pyplusplus_wrapper
-#define LayerDWBASimulation_hpp__pyplusplus_wrapper
-
-void register_LayerDWBASimulation_class();
-
-#endif//LayerDWBASimulation_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/LayerDecorator.pypp.h b/Core/PythonAPI/inc/LayerDecorator.pypp.h
index 49d7cb7416b6d0c8a89fd103ba2beaa1f33ef9a3..823731d8796f8fe9fddf40db796fac2240b4a088 100644
--- a/Core/PythonAPI/inc/LayerDecorator.pypp.h
+++ b/Core/PythonAPI/inc/LayerDecorator.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef LayerDecorator_hpp__pyplusplus_wrapper
 #define LayerDecorator_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/LayerDecoratorDWBASimulation.pypp.h b/Core/PythonAPI/inc/LayerDecoratorDWBASimulation.pypp.h
deleted file mode 100644
index 11b8962ec1a76bbb2f23d48da000bc01367d7adb..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/LayerDecoratorDWBASimulation.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef LayerDecoratorDWBASimulation_hpp__pyplusplus_wrapper
-#define LayerDecoratorDWBASimulation_hpp__pyplusplus_wrapper
-
-void register_LayerDecoratorDWBASimulation_class();
-
-#endif//LayerDecoratorDWBASimulation_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/LayerInterface.pypp.h b/Core/PythonAPI/inc/LayerInterface.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..ffb42480bbf0f7b0fc5b2f40e964ce8c496c4cd6
--- /dev/null
+++ b/Core/PythonAPI/inc/LayerInterface.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef LayerInterface_hpp__pyplusplus_wrapper
+#define LayerInterface_hpp__pyplusplus_wrapper
+
+void register_LayerInterface_class();
+
+#endif//LayerInterface_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/LayerRoughness.pypp.h b/Core/PythonAPI/inc/LayerRoughness.pypp.h
index dea7f6828a8f5841ed4c9990240dd5aa9937e4d8..637a4eb8bab9571204f9792eb4c70d731e66c0b6 100644
--- a/Core/PythonAPI/inc/LayerRoughness.pypp.h
+++ b/Core/PythonAPI/inc/LayerRoughness.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef LayerRoughness_hpp__pyplusplus_wrapper
 #define LayerRoughness_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/MaterialManager.pypp.h b/Core/PythonAPI/inc/MaterialManager.pypp.h
index febcc2994e321722e91cd9d3005a76eccdc99277..174a6bb802c6f289334dded80295259201ce9270 100644
--- a/Core/PythonAPI/inc/MaterialManager.pypp.h
+++ b/Core/PythonAPI/inc/MaterialManager.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef MaterialManager_hpp__pyplusplus_wrapper
 #define MaterialManager_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/MaterialManagerSingleton_t.pypp.h b/Core/PythonAPI/inc/MaterialManagerSingleton_t.pypp.h
deleted file mode 100644
index 50562acf79d0f435bd669a6e1656029f22577a19..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/MaterialManagerSingleton_t.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef MaterialManagerSingleton_t_hpp__pyplusplus_wrapper
-#define MaterialManagerSingleton_t_hpp__pyplusplus_wrapper
-
-void register_MaterialManagerSingleton_t_class();
-
-#endif//MaterialManagerSingleton_t_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/MesoCrystal.pypp.h b/Core/PythonAPI/inc/MesoCrystal.pypp.h
index cb25e2019a70addbff6587a640061dd4c9b2f807..0feefbcd00189708cc9ac3348627ea712620a844 100644
--- a/Core/PythonAPI/inc/MesoCrystal.pypp.h
+++ b/Core/PythonAPI/inc/MesoCrystal.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef MesoCrystal_hpp__pyplusplus_wrapper
 #define MesoCrystal_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/MultiLayer.pypp.h b/Core/PythonAPI/inc/MultiLayer.pypp.h
index 871b9f32c95b993585a4a4d74993cd45e85e9221..b8d0db505400eedccf3cbf2d117ebe7855c8ed02 100644
--- a/Core/PythonAPI/inc/MultiLayer.pypp.h
+++ b/Core/PythonAPI/inc/MultiLayer.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef MultiLayer_hpp__pyplusplus_wrapper
 #define MultiLayer_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/MultiLayerDWBASimulation.pypp.h b/Core/PythonAPI/inc/MultiLayerDWBASimulation.pypp.h
deleted file mode 100644
index d7ceb0a5606c8ca5b0ceed7bd5a89fc908ff9678..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/MultiLayerDWBASimulation.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef MultiLayerDWBASimulation_hpp__pyplusplus_wrapper
-#define MultiLayerDWBASimulation_hpp__pyplusplus_wrapper
-
-void register_MultiLayerDWBASimulation_class();
-
-#endif//MultiLayerDWBASimulation_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/OpticalFresnel.pypp.h b/Core/PythonAPI/inc/OpticalFresnel.pypp.h
deleted file mode 100644
index 3eca3f639d2f2831f0e7b99573765450ebfc551a..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/OpticalFresnel.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef OpticalFresnel_hpp__pyplusplus_wrapper
-#define OpticalFresnel_hpp__pyplusplus_wrapper
-
-void register_OpticalFresnel_class();
-
-#endif//OpticalFresnel_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/OutputDataIOFactory.pypp.h b/Core/PythonAPI/inc/OutputDataIOFactory.pypp.h
index 2f12f905023e48a0c544a9e7a4610ac2d6064665..3a47c6365525b8c17542f89402dde77d5b7fe85d 100644
--- a/Core/PythonAPI/inc/OutputDataIOFactory.pypp.h
+++ b/Core/PythonAPI/inc/OutputDataIOFactory.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef OutputDataIOFactory_hpp__pyplusplus_wrapper
 #define OutputDataIOFactory_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ParameterPool.pypp.h b/Core/PythonAPI/inc/ParameterPool.pypp.h
index e4e84a72ab32f93bdae52ddc289648c9d34dc4a1..269938b02250b78aa78682664a379ab0c26913c2 100644
--- a/Core/PythonAPI/inc/ParameterPool.pypp.h
+++ b/Core/PythonAPI/inc/ParameterPool.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ParameterPool_hpp__pyplusplus_wrapper
 #define ParameterPool_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Particle.pypp.h b/Core/PythonAPI/inc/Particle.pypp.h
index 08967364f15fe2823cae1cb181c4aa549bca97bb..de400a3bce235deaffbc84fe9f6940cddc69191f 100644
--- a/Core/PythonAPI/inc/Particle.pypp.h
+++ b/Core/PythonAPI/inc/Particle.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Particle_hpp__pyplusplus_wrapper
 #define Particle_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ParticleBuilder.pypp.h b/Core/PythonAPI/inc/ParticleBuilder.pypp.h
index c4d9df48a64956e0291dba286d6a77ec2d908548..e5205be0bf102049765a4597682c2f3308f84394 100644
--- a/Core/PythonAPI/inc/ParticleBuilder.pypp.h
+++ b/Core/PythonAPI/inc/ParticleBuilder.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ParticleBuilder_hpp__pyplusplus_wrapper
 #define ParticleBuilder_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ParticleCoreShell.pypp.h b/Core/PythonAPI/inc/ParticleCoreShell.pypp.h
index e100d77cef5b82fbcc0321cb00364e17e48fe08f..e10dde2e34e0375f793206c61b04dffcc13c6f20 100644
--- a/Core/PythonAPI/inc/ParticleCoreShell.pypp.h
+++ b/Core/PythonAPI/inc/ParticleCoreShell.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ParticleCoreShell_hpp__pyplusplus_wrapper
 #define ParticleCoreShell_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ParticleDecoration.pypp.h b/Core/PythonAPI/inc/ParticleDecoration.pypp.h
index 4563ed090bebe389fb8df02f08186454eb9b432f..fee65af279132deb585765dac42c42583d471f7e 100644
--- a/Core/PythonAPI/inc/ParticleDecoration.pypp.h
+++ b/Core/PythonAPI/inc/ParticleDecoration.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ParticleDecoration_hpp__pyplusplus_wrapper
 #define ParticleDecoration_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ParticleInfo.pypp.h b/Core/PythonAPI/inc/ParticleInfo.pypp.h
index 81e85e32584ee6c7358bc2f488c8865fcddabb84..87222a04491091000b90b0d75746a08fe60e90ee 100644
--- a/Core/PythonAPI/inc/ParticleInfo.pypp.h
+++ b/Core/PythonAPI/inc/ParticleInfo.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ParticleInfo_hpp__pyplusplus_wrapper
 #define ParticleInfo_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/PositionParticleInfo.pypp.h b/Core/PythonAPI/inc/PositionParticleInfo.pypp.h
index 0a0448a335fe92bf2a3a93df24364d44e9a4f750..1635749fcbac051dd148f122cd2180612be99308 100644
--- a/Core/PythonAPI/inc/PositionParticleInfo.pypp.h
+++ b/Core/PythonAPI/inc/PositionParticleInfo.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef PositionParticleInfo_hpp__pyplusplus_wrapper
 #define PositionParticleInfo_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/PythonCoreExposer.h b/Core/PythonAPI/inc/PythonCoreExposer.h
new file mode 100644
index 0000000000000000000000000000000000000000..87295abebf9039d792d44618f3904d638f621226
--- /dev/null
+++ b/Core/PythonAPI/inc/PythonCoreExposer.h
@@ -0,0 +1,67 @@
+// ************************************************************************** //
+//
+//  BornAgain: simulate and fit scattering at grazing incidence
+//
+//! @file      PythonAPI/inc/PythonCoreExposer.h
+//! @brief     Helpers for automatic PythonAPI generation
+//!
+//! @homepage  http://apps.jcns.fz-juelich.de/BornAgain
+//! @license   GNU General Public License v3 or higher (see COPYING)
+//! @copyright Forschungszentrum Jülich GmbH 2013
+//! @authors   Scientific Computing Group at MLZ Garching
+//! @authors   C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke
+//
+// ************************************************************************** //
+
+#ifndef PYTHONCOREEXPOSER_H
+#define PYTHONCOREEXPOSER_H
+
+#include "Types.h"
+#include "BasicVector3D.h"
+#include "DiffuseParticleInfo.h"
+#include "IFormFactor.h"
+#include "MaterialManager.h"
+#include "IStochasticParameter.h"
+#include "OutputData.h"
+
+//! this is special namespace to help Py++ generate correct names
+namespace pyplusplus {
+    namespace aliases {
+        using namespace Geometry;
+        //typedef Geometry::BasicVector3D<double > kvector_t;
+        typedef BasicVector3D<double > kvector_t;
+        typedef std::vector<kvector_t > vector_kvector_t;
+        typedef BasicVector3D<std::complex<double> > cvector_t;
+        typedef std::vector<cvector_t > vector_cvector_t;
+        typedef std::vector<DiffuseParticleInfo *> vector_DiffuseParticleInfoPtr_t;
+        typedef std::vector<IFormFactor *> vector_IFormFactorPtr_t;
+        typedef ISingleton<MaterialManager> MaterialManagerSingleton_t;
+        typedef StochasticParameter<double> StochasticParameter_t;
+        typedef OutputData<double > ndimdata_t;
+        typedef std::vector<int > vector_integer_t;
+        typedef std::vector<unsigned long int > vector_longinteger_t;
+    }
+}
+
+//! helper function to set value via subscript operator from python
+template <class Self, class Key, class Value>
+void pyplusplus_setitem(Self& self, Key const& key, Value const& value)
+{
+    self[key] = value;
+}
+
+//! functions to help Py++ with template instantiation
+namespace pyplusplus {
+    inline size_t pyplusplus_boost_kvector() { return sizeof(pyplusplus::aliases::kvector_t); }
+    inline size_t pyplusplus_boost_vectorof_kvector() { return sizeof(pyplusplus::aliases::vector_kvector_t); }
+    inline size_t pyplusplus_boost_cvector() { return sizeof(pyplusplus::aliases::cvector_t); }
+    inline size_t pyplusplus_boost_vectorof_cvector() { return sizeof(pyplusplus::aliases::vector_cvector_t); }
+    inline size_t pyplusplus_boost_vectorof_DiffuseParticleInfoPtr() { return sizeof(pyplusplus::aliases::vector_DiffuseParticleInfoPtr_t); }
+    inline size_t pyplusplus_boost_stochastic_parameter() { return sizeof(pyplusplus::aliases::StochasticParameter_t); }
+    inline size_t pyplusplus_boost_vector_integer() { return sizeof(pyplusplus::aliases::vector_integer_t); }
+    inline size_t pyplusplus_boost_vector_longinteger() { return sizeof(pyplusplus::aliases::vector_longinteger_t); }
+}
+
+#endif // PYTHONCOREEXPOSER_H
+
+
diff --git a/Core/PythonAPI/src/RotateZ3D.pypp.cpp b/Core/PythonAPI/inc/PythonCoreList.h
similarity index 77%
rename from Core/PythonAPI/src/RotateZ3D.pypp.cpp
rename to Core/PythonAPI/inc/PythonCoreList.h
index 86ee2daca3b94be66d2700481f1dac4976373ebd..db28eea6eaee11b9e628159c0d5e72c550efdbcd 100644
--- a/Core/PythonAPI/src/RotateZ3D.pypp.cpp
+++ b/Core/PythonAPI/inc/PythonCoreList.h
@@ -1,27 +1,29 @@
-// This file has been generated by Py++.
+#ifndef PYTHONCORELIST_H
+#define PYTHONCORELIST_H
+
+//! list of files to process with Py++
 
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
 #include "BasicVector3D.h"
 #include "Bin.h"
 #include "Crystal.h"
 #include "DiffuseParticleInfo.h"
 #include "FTDistributions.h"
 #include "FormFactorBox.h"
+#include "FormFactorCone.h"
 #include "FormFactorCrystal.h"
 #include "FormFactorCylinder.h"
 #include "FormFactorDecoratorDebyeWaller.h"
+#include "FormFactorEllipsoid.h"
 #include "FormFactorFullSphere.h"
+#include "FormFactorFullSpheroid.h"
 #include "FormFactorGauss.h"
+#include "FormFactorHemiSpheroid.h"
 #include "FormFactorLorentz.h"
 #include "FormFactorParallelepiped.h"
 #include "FormFactorPrism3.h"
+#include "FormFactorPrism6.h"
 #include "FormFactorPyramid.h"
+#include "FormFactorSphere.h"
 #include "FormFactorSphereGaussianRadius.h"
 #include "HomogeneousMaterial.h"
 #include "ICloneable.h"
@@ -34,56 +36,53 @@ GCC_DIAG_ON(missing-field-initializers);
 #include "IInterferenceFunction.h"
 #include "IMaterial.h"
 #include "IParameterized.h"
+#include "IResolutionFunction2D.h"
 #include "ISample.h"
 #include "ISampleBuilder.h"
 #include "ISelectionRule.h"
 #include "ISingleton.h"
+#include "IStochasticParameter.h"
+#include "ITransform3D.h"
 #include "Instrument.h"
 #include "InterferenceFunction1DParaCrystal.h"
 #include "InterferenceFunction2DLattice.h"
 #include "InterferenceFunction2DParaCrystal.h"
 #include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
 #include "Lattice.h"
 #include "Lattice2DIFParameters.h"
+#include "Lattice2DIFParameters.h"
 #include "LatticeBasis.h"
 #include "Layer.h"
 #include "LayerDecorator.h"
 #include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
+#include "MathFunctions.h"
 #include "MaterialManager.h"
 #include "MesoCrystal.h"
 #include "MultiLayer.h"
 #include "OpticalFresnel.h"
+#include "OutputData.h"
+#include "OutputDataIOFactory.h"
 #include "ParameterPool.h"
 #include "Particle.h"
 #include "ParticleBuilder.h"
 #include "ParticleCoreShell.h"
 #include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
 #include "ParticleInfo.h"
 #include "PositionParticleInfo.h"
 #include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
 #include "RealParameterWrapper.h"
+#include "ResolutionFunction2DSimple.h"
+#include "Rotate3D.h"
 #include "Simulation.h"
 #include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
+#include "StochasticDoubleGate.h"
 #include "StochasticGaussian.h"
 #include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
 #include "Types.h"
 #include "Units.h"
-#include "RotateZ3D.pypp.h"
-
-namespace bp = boost::python;
 
-void register_RotateZ3D_class(){
+//! file containig additional exposers
+#include "PythonCoreExposer.h"
 
-    bp::class_< Geometry::RotateZ3D, bp::bases< Geometry::Rotate3D > >( "RotateZ3D", bp::init< >() )    
-        .def( bp::init< double >(( bp::arg("a") )) );
 
-}
+#endif // PYTHONCORELIST_H
diff --git a/Core/PythonAPI/inc/PythonInterface_free_functions.pypp.h b/Core/PythonAPI/inc/PythonInterface_free_functions.pypp.h
index 0600a558b716e773e0d47ed4785fe07b4c005951..9abbf00785cd13e2ebc98e2299ede0442596e51e 100644
--- a/Core/PythonAPI/inc/PythonInterface_free_functions.pypp.h
+++ b/Core/PythonAPI/inc/PythonInterface_free_functions.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef PythonInterface_free_functions_hpp__pyplusplus_wrapper
 #define PythonInterface_free_functions_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/PythonInterface_global_variables.pypp.h b/Core/PythonAPI/inc/PythonInterface_global_variables.pypp.h
index f58b4fac620b83d011f47ddfa70f4e37d5ff1d54..940efc820a57e47dec272870b957e5b1681720f9 100644
--- a/Core/PythonAPI/inc/PythonInterface_global_variables.pypp.h
+++ b/Core/PythonAPI/inc/PythonInterface_global_variables.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef PythonInterface_global_variables_hpp__pyplusplus_wrapper
 #define PythonInterface_global_variables_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/PythonPlusplusHelper.h b/Core/PythonAPI/inc/PythonPlusplusHelper.h
deleted file mode 100644
index b7c7d8db5707e88eefd89a473be20a10646cfd2a..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/PythonPlusplusHelper.h
+++ /dev/null
@@ -1,156 +0,0 @@
-// ************************************************************************** //
-//
-//  BornAgain: simulate and fit scattering at grazing incidence
-//
-//! @file      PythonAPI/inc/PythonPlusplusHelper.h
-//! @brief     Defines class PythonPlusplusHelper, and namespace pypluslus::aliases.
-//!
-//! @homepage  http://apps.jcns.fz-juelich.de/BornAgain
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2013
-//! @authors   Scientific Computing Group at MLZ Garching
-//! @authors   C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke
-//
-// ************************************************************************** //
-
-#ifndef PYTHONPLUSPLUSHELPER_H
-#define PYTHONPLUSPLUSHELPER_H
-
-#include "Types.h"
-#include "BasicVector3D.h"
-#include "DiffuseParticleInfo.h"
-#include "IFormFactor.h"
-#include "MaterialManager.h"
-#include "IStochasticParameter.h"
-#include "OutputData.h"
-
-
-//! this is special namespace to help Py++ generate correct names
-namespace pyplusplus {
-    namespace aliases {
-        using namespace Geometry;
-        //typedef Geometry::BasicVector3D<double > kvector_t;
-        typedef BasicVector3D<double > kvector_t;
-        typedef std::vector<kvector_t > vector_kvector_t;
-        typedef BasicVector3D<std::complex<double> > cvector_t;
-        typedef std::vector<cvector_t > vector_cvector_t;
-        typedef std::vector<DiffuseParticleInfo *> vector_DiffuseParticleInfoPtr_t;
-        typedef std::vector<IFormFactor *> vector_IFormFactorPtr_t;
-        typedef ISingleton<MaterialManager> MaterialManagerSingleton_t;
-        typedef StochasticParameter<double> StochasticParameter_t;
-        typedef OutputData<double > ndimdata_t;
-        typedef std::vector<int > vector_integer_t;
-        typedef std::vector<unsigned long int > vector_longinteger_t;
-        static const kvector_t dummy1 = 2.0*kvector_t(0,0,0);
-        static const kvector_t dummy2 = kvector_t(0,0,0)*2.0;
-        static const kvector_t dumm32 = kvector_t(0,0,0)/2.0;
-    }
-}
-
-//! helper class to provide Py++ with explicit template instantiations
-
-class PythonPlusplusHelper
-{
- public:
-//    size_t pyplusplus_boost_kvector() { return sizeof(kvector_t); }
-    size_t pyplusplus_boost_kvector() { return sizeof(pyplusplus::aliases::kvector_t); }
-    size_t pyplusplus_boost_vectorof_kvector() { return sizeof(pyplusplus::aliases::vector_kvector_t); }
-    size_t pyplusplus_boost_cvector() { return sizeof(pyplusplus::aliases::cvector_t); }
-    size_t pyplusplus_boost_vectorof_cvector() { return sizeof(pyplusplus::aliases::vector_cvector_t); }
-    size_t pyplusplus_boost_vectorof_DiffuseParticleInfoPtr() { return sizeof(pyplusplus::aliases::vector_DiffuseParticleInfoPtr_t); }
-    size_t pyplusplus_boost_stochastic_parameter() { return sizeof(pyplusplus::aliases::StochasticParameter_t); }
-    size_t pyplusplus_boost_outputdata() { return sizeof(pyplusplus::aliases::ndimdata_t); }
-    //size_t pyplusplus_boost_kvector2() { return sizeof(pyplusplus::aliases::kvector_t); }
-};
-
-//! helper function to set value via subscript operator from python
-template <class Self, class Key, class Value>
-void pyplusplus_setitem(Self& self, Key const& key, Value const& value)
-{
-    self[key] = value;
-}
-
-
-namespace pyplusplus {
-
-//  inline Geometry::BasicVector3D<double>
-//  operator+(const Geometry::BasicVector3D<double> & v) { return v; }
-
-////  inline Geometry::BasicVector3D<double>
-////  operator+(const Geometry::BasicVector3D<double> & a,const BasicVector3D<double> & b) {
-////    return BasicVector3D<double>(a.x()+b.x(), a.y()+b.y(), a.z()+b.z());
-////  }
-
-//  inline Geometry::BasicVector3D<double>
-//  operator-(const Geometry::BasicVector3D<double> & v) {
-//    return Geometry::BasicVector3D<double>(-v.x(), -v.y(), -v.z());
-//  }
-
-////    inline BasicVector3D<double>
-////    operator-(const BasicVector3D<double> & a,const BasicVector3D<double> & b) {
-////      return BasicVector3D<double>(a.x()-b.x(), a.y()-b.y(), a.z()-b.z());
-////    }
-
-//    inline Geometry::BasicVector3D<double>
-//    operator*(const Geometry::BasicVector3D<double> & v, double a) {
-//      return Geometry::BasicVector3D<double>(v.x()*a, v.y()*a, v.z()*a);
-//    }
-
-////    /**
-////     * Scalar product of two vectors.
-////     * @relates BasicVector3D
-////     */
-////    inline double
-////    operator*(const BasicVector3D<double> & a,const BasicVector3D<double> & b) {
-////      return a.dot(b);
-////    }
-
-//      inline Geometry::BasicVector3D<double>
-//      operator*(double a, const Geometry::BasicVector3D<double> & v) {
-//        return Geometry::BasicVector3D<double>(a*v.x(), a*v.y(), a*v.z());
-//      }
-
-//      inline Geometry::BasicVector3D<double>
-//      operator/(const Geometry::BasicVector3D<double> & v, double a) {
-//        return Geometry::BasicVector3D<double>(v.x()/a, v.y()/a, v.z()/a);
-//      }
-
-////      /**
-////       * Comparison of two vectors for equality.
-////       * @relates BasicVector3D
-////       */
-////      inline bool
-////      operator==(const BasicVector3D<double> & a, const BasicVector3D<double> & b)
-////      {
-////        return (a.x()==b.x() && a.y()==b.y() && a.z()==b.z());
-////      }
-
-////      /**
-////       * Comparison of two vectors for inequality.
-////       * @relates BasicVector3D
-////       */
-////      inline bool
-////      operator!=(const BasicVector3D<double> & a, const BasicVector3D<double> & b)
-////      {
-////        return (a.x()!=b.x() || a.y()!=b.y() || a.z()!=b.z());
-////      }
-
-////      inline BasicVector3D<double> CrossProduct(const BasicVector3D<double> &vectorLeft, const BasicVector3D<double> &vectorRight)
-////        {
-////            double x = vectorLeft.y()*vectorRight.z() - vectorLeft.z()*vectorRight.y();
-////            double y = vectorLeft.z()*vectorRight.x() - vectorLeft.x()*vectorRight.z();
-////            double z = vectorLeft.x()*vectorRight.y() - vectorLeft.y()*vectorRight.x();
-////            return BasicVector3D<double> (x, y, z);
-////        }
-
-////        inline double DotProduct(const BasicVector3D<double> &left, const BasicVector3D<double> &right)
-////        {
-////            return left.x()*right.x() + left.y()*right.y() + left.z()*right.z();
-////        }
-
-//template Geometry::BasicVector3D<double> operator* <Geometry::BasicVector3D<double>, double> (const Geometry::BasicVector3D<double>& v, double a);
-}
-
-#endif // PYTHONPLUSPLUSHELPER_H
-
-
diff --git a/Core/PythonAPI/inc/RealParameterWrapper.pypp.h b/Core/PythonAPI/inc/RealParameterWrapper.pypp.h
index d28f37b946f484fe877c9723f8e120bd34cbd183..0c49c6031a4e11e4c54700a2829c613cf74a1e79 100644
--- a/Core/PythonAPI/inc/RealParameterWrapper.pypp.h
+++ b/Core/PythonAPI/inc/RealParameterWrapper.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef RealParameterWrapper_hpp__pyplusplus_wrapper
 #define RealParameterWrapper_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ResolutionFunction2DSimple.pypp.h b/Core/PythonAPI/inc/ResolutionFunction2DSimple.pypp.h
index 15eb0aa46542af0263b9e9dd619e3fa6acf985b8..fcaaaca71393ee3df33ddc475a39a97f7194dd63 100644
--- a/Core/PythonAPI/inc/ResolutionFunction2DSimple.pypp.h
+++ b/Core/PythonAPI/inc/ResolutionFunction2DSimple.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ResolutionFunction2DSimple_hpp__pyplusplus_wrapper
 #define ResolutionFunction2DSimple_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Rotate3D.pypp.h b/Core/PythonAPI/inc/Rotate3D.pypp.h
deleted file mode 100644
index 7629ca0387a1397628e926ece12f2bbe42a78bf2..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/Rotate3D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef Rotate3D_hpp__pyplusplus_wrapper
-#define Rotate3D_hpp__pyplusplus_wrapper
-
-void register_Rotate3D_class();
-
-#endif//Rotate3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/RotateX3D.pypp.h b/Core/PythonAPI/inc/RotateX3D.pypp.h
deleted file mode 100644
index 5ed66b3381341d38f32a6fc8011ea745f207afd7..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/RotateX3D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef RotateX3D_hpp__pyplusplus_wrapper
-#define RotateX3D_hpp__pyplusplus_wrapper
-
-void register_RotateX3D_class();
-
-#endif//RotateX3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/RotateY3D.pypp.h b/Core/PythonAPI/inc/RotateY3D.pypp.h
deleted file mode 100644
index 3c1ed384a4e7138ce98c16e7a6fc387b006a32ea..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/RotateY3D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef RotateY3D_hpp__pyplusplus_wrapper
-#define RotateY3D_hpp__pyplusplus_wrapper
-
-void register_RotateY3D_class();
-
-#endif//RotateY3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/RotateY_3D.pypp.h b/Core/PythonAPI/inc/RotateY_3D.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e932a21163490a02e45be5b5f310628b11c2a57
--- /dev/null
+++ b/Core/PythonAPI/inc/RotateY_3D.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef RotateY_3D_hpp__pyplusplus_wrapper
+#define RotateY_3D_hpp__pyplusplus_wrapper
+
+void register_RotateY_3D_class();
+
+#endif//RotateY_3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/RotateZ3D.pypp.h b/Core/PythonAPI/inc/RotateZ3D.pypp.h
deleted file mode 100644
index 457848234de7003799b7f377eef11985ce322e44..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/RotateZ3D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef RotateZ3D_hpp__pyplusplus_wrapper
-#define RotateZ3D_hpp__pyplusplus_wrapper
-
-void register_RotateZ3D_class();
-
-#endif//RotateZ3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/RotateZ_3D.pypp.h b/Core/PythonAPI/inc/RotateZ_3D.pypp.h
new file mode 100644
index 0000000000000000000000000000000000000000..f5c10c8900af04b647cf01313dd777d3a6243b17
--- /dev/null
+++ b/Core/PythonAPI/inc/RotateZ_3D.pypp.h
@@ -0,0 +1,11 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#ifndef RotateZ_3D_hpp__pyplusplus_wrapper
+#define RotateZ_3D_hpp__pyplusplus_wrapper
+
+void register_RotateZ_3D_class();
+
+#endif//RotateZ_3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h b/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h
index f5bc4e02125e39a62cbaa51751f321683fea6755..9b2457cf8587f067cc7e236ffdfbb6c266cb59b5 100644
--- a/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h
+++ b/Core/PythonAPI/inc/SimpleSelectionRule.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef SimpleSelectionRule_hpp__pyplusplus_wrapper
 #define SimpleSelectionRule_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Simulation.pypp.h b/Core/PythonAPI/inc/Simulation.pypp.h
index dce651f3effcfeec5c84b8a88847d514338e19aa..4f1e326c7dfccb9b06cf7b56eefe5853b193e47f 100644
--- a/Core/PythonAPI/inc/Simulation.pypp.h
+++ b/Core/PythonAPI/inc/Simulation.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef Simulation_hpp__pyplusplus_wrapper
 #define Simulation_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/SimulationParameters.pypp.h b/Core/PythonAPI/inc/SimulationParameters.pypp.h
index 1499898318348467f30d54547620af9be8dd671e..f85eb7ba0c287a70e1ec7d265e0dd98db7411884 100644
--- a/Core/PythonAPI/inc/SimulationParameters.pypp.h
+++ b/Core/PythonAPI/inc/SimulationParameters.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef SimulationParameters_hpp__pyplusplus_wrapper
 #define SimulationParameters_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/StochasticDoubleGate.pypp.h b/Core/PythonAPI/inc/StochasticDoubleGate.pypp.h
index a10b0b34ff8a41a0a0bffdb61e409053e8f46464..d6ef2cee6196a9a64433ca2c82ceefb9dc5128f5 100644
--- a/Core/PythonAPI/inc/StochasticDoubleGate.pypp.h
+++ b/Core/PythonAPI/inc/StochasticDoubleGate.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef StochasticDoubleGate_hpp__pyplusplus_wrapper
 #define StochasticDoubleGate_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/StochasticDoubleGaussian.pypp.h b/Core/PythonAPI/inc/StochasticDoubleGaussian.pypp.h
index b0c6237a220e1ee71c32ab242f5329b59104bce8..e2410b12c8dc5d262e96f2e8a9a91c113d1bd751 100644
--- a/Core/PythonAPI/inc/StochasticDoubleGaussian.pypp.h
+++ b/Core/PythonAPI/inc/StochasticDoubleGaussian.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef StochasticDoubleGaussian_hpp__pyplusplus_wrapper
 #define StochasticDoubleGaussian_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/StochasticParameter_t.pypp.h b/Core/PythonAPI/inc/StochasticParameter_t.pypp.h
index 2ebf74677b744e9c41cdd3488842e4c2d7c12958..fb9237dbd758a8ddca6bd47c6a8c64b8634f84a6 100644
--- a/Core/PythonAPI/inc/StochasticParameter_t.pypp.h
+++ b/Core/PythonAPI/inc/StochasticParameter_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef StochasticParameter_t_hpp__pyplusplus_wrapper
 #define StochasticParameter_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/StochasticSampledParameter.pypp.h b/Core/PythonAPI/inc/StochasticSampledParameter.pypp.h
index 947690b7e3036c478d675a19ca31f91c4a8d6e38..75b0d0c85a1a4558394cccd61c74449d715b3bf6 100644
--- a/Core/PythonAPI/inc/StochasticSampledParameter.pypp.h
+++ b/Core/PythonAPI/inc/StochasticSampledParameter.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef StochasticSampledParameter_hpp__pyplusplus_wrapper
 #define StochasticSampledParameter_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/Transform3D.pypp.h b/Core/PythonAPI/inc/Transform3D.pypp.h
deleted file mode 100644
index d88fdcbce7d6572101d1242a548640eaf2f4ce87..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/Transform3D.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef Transform3D_hpp__pyplusplus_wrapper
-#define Transform3D_hpp__pyplusplus_wrapper
-
-void register_Transform3D_class();
-
-#endif//Transform3D_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/__call_policies.pypp.hpp b/Core/PythonAPI/inc/__call_policies.pypp.hpp
index 06d8f24fdac0f194ff9c34cb73176132c3fb0925..b31e20b5413618a6720f6151c07ec0cfd0729a62 100644
--- a/Core/PythonAPI/inc/__call_policies.pypp.hpp
+++ b/Core/PythonAPI/inc/__call_policies.pypp.hpp
@@ -12,7 +12,6 @@
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "boost/cstdint.hpp"
diff --git a/Core/PythonAPI/inc/__convenience.pypp.hpp b/Core/PythonAPI/inc/__convenience.pypp.hpp
index da5c4d86ea081137ac164024e8b242f8051bafb2..705b5e9b168d442f19753c3163d9d011807a15f5 100644
--- a/Core/PythonAPI/inc/__convenience.pypp.hpp
+++ b/Core/PythonAPI/inc/__convenience.pypp.hpp
@@ -12,7 +12,6 @@
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 
diff --git a/Core/PythonAPI/inc/cvector_t.pypp.h b/Core/PythonAPI/inc/cvector_t.pypp.h
index 462c6b326ba8b7eeda352fb91adb6a77ef65d12d..6116bbaca416790a85b1a0d9cd082ac1434858ab 100644
--- a/Core/PythonAPI/inc/cvector_t.pypp.h
+++ b/Core/PythonAPI/inc/cvector_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef cvector_t_hpp__pyplusplus_wrapper
 #define cvector_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/kvector_t.pypp.h b/Core/PythonAPI/inc/kvector_t.pypp.h
index 30588226914d7887d00ba8a636d673a9ce4c3020..25f2ba5f3758f47e8747240ace361a52b3f71185 100644
--- a/Core/PythonAPI/inc/kvector_t.pypp.h
+++ b/Core/PythonAPI/inc/kvector_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef kvector_t_hpp__pyplusplus_wrapper
 #define kvector_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/ndimdata_t.pypp.h b/Core/PythonAPI/inc/ndimdata_t.pypp.h
index 2ada75050b3aaaeffad2b9b87074810d01adb764..372e33540ff7bca590b6bb9891dea306e06ad235 100644
--- a/Core/PythonAPI/inc/ndimdata_t.pypp.h
+++ b/Core/PythonAPI/inc/ndimdata_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ndimdata_t_hpp__pyplusplus_wrapper
 #define ndimdata_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/vdouble1d_t.pypp.h b/Core/PythonAPI/inc/vdouble1d_t.pypp.h
index 44bbd95fbee4c505d70ae610446a428ea7af50e8..276f62b515270c607b67e1a1a405e284debfb828 100644
--- a/Core/PythonAPI/inc/vdouble1d_t.pypp.h
+++ b/Core/PythonAPI/inc/vdouble1d_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef vdouble1d_t_hpp__pyplusplus_wrapper
 #define vdouble1d_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/vector_DiffuseParticleInfoPtr_t.pypp.h b/Core/PythonAPI/inc/vector_DiffuseParticleInfoPtr_t.pypp.h
deleted file mode 100644
index 512803f258dd4fa2e6c7fee459d819eb84be9e5b..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/inc/vector_DiffuseParticleInfoPtr_t.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef vector_DiffuseParticleInfoPtr_t_hpp__pyplusplus_wrapper
-#define vector_DiffuseParticleInfoPtr_t_hpp__pyplusplus_wrapper
-
-void register_vector_DiffuseParticleInfoPtr_t_class();
-
-#endif//vector_DiffuseParticleInfoPtr_t_hpp__pyplusplus_wrapper
diff --git a/Core/PythonAPI/inc/vector_IFormFactorPtr_t.pypp.h b/Core/PythonAPI/inc/vector_IFormFactorPtr_t.pypp.h
index b97febd4a31caafdd1a8e905f2f9652eb4957bbc..1f21922b5c7e60530242b15851cc899a3b0f65e4 100644
--- a/Core/PythonAPI/inc/vector_IFormFactorPtr_t.pypp.h
+++ b/Core/PythonAPI/inc/vector_IFormFactorPtr_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef vector_IFormFactorPtr_t_hpp__pyplusplus_wrapper
 #define vector_IFormFactorPtr_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/vector_integer_t.pypp.h b/Core/PythonAPI/inc/vector_integer_t.pypp.h
index 5e65e50f2a98f5cd41b3f0a0197f8fd4d051e0c5..6c5a22fa9722fac720c9db1d716ff89ba217c665 100644
--- a/Core/PythonAPI/inc/vector_integer_t.pypp.h
+++ b/Core/PythonAPI/inc/vector_integer_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef vector_integer_t_hpp__pyplusplus_wrapper
 #define vector_integer_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/vector_kvector_t.pypp.h b/Core/PythonAPI/inc/vector_kvector_t.pypp.h
index d2c71600d976373207303913bd119ffcca595f17..fa1348dab175ef29a24d2ac5d6045e8cd8abc721 100644
--- a/Core/PythonAPI/inc/vector_kvector_t.pypp.h
+++ b/Core/PythonAPI/inc/vector_kvector_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef vector_kvector_t_hpp__pyplusplus_wrapper
 #define vector_kvector_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/inc/vector_longinteger_t.pypp.h b/Core/PythonAPI/inc/vector_longinteger_t.pypp.h
index 59e4375f3a4531a8f626f60bed43559e42fec37f..6f3028c1ec4b1f46c9b6ac9507a44aecf0d5e6ea 100644
--- a/Core/PythonAPI/inc/vector_longinteger_t.pypp.h
+++ b/Core/PythonAPI/inc/vector_longinteger_t.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef vector_longinteger_t_hpp__pyplusplus_wrapper
 #define vector_longinteger_t_hpp__pyplusplus_wrapper
 
diff --git a/Core/PythonAPI/src/Beam.pypp.cpp b/Core/PythonAPI/src/Beam.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7be8b71bcf08266592256d4ad8d71e74f8bb25fb
--- /dev/null
+++ b/Core/PythonAPI/src/Beam.pypp.cpp
@@ -0,0 +1,274 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "Beam.pypp.h"
+
+namespace bp = boost::python;
+
+struct Beam_wrapper : Beam, bp::wrapper< Beam > {
+
+    Beam_wrapper( )
+    : Beam( )
+      , bp::wrapper< Beam >(){
+        // null constructor
+    
+    }
+
+    Beam_wrapper(::Beam const & other )
+    : Beam( boost::ref(other) )
+      , bp::wrapper< Beam >(){
+        // copy constructor
+    
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< Beam_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_Beam_class(){
+
+    { //::Beam
+        typedef bp::class_< Beam_wrapper, bp::bases< IParameterized > > Beam_exposer_t;
+        Beam_exposer_t Beam_exposer = Beam_exposer_t( "Beam", bp::init< >() );
+        bp::scope Beam_scope( Beam_exposer );
+        Beam_exposer.def( bp::init< Beam const & >(( bp::arg("other") )) );
+        { //::Beam::getCentralK
+        
+            typedef ::cvector_t ( ::Beam::*getCentralK_function_type )(  ) const;
+            
+            Beam_exposer.def( 
+                "getCentralK"
+                , getCentralK_function_type( &::Beam::getCentralK ) );
+        
+        }
+        { //::Beam::getIntensity
+        
+            typedef double ( ::Beam::*getIntensity_function_type )(  ) const;
+            
+            Beam_exposer.def( 
+                "getIntensity"
+                , getIntensity_function_type( &::Beam::getIntensity ) );
+        
+        }
+        { //::Beam::operator=
+        
+            typedef ::Beam & ( ::Beam::*assign_function_type )( ::Beam const & ) ;
+            
+            Beam_exposer.def( 
+                "assign"
+                , assign_function_type( &::Beam::operator= )
+                , ( bp::arg("other") )
+                , bp::return_self< >() );
+        
+        }
+        { //::Beam::setCentralK
+        
+            typedef void ( ::Beam::*setCentralK_function_type )( ::cvector_t const & ) ;
+            
+            Beam_exposer.def( 
+                "setCentralK"
+                , setCentralK_function_type( &::Beam::setCentralK )
+                , ( bp::arg("k_i") ) );
+        
+        }
+        { //::Beam::setCentralK
+        
+            typedef void ( ::Beam::*setCentralK_function_type )( double,double,double ) ;
+            
+            Beam_exposer.def( 
+                "setCentralK"
+                , setCentralK_function_type( &::Beam::setCentralK )
+                , ( bp::arg("lambda"), bp::arg("alpha_i"), bp::arg("phi_i") ) );
+        
+        }
+        { //::Beam::setIntensity
+        
+            typedef void ( ::Beam::*setIntensity_function_type )( double ) ;
+            
+            Beam_exposer.def( 
+                "setIntensity"
+                , setIntensity_function_type( &::Beam::setIntensity )
+                , ( bp::arg("intensity") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Beam_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Beam_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Beam_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Beam_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Beam_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Beam_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Beam_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Beam_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Beam_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Beam_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Beam_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Beam_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Beam_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Beam_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Beam_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Beam_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Beam_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Beam_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Beam_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Beam_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/Bin1D.pypp.cpp b/Core/PythonAPI/src/Bin1D.pypp.cpp
index 2377cc6af46a3f7586c6c1b5e22b43dd2911c2e9..84b04dc6192341d60e358699cd4a227507d54f0d 100644
--- a/Core/PythonAPI/src/Bin1D.pypp.cpp
+++ b/Core/PythonAPI/src/Bin1D.pypp.cpp
@@ -1,95 +1,36 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Bin1D.pypp.h"
 
 namespace bp = boost::python;
 
 void register_Bin1D_class(){
 
-    bp::class_< Bin1D >( "Bin1D" )    
-        .def( 
-            "getMidPoint"
-            , (double ( ::Bin1D::* )(  ) const)(& ::Bin1D::getMidPoint ) )    
-        .def_readwrite( "m_lower", &Bin1D::m_lower )    
-        .def_readwrite( "m_upper", &Bin1D::m_upper )    
-        .def( bp::self != bp::self )    
-        .def( bp::self == bp::self );
+    { //::Bin1D
+        typedef bp::class_< Bin1D > Bin1D_exposer_t;
+        Bin1D_exposer_t Bin1D_exposer = Bin1D_exposer_t( "Bin1D" );
+        bp::scope Bin1D_scope( Bin1D_exposer );
+        { //::Bin1D::getMidPoint
+        
+            typedef double ( ::Bin1D::*getMidPoint_function_type )(  ) const;
+            
+            Bin1D_exposer.def( 
+                "getMidPoint"
+                , getMidPoint_function_type( &::Bin1D::getMidPoint ) );
+        
+        }
+        Bin1D_exposer.def_readwrite( "m_lower", &Bin1D::m_lower );
+        Bin1D_exposer.def_readwrite( "m_upper", &Bin1D::m_upper );
+    }
 
 }
diff --git a/Core/PythonAPI/src/Bin1DCVector.pypp.cpp b/Core/PythonAPI/src/Bin1DCVector.pypp.cpp
index 0007dfb5cb8687d0961bf2ced876d4641f196357..2feb8e315d8220e5f2274f7bd14ff413a0cffb7c 100644
--- a/Core/PythonAPI/src/Bin1DCVector.pypp.cpp
+++ b/Core/PythonAPI/src/Bin1DCVector.pypp.cpp
@@ -1,98 +1,47 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Bin1DCVector.pypp.h"
 
 namespace bp = boost::python;
 
 void register_Bin1DCVector_class(){
 
-    bp::class_< Bin1DCVector >( "Bin1DCVector", bp::init< >() )    
-        .def( bp::init< cvector_t const &, cvector_t const & >(( bp::arg("lower"), bp::arg("upper") )) )    
-        .def( bp::init< double, Bin1D const &, Bin1D const & >(( bp::arg("wavelength"), bp::arg("alpha_bin"), bp::arg("phi_bin") )) )    
-        .def( 
-            "getDelta"
-            , (::cvector_t ( ::Bin1DCVector::* )(  ) const)( &::Bin1DCVector::getDelta ) )    
-        .def( 
-            "getMidPoint"
-            , (::cvector_t ( ::Bin1DCVector::* )(  ) const)(& ::Bin1DCVector::getMidPoint ) )    
-        .def_readwrite( "m_q_lower", &Bin1DCVector::m_q_lower )    
-        .def_readwrite( "m_q_upper", &Bin1DCVector::m_q_upper );
+    { //::Bin1DCVector
+        typedef bp::class_< Bin1DCVector > Bin1DCVector_exposer_t;
+        Bin1DCVector_exposer_t Bin1DCVector_exposer = Bin1DCVector_exposer_t( "Bin1DCVector", bp::init< >() );
+        bp::scope Bin1DCVector_scope( Bin1DCVector_exposer );
+        Bin1DCVector_exposer.def( bp::init< cvector_t const &, cvector_t const & >(( bp::arg("lower"), bp::arg("upper") )) );
+        Bin1DCVector_exposer.def( bp::init< double, Bin1D const &, Bin1D const & >(( bp::arg("wavelength"), bp::arg("alpha_bin"), bp::arg("phi_bin") )) );
+        { //::Bin1DCVector::getDelta
+        
+            typedef ::cvector_t ( ::Bin1DCVector::*getDelta_function_type )(  ) const;
+            
+            Bin1DCVector_exposer.def( 
+                "getDelta"
+                , getDelta_function_type( &::Bin1DCVector::getDelta ) );
+        
+        }
+        { //::Bin1DCVector::getMidPoint
+        
+            typedef ::cvector_t ( ::Bin1DCVector::*getMidPoint_function_type )(  ) const;
+            
+            Bin1DCVector_exposer.def( 
+                "getMidPoint"
+                , getMidPoint_function_type( &::Bin1DCVector::getMidPoint ) );
+        
+        }
+        Bin1DCVector_exposer.def_readwrite( "m_q_lower", &Bin1DCVector::m_q_lower );
+        Bin1DCVector_exposer.def_readwrite( "m_q_upper", &Bin1DCVector::m_q_upper );
+    }
 
 }
diff --git a/Core/PythonAPI/src/Crystal.pypp.cpp b/Core/PythonAPI/src/Crystal.pypp.cpp
index e4babbce2fbd0cbd7d9d3335b907947e1e48848a..372654b945423dd913d511696d09a08a8f9efba8 100644
--- a/Core/PythonAPI/src/Crystal.pypp.cpp
+++ b/Core/PythonAPI/src/Crystal.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Crystal.pypp.h"
 
 namespace bp = boost::python;
@@ -104,18 +37,6 @@ struct Crystal_wrapper : Crystal, bp::wrapper< Crystal > {
         return Crystal::clone( );
     }
 
-    virtual ::std::vector< DiffuseParticleInfo* > * createDiffuseParticleInfo( ::ParticleInfo const & parent_info ) const  {
-        if( bp::override func_createDiffuseParticleInfo = this->get_override( "createDiffuseParticleInfo" ) )
-            return func_createDiffuseParticleInfo( boost::ref(parent_info) );
-        else{
-            return this->Crystal::createDiffuseParticleInfo( boost::ref(parent_info) );
-        }
-    }
-    
-    ::std::vector< DiffuseParticleInfo* > * default_createDiffuseParticleInfo( ::ParticleInfo const & parent_info ) const  {
-        return Crystal::createDiffuseParticleInfo( boost::ref(parent_info) );
-    }
-
     virtual ::IFormFactor * createTotalFormFactor( ::IFormFactor const & meso_crystal_form_factor, ::complex_t ambient_refractive_index ) const  {
         if( bp::override func_createTotalFormFactor = this->get_override( "createTotalFormFactor" ) )
             return func_createTotalFormFactor( boost::ref(meso_crystal_form_factor), ambient_refractive_index );
@@ -212,18 +133,6 @@ struct Crystal_wrapper : Crystal, bp::wrapper< Crystal > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -283,91 +192,199 @@ struct Crystal_wrapper : Crystal, bp::wrapper< Crystal > {
 
 void register_Crystal_class(){
 
-    bp::class_< Crystal_wrapper, bp::bases< IClusteredParticles >, boost::noncopyable >( "Crystal", bp::init< LatticeBasis const &, Lattice const & >(( bp::arg("lattice_basis"), bp::arg("lattice") )) )    
-        .def( 
-            "clone"
-            , (::Crystal * ( ::Crystal::* )(  ) const)(&::Crystal::clone)
-            , (::Crystal * ( Crystal_wrapper::* )(  ) const)(&Crystal_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createBasis"
-            , (::Particle * ( ::Crystal::* )(  ) const)( &::Crystal::createBasis )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createDiffuseParticleInfo"
-            , (::std::vector< DiffuseParticleInfo* > * ( ::Crystal::* )( ::ParticleInfo const & ) const)(&::Crystal::createDiffuseParticleInfo)
-            , (::std::vector< DiffuseParticleInfo* > * ( Crystal_wrapper::* )( ::ParticleInfo const & ) const)(&Crystal_wrapper::default_createDiffuseParticleInfo)
-            , ( bp::arg("parent_info") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createTotalFormFactor"
-            , (::IFormFactor * ( ::Crystal::* )( ::IFormFactor const &,::complex_t ) const)(&::Crystal::createTotalFormFactor)
-            , (::IFormFactor * ( Crystal_wrapper::* )( ::IFormFactor const &,::complex_t ) const)(&Crystal_wrapper::default_createTotalFormFactor)
-            , ( bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getLattice"
-            , (::Lattice ( ::Crystal::* )(  ) const)( &::Crystal::getLattice ) )    
-        .def( 
-            "getLatticeBasis"
-            , (::LatticeBasis const * ( ::Crystal::* )(  ) const)( &::Crystal::getLatticeBasis )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::Crystal::* )( ::complex_t ) )(&::Crystal::setAmbientRefractiveIndex)
-            , (void ( Crystal_wrapper::* )( ::complex_t ) )(&Crystal_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setDWFactor"
-            , (void ( ::Crystal::* )( double ) )( &::Crystal::setDWFactor )
-            , ( bp::arg("dw_factor") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( Crystal_wrapper::* )(  ) )(&Crystal_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( Crystal_wrapper::* )(  ) )(&Crystal_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( Crystal_wrapper::* )(  ) const)(&Crystal_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( Crystal_wrapper::* )(  ) )(&Crystal_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( Crystal_wrapper::* )(  ) const)(&Crystal_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( Crystal_wrapper::* )(  ) const)(&Crystal_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( Crystal_wrapper::* )(  ) )(&Crystal_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &Crystal_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( Crystal_wrapper::* )( ::std::string const &,double ) )(&Crystal_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( Crystal_wrapper::* )(  ) )(&Crystal_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( Crystal_wrapper::* )(  ) const)(&Crystal_wrapper::default_size) );
+    { //::Crystal
+        typedef bp::class_< Crystal_wrapper, bp::bases< IClusteredParticles >, boost::noncopyable > Crystal_exposer_t;
+        Crystal_exposer_t Crystal_exposer = Crystal_exposer_t( "Crystal", bp::init< LatticeBasis const &, Lattice const & >(( bp::arg("lattice_basis"), bp::arg("lattice") )) );
+        bp::scope Crystal_scope( Crystal_exposer );
+        { //::Crystal::clone
+        
+            typedef ::Crystal * ( ::Crystal::*clone_function_type )(  ) const;
+            typedef ::Crystal * ( Crystal_wrapper::*default_clone_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "clone"
+                , clone_function_type(&::Crystal::clone)
+                , default_clone_function_type(&Crystal_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Crystal::createBasis
+        
+            typedef ::Particle * ( ::Crystal::*createBasis_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "createBasis"
+                , createBasis_function_type( &::Crystal::createBasis )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Crystal::createTotalFormFactor
+        
+            typedef ::IFormFactor * ( ::Crystal::*createTotalFormFactor_function_type )( ::IFormFactor const &,::complex_t ) const;
+            typedef ::IFormFactor * ( Crystal_wrapper::*default_createTotalFormFactor_function_type )( ::IFormFactor const &,::complex_t ) const;
+            
+            Crystal_exposer.def( 
+                "createTotalFormFactor"
+                , createTotalFormFactor_function_type(&::Crystal::createTotalFormFactor)
+                , default_createTotalFormFactor_function_type(&Crystal_wrapper::default_createTotalFormFactor)
+                , ( bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Crystal::getLattice
+        
+            typedef ::Lattice ( ::Crystal::*getLattice_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "getLattice"
+                , getLattice_function_type( &::Crystal::getLattice ) );
+        
+        }
+        { //::Crystal::getLatticeBasis
+        
+            typedef ::LatticeBasis const * ( ::Crystal::*getLatticeBasis_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "getLatticeBasis"
+                , getLatticeBasis_function_type( &::Crystal::getLatticeBasis )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Crystal::setAmbientRefractiveIndex
+        
+            typedef void ( ::Crystal::*setAmbientRefractiveIndex_function_type )( ::complex_t ) ;
+            typedef void ( Crystal_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t ) ;
+            
+            Crystal_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::Crystal::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&Crystal_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::Crystal::setDWFactor
+        
+            typedef void ( ::Crystal::*setDWFactor_function_type )( double ) ;
+            
+            Crystal_exposer.def( 
+                "setDWFactor"
+                , setDWFactor_function_type( &::Crystal::setDWFactor )
+                , ( bp::arg("dw_factor") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Crystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Crystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Crystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Crystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Crystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Crystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Crystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Crystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( Crystal_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            Crystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&Crystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( Crystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&Crystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Crystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Crystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Crystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Crystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Crystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Crystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Crystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Crystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Crystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Crystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( Crystal_wrapper::*default_size_function_type )(  ) const;
+            
+            Crystal_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&Crystal_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Detector.pypp.cpp b/Core/PythonAPI/src/Detector.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..17c52c99368ca4464f26779411000f1a37275fb8
--- /dev/null
+++ b/Core/PythonAPI/src/Detector.pypp.cpp
@@ -0,0 +1,265 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "Detector.pypp.h"
+
+namespace bp = boost::python;
+
+struct Detector_wrapper : Detector, bp::wrapper< Detector > {
+
+    Detector_wrapper( )
+    : Detector( )
+      , bp::wrapper< Detector >(){
+        // null constructor
+    
+    }
+
+    Detector_wrapper(::Detector const & other )
+    : Detector( boost::ref(other) )
+      , bp::wrapper< Detector >(){
+        // copy constructor
+    
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< Detector_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_Detector_class(){
+
+    { //::Detector
+        typedef bp::class_< Detector_wrapper, bp::bases< IParameterized > > Detector_exposer_t;
+        Detector_exposer_t Detector_exposer = Detector_exposer_t( "Detector", bp::init< >() );
+        bp::scope Detector_scope( Detector_exposer );
+        Detector_exposer.def( bp::init< Detector const & >(( bp::arg("other") )) );
+        { //::Detector::clear
+        
+            typedef void ( ::Detector::*clear_function_type )(  ) ;
+            
+            Detector_exposer.def( 
+                "clear"
+                , clear_function_type( &::Detector::clear ) );
+        
+        }
+        { //::Detector::getAxis
+        
+            typedef ::IAxis const & ( ::Detector::*getAxis_function_type )( ::size_t ) const;
+            
+            Detector_exposer.def( 
+                "getAxis"
+                , getAxis_function_type( &::Detector::getAxis )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::copy_const_reference >() );
+        
+        }
+        { //::Detector::getDetectorResolutionFunction
+        
+            typedef ::IDetectorResolution const * ( ::Detector::*getDetectorResolutionFunction_function_type )(  ) const;
+            
+            Detector_exposer.def( 
+                "getDetectorResolutionFunction"
+                , getDetectorResolutionFunction_function_type( &::Detector::getDetectorResolutionFunction )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Detector::getDimension
+        
+            typedef ::size_t ( ::Detector::*getDimension_function_type )(  ) const;
+            
+            Detector_exposer.def( 
+                "getDimension"
+                , getDimension_function_type( &::Detector::getDimension ) );
+        
+        }
+        { //::Detector::operator=
+        
+            typedef ::Detector & ( ::Detector::*assign_function_type )( ::Detector const & ) ;
+            
+            Detector_exposer.def( 
+                "assign"
+                , assign_function_type( &::Detector::operator= )
+                , ( bp::arg("other") )
+                , bp::return_self< >() );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Detector_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Detector_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Detector_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Detector_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Detector_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Detector_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Detector_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Detector_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Detector_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Detector_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Detector_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Detector_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Detector_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Detector_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Detector_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Detector_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Detector_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Detector_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Detector_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Detector_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/DiffuseDWBASimulation.pypp.cpp b/Core/PythonAPI/src/DiffuseDWBASimulation.pypp.cpp
deleted file mode 100644
index e62738d64fbcdf9accd06d5ecae674176cc6a92e..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/DiffuseDWBASimulation.pypp.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "DiffuseDWBASimulation.pypp.h"
-
-namespace bp = boost::python;
-
-struct DiffuseDWBASimulation_wrapper : DiffuseDWBASimulation, bp::wrapper< DiffuseDWBASimulation > {
-
-    DiffuseDWBASimulation_wrapper( )
-    : DiffuseDWBASimulation( )
-      , bp::wrapper< DiffuseDWBASimulation >(){
-        // null constructor
-    
-    }
-
-    virtual void run(  ) {
-        if( bp::override func_run = this->get_override( "run" ) )
-            func_run(  );
-        else{
-            this->DiffuseDWBASimulation::run(  );
-        }
-    }
-    
-    void default_run(  ) {
-        DiffuseDWBASimulation::run( );
-    }
-
-    virtual ::LayerDWBASimulation * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->LayerDWBASimulation::clone(  );
-        }
-    }
-    
-    ::LayerDWBASimulation * default_clone(  ) const  {
-        return LayerDWBASimulation::clone( );
-    }
-
-};
-
-void register_DiffuseDWBASimulation_class(){
-
-    bp::class_< DiffuseDWBASimulation_wrapper, bp::bases< LayerDWBASimulation >, boost::noncopyable >( "DiffuseDWBASimulation", bp::init< >() )    
-        .def( 
-            "getSize"
-            , (::size_t ( ::DiffuseDWBASimulation::* )(  ) const)( &::DiffuseDWBASimulation::getSize ) )    
-        .def( 
-            "rescaleAbundances"
-            , (void ( ::DiffuseDWBASimulation::* )( double ) )( &::DiffuseDWBASimulation::rescaleAbundances )
-            , ( bp::arg("factor") ) )    
-        .def( 
-            "run"
-            , (void ( ::DiffuseDWBASimulation::* )(  ) )(&::DiffuseDWBASimulation::run)
-            , (void ( DiffuseDWBASimulation_wrapper::* )(  ) )(&DiffuseDWBASimulation_wrapper::default_run) )    
-        .def( 
-            "setRefractiveIndex"
-            , (void ( ::DiffuseDWBASimulation::* )( ::complex_t ) )( &::DiffuseDWBASimulation::setRefractiveIndex )
-            , ( bp::arg("n") ) )    
-        .def( 
-            "setSurfaceDensity"
-            , (void ( ::DiffuseDWBASimulation::* )( double ) )( &::DiffuseDWBASimulation::setSurfaceDensity )
-            , ( bp::arg("surface_density") ) )    
-        .def( 
-            "clone"
-            , (::LayerDWBASimulation * ( ::LayerDWBASimulation::* )(  ) const)(&::LayerDWBASimulation::clone)
-            , (::LayerDWBASimulation * ( DiffuseDWBASimulation_wrapper::* )(  ) const)(&DiffuseDWBASimulation_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() );
-
-}
diff --git a/Core/PythonAPI/src/DiffuseParticleInfo.pypp.cpp b/Core/PythonAPI/src/DiffuseParticleInfo.pypp.cpp
deleted file mode 100644
index ad5c30979f60828b189b5c9d694c6bcb829d1a5b..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/DiffuseParticleInfo.pypp.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "__call_policies.pypp.hpp"
-#include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "DiffuseParticleInfo.pypp.h"
-
-namespace bp = boost::python;
-
-struct DiffuseParticleInfo_wrapper : DiffuseParticleInfo, bp::wrapper< DiffuseParticleInfo > {
-
-    virtual ::DiffuseParticleInfo * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->DiffuseParticleInfo::clone(  );
-        }
-    }
-    
-    ::DiffuseParticleInfo * default_clone(  ) const  {
-        return DiffuseParticleInfo::clone( );
-    }
-
-    virtual bool areParametersChanged(  ) {
-        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
-            return func_areParametersChanged(  );
-        else{
-            return this->IParameterized::areParametersChanged(  );
-        }
-    }
-    
-    bool default_areParametersChanged(  ) {
-        return IParameterized::areParametersChanged( );
-    }
-
-    virtual void clearParameterPool(  ) {
-        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
-            func_clearParameterPool(  );
-        else{
-            this->IParameterized::clearParameterPool(  );
-        }
-    }
-    
-    void default_clearParameterPool(  ) {
-        IParameterized::clearParameterPool( );
-    }
-
-    virtual ::ParameterPool * createParameterTree(  ) const  {
-        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
-            return func_createParameterTree(  );
-        else{
-            return this->IParameterized::createParameterTree(  );
-        }
-    }
-    
-    ::ParameterPool * default_createParameterTree(  ) const  {
-        return IParameterized::createParameterTree( );
-    }
-
-    virtual ::ICompositeSample * getCompositeSample(  ) {
-        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
-            return func_getCompositeSample(  );
-        else{
-            return this->ICompositeSample::getCompositeSample(  );
-        }
-    }
-    
-    ::ICompositeSample * default_getCompositeSample(  ) {
-        return ICompositeSample::getCompositeSample( );
-    }
-
-    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
-        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
-            return func_getCompositeSample(  );
-        else{
-            return this->ICompositeSample::getCompositeSample(  );
-        }
-    }
-    
-    ::ICompositeSample const * default_getCompositeSample(  ) const  {
-        return ICompositeSample::getCompositeSample( );
-    }
-
-    virtual void printParameters(  ) const  {
-        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
-            func_printParameters(  );
-        else{
-            this->IParameterized::printParameters(  );
-        }
-    }
-    
-    void default_printParameters(  ) const  {
-        IParameterized::printParameters( );
-    }
-
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
-    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
-        namespace bpl = boost::python;
-        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
-            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
-        }
-        else{
-            IParameterized::registerParameter( name, parpointer );
-        }
-    }
-    
-    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
-        if( dynamic_cast< DiffuseParticleInfo_wrapper * >( boost::addressof( inst ) ) ){
-            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
-        }
-        else{
-            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
-        }
-    }
-
-    virtual bool setParameterValue( ::std::string const & name, double value ) {
-        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
-            return func_setParameterValue( name, value );
-        else{
-            return this->IParameterized::setParameterValue( name, value );
-        }
-    }
-    
-    bool default_setParameterValue( ::std::string const & name, double value ) {
-        return IParameterized::setParameterValue( name, value );
-    }
-
-    virtual void setParametersAreChanged(  ) {
-        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
-            func_setParametersAreChanged(  );
-        else{
-            this->IParameterized::setParametersAreChanged(  );
-        }
-    }
-    
-    void default_setParametersAreChanged(  ) {
-        IParameterized::setParametersAreChanged( );
-    }
-
-    virtual ::size_t size(  ) const  {
-        if( bp::override func_size = this->get_override( "size" ) )
-            return func_size(  );
-        else{
-            return this->ICompositeSample::size(  );
-        }
-    }
-    
-    ::size_t default_size(  ) const  {
-        return ICompositeSample::size( );
-    }
-
-};
-
-void register_DiffuseParticleInfo_class(){
-
-    bp::class_< DiffuseParticleInfo_wrapper, bp::bases< ParticleInfo >, boost::noncopyable >( "DiffuseParticleInfo", bp::no_init )    
-        .def( 
-            "clone"
-            , (::DiffuseParticleInfo * ( ::DiffuseParticleInfo::* )(  ) const)(&::DiffuseParticleInfo::clone)
-            , (::DiffuseParticleInfo * ( DiffuseParticleInfo_wrapper::* )(  ) const)(&DiffuseParticleInfo_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getHeightRange"
-            , (double ( ::DiffuseParticleInfo::* )(  ) const)( &::DiffuseParticleInfo::getHeightRange ) )    
-        .def( 
-            "getNumberPerMeso"
-            , (double ( ::DiffuseParticleInfo::* )(  ) const)( &::DiffuseParticleInfo::getNumberPerMeso ) )    
-        .def( 
-            "scaleAbundance"
-            , (void ( ::DiffuseParticleInfo::* )( double ) )( &::DiffuseParticleInfo::scaleAbundance )
-            , ( bp::arg("factor") ) )    
-        .def( 
-            "scaleNumberPerMeso"
-            , (void ( ::DiffuseParticleInfo::* )( double ) )( &::DiffuseParticleInfo::scaleNumberPerMeso )
-            , ( bp::arg("factor") ) )    
-        .def( 
-            "setHeightRange"
-            , (void ( ::DiffuseParticleInfo::* )( double ) )( &::DiffuseParticleInfo::setHeightRange )
-            , ( bp::arg("height_range") ) )    
-        .def( 
-            "setNumberPerMeso"
-            , (void ( ::DiffuseParticleInfo::* )( double ) )( &::DiffuseParticleInfo::setNumberPerMeso )
-            , ( bp::arg("n") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( DiffuseParticleInfo_wrapper::* )(  ) )(&DiffuseParticleInfo_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( DiffuseParticleInfo_wrapper::* )(  ) )(&DiffuseParticleInfo_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( DiffuseParticleInfo_wrapper::* )(  ) const)(&DiffuseParticleInfo_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( DiffuseParticleInfo_wrapper::* )(  ) )(&DiffuseParticleInfo_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( DiffuseParticleInfo_wrapper::* )(  ) const)(&DiffuseParticleInfo_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( DiffuseParticleInfo_wrapper::* )(  ) const)(&DiffuseParticleInfo_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( DiffuseParticleInfo_wrapper::* )(  ) )(&DiffuseParticleInfo_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &DiffuseParticleInfo_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( DiffuseParticleInfo_wrapper::* )( ::std::string const &,double ) )(&DiffuseParticleInfo_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( DiffuseParticleInfo_wrapper::* )(  ) )(&DiffuseParticleInfo_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( DiffuseParticleInfo_wrapper::* )(  ) const)(&DiffuseParticleInfo_wrapper::default_size) );
-
-}
diff --git a/Core/PythonAPI/src/FTDistribution2DCauchy.pypp.cpp b/Core/PythonAPI/src/FTDistribution2DCauchy.pypp.cpp
index ec9d1621deca5a4f61281a22c80448a15d766774..ca3f64b351588b81c7b02a08af7ee0162895b335 100644
--- a/Core/PythonAPI/src/FTDistribution2DCauchy.pypp.cpp
+++ b/Core/PythonAPI/src/FTDistribution2DCauchy.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FTDistribution2DCauchy.pypp.h"
 
 namespace bp = boost::python;
@@ -230,51 +163,124 @@ struct FTDistribution2DCauchy_wrapper : FTDistribution2DCauchy, bp::wrapper< FTD
 
 void register_FTDistribution2DCauchy_class(){
 
-    bp::class_< FTDistribution2DCauchy_wrapper, bp::bases< IFTDistribution2D > >( "FTDistribution2DCauchy", bp::init< double, double >(( bp::arg("omega_x"), bp::arg("omega_y") )) )    
-        .def( 
-            "clone"
-            , (::FTDistribution2DCauchy * ( ::FTDistribution2DCauchy::* )(  ) const)(&::FTDistribution2DCauchy::clone)
-            , (::FTDistribution2DCauchy * ( FTDistribution2DCauchy_wrapper::* )(  ) const)(&FTDistribution2DCauchy_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (double ( ::FTDistribution2DCauchy::* )( double,double ) const)(&::FTDistribution2DCauchy::evaluate)
-            , (double ( FTDistribution2DCauchy_wrapper::* )( double,double ) const)(&FTDistribution2DCauchy_wrapper::default_evaluate)
-            , ( bp::arg("qx"), bp::arg("qy") ) )    
-        .def( 
-            "transformToStarBasis"
-            , (void ( ::FTDistribution2DCauchy::* )( double,double,double,double,double,double &,double & ) const)(&::FTDistribution2DCauchy::transformToStarBasis)
-            , (void ( FTDistribution2DCauchy_wrapper::* )( double,double,double,double,double,double &,double & ) const)(&FTDistribution2DCauchy_wrapper::default_transformToStarBasis)
-            , ( bp::arg("qX"), bp::arg("qY"), bp::arg("alpha"), bp::arg("a"), bp::arg("b"), bp::arg("qa"), bp::arg("qb") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FTDistribution2DCauchy_wrapper::* )(  ) )(&FTDistribution2DCauchy_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FTDistribution2DCauchy_wrapper::* )(  ) )(&FTDistribution2DCauchy_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FTDistribution2DCauchy_wrapper::* )(  ) const)(&FTDistribution2DCauchy_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FTDistribution2DCauchy_wrapper::* )(  ) const)(&FTDistribution2DCauchy_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FTDistribution2DCauchy_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FTDistribution2DCauchy_wrapper::* )( ::std::string const &,double ) )(&FTDistribution2DCauchy_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FTDistribution2DCauchy_wrapper::* )(  ) )(&FTDistribution2DCauchy_wrapper::default_setParametersAreChanged) );
+    { //::FTDistribution2DCauchy
+        typedef bp::class_< FTDistribution2DCauchy_wrapper, bp::bases< IFTDistribution2D > > FTDistribution2DCauchy_exposer_t;
+        FTDistribution2DCauchy_exposer_t FTDistribution2DCauchy_exposer = FTDistribution2DCauchy_exposer_t( "FTDistribution2DCauchy", bp::init< double, double >(( bp::arg("omega_x"), bp::arg("omega_y") )) );
+        bp::scope FTDistribution2DCauchy_scope( FTDistribution2DCauchy_exposer );
+        { //::FTDistribution2DCauchy::clone
+        
+            typedef ::FTDistribution2DCauchy * ( ::FTDistribution2DCauchy::*clone_function_type )(  ) const;
+            typedef ::FTDistribution2DCauchy * ( FTDistribution2DCauchy_wrapper::*default_clone_function_type )(  ) const;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "clone"
+                , clone_function_type(&::FTDistribution2DCauchy::clone)
+                , default_clone_function_type(&FTDistribution2DCauchy_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FTDistribution2DCauchy::evaluate
+        
+            typedef double ( ::FTDistribution2DCauchy::*evaluate_function_type )( double,double ) const;
+            typedef double ( FTDistribution2DCauchy_wrapper::*default_evaluate_function_type )( double,double ) const;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::FTDistribution2DCauchy::evaluate)
+                , default_evaluate_function_type(&FTDistribution2DCauchy_wrapper::default_evaluate)
+                , ( bp::arg("qx"), bp::arg("qy") ) );
+        
+        }
+        { //::FTDistribution2DCauchy::transformToStarBasis
+        
+            typedef void ( ::FTDistribution2DCauchy::*transformToStarBasis_function_type )( double,double,double,double,double,double &,double & ) const;
+            typedef void ( FTDistribution2DCauchy_wrapper::*default_transformToStarBasis_function_type )( double,double,double,double,double,double &,double & ) const;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "transformToStarBasis"
+                , transformToStarBasis_function_type(&::FTDistribution2DCauchy::transformToStarBasis)
+                , default_transformToStarBasis_function_type(&FTDistribution2DCauchy_wrapper::default_transformToStarBasis)
+                , ( bp::arg("qX"), bp::arg("qY"), bp::arg("alpha"), bp::arg("a"), bp::arg("b"), bp::arg("qa"), bp::arg("qb") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FTDistribution2DCauchy_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FTDistribution2DCauchy_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FTDistribution2DCauchy_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FTDistribution2DCauchy_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FTDistribution2DCauchy_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FTDistribution2DCauchy_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FTDistribution2DCauchy_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FTDistribution2DCauchy_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FTDistribution2DCauchy_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FTDistribution2DCauchy_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FTDistribution2DCauchy_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FTDistribution2DCauchy_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FTDistribution2DCauchy_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FTDistribution2DCauchy_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorBox.pypp.cpp b/Core/PythonAPI/src/FormFactorBox.pypp.cpp
index 5e0082275f07298749d0c9b9f57d8ab71e9fcddc..41eacc1c3d05d4477ceb683a97c875fa1062d9cd 100644
--- a/Core/PythonAPI/src/FormFactorBox.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorBox.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorBox.pypp.h"
 
 namespace bp = boost::python;
@@ -224,6 +157,18 @@ struct FormFactorBox_wrapper : FormFactorBox, bp::wrapper< FormFactorBox > {
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual bool isDistributedFormFactor(  ) const  {
         if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
             return func_isDistributedFormFactor(  );
@@ -248,18 +193,6 @@ struct FormFactorBox_wrapper : FormFactorBox, bp::wrapper< FormFactorBox > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -319,89 +252,225 @@ struct FormFactorBox_wrapper : FormFactorBox, bp::wrapper< FormFactorBox > {
 
 void register_FormFactorBox_class(){
 
-    bp::class_< FormFactorBox_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorBox", bp::init< double, double, double >(( bp::arg("radius"), bp::arg("width"), bp::arg("height") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorBox * ( ::FormFactorBox::* )(  ) const)(&::FormFactorBox::clone)
-            , (::FormFactorBox * ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorBox::* )( ::cvector_t const & ) const)(&::FormFactorBox::evaluate_for_q)
-            , (::complex_t ( FormFactorBox_wrapper::* )( ::cvector_t const & ) const)(&FormFactorBox_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorBox::* )(  ) const)(&::FormFactorBox::getHeight)
-            , (double ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorBox::* )(  ) const)(&::FormFactorBox::getNumberOfStochasticParameters)
-            , (int ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::FormFactorBox::* )(  ) const)(&::FormFactorBox::getRadius)
-            , (double ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::FormFactorBox::* )(  ) const)(&::FormFactorBox::getVolume)
-            , (double ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_getVolume) )    
-        .def( 
-            "getwidth"
-            , (double ( ::FormFactorBox::* )(  ) const)( &::FormFactorBox::getwidth ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorBox_wrapper::* )(  ) )(&FormFactorBox_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorBox_wrapper::* )(  ) )(&FormFactorBox_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorBox_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorBox_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorBox_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorBox_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorBox_wrapper::* )(  ) const)(&FormFactorBox_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorBox_wrapper::* )(  ) )(&FormFactorBox_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorBox_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorBox_wrapper::* )( ::complex_t const & ) )(&FormFactorBox_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorBox_wrapper::* )( ::std::string const &,double ) )(&FormFactorBox_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorBox_wrapper::* )(  ) )(&FormFactorBox_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorBox
+        typedef bp::class_< FormFactorBox_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorBox_exposer_t;
+        FormFactorBox_exposer_t FormFactorBox_exposer = FormFactorBox_exposer_t( "FormFactorBox", bp::init< double, double, double >(( bp::arg("radius"), bp::arg("width"), bp::arg("height") )) );
+        bp::scope FormFactorBox_scope( FormFactorBox_exposer );
+        { //::FormFactorBox::clone
+        
+            typedef ::FormFactorBox * ( ::FormFactorBox::*clone_function_type )(  ) const;
+            typedef ::FormFactorBox * ( FormFactorBox_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorBox::clone)
+                , default_clone_function_type(&FormFactorBox_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorBox::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorBox::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorBox_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorBox_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorBox::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorBox_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorBox::getHeight
+        
+            typedef double ( ::FormFactorBox::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorBox_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorBox::getHeight)
+                , default_getHeight_function_type(&FormFactorBox_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorBox::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorBox::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorBox_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorBox::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorBox_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorBox::getRadius
+        
+            typedef double ( ::FormFactorBox::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorBox_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::FormFactorBox::getRadius)
+                , default_getRadius_function_type(&FormFactorBox_wrapper::default_getRadius) );
+        
+        }
+        { //::FormFactorBox::getVolume
+        
+            typedef double ( ::FormFactorBox::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorBox_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::FormFactorBox::getVolume)
+                , default_getVolume_function_type(&FormFactorBox_wrapper::default_getVolume) );
+        
+        }
+        { //::FormFactorBox::getwidth
+        
+            typedef double ( ::FormFactorBox::*getwidth_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "getwidth"
+                , getwidth_function_type( &::FormFactorBox::getwidth ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorBox_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorBox_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorBox_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorBox_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorBox_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorBox_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorBox_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorBox_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorBox_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorBox_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorBox_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorBox_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorBox_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorBox_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorBox_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorBox_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorBox_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorBox_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorBox_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorBox_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorBox_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorBox_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorBox_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorBox_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorBox_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorBox_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorBox_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorBox_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorBox_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorBox_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorBox_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorBox_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorCone.pypp.cpp b/Core/PythonAPI/src/FormFactorCone.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..409155eacd9fce1643942822b940e53534766fba
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorCone.pypp.cpp
@@ -0,0 +1,443 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorCone.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorCone_wrapper : FormFactorCone, bp::wrapper< FormFactorCone > {
+
+    FormFactorCone_wrapper(double radius, double height, double alpha )
+    : FormFactorCone( radius, height, alpha )
+      , bp::wrapper< FormFactorCone >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorCone * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorCone::clone(  );
+        }
+    }
+    
+    ::FormFactorCone * default_clone(  ) const  {
+        return FormFactorCone::clone( );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorCone::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorCone::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorCone::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorCone::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorBorn::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorBorn::getVolume( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorCone_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorCone_class(){
+
+    { //::FormFactorCone
+        typedef bp::class_< FormFactorCone_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorCone_exposer_t;
+        FormFactorCone_exposer_t FormFactorCone_exposer = FormFactorCone_exposer_t( "FormFactorCone", bp::init< double, double, double >(( bp::arg("radius"), bp::arg("height"), bp::arg("alpha") )) );
+        bp::scope FormFactorCone_scope( FormFactorCone_exposer );
+        { //::FormFactorCone::clone
+        
+            typedef ::FormFactorCone * ( ::FormFactorCone::*clone_function_type )(  ) const;
+            typedef ::FormFactorCone * ( FormFactorCone_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorCone::clone)
+                , default_clone_function_type(&FormFactorCone_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorCone::getHeight
+        
+            typedef double ( ::FormFactorCone::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorCone_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorCone::getHeight)
+                , default_getHeight_function_type(&FormFactorCone_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorCone::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorCone::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorCone_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorCone::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorCone_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorCone_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorCone_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorCone_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorCone_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorCone_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorCone_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorCone_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorCone_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorCone_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorCone_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorCone_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorCone_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorCone_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorCone_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorCone_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorCone_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorCone_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorCone_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorCone_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorCone_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorCone_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorCone_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorCone_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorCone_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorCone_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorCone_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorCone_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorCone_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorCone_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorCone_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorCone_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorCone_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorCone_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorCone_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorCone_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorCone_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp b/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp
index 59aaa7a4dc0cdfce71e0ef4d70e32f271f6f7521..69b827c9c17bb238cacf706d5fef52d4e4c2833a 100644
--- a/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorCrystal.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorCrystal.pypp.h"
 
 namespace bp = boost::python;
@@ -104,6 +37,30 @@ struct FormFactorCrystal_wrapper : FormFactorCrystal, bp::wrapper< FormFactorCry
         return FormFactorCrystal::clone( );
     }
 
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->FormFactorCrystal::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return FormFactorCrystal::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const  {
+        if( bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" ) )
+            return func_evaluate_for_q( boost::ref(q) );
+        else{
+            return this->FormFactorCrystal::evaluate_for_q( boost::ref(q) );
+        }
+    }
+    
+    ::complex_t default_evaluate_for_q( ::cvector_t const & q ) const  {
+        return FormFactorCrystal::evaluate_for_q( boost::ref(q) );
+    }
+
     virtual double getVolume(  ) const  {
         if( bp::override func_getVolume = this->get_override( "getVolume" ) )
             return func_getVolume(  );
@@ -176,21 +133,16 @@ struct FormFactorCrystal_wrapper : FormFactorCrystal, bp::wrapper< FormFactorCry
         return IParameterized::createParameterTree( );
     }
 
-    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
-        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
-            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
         else{
-            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+            return this->ISample::getCompositeSample(  );
         }
     }
     
-    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
-        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
-    }
-
-    virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const {
-        bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" );
-        return func_evaluate_for_q( boost::ref(q) );
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
     }
 
     virtual double getHeight(  ) const  {
@@ -253,18 +205,6 @@ struct FormFactorCrystal_wrapper : FormFactorCrystal, bp::wrapper< FormFactorCry
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -312,85 +252,216 @@ struct FormFactorCrystal_wrapper : FormFactorCrystal, bp::wrapper< FormFactorCry
 
 void register_FormFactorCrystal_class(){
 
-    bp::class_< FormFactorCrystal_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorCrystal", bp::init< Crystal const &, IFormFactor const &, complex_t const & >(( bp::arg("p_crystal"), bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorCrystal * ( ::FormFactorCrystal::* )(  ) const)(&::FormFactorCrystal::clone)
-            , (::FormFactorCrystal * ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getVolume"
-            , (double ( ::FormFactorCrystal::* )(  ) const)(&::FormFactorCrystal::getVolume)
-            , (double ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_getVolume) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::FormFactorCrystal::* )( ::complex_t const & ) )(&::FormFactorCrystal::setAmbientRefractiveIndex)
-            , (void ( FormFactorCrystal_wrapper::* )( ::complex_t const & ) )(&FormFactorCrystal_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorCrystal_wrapper::* )(  ) )(&FormFactorCrystal_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorCrystal_wrapper::* )(  ) )(&FormFactorCrystal_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorCrystal_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorCrystal_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorCrystal_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorCrystal_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "evaluate_for_q"
-            , bp::pure_virtual( (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const & ) const)(&::IFormFactorBorn::evaluate_for_q) )
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getHeight)
-            , (double ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getNumberOfStochasticParameters)
-            , (int ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_getRadius) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorCrystal_wrapper::* )(  ) const)(&FormFactorCrystal_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorCrystal_wrapper::* )(  ) )(&FormFactorCrystal_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorCrystal_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorCrystal_wrapper::* )( ::std::string const &,double ) )(&FormFactorCrystal_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorCrystal_wrapper::* )(  ) )(&FormFactorCrystal_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorCrystal
+        typedef bp::class_< FormFactorCrystal_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorCrystal_exposer_t;
+        FormFactorCrystal_exposer_t FormFactorCrystal_exposer = FormFactorCrystal_exposer_t( "FormFactorCrystal", bp::init< Crystal const &, IFormFactor const &, complex_t const & >(( bp::arg("p_crystal"), bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )) );
+        bp::scope FormFactorCrystal_scope( FormFactorCrystal_exposer );
+        { //::FormFactorCrystal::clone
+        
+            typedef ::FormFactorCrystal * ( ::FormFactorCrystal::*clone_function_type )(  ) const;
+            typedef ::FormFactorCrystal * ( FormFactorCrystal_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorCrystal::clone)
+                , default_clone_function_type(&FormFactorCrystal_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorCrystal::evaluate
+        
+            typedef ::complex_t ( ::FormFactorCrystal::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorCrystal_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::FormFactorCrystal::evaluate)
+                , default_evaluate_function_type(&FormFactorCrystal_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::FormFactorCrystal::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorCrystal::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorCrystal_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorCrystal::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorCrystal_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorCrystal::getVolume
+        
+            typedef double ( ::FormFactorCrystal::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorCrystal_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::FormFactorCrystal::getVolume)
+                , default_getVolume_function_type(&FormFactorCrystal_wrapper::default_getVolume) );
+        
+        }
+        { //::FormFactorCrystal::setAmbientRefractiveIndex
+        
+            typedef void ( ::FormFactorCrystal::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorCrystal_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::FormFactorCrystal::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorCrystal_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorCrystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorCrystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorCrystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorCrystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorCrystal_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorCrystal_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorCrystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorCrystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorCrystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getHeight
+        
+            typedef double ( ::IFormFactor::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorCrystal_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactor::getHeight)
+                , default_getHeight_function_type(&FormFactorCrystal_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactor::getNumberOfStochasticParameters
+        
+            typedef int ( ::IFormFactor::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorCrystal_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::IFormFactor::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorCrystal_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorCrystal_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorCrystal_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorCrystal_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorCrystal_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorCrystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorCrystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorCrystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorCrystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorCrystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorCrystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorCrystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorCrystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorCrystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorCrystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorCylinder.pypp.cpp b/Core/PythonAPI/src/FormFactorCylinder.pypp.cpp
index 66491bb3842aa115e31c7dfa164d6959052e0b0c..e8d7f9d9f8d86c2e998fe8bc52831c692e8251f3 100644
--- a/Core/PythonAPI/src/FormFactorCylinder.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorCylinder.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorCylinder.pypp.h"
 
 namespace bp = boost::python;
@@ -212,6 +145,18 @@ struct FormFactorCylinder_wrapper : FormFactorCylinder, bp::wrapper< FormFactorC
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getVolume(  ) const  {
         if( bp::override func_getVolume = this->get_override( "getVolume" ) )
             return func_getVolume(  );
@@ -248,18 +193,6 @@ struct FormFactorCylinder_wrapper : FormFactorCylinder, bp::wrapper< FormFactorC
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -319,86 +252,216 @@ struct FormFactorCylinder_wrapper : FormFactorCylinder, bp::wrapper< FormFactorC
 
 void register_FormFactorCylinder_class(){
 
-    bp::class_< FormFactorCylinder_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorCylinder", bp::init< double, double >(( bp::arg("height"), bp::arg("radius") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorCylinder * ( ::FormFactorCylinder::* )(  ) const)(&::FormFactorCylinder::clone)
-            , (::FormFactorCylinder * ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorCylinder::* )( ::cvector_t const & ) const)(&::FormFactorCylinder::evaluate_for_q)
-            , (::complex_t ( FormFactorCylinder_wrapper::* )( ::cvector_t const & ) const)(&FormFactorCylinder_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorCylinder::* )(  ) const)(&::FormFactorCylinder::getHeight)
-            , (double ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorCylinder::* )(  ) const)(&::FormFactorCylinder::getNumberOfStochasticParameters)
-            , (int ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::FormFactorCylinder::* )(  ) const)(&::FormFactorCylinder::getRadius)
-            , (double ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_getRadius) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorCylinder_wrapper::* )(  ) )(&FormFactorCylinder_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorCylinder_wrapper::* )(  ) )(&FormFactorCylinder_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorCylinder_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorCylinder_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorCylinder_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorCylinder_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorCylinder_wrapper::* )(  ) const)(&FormFactorCylinder_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorCylinder_wrapper::* )(  ) )(&FormFactorCylinder_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorCylinder_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorCylinder_wrapper::* )( ::complex_t const & ) )(&FormFactorCylinder_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorCylinder_wrapper::* )( ::std::string const &,double ) )(&FormFactorCylinder_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorCylinder_wrapper::* )(  ) )(&FormFactorCylinder_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorCylinder
+        typedef bp::class_< FormFactorCylinder_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorCylinder_exposer_t;
+        FormFactorCylinder_exposer_t FormFactorCylinder_exposer = FormFactorCylinder_exposer_t( "FormFactorCylinder", bp::init< double, double >(( bp::arg("height"), bp::arg("radius") )) );
+        bp::scope FormFactorCylinder_scope( FormFactorCylinder_exposer );
+        { //::FormFactorCylinder::clone
+        
+            typedef ::FormFactorCylinder * ( ::FormFactorCylinder::*clone_function_type )(  ) const;
+            typedef ::FormFactorCylinder * ( FormFactorCylinder_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorCylinder::clone)
+                , default_clone_function_type(&FormFactorCylinder_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorCylinder::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorCylinder::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorCylinder_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorCylinder::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorCylinder_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorCylinder::getHeight
+        
+            typedef double ( ::FormFactorCylinder::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorCylinder_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorCylinder::getHeight)
+                , default_getHeight_function_type(&FormFactorCylinder_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorCylinder::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorCylinder::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorCylinder_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorCylinder::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorCylinder_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorCylinder::getRadius
+        
+            typedef double ( ::FormFactorCylinder::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorCylinder_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::FormFactorCylinder::getRadius)
+                , default_getRadius_function_type(&FormFactorCylinder_wrapper::default_getRadius) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorCylinder_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorCylinder_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorCylinder_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorCylinder_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorCylinder_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorCylinder_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorCylinder_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorCylinder_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorCylinder_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorCylinder_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorCylinder_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorCylinder_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorCylinder_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorCylinder_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorCylinder_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorCylinder_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorCylinder_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorCylinder_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorCylinder_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorCylinder_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorCylinder_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorCylinder_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorCylinder_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorCylinder_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorCylinder_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorCylinder_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorCylinder_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorCylinder_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorCylinder_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorCylinder_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorCylinder_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorCylinder_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp b/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp
index 569e04ce23e7c0bda0a737e828750d86f5b62a25..db7a0dc096746269daeaef7791dea9c58dcbd1f9 100644
--- a/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorDecoratorDebyeWaller.pypp.h"
 
 namespace bp = boost::python;
@@ -176,6 +109,18 @@ struct FormFactorDecoratorDebyeWaller_wrapper : FormFactorDecoratorDebyeWaller,
         return IParameterized::createParameterTree( );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getHeight(  ) const  {
         if( bp::override func_getHeight = this->get_override( "getHeight" ) )
             return func_getHeight(  );
@@ -236,18 +181,6 @@ struct FormFactorDecoratorDebyeWaller_wrapper : FormFactorDecoratorDebyeWaller,
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -307,81 +240,204 @@ struct FormFactorDecoratorDebyeWaller_wrapper : FormFactorDecoratorDebyeWaller,
 
 void register_FormFactorDecoratorDebyeWaller_class(){
 
-    bp::class_< FormFactorDecoratorDebyeWaller_wrapper, bp::bases< IFormFactorDecorator >, boost::noncopyable >( "FormFactorDecoratorDebyeWaller", bp::init< IFormFactor const &, double, double >(( bp::arg("p_form_factor"), bp::arg("dw_h_factor"), bp::arg("dw_r_factor") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorDecoratorDebyeWaller * ( ::FormFactorDecoratorDebyeWaller::* )(  ) const)(&::FormFactorDecoratorDebyeWaller::clone)
-            , (::FormFactorDecoratorDebyeWaller * ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::FormFactorDecoratorDebyeWaller::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::FormFactorDecoratorDebyeWaller::evaluate)
-            , (::complex_t ( FormFactorDecoratorDebyeWaller_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorDecoratorDebyeWaller::* )(  ) const)(&::FormFactorDecoratorDebyeWaller::getNumberOfStochasticParameters)
-            , (int ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) )(&FormFactorDecoratorDebyeWaller_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) )(&FormFactorDecoratorDebyeWaller_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorDecoratorDebyeWaller_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::getHeight)
-            , (double ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_getHeight) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::getRadius)
-            , (double ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::getVolume)
-            , (double ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) const)(&FormFactorDecoratorDebyeWaller_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) )(&FormFactorDecoratorDebyeWaller_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorDecoratorDebyeWaller_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactorDecorator::* )( ::complex_t const & ) )(&::IFormFactorDecorator::setAmbientRefractiveIndex)
-            , (void ( FormFactorDecoratorDebyeWaller_wrapper::* )( ::complex_t const & ) )(&FormFactorDecoratorDebyeWaller_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorDecoratorDebyeWaller_wrapper::* )( ::std::string const &,double ) )(&FormFactorDecoratorDebyeWaller_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorDecoratorDebyeWaller_wrapper::* )(  ) )(&FormFactorDecoratorDebyeWaller_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorDecoratorDebyeWaller
+        typedef bp::class_< FormFactorDecoratorDebyeWaller_wrapper, bp::bases< IFormFactorDecorator >, boost::noncopyable > FormFactorDecoratorDebyeWaller_exposer_t;
+        FormFactorDecoratorDebyeWaller_exposer_t FormFactorDecoratorDebyeWaller_exposer = FormFactorDecoratorDebyeWaller_exposer_t( "FormFactorDecoratorDebyeWaller", bp::init< IFormFactor const &, double, double >(( bp::arg("p_form_factor"), bp::arg("dw_h_factor"), bp::arg("dw_r_factor") )) );
+        bp::scope FormFactorDecoratorDebyeWaller_scope( FormFactorDecoratorDebyeWaller_exposer );
+        { //::FormFactorDecoratorDebyeWaller::clone
+        
+            typedef ::FormFactorDecoratorDebyeWaller * ( ::FormFactorDecoratorDebyeWaller::*clone_function_type )(  ) const;
+            typedef ::FormFactorDecoratorDebyeWaller * ( FormFactorDecoratorDebyeWaller_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorDecoratorDebyeWaller::clone)
+                , default_clone_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorDecoratorDebyeWaller::evaluate
+        
+            typedef ::complex_t ( ::FormFactorDecoratorDebyeWaller::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorDecoratorDebyeWaller_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::FormFactorDecoratorDebyeWaller::evaluate)
+                , default_evaluate_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::FormFactorDecoratorDebyeWaller::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorDecoratorDebyeWaller::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorDecoratorDebyeWaller_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorDecoratorDebyeWaller::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorDecoratorDebyeWaller_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorDecoratorDebyeWaller_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorDecoratorDebyeWaller_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorDecoratorDebyeWaller_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorDecoratorDebyeWaller_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactorDecorator::getHeight
+        
+            typedef double ( ::IFormFactorDecorator::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorDecoratorDebyeWaller_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactorDecorator::getHeight)
+                , default_getHeight_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactorDecorator::getRadius
+        
+            typedef double ( ::IFormFactorDecorator::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorDecoratorDebyeWaller_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactorDecorator::getRadius)
+                , default_getRadius_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorDecorator::getVolume
+        
+            typedef double ( ::IFormFactorDecorator::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorDecoratorDebyeWaller_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorDecorator::getVolume)
+                , default_getVolume_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorDecoratorDebyeWaller_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorDecoratorDebyeWaller_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorDecoratorDebyeWaller_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactorDecorator::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactorDecorator::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorDecoratorDebyeWaller_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactorDecorator::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorDecoratorDebyeWaller_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorDecoratorDebyeWaller_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorDecoratorDebyeWaller_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorDecoratorDebyeWaller_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorEllipsoid.pypp.cpp b/Core/PythonAPI/src/FormFactorEllipsoid.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5f07705a3b858e5315965dd221b21a48d10b18fd
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorEllipsoid.pypp.cpp
@@ -0,0 +1,476 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorEllipsoid.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorEllipsoid_wrapper : FormFactorEllipsoid, bp::wrapper< FormFactorEllipsoid > {
+
+    FormFactorEllipsoid_wrapper(double radius, double width, double height, double alpha )
+    : FormFactorEllipsoid( radius, width, height, alpha )
+      , bp::wrapper< FormFactorEllipsoid >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorEllipsoid * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorEllipsoid::clone(  );
+        }
+    }
+    
+    ::FormFactorEllipsoid * default_clone(  ) const  {
+        return FormFactorEllipsoid::clone( );
+    }
+
+    virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const  {
+        if( bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" ) )
+            return func_evaluate_for_q( boost::ref(q) );
+        else{
+            return this->FormFactorEllipsoid::evaluate_for_q( boost::ref(q) );
+        }
+    }
+    
+    ::complex_t default_evaluate_for_q( ::cvector_t const & q ) const  {
+        return FormFactorEllipsoid::evaluate_for_q( boost::ref(q) );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorEllipsoid::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorEllipsoid::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorEllipsoid::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorEllipsoid::getNumberOfStochasticParameters( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->FormFactorEllipsoid::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return FormFactorEllipsoid::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->FormFactorEllipsoid::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return FormFactorEllipsoid::getVolume( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorEllipsoid_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorEllipsoid_class(){
+
+    { //::FormFactorEllipsoid
+        typedef bp::class_< FormFactorEllipsoid_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorEllipsoid_exposer_t;
+        FormFactorEllipsoid_exposer_t FormFactorEllipsoid_exposer = FormFactorEllipsoid_exposer_t( "FormFactorEllipsoid", bp::init< double, double, double, double >(( bp::arg("radius"), bp::arg("width"), bp::arg("height"), bp::arg("alpha") )) );
+        bp::scope FormFactorEllipsoid_scope( FormFactorEllipsoid_exposer );
+        { //::FormFactorEllipsoid::clone
+        
+            typedef ::FormFactorEllipsoid * ( ::FormFactorEllipsoid::*clone_function_type )(  ) const;
+            typedef ::FormFactorEllipsoid * ( FormFactorEllipsoid_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorEllipsoid::clone)
+                , default_clone_function_type(&FormFactorEllipsoid_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorEllipsoid::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorEllipsoid::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorEllipsoid_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorEllipsoid::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorEllipsoid_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorEllipsoid::getHeight
+        
+            typedef double ( ::FormFactorEllipsoid::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorEllipsoid_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorEllipsoid::getHeight)
+                , default_getHeight_function_type(&FormFactorEllipsoid_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorEllipsoid::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorEllipsoid::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorEllipsoid_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorEllipsoid::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorEllipsoid_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorEllipsoid::getRadius
+        
+            typedef double ( ::FormFactorEllipsoid::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorEllipsoid_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::FormFactorEllipsoid::getRadius)
+                , default_getRadius_function_type(&FormFactorEllipsoid_wrapper::default_getRadius) );
+        
+        }
+        { //::FormFactorEllipsoid::getVolume
+        
+            typedef double ( ::FormFactorEllipsoid::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorEllipsoid_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::FormFactorEllipsoid::getVolume)
+                , default_getVolume_function_type(&FormFactorEllipsoid_wrapper::default_getVolume) );
+        
+        }
+        { //::FormFactorEllipsoid::getWidth
+        
+            typedef double ( ::FormFactorEllipsoid::*getWidth_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "getWidth"
+                , getWidth_function_type( &::FormFactorEllipsoid::getWidth ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorEllipsoid_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorEllipsoid_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorEllipsoid_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorEllipsoid_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorEllipsoid_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorEllipsoid_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorEllipsoid_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorEllipsoid_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorEllipsoid_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorEllipsoid_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorEllipsoid_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorEllipsoid_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorEllipsoid_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorEllipsoid_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorEllipsoid_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorEllipsoid_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorEllipsoid_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorEllipsoid_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorEllipsoid_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorEllipsoid_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorEllipsoid_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorEllipsoid_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorEllipsoid_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorEllipsoid_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorEllipsoid_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorFullSphere.pypp.cpp b/Core/PythonAPI/src/FormFactorFullSphere.pypp.cpp
index b64cf149426f5b70256d89682029962144bc9b60..a1ffea33bcd6691a332f4fb660d5331591b47098 100644
--- a/Core/PythonAPI/src/FormFactorFullSphere.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorFullSphere.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorFullSphere.pypp.h"
 
 namespace bp = boost::python;
@@ -212,6 +145,18 @@ struct FormFactorFullSphere_wrapper : FormFactorFullSphere, bp::wrapper< FormFac
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getVolume(  ) const  {
         if( bp::override func_getVolume = this->get_override( "getVolume" ) )
             return func_getVolume(  );
@@ -248,18 +193,6 @@ struct FormFactorFullSphere_wrapper : FormFactorFullSphere, bp::wrapper< FormFac
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -319,86 +252,216 @@ struct FormFactorFullSphere_wrapper : FormFactorFullSphere, bp::wrapper< FormFac
 
 void register_FormFactorFullSphere_class(){
 
-    bp::class_< FormFactorFullSphere_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorFullSphere", bp::init< double >(( bp::arg("radius") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorFullSphere * ( ::FormFactorFullSphere::* )(  ) const)(&::FormFactorFullSphere::clone)
-            , (::FormFactorFullSphere * ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorFullSphere::* )( ::cvector_t const & ) const)(&::FormFactorFullSphere::evaluate_for_q)
-            , (::complex_t ( FormFactorFullSphere_wrapper::* )( ::cvector_t const & ) const)(&FormFactorFullSphere_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorFullSphere::* )(  ) const)(&::FormFactorFullSphere::getHeight)
-            , (double ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorFullSphere::* )(  ) const)(&::FormFactorFullSphere::getNumberOfStochasticParameters)
-            , (int ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::FormFactorFullSphere::* )(  ) const)(&::FormFactorFullSphere::getRadius)
-            , (double ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_getRadius) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorFullSphere_wrapper::* )(  ) )(&FormFactorFullSphere_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorFullSphere_wrapper::* )(  ) )(&FormFactorFullSphere_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorFullSphere_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorFullSphere_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorFullSphere_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorFullSphere_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorFullSphere_wrapper::* )(  ) const)(&FormFactorFullSphere_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorFullSphere_wrapper::* )(  ) )(&FormFactorFullSphere_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorFullSphere_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorFullSphere_wrapper::* )( ::complex_t const & ) )(&FormFactorFullSphere_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorFullSphere_wrapper::* )( ::std::string const &,double ) )(&FormFactorFullSphere_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorFullSphere_wrapper::* )(  ) )(&FormFactorFullSphere_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorFullSphere
+        typedef bp::class_< FormFactorFullSphere_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorFullSphere_exposer_t;
+        FormFactorFullSphere_exposer_t FormFactorFullSphere_exposer = FormFactorFullSphere_exposer_t( "FormFactorFullSphere", bp::init< double >(( bp::arg("radius") )) );
+        bp::scope FormFactorFullSphere_scope( FormFactorFullSphere_exposer );
+        { //::FormFactorFullSphere::clone
+        
+            typedef ::FormFactorFullSphere * ( ::FormFactorFullSphere::*clone_function_type )(  ) const;
+            typedef ::FormFactorFullSphere * ( FormFactorFullSphere_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorFullSphere::clone)
+                , default_clone_function_type(&FormFactorFullSphere_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorFullSphere::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorFullSphere::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorFullSphere_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorFullSphere::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorFullSphere_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorFullSphere::getHeight
+        
+            typedef double ( ::FormFactorFullSphere::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorFullSphere_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorFullSphere::getHeight)
+                , default_getHeight_function_type(&FormFactorFullSphere_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorFullSphere::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorFullSphere::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorFullSphere_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorFullSphere::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorFullSphere_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorFullSphere::getRadius
+        
+            typedef double ( ::FormFactorFullSphere::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorFullSphere_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::FormFactorFullSphere::getRadius)
+                , default_getRadius_function_type(&FormFactorFullSphere_wrapper::default_getRadius) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorFullSphere_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorFullSphere_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorFullSphere_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorFullSphere_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorFullSphere_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorFullSphere_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorFullSphere_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorFullSphere_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorFullSphere_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorFullSphere_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorFullSphere_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorFullSphere_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorFullSphere_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorFullSphere_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorFullSphere_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorFullSphere_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorFullSphere_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorFullSphere_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorFullSphere_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorFullSphere_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorFullSphere_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorFullSphere_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorFullSphere_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorFullSphere_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorFullSphere_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorFullSphere_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorFullSphere_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorFullSphere_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorFullSphere_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorFullSphere_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorFullSphere_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorFullSphere_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorFullSpheroid.pypp.cpp b/Core/PythonAPI/src/FormFactorFullSpheroid.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2484f4b99cf9903a16afaa0668c966135407554e
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorFullSpheroid.pypp.cpp
@@ -0,0 +1,443 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorFullSpheroid.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorFullSpheroid_wrapper : FormFactorFullSpheroid, bp::wrapper< FormFactorFullSpheroid > {
+
+    FormFactorFullSpheroid_wrapper(double radius, double height )
+    : FormFactorFullSpheroid( radius, height )
+      , bp::wrapper< FormFactorFullSpheroid >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorFullSpheroid * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorFullSpheroid::clone(  );
+        }
+    }
+    
+    ::FormFactorFullSpheroid * default_clone(  ) const  {
+        return FormFactorFullSpheroid::clone( );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorFullSpheroid::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorFullSpheroid::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorFullSpheroid::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorFullSpheroid::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorBorn::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorBorn::getVolume( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorFullSpheroid_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorFullSpheroid_class(){
+
+    { //::FormFactorFullSpheroid
+        typedef bp::class_< FormFactorFullSpheroid_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorFullSpheroid_exposer_t;
+        FormFactorFullSpheroid_exposer_t FormFactorFullSpheroid_exposer = FormFactorFullSpheroid_exposer_t( "FormFactorFullSpheroid", bp::init< double, double >(( bp::arg("radius"), bp::arg("height") )) );
+        bp::scope FormFactorFullSpheroid_scope( FormFactorFullSpheroid_exposer );
+        { //::FormFactorFullSpheroid::clone
+        
+            typedef ::FormFactorFullSpheroid * ( ::FormFactorFullSpheroid::*clone_function_type )(  ) const;
+            typedef ::FormFactorFullSpheroid * ( FormFactorFullSpheroid_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorFullSpheroid::clone)
+                , default_clone_function_type(&FormFactorFullSpheroid_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorFullSpheroid::getHeight
+        
+            typedef double ( ::FormFactorFullSpheroid::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorFullSpheroid_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorFullSpheroid::getHeight)
+                , default_getHeight_function_type(&FormFactorFullSpheroid_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorFullSpheroid::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorFullSpheroid::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorFullSpheroid_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorFullSpheroid::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorFullSpheroid_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorFullSpheroid_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorFullSpheroid_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorFullSpheroid_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorFullSpheroid_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorFullSpheroid_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorFullSpheroid_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorFullSpheroid_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorFullSpheroid_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorFullSpheroid_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorFullSpheroid_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorFullSpheroid_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorFullSpheroid_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorFullSpheroid_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorFullSpheroid_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorFullSpheroid_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorFullSpheroid_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorFullSpheroid_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorFullSpheroid_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorFullSpheroid_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorFullSpheroid_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorFullSpheroid_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorFullSpheroid_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorFullSpheroid_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorFullSpheroid_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorFullSpheroid_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorFullSpheroid_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorFullSpheroid_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorFullSpheroid_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorGauss.pypp.cpp b/Core/PythonAPI/src/FormFactorGauss.pypp.cpp
index 518a34334275c2371b293b181fdff96c18dba6cb..7a1d9c6b40922dc4e26f726a23851f0af466c7b7 100644
--- a/Core/PythonAPI/src/FormFactorGauss.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorGauss.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorGauss.pypp.h"
 
 namespace bp = boost::python;
@@ -195,6 +128,18 @@ struct FormFactorGauss_wrapper : FormFactorGauss, bp::wrapper< FormFactorGauss >
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getHeight(  ) const  {
         if( bp::override func_getHeight = this->get_override( "getHeight" ) )
             return func_getHeight(  );
@@ -255,18 +200,6 @@ struct FormFactorGauss_wrapper : FormFactorGauss, bp::wrapper< FormFactorGauss >
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -326,87 +259,217 @@ struct FormFactorGauss_wrapper : FormFactorGauss, bp::wrapper< FormFactorGauss >
 
 void register_FormFactorGauss_class(){
 
-    bp::class_< FormFactorGauss_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorGauss", bp::init< double >(( bp::arg("volume") )) )    
-        .def( bp::init< double, double >(( bp::arg("height"), bp::arg("width") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorGauss * ( ::FormFactorGauss::* )(  ) const)(&::FormFactorGauss::clone)
-            , (::FormFactorGauss * ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorGauss::* )( ::cvector_t const & ) const)(&::FormFactorGauss::evaluate_for_q)
-            , (::complex_t ( FormFactorGauss_wrapper::* )( ::cvector_t const & ) const)(&FormFactorGauss_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorGauss::* )(  ) const)(&::FormFactorGauss::getNumberOfStochasticParameters)
-            , (int ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorGauss_wrapper::* )(  ) )(&FormFactorGauss_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorGauss_wrapper::* )(  ) )(&FormFactorGauss_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorGauss_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorGauss_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorGauss_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorGauss_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getHeight)
-            , (double ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_getHeight) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorGauss_wrapper::* )(  ) const)(&FormFactorGauss_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorGauss_wrapper::* )(  ) )(&FormFactorGauss_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorGauss_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorGauss_wrapper::* )( ::complex_t const & ) )(&FormFactorGauss_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorGauss_wrapper::* )( ::std::string const &,double ) )(&FormFactorGauss_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorGauss_wrapper::* )(  ) )(&FormFactorGauss_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorGauss
+        typedef bp::class_< FormFactorGauss_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorGauss_exposer_t;
+        FormFactorGauss_exposer_t FormFactorGauss_exposer = FormFactorGauss_exposer_t( "FormFactorGauss", bp::init< double >(( bp::arg("volume") )) );
+        bp::scope FormFactorGauss_scope( FormFactorGauss_exposer );
+        FormFactorGauss_exposer.def( bp::init< double, double >(( bp::arg("height"), bp::arg("width") )) );
+        { //::FormFactorGauss::clone
+        
+            typedef ::FormFactorGauss * ( ::FormFactorGauss::*clone_function_type )(  ) const;
+            typedef ::FormFactorGauss * ( FormFactorGauss_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorGauss::clone)
+                , default_clone_function_type(&FormFactorGauss_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorGauss::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorGauss::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorGauss_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorGauss::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorGauss_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorGauss::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorGauss::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorGauss_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorGauss::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorGauss_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorGauss_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorGauss_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorGauss_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorGauss_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorGauss_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorGauss_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorGauss_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorGauss_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorGauss_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorGauss_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorGauss_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorGauss_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorGauss_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorGauss_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getHeight
+        
+            typedef double ( ::IFormFactor::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorGauss_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactor::getHeight)
+                , default_getHeight_function_type(&FormFactorGauss_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorGauss_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorGauss_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorGauss_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorGauss_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorGauss_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorGauss_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorGauss_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorGauss_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorGauss_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorGauss_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorGauss_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorGauss_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorGauss_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorGauss_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorGauss_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorGauss_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorGauss_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorGauss_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorGauss_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorGauss_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorHemiSpheroid.pypp.cpp b/Core/PythonAPI/src/FormFactorHemiSpheroid.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5593fb1acba4436ba2d991d71f048a79d628d148
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorHemiSpheroid.pypp.cpp
@@ -0,0 +1,443 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorHemiSpheroid.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorHemiSpheroid_wrapper : FormFactorHemiSpheroid, bp::wrapper< FormFactorHemiSpheroid > {
+
+    FormFactorHemiSpheroid_wrapper(double radius, double width, double height )
+    : FormFactorHemiSpheroid( radius, width, height )
+      , bp::wrapper< FormFactorHemiSpheroid >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorHemiSpheroid * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorHemiSpheroid::clone(  );
+        }
+    }
+    
+    ::FormFactorHemiSpheroid * default_clone(  ) const  {
+        return FormFactorHemiSpheroid::clone( );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorHemiSpheroid::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorHemiSpheroid::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorHemiSpheroid::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorHemiSpheroid::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorBorn::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorBorn::getVolume( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorHemiSpheroid_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorHemiSpheroid_class(){
+
+    { //::FormFactorHemiSpheroid
+        typedef bp::class_< FormFactorHemiSpheroid_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorHemiSpheroid_exposer_t;
+        FormFactorHemiSpheroid_exposer_t FormFactorHemiSpheroid_exposer = FormFactorHemiSpheroid_exposer_t( "FormFactorHemiSpheroid", bp::init< double, double, double >(( bp::arg("radius"), bp::arg("width"), bp::arg("height") )) );
+        bp::scope FormFactorHemiSpheroid_scope( FormFactorHemiSpheroid_exposer );
+        { //::FormFactorHemiSpheroid::clone
+        
+            typedef ::FormFactorHemiSpheroid * ( ::FormFactorHemiSpheroid::*clone_function_type )(  ) const;
+            typedef ::FormFactorHemiSpheroid * ( FormFactorHemiSpheroid_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorHemiSpheroid::clone)
+                , default_clone_function_type(&FormFactorHemiSpheroid_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorHemiSpheroid::getHeight
+        
+            typedef double ( ::FormFactorHemiSpheroid::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorHemiSpheroid_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorHemiSpheroid::getHeight)
+                , default_getHeight_function_type(&FormFactorHemiSpheroid_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorHemiSpheroid::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorHemiSpheroid::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorHemiSpheroid_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorHemiSpheroid::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorHemiSpheroid_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorHemiSpheroid_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorHemiSpheroid_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorHemiSpheroid_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorHemiSpheroid_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorHemiSpheroid_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorHemiSpheroid_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorHemiSpheroid_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorHemiSpheroid_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorHemiSpheroid_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorHemiSpheroid_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorHemiSpheroid_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorHemiSpheroid_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorHemiSpheroid_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorHemiSpheroid_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorHemiSpheroid_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorHemiSpheroid_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorHemiSpheroid_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorHemiSpheroid_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorHemiSpheroid_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorHemiSpheroid_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorHemiSpheroid_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorHemiSpheroid_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorHemiSpheroid_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorHemiSpheroid_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorHemiSpheroid_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorHemiSpheroid_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorHemiSpheroid_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorHemiSpheroid_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorLorentz.pypp.cpp b/Core/PythonAPI/src/FormFactorLorentz.pypp.cpp
index 2343d225326a7817f5c4f055ce1d035a737f9db8..c2a4afcbbff8aed652a3863348115b6dd76fc364 100644
--- a/Core/PythonAPI/src/FormFactorLorentz.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorLorentz.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorLorentz.pypp.h"
 
 namespace bp = boost::python;
@@ -195,6 +128,18 @@ struct FormFactorLorentz_wrapper : FormFactorLorentz, bp::wrapper< FormFactorLor
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getHeight(  ) const  {
         if( bp::override func_getHeight = this->get_override( "getHeight" ) )
             return func_getHeight(  );
@@ -255,18 +200,6 @@ struct FormFactorLorentz_wrapper : FormFactorLorentz, bp::wrapper< FormFactorLor
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -326,87 +259,217 @@ struct FormFactorLorentz_wrapper : FormFactorLorentz, bp::wrapper< FormFactorLor
 
 void register_FormFactorLorentz_class(){
 
-    bp::class_< FormFactorLorentz_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorLorentz", bp::init< double >(( bp::arg("volume") )) )    
-        .def( bp::init< double, double >(( bp::arg("height"), bp::arg("width") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorLorentz * ( ::FormFactorLorentz::* )(  ) const)(&::FormFactorLorentz::clone)
-            , (::FormFactorLorentz * ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorLorentz::* )( ::cvector_t const & ) const)(&::FormFactorLorentz::evaluate_for_q)
-            , (::complex_t ( FormFactorLorentz_wrapper::* )( ::cvector_t const & ) const)(&FormFactorLorentz_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorLorentz::* )(  ) const)(&::FormFactorLorentz::getNumberOfStochasticParameters)
-            , (int ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorLorentz_wrapper::* )(  ) )(&FormFactorLorentz_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorLorentz_wrapper::* )(  ) )(&FormFactorLorentz_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorLorentz_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorLorentz_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorLorentz_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorLorentz_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getHeight)
-            , (double ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_getHeight) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorLorentz_wrapper::* )(  ) const)(&FormFactorLorentz_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorLorentz_wrapper::* )(  ) )(&FormFactorLorentz_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorLorentz_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorLorentz_wrapper::* )( ::complex_t const & ) )(&FormFactorLorentz_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorLorentz_wrapper::* )( ::std::string const &,double ) )(&FormFactorLorentz_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorLorentz_wrapper::* )(  ) )(&FormFactorLorentz_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorLorentz
+        typedef bp::class_< FormFactorLorentz_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorLorentz_exposer_t;
+        FormFactorLorentz_exposer_t FormFactorLorentz_exposer = FormFactorLorentz_exposer_t( "FormFactorLorentz", bp::init< double >(( bp::arg("volume") )) );
+        bp::scope FormFactorLorentz_scope( FormFactorLorentz_exposer );
+        FormFactorLorentz_exposer.def( bp::init< double, double >(( bp::arg("height"), bp::arg("width") )) );
+        { //::FormFactorLorentz::clone
+        
+            typedef ::FormFactorLorentz * ( ::FormFactorLorentz::*clone_function_type )(  ) const;
+            typedef ::FormFactorLorentz * ( FormFactorLorentz_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorLorentz::clone)
+                , default_clone_function_type(&FormFactorLorentz_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorLorentz::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorLorentz::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorLorentz_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorLorentz::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorLorentz_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorLorentz::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorLorentz::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorLorentz_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorLorentz::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorLorentz_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorLorentz_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorLorentz_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorLorentz_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorLorentz_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorLorentz_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorLorentz_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorLorentz_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorLorentz_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorLorentz_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorLorentz_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorLorentz_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorLorentz_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorLorentz_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorLorentz_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getHeight
+        
+            typedef double ( ::IFormFactor::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorLorentz_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactor::getHeight)
+                , default_getHeight_function_type(&FormFactorLorentz_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorLorentz_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorLorentz_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorLorentz_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorLorentz_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorLorentz_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorLorentz_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorLorentz_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorLorentz_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorLorentz_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorLorentz_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorLorentz_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorLorentz_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorLorentz_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorLorentz_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorLorentz_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorLorentz_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorLorentz_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorLorentz_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorLorentz_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorLorentz_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorParallelepiped.pypp.cpp b/Core/PythonAPI/src/FormFactorParallelepiped.pypp.cpp
index 3ef361b2503e27debd92a26c44737ace23f9be5f..aadba71ade5dca84446c4bb6af43e984b4455c54 100644
--- a/Core/PythonAPI/src/FormFactorParallelepiped.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorParallelepiped.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorParallelepiped.pypp.h"
 
 namespace bp = boost::python;
@@ -224,6 +157,18 @@ struct FormFactorParallelepiped_wrapper : FormFactorParallelepiped, bp::wrapper<
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual bool isDistributedFormFactor(  ) const  {
         if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
             return func_isDistributedFormFactor(  );
@@ -248,18 +193,6 @@ struct FormFactorParallelepiped_wrapper : FormFactorParallelepiped, bp::wrapper<
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -319,86 +252,216 @@ struct FormFactorParallelepiped_wrapper : FormFactorParallelepiped, bp::wrapper<
 
 void register_FormFactorParallelepiped_class(){
 
-    bp::class_< FormFactorParallelepiped_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorParallelepiped", bp::init< double, double >(( bp::arg("height"), bp::arg("radius") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorParallelepiped * ( ::FormFactorParallelepiped::* )(  ) const)(&::FormFactorParallelepiped::clone)
-            , (::FormFactorParallelepiped * ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorParallelepiped::* )( ::cvector_t const & ) const)(&::FormFactorParallelepiped::evaluate_for_q)
-            , (::complex_t ( FormFactorParallelepiped_wrapper::* )( ::cvector_t const & ) const)(&FormFactorParallelepiped_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorParallelepiped::* )(  ) const)(&::FormFactorParallelepiped::getHeight)
-            , (double ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorParallelepiped::* )(  ) const)(&::FormFactorParallelepiped::getNumberOfStochasticParameters)
-            , (int ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::FormFactorParallelepiped::* )(  ) const)(&::FormFactorParallelepiped::getRadius)
-            , (double ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::FormFactorParallelepiped::* )(  ) const)(&::FormFactorParallelepiped::getVolume)
-            , (double ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_getVolume) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorParallelepiped_wrapper::* )(  ) )(&FormFactorParallelepiped_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorParallelepiped_wrapper::* )(  ) )(&FormFactorParallelepiped_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorParallelepiped_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorParallelepiped_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorParallelepiped_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorParallelepiped_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorParallelepiped_wrapper::* )(  ) const)(&FormFactorParallelepiped_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorParallelepiped_wrapper::* )(  ) )(&FormFactorParallelepiped_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorParallelepiped_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorParallelepiped_wrapper::* )( ::complex_t const & ) )(&FormFactorParallelepiped_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorParallelepiped_wrapper::* )( ::std::string const &,double ) )(&FormFactorParallelepiped_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorParallelepiped_wrapper::* )(  ) )(&FormFactorParallelepiped_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorParallelepiped
+        typedef bp::class_< FormFactorParallelepiped_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorParallelepiped_exposer_t;
+        FormFactorParallelepiped_exposer_t FormFactorParallelepiped_exposer = FormFactorParallelepiped_exposer_t( "FormFactorParallelepiped", bp::init< double, double >(( bp::arg("height"), bp::arg("radius") )) );
+        bp::scope FormFactorParallelepiped_scope( FormFactorParallelepiped_exposer );
+        { //::FormFactorParallelepiped::clone
+        
+            typedef ::FormFactorParallelepiped * ( ::FormFactorParallelepiped::*clone_function_type )(  ) const;
+            typedef ::FormFactorParallelepiped * ( FormFactorParallelepiped_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorParallelepiped::clone)
+                , default_clone_function_type(&FormFactorParallelepiped_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorParallelepiped::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorParallelepiped::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorParallelepiped_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorParallelepiped::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorParallelepiped_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorParallelepiped::getHeight
+        
+            typedef double ( ::FormFactorParallelepiped::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorParallelepiped_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorParallelepiped::getHeight)
+                , default_getHeight_function_type(&FormFactorParallelepiped_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorParallelepiped::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorParallelepiped::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorParallelepiped_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorParallelepiped::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorParallelepiped_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorParallelepiped::getRadius
+        
+            typedef double ( ::FormFactorParallelepiped::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorParallelepiped_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::FormFactorParallelepiped::getRadius)
+                , default_getRadius_function_type(&FormFactorParallelepiped_wrapper::default_getRadius) );
+        
+        }
+        { //::FormFactorParallelepiped::getVolume
+        
+            typedef double ( ::FormFactorParallelepiped::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorParallelepiped_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::FormFactorParallelepiped::getVolume)
+                , default_getVolume_function_type(&FormFactorParallelepiped_wrapper::default_getVolume) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorParallelepiped_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorParallelepiped_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorParallelepiped_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorParallelepiped_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorParallelepiped_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorParallelepiped_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorParallelepiped_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorParallelepiped_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorParallelepiped_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorParallelepiped_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorParallelepiped_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorParallelepiped_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorParallelepiped_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorParallelepiped_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorParallelepiped_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorParallelepiped_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorParallelepiped_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorParallelepiped_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorParallelepiped_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorParallelepiped_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorParallelepiped_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorParallelepiped_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorParallelepiped_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorParallelepiped_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorParallelepiped_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorPrism3.pypp.cpp b/Core/PythonAPI/src/FormFactorPrism3.pypp.cpp
index 167ce4424b549d3c82ac2019316989d6808a54b1..8b56f336be8fea5b1b54336de17566276ff9ae5e 100644
--- a/Core/PythonAPI/src/FormFactorPrism3.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorPrism3.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorPrism3.pypp.h"
 
 namespace bp = boost::python;
@@ -200,6 +133,18 @@ struct FormFactorPrism3_wrapper : FormFactorPrism3, bp::wrapper< FormFactorPrism
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getRadius(  ) const  {
         if( bp::override func_getRadius = this->get_override( "getRadius" ) )
             return func_getRadius(  );
@@ -248,18 +193,6 @@ struct FormFactorPrism3_wrapper : FormFactorPrism3, bp::wrapper< FormFactorPrism
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -319,86 +252,216 @@ struct FormFactorPrism3_wrapper : FormFactorPrism3, bp::wrapper< FormFactorPrism
 
 void register_FormFactorPrism3_class(){
 
-    bp::class_< FormFactorPrism3_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorPrism3", bp::init< double, double >(( bp::arg("height"), bp::arg("half_side") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorPrism3 * ( ::FormFactorPrism3::* )(  ) const)(&::FormFactorPrism3::clone)
-            , (::FormFactorPrism3 * ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorPrism3::* )( ::cvector_t const & ) const)(&::FormFactorPrism3::evaluate_for_q)
-            , (::complex_t ( FormFactorPrism3_wrapper::* )( ::cvector_t const & ) const)(&FormFactorPrism3_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorPrism3::* )(  ) const)(&::FormFactorPrism3::getHeight)
-            , (double ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorPrism3::* )(  ) const)(&::FormFactorPrism3::getNumberOfStochasticParameters)
-            , (int ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorPrism3_wrapper::* )(  ) )(&FormFactorPrism3_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorPrism3_wrapper::* )(  ) )(&FormFactorPrism3_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorPrism3_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorPrism3_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorPrism3_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorPrism3_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorPrism3_wrapper::* )(  ) const)(&FormFactorPrism3_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorPrism3_wrapper::* )(  ) )(&FormFactorPrism3_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorPrism3_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorPrism3_wrapper::* )( ::complex_t const & ) )(&FormFactorPrism3_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorPrism3_wrapper::* )( ::std::string const &,double ) )(&FormFactorPrism3_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorPrism3_wrapper::* )(  ) )(&FormFactorPrism3_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorPrism3
+        typedef bp::class_< FormFactorPrism3_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorPrism3_exposer_t;
+        FormFactorPrism3_exposer_t FormFactorPrism3_exposer = FormFactorPrism3_exposer_t( "FormFactorPrism3", bp::init< double, double >(( bp::arg("height"), bp::arg("half_side") )) );
+        bp::scope FormFactorPrism3_scope( FormFactorPrism3_exposer );
+        { //::FormFactorPrism3::clone
+        
+            typedef ::FormFactorPrism3 * ( ::FormFactorPrism3::*clone_function_type )(  ) const;
+            typedef ::FormFactorPrism3 * ( FormFactorPrism3_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorPrism3::clone)
+                , default_clone_function_type(&FormFactorPrism3_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorPrism3::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorPrism3::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorPrism3_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorPrism3::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorPrism3_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorPrism3::getHeight
+        
+            typedef double ( ::FormFactorPrism3::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorPrism3_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorPrism3::getHeight)
+                , default_getHeight_function_type(&FormFactorPrism3_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorPrism3::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorPrism3::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorPrism3_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorPrism3::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorPrism3_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorPrism3_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorPrism3_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorPrism3_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorPrism3_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorPrism3_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorPrism3_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorPrism3_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorPrism3_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorPrism3_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorPrism3_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorPrism3_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorPrism3_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorPrism3_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorPrism3_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorPrism3_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorPrism3_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorPrism3_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorPrism3_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorPrism3_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorPrism3_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorPrism3_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorPrism3_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorPrism3_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorPrism3_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorPrism3_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorPrism3_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorPrism3_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorPrism3_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorPrism3_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorPrism3_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorPrism3_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorPrism3_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorPrism3_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorPrism3_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorPrism6.pypp.cpp b/Core/PythonAPI/src/FormFactorPrism6.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..cd03e8bcc1ba4cfc0d25bf553fb17833664d3529
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorPrism6.pypp.cpp
@@ -0,0 +1,467 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorPrism6.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorPrism6_wrapper : FormFactorPrism6, bp::wrapper< FormFactorPrism6 > {
+
+    FormFactorPrism6_wrapper(double height, double half_side )
+    : FormFactorPrism6( height, half_side )
+      , bp::wrapper< FormFactorPrism6 >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorPrism6 * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorPrism6::clone(  );
+        }
+    }
+    
+    ::FormFactorPrism6 * default_clone(  ) const  {
+        return FormFactorPrism6::clone( );
+    }
+
+    virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const  {
+        if( bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" ) )
+            return func_evaluate_for_q( boost::ref(q) );
+        else{
+            return this->FormFactorPrism6::evaluate_for_q( boost::ref(q) );
+        }
+    }
+    
+    ::complex_t default_evaluate_for_q( ::cvector_t const & q ) const  {
+        return FormFactorPrism6::evaluate_for_q( boost::ref(q) );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorPrism6::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorPrism6::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorPrism6::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorPrism6::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorBorn::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorBorn::getVolume( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorPrism6_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorPrism6_class(){
+
+    { //::FormFactorPrism6
+        typedef bp::class_< FormFactorPrism6_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorPrism6_exposer_t;
+        FormFactorPrism6_exposer_t FormFactorPrism6_exposer = FormFactorPrism6_exposer_t( "FormFactorPrism6", bp::init< double, double >(( bp::arg("height"), bp::arg("half_side") )) );
+        bp::scope FormFactorPrism6_scope( FormFactorPrism6_exposer );
+        { //::FormFactorPrism6::clone
+        
+            typedef ::FormFactorPrism6 * ( ::FormFactorPrism6::*clone_function_type )(  ) const;
+            typedef ::FormFactorPrism6 * ( FormFactorPrism6_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorPrism6::clone)
+                , default_clone_function_type(&FormFactorPrism6_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorPrism6::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorPrism6::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorPrism6_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorPrism6::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorPrism6_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorPrism6::getHeight
+        
+            typedef double ( ::FormFactorPrism6::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorPrism6_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorPrism6::getHeight)
+                , default_getHeight_function_type(&FormFactorPrism6_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorPrism6::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorPrism6::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorPrism6_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorPrism6::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorPrism6_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorPrism6_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorPrism6_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorPrism6_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorPrism6_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorPrism6_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorPrism6_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorPrism6_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorPrism6_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorPrism6_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorPrism6_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorPrism6_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorPrism6_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorPrism6_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorPrism6_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorPrism6_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorPrism6_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorPrism6_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorPrism6_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorPrism6_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorPrism6_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorPrism6_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorPrism6_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorPrism6_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorPrism6_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorPrism6_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorPrism6_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorPrism6_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorPrism6_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorPrism6_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorPrism6_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorPrism6_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorPrism6_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorPrism6_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorPrism6_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorPyramid.pypp.cpp b/Core/PythonAPI/src/FormFactorPyramid.pypp.cpp
index 469bf4e93f759842ab7e37af380ba601c48fb69e..92dcdb0ad8f09e807f3d061b84b33999bdbf0a4e 100644
--- a/Core/PythonAPI/src/FormFactorPyramid.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorPyramid.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorPyramid.pypp.h"
 
 namespace bp = boost::python;
@@ -200,6 +133,18 @@ struct FormFactorPyramid_wrapper : FormFactorPyramid, bp::wrapper< FormFactorPyr
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getRadius(  ) const  {
         if( bp::override func_getRadius = this->get_override( "getRadius" ) )
             return func_getRadius(  );
@@ -248,18 +193,6 @@ struct FormFactorPyramid_wrapper : FormFactorPyramid, bp::wrapper< FormFactorPyr
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -319,86 +252,216 @@ struct FormFactorPyramid_wrapper : FormFactorPyramid, bp::wrapper< FormFactorPyr
 
 void register_FormFactorPyramid_class(){
 
-    bp::class_< FormFactorPyramid_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorPyramid", bp::init< double, double, double >(( bp::arg("height"), bp::arg("half_side"), bp::arg("alpha") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorPyramid * ( ::FormFactorPyramid::* )(  ) const)(&::FormFactorPyramid::clone)
-            , (::FormFactorPyramid * ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorPyramid::* )( ::cvector_t const & ) const)(&::FormFactorPyramid::evaluate_for_q)
-            , (::complex_t ( FormFactorPyramid_wrapper::* )( ::cvector_t const & ) const)(&FormFactorPyramid_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorPyramid::* )(  ) const)(&::FormFactorPyramid::getHeight)
-            , (double ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorPyramid::* )(  ) const)(&::FormFactorPyramid::getNumberOfStochasticParameters)
-            , (int ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorPyramid_wrapper::* )(  ) )(&FormFactorPyramid_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorPyramid_wrapper::* )(  ) )(&FormFactorPyramid_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( FormFactorPyramid_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&FormFactorPyramid_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorPyramid_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorPyramid_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorPyramid_wrapper::* )(  ) const)(&FormFactorPyramid_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorPyramid_wrapper::* )(  ) )(&FormFactorPyramid_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorPyramid_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorPyramid_wrapper::* )( ::complex_t const & ) )(&FormFactorPyramid_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorPyramid_wrapper::* )( ::std::string const &,double ) )(&FormFactorPyramid_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorPyramid_wrapper::* )(  ) )(&FormFactorPyramid_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorPyramid
+        typedef bp::class_< FormFactorPyramid_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorPyramid_exposer_t;
+        FormFactorPyramid_exposer_t FormFactorPyramid_exposer = FormFactorPyramid_exposer_t( "FormFactorPyramid", bp::init< double, double, double >(( bp::arg("height"), bp::arg("half_side"), bp::arg("alpha") )) );
+        bp::scope FormFactorPyramid_scope( FormFactorPyramid_exposer );
+        { //::FormFactorPyramid::clone
+        
+            typedef ::FormFactorPyramid * ( ::FormFactorPyramid::*clone_function_type )(  ) const;
+            typedef ::FormFactorPyramid * ( FormFactorPyramid_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorPyramid::clone)
+                , default_clone_function_type(&FormFactorPyramid_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorPyramid::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorPyramid::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorPyramid_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorPyramid::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorPyramid_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorPyramid::getHeight
+        
+            typedef double ( ::FormFactorPyramid::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorPyramid_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorPyramid::getHeight)
+                , default_getHeight_function_type(&FormFactorPyramid_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorPyramid::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorPyramid::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorPyramid_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorPyramid::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorPyramid_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorPyramid_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorPyramid_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorPyramid_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorPyramid_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorPyramid_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorPyramid_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorPyramid_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorPyramid_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorPyramid_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorPyramid_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorPyramid_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorPyramid_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorPyramid_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorPyramid_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorPyramid_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorPyramid_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorPyramid_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorPyramid_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorPyramid_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorPyramid_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorPyramid_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorPyramid_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorPyramid_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorPyramid_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorPyramid_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorPyramid_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorPyramid_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorPyramid_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorPyramid_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorPyramid_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorPyramid_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorPyramid_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorPyramid_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorPyramid_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/FormFactorSphere.pypp.cpp b/Core/PythonAPI/src/FormFactorSphere.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0e75c0d09da50f4a24aee380f6fb0a286c8ce55f
--- /dev/null
+++ b/Core/PythonAPI/src/FormFactorSphere.pypp.cpp
@@ -0,0 +1,443 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "FormFactorSphere.pypp.h"
+
+namespace bp = boost::python;
+
+struct FormFactorSphere_wrapper : FormFactorSphere, bp::wrapper< FormFactorSphere > {
+
+    FormFactorSphere_wrapper(double radius, double height )
+    : FormFactorSphere( radius, height )
+      , bp::wrapper< FormFactorSphere >(){
+        // constructor
+    
+    }
+
+    virtual ::FormFactorSphere * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->FormFactorSphere::clone(  );
+        }
+    }
+    
+    ::FormFactorSphere * default_clone(  ) const  {
+        return FormFactorSphere::clone( );
+    }
+
+    virtual double getHeight(  ) const  {
+        if( bp::override func_getHeight = this->get_override( "getHeight" ) )
+            return func_getHeight(  );
+        else{
+            return this->FormFactorSphere::getHeight(  );
+        }
+    }
+    
+    double default_getHeight(  ) const  {
+        return FormFactorSphere::getHeight( );
+    }
+
+    virtual int getNumberOfStochasticParameters(  ) const  {
+        if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
+            return func_getNumberOfStochasticParameters(  );
+        else{
+            return this->FormFactorSphere::getNumberOfStochasticParameters(  );
+        }
+    }
+    
+    int default_getNumberOfStochasticParameters(  ) const  {
+        return FormFactorSphere::getNumberOfStochasticParameters( );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        IFormFactor::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::complex_t evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        if( bp::override func_evaluate = this->get_override( "evaluate" ) )
+            return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        else{
+            return this->IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+        }
+    }
+    
+    ::complex_t default_evaluate( ::cvector_t const & k_i, ::Bin1DCVector const & k_f_bin, double alpha_i, double alpha_f ) const  {
+        return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
+    virtual double getRadius(  ) const  {
+        if( bp::override func_getRadius = this->get_override( "getRadius" ) )
+            return func_getRadius(  );
+        else{
+            return this->IFormFactor::getRadius(  );
+        }
+    }
+    
+    double default_getRadius(  ) const  {
+        return IFormFactor::getRadius( );
+    }
+
+    virtual double getVolume(  ) const  {
+        if( bp::override func_getVolume = this->get_override( "getVolume" ) )
+            return func_getVolume(  );
+        else{
+            return this->IFormFactorBorn::getVolume(  );
+        }
+    }
+    
+    double default_getVolume(  ) const  {
+        return IFormFactorBorn::getVolume( );
+    }
+
+    virtual bool isDistributedFormFactor(  ) const  {
+        if( bp::override func_isDistributedFormFactor = this->get_override( "isDistributedFormFactor" ) )
+            return func_isDistributedFormFactor(  );
+        else{
+            return this->IFormFactor::isDistributedFormFactor(  );
+        }
+    }
+    
+    bool default_isDistributedFormFactor(  ) const  {
+        return IFormFactor::isDistributedFormFactor( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< FormFactorSphere_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual void setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
+            func_setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        else{
+            this->IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+        }
+    }
+    
+    void default_setAmbientRefractiveIndex( ::complex_t const & refractive_index ) {
+        IFormFactor::setAmbientRefractiveIndex( boost::ref(refractive_index) );
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_FormFactorSphere_class(){
+
+    { //::FormFactorSphere
+        typedef bp::class_< FormFactorSphere_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorSphere_exposer_t;
+        FormFactorSphere_exposer_t FormFactorSphere_exposer = FormFactorSphere_exposer_t( "FormFactorSphere", bp::init< double, double >(( bp::arg("radius"), bp::arg("height") )) );
+        bp::scope FormFactorSphere_scope( FormFactorSphere_exposer );
+        { //::FormFactorSphere::clone
+        
+            typedef ::FormFactorSphere * ( ::FormFactorSphere::*clone_function_type )(  ) const;
+            typedef ::FormFactorSphere * ( FormFactorSphere_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorSphere::clone)
+                , default_clone_function_type(&FormFactorSphere_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorSphere::getHeight
+        
+            typedef double ( ::FormFactorSphere::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorSphere_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorSphere::getHeight)
+                , default_getHeight_function_type(&FormFactorSphere_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorSphere::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorSphere::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorSphere_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorSphere::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorSphere_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorSphere_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorSphere_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorSphere_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorSphere_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorSphere_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorSphere_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorSphere_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorSphere_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorSphere_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorSphere_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorSphere_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorSphere_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorSphere_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorSphere_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorSphere_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorSphere_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorSphere_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorSphere_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorSphere_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorSphere_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorSphere_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorSphere_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorSphere_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorSphere_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorSphere_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorSphere_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorSphere_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorSphere_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorSphere_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorSphere_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorSphere_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorSphere_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorSphere_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorSphere_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp b/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp
index 1b3933ecb0f5a059c16299e4db67ed603fa17bbb..a6355deec27609730e7abf110c66163769d3ce03 100644
--- a/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp
+++ b/Core/PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "FormFactorSphereGaussianRadius.pypp.h"
 
 namespace bp = boost::python;
@@ -104,6 +37,18 @@ struct FormFactorSphereGaussianRadius_wrapper : FormFactorSphereGaussianRadius,
         return FormFactorSphereGaussianRadius::clone( );
     }
 
+    virtual void createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        if( bp::override func_createDistributedFormFactors = this->get_override( "createDistributedFormFactors" ) )
+            func_createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        else{
+            this->FormFactorSphereGaussianRadius::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+        }
+    }
+    
+    void default_createDistributedFormFactors( ::std::vector< IFormFactor* > & form_factors, ::std::vector< double > & probabilities, ::size_t nbr_samples ) const  {
+        FormFactorSphereGaussianRadius::createDistributedFormFactors( boost::ref(form_factors), boost::ref(probabilities), nbr_samples );
+    }
+
     virtual ::complex_t evaluate_for_q( ::cvector_t const & q ) const  {
         if( bp::override func_evaluate_for_q = this->get_override( "evaluate_for_q" ) )
             return func_evaluate_for_q( boost::ref(q) );
@@ -200,6 +145,18 @@ struct FormFactorSphereGaussianRadius_wrapper : FormFactorSphereGaussianRadius,
         return IFormFactorBorn::evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getRadius(  ) const  {
         if( bp::override func_getRadius = this->get_override( "getRadius" ) )
             return func_getRadius(  );
@@ -236,18 +193,6 @@ struct FormFactorSphereGaussianRadius_wrapper : FormFactorSphereGaussianRadius,
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -307,80 +252,216 @@ struct FormFactorSphereGaussianRadius_wrapper : FormFactorSphereGaussianRadius,
 
 void register_FormFactorSphereGaussianRadius_class(){
 
-    bp::class_< FormFactorSphereGaussianRadius_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable >( "FormFactorSphereGaussianRadius", bp::init< double, double >(( bp::arg("mean"), bp::arg("sigma") )) )    
-        .def( 
-            "clone"
-            , (::FormFactorSphereGaussianRadius * ( ::FormFactorSphereGaussianRadius::* )(  ) const)(&::FormFactorSphereGaussianRadius::clone)
-            , (::FormFactorSphereGaussianRadius * ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate_for_q"
-            , (::complex_t ( ::FormFactorSphereGaussianRadius::* )( ::cvector_t const & ) const)(&::FormFactorSphereGaussianRadius::evaluate_for_q)
-            , (::complex_t ( FormFactorSphereGaussianRadius_wrapper::* )( ::cvector_t const & ) const)(&FormFactorSphereGaussianRadius_wrapper::default_evaluate_for_q)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::FormFactorSphereGaussianRadius::* )(  ) const)(&::FormFactorSphereGaussianRadius::getHeight)
-            , (double ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::FormFactorSphereGaussianRadius::* )(  ) const)(&::FormFactorSphereGaussianRadius::getNumberOfStochasticParameters)
-            , (int ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::FormFactorSphereGaussianRadius::* )(  ) const)(&::FormFactorSphereGaussianRadius::isDistributedFormFactor)
-            , (bool ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( FormFactorSphereGaussianRadius_wrapper::* )(  ) )(&FormFactorSphereGaussianRadius_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( FormFactorSphereGaussianRadius_wrapper::* )(  ) )(&FormFactorSphereGaussianRadius_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( FormFactorSphereGaussianRadius_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&FormFactorSphereGaussianRadius_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_getVolume) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( FormFactorSphereGaussianRadius_wrapper::* )(  ) const)(&FormFactorSphereGaussianRadius_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( FormFactorSphereGaussianRadius_wrapper::* )(  ) )(&FormFactorSphereGaussianRadius_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &FormFactorSphereGaussianRadius_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( FormFactorSphereGaussianRadius_wrapper::* )( ::complex_t const & ) )(&FormFactorSphereGaussianRadius_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( FormFactorSphereGaussianRadius_wrapper::* )( ::std::string const &,double ) )(&FormFactorSphereGaussianRadius_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( FormFactorSphereGaussianRadius_wrapper::* )(  ) )(&FormFactorSphereGaussianRadius_wrapper::default_setParametersAreChanged) );
+    { //::FormFactorSphereGaussianRadius
+        typedef bp::class_< FormFactorSphereGaussianRadius_wrapper, bp::bases< IFormFactorBorn >, boost::noncopyable > FormFactorSphereGaussianRadius_exposer_t;
+        FormFactorSphereGaussianRadius_exposer_t FormFactorSphereGaussianRadius_exposer = FormFactorSphereGaussianRadius_exposer_t( "FormFactorSphereGaussianRadius", bp::init< double, double >(( bp::arg("mean"), bp::arg("sigma") )) );
+        bp::scope FormFactorSphereGaussianRadius_scope( FormFactorSphereGaussianRadius_exposer );
+        { //::FormFactorSphereGaussianRadius::clone
+        
+            typedef ::FormFactorSphereGaussianRadius * ( ::FormFactorSphereGaussianRadius::*clone_function_type )(  ) const;
+            typedef ::FormFactorSphereGaussianRadius * ( FormFactorSphereGaussianRadius_wrapper::*default_clone_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "clone"
+                , clone_function_type(&::FormFactorSphereGaussianRadius::clone)
+                , default_clone_function_type(&FormFactorSphereGaussianRadius_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::createDistributedFormFactors
+        
+            typedef void ( ::FormFactorSphereGaussianRadius::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::FormFactorSphereGaussianRadius::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&FormFactorSphereGaussianRadius_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::evaluate_for_q
+        
+            typedef ::complex_t ( ::FormFactorSphereGaussianRadius::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            typedef ::complex_t ( FormFactorSphereGaussianRadius_wrapper::*default_evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "evaluate_for_q"
+                , evaluate_for_q_function_type(&::FormFactorSphereGaussianRadius::evaluate_for_q)
+                , default_evaluate_for_q_function_type(&FormFactorSphereGaussianRadius_wrapper::default_evaluate_for_q)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::getHeight
+        
+            typedef double ( ::FormFactorSphereGaussianRadius::*getHeight_function_type )(  ) const;
+            typedef double ( FormFactorSphereGaussianRadius_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::FormFactorSphereGaussianRadius::getHeight)
+                , default_getHeight_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getHeight) );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::getNumberOfStochasticParameters
+        
+            typedef int ( ::FormFactorSphereGaussianRadius::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( FormFactorSphereGaussianRadius_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::FormFactorSphereGaussianRadius::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::FormFactorSphereGaussianRadius::isDistributedFormFactor
+        
+            typedef bool ( ::FormFactorSphereGaussianRadius::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( FormFactorSphereGaussianRadius_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::FormFactorSphereGaussianRadius::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&FormFactorSphereGaussianRadius_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( FormFactorSphereGaussianRadius_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&FormFactorSphereGaussianRadius_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&FormFactorSphereGaussianRadius_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( FormFactorSphereGaussianRadius_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&FormFactorSphereGaussianRadius_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( FormFactorSphereGaussianRadius_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&FormFactorSphereGaussianRadius_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( FormFactorSphereGaussianRadius_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( FormFactorSphereGaussianRadius_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( FormFactorSphereGaussianRadius_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&FormFactorSphereGaussianRadius_wrapper::default_getVolume) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&FormFactorSphereGaussianRadius_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &FormFactorSphereGaussianRadius_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&FormFactorSphereGaussianRadius_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( FormFactorSphereGaussianRadius_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&FormFactorSphereGaussianRadius_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( FormFactorSphereGaussianRadius_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            FormFactorSphereGaussianRadius_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&FormFactorSphereGaussianRadius_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/HomogeneousMaterial.pypp.cpp b/Core/PythonAPI/src/HomogeneousMaterial.pypp.cpp
index 6958510208e3a86cbf2926cfaa629cdf412dffcd..1e01a3ee1dc5acd5c2d0130b75c8637a36fe04ae 100644
--- a/Core/PythonAPI/src/HomogeneousMaterial.pypp.cpp
+++ b/Core/PythonAPI/src/HomogeneousMaterial.pypp.cpp
@@ -1,97 +1,46 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "HomogeneousMaterial.pypp.h"
 
 namespace bp = boost::python;
 
 void register_HomogeneousMaterial_class(){
 
-    bp::class_< HomogeneousMaterial, bp::bases< IMaterial > >( "HomogeneousMaterial", bp::init< complex_t const & >(( bp::arg("refractive_index") )) )    
-        .def( bp::init< std::string const &, complex_t const & >(( bp::arg("name"), bp::arg("refractive_index") )) )    
-        .def( bp::init< std::string const &, double, double >(( bp::arg("name"), bp::arg("refractive_index_real"), bp::arg("refractive_index_imag") )) )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t ( ::HomogeneousMaterial::* )(  ) const)( &::HomogeneousMaterial::getRefractiveIndex ) )    
-        .def( 
-            "setRefractiveIndex"
-            , (void ( ::HomogeneousMaterial::* )( ::complex_t const & ) )( &::HomogeneousMaterial::setRefractiveIndex )
-            , ( bp::arg("refractive_index") ) );
+    { //::HomogeneousMaterial
+        typedef bp::class_< HomogeneousMaterial, bp::bases< IMaterial > > HomogeneousMaterial_exposer_t;
+        HomogeneousMaterial_exposer_t HomogeneousMaterial_exposer = HomogeneousMaterial_exposer_t( "HomogeneousMaterial", bp::init< std::string const &, complex_t const & >(( bp::arg("name"), bp::arg("refractive_index") )) );
+        bp::scope HomogeneousMaterial_scope( HomogeneousMaterial_exposer );
+        HomogeneousMaterial_exposer.def( bp::init< std::string const &, double, double >(( bp::arg("name"), bp::arg("refractive_index_real"), bp::arg("refractive_index_imag") )) );
+        HomogeneousMaterial_exposer.def( bp::init< complex_t const & >(( bp::arg("refractive_index") )) );
+        { //::HomogeneousMaterial::getRefractiveIndex
+        
+            typedef ::complex_t ( ::HomogeneousMaterial::*getRefractiveIndex_function_type )(  ) const;
+            
+            HomogeneousMaterial_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type( &::HomogeneousMaterial::getRefractiveIndex ) );
+        
+        }
+        { //::HomogeneousMaterial::setRefractiveIndex
+        
+            typedef void ( ::HomogeneousMaterial::*setRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            HomogeneousMaterial_exposer.def( 
+                "setRefractiveIndex"
+                , setRefractiveIndex_function_type( &::HomogeneousMaterial::setRefractiveIndex )
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IAxis.pypp.cpp b/Core/PythonAPI/src/IAxis.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a6c9c35dcd98aa69f39a992fe63304b54e7adf7c
--- /dev/null
+++ b/Core/PythonAPI/src/IAxis.pypp.cpp
@@ -0,0 +1,172 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "PythonCoreList.h"
+#include "IAxis.pypp.h"
+
+namespace bp = boost::python;
+
+struct IAxis_wrapper : IAxis, bp::wrapper< IAxis > {
+
+    IAxis_wrapper(::std::string name )
+    : IAxis( name )
+      , bp::wrapper< IAxis >(){
+        // constructor
+    
+    }
+
+    virtual ::IAxis * clone(  ) const {
+        bp::override func_clone = this->get_override( "clone" );
+        return func_clone(  );
+    }
+
+    virtual ::IAxis * createDoubleBinSize(  ) const {
+        bp::override func_createDoubleBinSize = this->get_override( "createDoubleBinSize" );
+        return func_createDoubleBinSize(  );
+    }
+
+    virtual ::size_t findClosestIndex( double value ) const {
+        bp::override func_findClosestIndex = this->get_override( "findClosestIndex" );
+        return func_findClosestIndex( value );
+    }
+
+    virtual ::Bin1D getBin( ::size_t index ) const {
+        bp::override func_getBin = this->get_override( "getBin" );
+        return func_getBin( index );
+    }
+
+    virtual double getMax(  ) const {
+        bp::override func_getMax = this->get_override( "getMax" );
+        return func_getMax(  );
+    }
+
+    virtual double getMin(  ) const {
+        bp::override func_getMin = this->get_override( "getMin" );
+        return func_getMin(  );
+    }
+
+    virtual ::size_t getSize(  ) const {
+        bp::override func_getSize = this->get_override( "getSize" );
+        return func_getSize(  );
+    }
+
+    virtual double operator[]( ::size_t index ) const {
+        bp::override func___getitem__ = this->get_override( "__getitem__" );
+        return func___getitem__( index );
+    }
+
+};
+
+void register_IAxis_class(){
+
+    { //::IAxis
+        typedef bp::class_< IAxis_wrapper, boost::noncopyable > IAxis_exposer_t;
+        IAxis_exposer_t IAxis_exposer = IAxis_exposer_t( "IAxis", bp::init< std::string >(( bp::arg("name") )) );
+        bp::scope IAxis_scope( IAxis_exposer );
+        { //::IAxis::clone
+        
+            typedef ::IAxis * ( ::IAxis::*clone_function_type )(  ) const;
+            
+            IAxis_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IAxis::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IAxis::createDoubleBinSize
+        
+            typedef ::IAxis * ( ::IAxis::*createDoubleBinSize_function_type )(  ) const;
+            
+            IAxis_exposer.def( 
+                "createDoubleBinSize"
+                , bp::pure_virtual( createDoubleBinSize_function_type(&::IAxis::createDoubleBinSize) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IAxis::findClosestIndex
+        
+            typedef ::size_t ( ::IAxis::*findClosestIndex_function_type )( double ) const;
+            
+            IAxis_exposer.def( 
+                "findClosestIndex"
+                , bp::pure_virtual( findClosestIndex_function_type(&::IAxis::findClosestIndex) )
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::IAxis::getBin
+        
+            typedef ::Bin1D ( ::IAxis::*getBin_function_type )( ::size_t ) const;
+            
+            IAxis_exposer.def( 
+                "getBin"
+                , bp::pure_virtual( getBin_function_type(&::IAxis::getBin) )
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::IAxis::getMax
+        
+            typedef double ( ::IAxis::*getMax_function_type )(  ) const;
+            
+            IAxis_exposer.def( 
+                "getMax"
+                , bp::pure_virtual( getMax_function_type(&::IAxis::getMax) ) );
+        
+        }
+        { //::IAxis::getMin
+        
+            typedef double ( ::IAxis::*getMin_function_type )(  ) const;
+            
+            IAxis_exposer.def( 
+                "getMin"
+                , bp::pure_virtual( getMin_function_type(&::IAxis::getMin) ) );
+        
+        }
+        { //::IAxis::getName
+        
+            typedef ::std::string ( ::IAxis::*getName_function_type )(  ) const;
+            
+            IAxis_exposer.def( 
+                "getName"
+                , getName_function_type( &::IAxis::getName ) );
+        
+        }
+        { //::IAxis::getSize
+        
+            typedef ::size_t ( ::IAxis::*getSize_function_type )(  ) const;
+            
+            IAxis_exposer.def( 
+                "getSize"
+                , bp::pure_virtual( getSize_function_type(&::IAxis::getSize) ) );
+        
+        }
+        { //::IAxis::operator[]
+        
+            typedef double ( ::IAxis::*__getitem___function_type )( ::size_t ) const;
+            
+            IAxis_exposer.def( 
+                "__getitem__"
+                , bp::pure_virtual( __getitem___function_type(&::IAxis::operator[]) )
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::IAxis::setName
+        
+            typedef void ( ::IAxis::*setName_function_type )( ::std::string ) ;
+            
+            IAxis_exposer.def( 
+                "setName"
+                , setName_function_type( &::IAxis::setName )
+                , ( bp::arg("name") ) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/ICloneable.pypp.cpp b/Core/PythonAPI/src/ICloneable.pypp.cpp
index d0b8bf1f2fe89bda1e95e62891df401a1e01f7a3..3459ec80f0c7c4fea2c1dce39901d31d726ec445 100644
--- a/Core/PythonAPI/src/ICloneable.pypp.cpp
+++ b/Core/PythonAPI/src/ICloneable.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ICloneable.pypp.h"
 
 namespace bp = boost::python;
@@ -99,10 +32,20 @@ struct ICloneable_wrapper : ICloneable, bp::wrapper< ICloneable > {
 
 void register_ICloneable_class(){
 
-    bp::class_< ICloneable_wrapper, boost::noncopyable >( "ICloneable", bp::init< >() )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::ICloneable * ( ::ICloneable::* )(  ) const)(&::ICloneable::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() );
+    { //::ICloneable
+        typedef bp::class_< ICloneable_wrapper, boost::noncopyable > ICloneable_exposer_t;
+        ICloneable_exposer_t ICloneable_exposer = ICloneable_exposer_t( "ICloneable", bp::init< >() );
+        bp::scope ICloneable_scope( ICloneable_exposer );
+        { //::ICloneable::clone
+        
+            typedef ::ICloneable * ( ::ICloneable::*clone_function_type )(  ) const;
+            
+            ICloneable_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::ICloneable::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IClusteredParticles.pypp.cpp b/Core/PythonAPI/src/IClusteredParticles.pypp.cpp
index 5f95ff958a118ffb7c2f7602780c2d211c0e5b75..c4e5791058bbc82665f2336bc7df300f89ea9c1c 100644
--- a/Core/PythonAPI/src/IClusteredParticles.pypp.cpp
+++ b/Core/PythonAPI/src/IClusteredParticles.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IClusteredParticles.pypp.h"
 
 namespace bp = boost::python;
@@ -104,18 +37,6 @@ struct IClusteredParticles_wrapper : IClusteredParticles, bp::wrapper< IClustere
         return IClusteredParticles::clone( );
     }
 
-    virtual ::std::vector< DiffuseParticleInfo* > * createDiffuseParticleInfo( ::ParticleInfo const & parent_info ) const  {
-        if( bp::override func_createDiffuseParticleInfo = this->get_override( "createDiffuseParticleInfo" ) )
-            return func_createDiffuseParticleInfo( boost::ref(parent_info) );
-        else{
-            return this->IClusteredParticles::createDiffuseParticleInfo( boost::ref(parent_info) );
-        }
-    }
-    
-    ::std::vector< DiffuseParticleInfo* > * default_createDiffuseParticleInfo( ::ParticleInfo const & parent_info ) const  {
-        return IClusteredParticles::createDiffuseParticleInfo( boost::ref(parent_info) );
-    }
-
     virtual ::IFormFactor * createTotalFormFactor( ::IFormFactor const & meso_crystal_form_factor, ::complex_t ambient_refractive_index ) const  {
         if( bp::override func_createTotalFormFactor = this->get_override( "createTotalFormFactor" ) )
             return func_createTotalFormFactor( boost::ref(meso_crystal_form_factor), ambient_refractive_index );
@@ -205,18 +126,6 @@ struct IClusteredParticles_wrapper : IClusteredParticles, bp::wrapper< IClustere
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -276,75 +185,158 @@ struct IClusteredParticles_wrapper : IClusteredParticles, bp::wrapper< IClustere
 
 void register_IClusteredParticles_class(){
 
-    bp::class_< IClusteredParticles_wrapper, bp::bases< ICompositeSample >, boost::noncopyable >( "IClusteredParticles", bp::init< >() )    
-        .def( 
-            "clone"
-            , (::IClusteredParticles * ( ::IClusteredParticles::* )(  ) const)(&::IClusteredParticles::clone)
-            , (::IClusteredParticles * ( IClusteredParticles_wrapper::* )(  ) const)(&IClusteredParticles_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createDiffuseParticleInfo"
-            , (::std::vector< DiffuseParticleInfo* > * ( ::IClusteredParticles::* )( ::ParticleInfo const & ) const)(&::IClusteredParticles::createDiffuseParticleInfo)
-            , (::std::vector< DiffuseParticleInfo* > * ( IClusteredParticles_wrapper::* )( ::ParticleInfo const & ) const)(&IClusteredParticles_wrapper::default_createDiffuseParticleInfo)
-            , ( bp::arg("parent_info") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createTotalFormFactor"
-            , (::IFormFactor * ( ::IClusteredParticles::* )( ::IFormFactor const &,::complex_t ) const)(&::IClusteredParticles::createTotalFormFactor)
-            , (::IFormFactor * ( IClusteredParticles_wrapper::* )( ::IFormFactor const &,::complex_t ) const)(&IClusteredParticles_wrapper::default_createTotalFormFactor)
-            , ( bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , bp::pure_virtual( (void ( ::IClusteredParticles::* )( ::complex_t ) )(&::IClusteredParticles::setAmbientRefractiveIndex) )
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IClusteredParticles_wrapper::* )(  ) )(&IClusteredParticles_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IClusteredParticles_wrapper::* )(  ) )(&IClusteredParticles_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IClusteredParticles_wrapper::* )(  ) const)(&IClusteredParticles_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( IClusteredParticles_wrapper::* )(  ) )(&IClusteredParticles_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( IClusteredParticles_wrapper::* )(  ) const)(&IClusteredParticles_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IClusteredParticles_wrapper::* )(  ) const)(&IClusteredParticles_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( IClusteredParticles_wrapper::* )(  ) )(&IClusteredParticles_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IClusteredParticles_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IClusteredParticles_wrapper::* )( ::std::string const &,double ) )(&IClusteredParticles_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IClusteredParticles_wrapper::* )(  ) )(&IClusteredParticles_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( IClusteredParticles_wrapper::* )(  ) const)(&IClusteredParticles_wrapper::default_size) );
+    { //::IClusteredParticles
+        typedef bp::class_< IClusteredParticles_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > IClusteredParticles_exposer_t;
+        IClusteredParticles_exposer_t IClusteredParticles_exposer = IClusteredParticles_exposer_t( "IClusteredParticles", bp::init< >() );
+        bp::scope IClusteredParticles_scope( IClusteredParticles_exposer );
+        { //::IClusteredParticles::clone
+        
+            typedef ::IClusteredParticles * ( ::IClusteredParticles::*clone_function_type )(  ) const;
+            typedef ::IClusteredParticles * ( IClusteredParticles_wrapper::*default_clone_function_type )(  ) const;
+            
+            IClusteredParticles_exposer.def( 
+                "clone"
+                , clone_function_type(&::IClusteredParticles::clone)
+                , default_clone_function_type(&IClusteredParticles_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IClusteredParticles::createTotalFormFactor
+        
+            typedef ::IFormFactor * ( ::IClusteredParticles::*createTotalFormFactor_function_type )( ::IFormFactor const &,::complex_t ) const;
+            typedef ::IFormFactor * ( IClusteredParticles_wrapper::*default_createTotalFormFactor_function_type )( ::IFormFactor const &,::complex_t ) const;
+            
+            IClusteredParticles_exposer.def( 
+                "createTotalFormFactor"
+                , createTotalFormFactor_function_type(&::IClusteredParticles::createTotalFormFactor)
+                , default_createTotalFormFactor_function_type(&IClusteredParticles_wrapper::default_createTotalFormFactor)
+                , ( bp::arg("meso_crystal_form_factor"), bp::arg("ambient_refractive_index") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IClusteredParticles::setAmbientRefractiveIndex
+        
+            typedef void ( ::IClusteredParticles::*setAmbientRefractiveIndex_function_type )( ::complex_t ) ;
+            
+            IClusteredParticles_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , bp::pure_virtual( setAmbientRefractiveIndex_function_type(&::IClusteredParticles::setAmbientRefractiveIndex) )
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IClusteredParticles_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IClusteredParticles_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IClusteredParticles_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IClusteredParticles_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IClusteredParticles_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IClusteredParticles_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IClusteredParticles_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IClusteredParticles_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IClusteredParticles_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( IClusteredParticles_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            IClusteredParticles_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IClusteredParticles_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IClusteredParticles_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IClusteredParticles_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IClusteredParticles_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IClusteredParticles_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IClusteredParticles_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IClusteredParticles_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IClusteredParticles_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IClusteredParticles_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IClusteredParticles_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IClusteredParticles_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IClusteredParticles_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IClusteredParticles_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IClusteredParticles_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IClusteredParticles_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( IClusteredParticles_wrapper::*default_size_function_type )(  ) const;
+            
+            IClusteredParticles_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&IClusteredParticles_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ICompositeSample.pypp.cpp b/Core/PythonAPI/src/ICompositeSample.pypp.cpp
index b1177c0a0b749b63858cc1807e3a79d596449bb6..5f60cb8c9624238cb62315a1fa5d56bee6a8aba0 100644
--- a/Core/PythonAPI/src/ICompositeSample.pypp.cpp
+++ b/Core/PythonAPI/src/ICompositeSample.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ICompositeSample.pypp.h"
 
 namespace bp = boost::python;
@@ -188,18 +121,6 @@ struct ICompositeSample_wrapper : ICompositeSample, bp::wrapper< ICompositeSampl
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -247,71 +168,171 @@ struct ICompositeSample_wrapper : ICompositeSample, bp::wrapper< ICompositeSampl
 
 void register_ICompositeSample_class(){
 
-    bp::class_< ICompositeSample_wrapper, bp::bases< ISample >, boost::noncopyable >( "ICompositeSample", bp::init< >() )    
-        .def( 
-            "begin_shallow"
-            , (::std::_List_iterator< ISample* > ( ::ICompositeSample::* )(  ) )( &::ICompositeSample::begin_shallow ) )    
-        .def( 
-            "begin_shallow"
-            , (::std::_List_const_iterator< ISample* > ( ::ICompositeSample::* )(  ) const)( &::ICompositeSample::begin_shallow ) )    
-        .def( 
-            "clone"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::clone)
-            , (::ICompositeSample * ( ICompositeSample_wrapper::* )(  ) const)(&ICompositeSample_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "end_shallow"
-            , (::std::_List_iterator< ISample* > ( ::ICompositeSample::* )(  ) )( &::ICompositeSample::end_shallow ) )    
-        .def( 
-            "end_shallow"
-            , (::std::_List_const_iterator< ISample* > ( ::ICompositeSample::* )(  ) const)( &::ICompositeSample::end_shallow ) )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( ICompositeSample_wrapper::* )(  ) )(&ICompositeSample_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( ICompositeSample_wrapper::* )(  ) const)(&ICompositeSample_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( ICompositeSample_wrapper::* )(  ) const)(&ICompositeSample_wrapper::default_size) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ICompositeSample_wrapper::* )(  ) )(&ICompositeSample_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ICompositeSample_wrapper::* )(  ) )(&ICompositeSample_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ICompositeSample_wrapper::* )(  ) const)(&ICompositeSample_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ICompositeSample_wrapper::* )(  ) const)(&ICompositeSample_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( ICompositeSample_wrapper::* )(  ) )(&ICompositeSample_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ICompositeSample_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ICompositeSample_wrapper::* )( ::std::string const &,double ) )(&ICompositeSample_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ICompositeSample_wrapper::* )(  ) )(&ICompositeSample_wrapper::default_setParametersAreChanged) );
+    { //::ICompositeSample
+        typedef bp::class_< ICompositeSample_wrapper, bp::bases< ISample >, boost::noncopyable > ICompositeSample_exposer_t;
+        ICompositeSample_exposer_t ICompositeSample_exposer = ICompositeSample_exposer_t( "ICompositeSample", bp::init< >() );
+        bp::scope ICompositeSample_scope( ICompositeSample_exposer );
+        { //::ICompositeSample::begin_shallow
+        
+            typedef ::std::_List_iterator< ISample* > ( ::ICompositeSample::*begin_shallow_function_type )(  ) ;
+            
+            ICompositeSample_exposer.def( 
+                "begin_shallow"
+                , begin_shallow_function_type( &::ICompositeSample::begin_shallow ) );
+        
+        }
+        { //::ICompositeSample::begin_shallow
+        
+            typedef ::std::_List_const_iterator< ISample* > ( ::ICompositeSample::*begin_shallow_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "begin_shallow"
+                , begin_shallow_function_type( &::ICompositeSample::begin_shallow ) );
+        
+        }
+        { //::ICompositeSample::clone
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*clone_function_type )(  ) const;
+            typedef ::ICompositeSample * ( ICompositeSample_wrapper::*default_clone_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "clone"
+                , clone_function_type(&::ICompositeSample::clone)
+                , default_clone_function_type(&ICompositeSample_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::end_shallow
+        
+            typedef ::std::_List_iterator< ISample* > ( ::ICompositeSample::*end_shallow_function_type )(  ) ;
+            
+            ICompositeSample_exposer.def( 
+                "end_shallow"
+                , end_shallow_function_type( &::ICompositeSample::end_shallow ) );
+        
+        }
+        { //::ICompositeSample::end_shallow
+        
+            typedef ::std::_List_const_iterator< ISample* > ( ::ICompositeSample::*end_shallow_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "end_shallow"
+                , end_shallow_function_type( &::ICompositeSample::end_shallow ) );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( ICompositeSample_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            ICompositeSample_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ICompositeSample_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( ICompositeSample_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ICompositeSample_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( ICompositeSample_wrapper::*default_size_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&ICompositeSample_wrapper::default_size) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ICompositeSample_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ICompositeSample_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ICompositeSample_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ICompositeSample_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ICompositeSample_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ICompositeSample_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ICompositeSample_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ICompositeSample_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ICompositeSample_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ICompositeSample_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ICompositeSample_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ICompositeSample_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ICompositeSample_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ICompositeSample_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ICompositeSample_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ICompositeSample_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ICompositeSample_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ICompositeSample_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ICompositeSample_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IDecoration.pypp.cpp b/Core/PythonAPI/src/IDecoration.pypp.cpp
index 0c7d2e3b2a8a3c3a30e3040840c0ef2cd23031b3..a14211b06a2aee6bf76d1c13819a9a3a8448513e 100644
--- a/Core/PythonAPI/src/IDecoration.pypp.cpp
+++ b/Core/PythonAPI/src/IDecoration.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IDecoration.pypp.h"
 
 namespace bp = boost::python;
@@ -201,18 +134,6 @@ struct IDecoration_wrapper : IDecoration, bp::wrapper< IDecoration > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -272,84 +193,202 @@ struct IDecoration_wrapper : IDecoration, bp::wrapper< IDecoration > {
 
 void register_IDecoration_class(){
 
-    bp::class_< IDecoration_wrapper, bp::bases< ICompositeSample >, boost::noncopyable >( "IDecoration", bp::init< >() )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IDecoration * ( ::IDecoration::* )(  ) const)(&::IDecoration::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getAbundanceFractionOfParticle"
-            , bp::pure_virtual( (double ( ::IDecoration::* )( ::size_t ) const)(&::IDecoration::getAbundanceFractionOfParticle) )
-            , ( bp::arg("index") ) )    
-        .def( 
-            "getInterferenceFunctions"
-            , bp::pure_virtual( (::SafePointerVector< IInterferenceFunction > ( ::IDecoration::* )(  ) const)(&::IDecoration::getInterferenceFunctions) ) )    
-        .def( 
-            "getNumberOfInterferenceFunctions"
-            , (::size_t ( ::IDecoration::* )(  ) const)(&::IDecoration::getNumberOfInterferenceFunctions)
-            , (::size_t ( IDecoration_wrapper::* )(  ) const)(&IDecoration_wrapper::default_getNumberOfInterferenceFunctions) )    
-        .def( 
-            "getNumberOfParticles"
-            , bp::pure_virtual( (::size_t ( ::IDecoration::* )(  ) const)(&::IDecoration::getNumberOfParticles) ) )    
-        .def( 
-            "getParticleInfo"
-            , bp::pure_virtual( (::ParticleInfo const * ( ::IDecoration::* )( ::size_t ) const)(&::IDecoration::getParticleInfo) )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getTotalParticleSurfaceDensity"
-            , (double ( ::IDecoration::* )(  ) const)( &::IDecoration::getTotalParticleSurfaceDensity ) )    
-        .def( 
-            "setTotalParticleSurfaceDensity"
-            , (void ( ::IDecoration::* )( double ) )( &::IDecoration::setTotalParticleSurfaceDensity )
-            , ( bp::arg("surface_density") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IDecoration_wrapper::* )(  ) )(&IDecoration_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IDecoration_wrapper::* )(  ) )(&IDecoration_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IDecoration_wrapper::* )(  ) const)(&IDecoration_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( IDecoration_wrapper::* )(  ) )(&IDecoration_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( IDecoration_wrapper::* )(  ) const)(&IDecoration_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IDecoration_wrapper::* )(  ) const)(&IDecoration_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( IDecoration_wrapper::* )(  ) )(&IDecoration_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IDecoration_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IDecoration_wrapper::* )( ::std::string const &,double ) )(&IDecoration_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IDecoration_wrapper::* )(  ) )(&IDecoration_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( IDecoration_wrapper::* )(  ) const)(&IDecoration_wrapper::default_size) );
+    { //::IDecoration
+        typedef bp::class_< IDecoration_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > IDecoration_exposer_t;
+        IDecoration_exposer_t IDecoration_exposer = IDecoration_exposer_t( "IDecoration", bp::init< >() );
+        bp::scope IDecoration_scope( IDecoration_exposer );
+        { //::IDecoration::clone
+        
+            typedef ::IDecoration * ( ::IDecoration::*clone_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IDecoration::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IDecoration::getAbundanceFractionOfParticle
+        
+            typedef double ( ::IDecoration::*getAbundanceFractionOfParticle_function_type )( ::size_t ) const;
+            
+            IDecoration_exposer.def( 
+                "getAbundanceFractionOfParticle"
+                , bp::pure_virtual( getAbundanceFractionOfParticle_function_type(&::IDecoration::getAbundanceFractionOfParticle) )
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::IDecoration::getInterferenceFunctions
+        
+            typedef ::SafePointerVector<IInterferenceFunction> ( ::IDecoration::*getInterferenceFunctions_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "getInterferenceFunctions"
+                , bp::pure_virtual( getInterferenceFunctions_function_type(&::IDecoration::getInterferenceFunctions) ) );
+        
+        }
+        { //::IDecoration::getNumberOfInterferenceFunctions
+        
+            typedef ::size_t ( ::IDecoration::*getNumberOfInterferenceFunctions_function_type )(  ) const;
+            typedef ::size_t ( IDecoration_wrapper::*default_getNumberOfInterferenceFunctions_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "getNumberOfInterferenceFunctions"
+                , getNumberOfInterferenceFunctions_function_type(&::IDecoration::getNumberOfInterferenceFunctions)
+                , default_getNumberOfInterferenceFunctions_function_type(&IDecoration_wrapper::default_getNumberOfInterferenceFunctions) );
+        
+        }
+        { //::IDecoration::getNumberOfParticles
+        
+            typedef ::size_t ( ::IDecoration::*getNumberOfParticles_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "getNumberOfParticles"
+                , bp::pure_virtual( getNumberOfParticles_function_type(&::IDecoration::getNumberOfParticles) ) );
+        
+        }
+        { //::IDecoration::getParticleInfo
+        
+            typedef ::ParticleInfo const * ( ::IDecoration::*getParticleInfo_function_type )( ::size_t ) const;
+            
+            IDecoration_exposer.def( 
+                "getParticleInfo"
+                , bp::pure_virtual( getParticleInfo_function_type(&::IDecoration::getParticleInfo) )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IDecoration::getTotalParticleSurfaceDensity
+        
+            typedef double ( ::IDecoration::*getTotalParticleSurfaceDensity_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "getTotalParticleSurfaceDensity"
+                , getTotalParticleSurfaceDensity_function_type( &::IDecoration::getTotalParticleSurfaceDensity ) );
+        
+        }
+        { //::IDecoration::setTotalParticleSurfaceDensity
+        
+            typedef void ( ::IDecoration::*setTotalParticleSurfaceDensity_function_type )( double ) ;
+            
+            IDecoration_exposer.def( 
+                "setTotalParticleSurfaceDensity"
+                , setTotalParticleSurfaceDensity_function_type( &::IDecoration::setTotalParticleSurfaceDensity )
+                , ( bp::arg("surface_density") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IDecoration_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IDecoration_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IDecoration_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IDecoration_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IDecoration_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IDecoration_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IDecoration_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IDecoration_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( IDecoration_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            IDecoration_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IDecoration_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IDecoration_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IDecoration_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IDecoration_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IDecoration_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IDecoration_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IDecoration_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IDecoration_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IDecoration_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IDecoration_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IDecoration_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IDecoration_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IDecoration_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( IDecoration_wrapper::*default_size_function_type )(  ) const;
+            
+            IDecoration_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&IDecoration_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IDetectorResolution.pypp.cpp b/Core/PythonAPI/src/IDetectorResolution.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7332b764f3c96f324096ae7816ce40f921942ec6
--- /dev/null
+++ b/Core/PythonAPI/src/IDetectorResolution.pypp.cpp
@@ -0,0 +1,237 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "IDetectorResolution.pypp.h"
+
+namespace bp = boost::python;
+
+struct IDetectorResolution_wrapper : IDetectorResolution, bp::wrapper< IDetectorResolution > {
+
+    IDetectorResolution_wrapper()
+    : IDetectorResolution()
+      , bp::wrapper< IDetectorResolution >(){
+        // null constructor
+        
+    }
+
+    virtual void applyDetectorResolution( ::OutputData< double > * p_intensity_map ) const {
+        bp::override func_applyDetectorResolution = this->get_override( "applyDetectorResolution" );
+        func_applyDetectorResolution( boost::python::ptr(p_intensity_map) );
+    }
+
+    virtual ::IDetectorResolution * clone(  ) const {
+        bp::override func_clone = this->get_override( "clone" );
+        return func_clone(  );
+    }
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< IDetectorResolution_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+};
+
+void register_IDetectorResolution_class(){
+
+    { //::IDetectorResolution
+        typedef bp::class_< IDetectorResolution_wrapper, bp::bases< IParameterized, ICloneable >, boost::noncopyable > IDetectorResolution_exposer_t;
+        IDetectorResolution_exposer_t IDetectorResolution_exposer = IDetectorResolution_exposer_t( "IDetectorResolution" );
+        bp::scope IDetectorResolution_scope( IDetectorResolution_exposer );
+        { //::IDetectorResolution::applyDetectorResolution
+        
+            typedef void ( ::IDetectorResolution::*applyDetectorResolution_function_type )( ::OutputData<double> * ) const;
+            
+            IDetectorResolution_exposer.def( 
+                "applyDetectorResolution"
+                , bp::pure_virtual( applyDetectorResolution_function_type(&::IDetectorResolution::applyDetectorResolution) )
+                , ( bp::arg("p_intensity_map") ) );
+        
+        }
+        { //::IDetectorResolution::clone
+        
+            typedef ::IDetectorResolution * ( ::IDetectorResolution::*clone_function_type )(  ) const;
+            
+            IDetectorResolution_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IDetectorResolution::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IDetectorResolution_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IDetectorResolution_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IDetectorResolution_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IDetectorResolution_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IDetectorResolution_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IDetectorResolution_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IDetectorResolution_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IDetectorResolution_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IDetectorResolution_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IDetectorResolution_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IDetectorResolution_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IDetectorResolution_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IDetectorResolution_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IDetectorResolution_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IDetectorResolution_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IDetectorResolution_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IDetectorResolution_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IDetectorResolution_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IDetectorResolution_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IDetectorResolution_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/IFTDistribution1D.pypp.cpp b/Core/PythonAPI/src/IFTDistribution1D.pypp.cpp
deleted file mode 100644
index b7ac32d880db32b7e066ac99e3287122a2ceabce..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/IFTDistribution1D.pypp.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "IFTDistribution1D.pypp.h"
-
-namespace bp = boost::python;
-
-struct IFTDistribution1D_wrapper : IFTDistribution1D, bp::wrapper< IFTDistribution1D > {
-
-    IFTDistribution1D_wrapper(double omega )
-    : IFTDistribution1D( omega )
-      , bp::wrapper< IFTDistribution1D >(){
-        // constructor
-    
-    }
-
-    virtual double evaluate( double q ) const {
-        bp::override func_evaluate = this->get_override( "evaluate" );
-        return func_evaluate( q );
-    }
-
-};
-
-void register_IFTDistribution1D_class(){
-
-    bp::class_< IFTDistribution1D_wrapper, boost::noncopyable >( "IFTDistribution1D", bp::init< double >(( bp::arg("omega") )) )    
-        .def( 
-            "evaluate"
-            , bp::pure_virtual( (double ( ::IFTDistribution1D::* )( double ) const)(&::IFTDistribution1D::evaluate) )
-            , ( bp::arg("q") ) );
-
-}
diff --git a/Core/PythonAPI/src/IFTDistribution2D.pypp.cpp b/Core/PythonAPI/src/IFTDistribution2D.pypp.cpp
index eb856d2fc0b0a4787af50796d6a19da460a81e83..3e0819da07dff38e9cb126774ff42b0c637c1898 100644
--- a/Core/PythonAPI/src/IFTDistribution2D.pypp.cpp
+++ b/Core/PythonAPI/src/IFTDistribution2D.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IFTDistribution2D.pypp.h"
 
 namespace bp = boost::python;
@@ -202,58 +135,146 @@ struct IFTDistribution2D_wrapper : IFTDistribution2D, bp::wrapper< IFTDistributi
 
 void register_IFTDistribution2D_class(){
 
-    bp::class_< IFTDistribution2D_wrapper, bp::bases< IParameterized >, boost::noncopyable >( "IFTDistribution2D", bp::init< double, double >(( bp::arg("omega_x"), bp::arg("omega_y") )) )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IFTDistribution2D * ( ::IFTDistribution2D::* )(  ) const)(&::IFTDistribution2D::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , bp::pure_virtual( (double ( ::IFTDistribution2D::* )( double,double ) const)(&::IFTDistribution2D::evaluate) )
-            , ( bp::arg("qx"), bp::arg("qy") ) )    
-        .def( 
-            "getDelta"
-            , (double ( ::IFTDistribution2D::* )(  ) const)( &::IFTDistribution2D::getDelta ) )    
-        .def( 
-            "getGamma"
-            , (double ( ::IFTDistribution2D::* )(  ) const)( &::IFTDistribution2D::getGamma ) )    
-        .def( 
-            "setGamma"
-            , (void ( ::IFTDistribution2D::* )( double ) )( &::IFTDistribution2D::setGamma )
-            , ( bp::arg("gamma") ) )    
-        .def( 
-            "transformToStarBasis"
-            , bp::pure_virtual( (void ( ::IFTDistribution2D::* )( double,double,double,double,double,double &,double & ) const)(&::IFTDistribution2D::transformToStarBasis) )
-            , ( bp::arg("qX"), bp::arg("qY"), bp::arg("alpha"), bp::arg("a"), bp::arg("b"), bp::arg("qa"), bp::arg("qb") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IFTDistribution2D_wrapper::* )(  ) )(&IFTDistribution2D_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IFTDistribution2D_wrapper::* )(  ) )(&IFTDistribution2D_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IFTDistribution2D_wrapper::* )(  ) const)(&IFTDistribution2D_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IFTDistribution2D_wrapper::* )(  ) const)(&IFTDistribution2D_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IFTDistribution2D_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IFTDistribution2D_wrapper::* )( ::std::string const &,double ) )(&IFTDistribution2D_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IFTDistribution2D_wrapper::* )(  ) )(&IFTDistribution2D_wrapper::default_setParametersAreChanged) );
+    { //::IFTDistribution2D
+        typedef bp::class_< IFTDistribution2D_wrapper, bp::bases< IParameterized >, boost::noncopyable > IFTDistribution2D_exposer_t;
+        IFTDistribution2D_exposer_t IFTDistribution2D_exposer = IFTDistribution2D_exposer_t( "IFTDistribution2D", bp::init< double, double >(( bp::arg("omega_x"), bp::arg("omega_y") )) );
+        bp::scope IFTDistribution2D_scope( IFTDistribution2D_exposer );
+        { //::IFTDistribution2D::clone
+        
+            typedef ::IFTDistribution2D * ( ::IFTDistribution2D::*clone_function_type )(  ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IFTDistribution2D::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFTDistribution2D::evaluate
+        
+            typedef double ( ::IFTDistribution2D::*evaluate_function_type )( double,double ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "evaluate"
+                , bp::pure_virtual( evaluate_function_type(&::IFTDistribution2D::evaluate) )
+                , ( bp::arg("qx"), bp::arg("qy") ) );
+        
+        }
+        { //::IFTDistribution2D::getDelta
+        
+            typedef double ( ::IFTDistribution2D::*getDelta_function_type )(  ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "getDelta"
+                , getDelta_function_type( &::IFTDistribution2D::getDelta ) );
+        
+        }
+        { //::IFTDistribution2D::getGamma
+        
+            typedef double ( ::IFTDistribution2D::*getGamma_function_type )(  ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "getGamma"
+                , getGamma_function_type( &::IFTDistribution2D::getGamma ) );
+        
+        }
+        { //::IFTDistribution2D::setGamma
+        
+            typedef void ( ::IFTDistribution2D::*setGamma_function_type )( double ) ;
+            
+            IFTDistribution2D_exposer.def( 
+                "setGamma"
+                , setGamma_function_type( &::IFTDistribution2D::setGamma )
+                , ( bp::arg("gamma") ) );
+        
+        }
+        { //::IFTDistribution2D::transformToStarBasis
+        
+            typedef void ( ::IFTDistribution2D::*transformToStarBasis_function_type )( double,double,double,double,double,double &,double & ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "transformToStarBasis"
+                , bp::pure_virtual( transformToStarBasis_function_type(&::IFTDistribution2D::transformToStarBasis) )
+                , ( bp::arg("qX"), bp::arg("qY"), bp::arg("alpha"), bp::arg("a"), bp::arg("b"), bp::arg("qa"), bp::arg("qb") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IFTDistribution2D_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IFTDistribution2D_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IFTDistribution2D_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IFTDistribution2D_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IFTDistribution2D_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IFTDistribution2D_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IFTDistribution2D_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IFTDistribution2D_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IFTDistribution2D_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IFTDistribution2D_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IFTDistribution2D_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IFTDistribution2D_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IFTDistribution2D_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IFTDistribution2D_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IFTDistribution2D_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IFTDistribution2D_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IFTDistribution2D_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IFTDistribution2D_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IFTDistribution2D_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IFormFactor.pypp.cpp b/Core/PythonAPI/src/IFormFactor.pypp.cpp
index 35e55231a72380c552b169e1870b122f9c7a6c2f..48944ab83f36a1e7cfa4280ebedc25ddf01a3e1a 100644
--- a/Core/PythonAPI/src/IFormFactor.pypp.cpp
+++ b/Core/PythonAPI/src/IFormFactor.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IFormFactor.pypp.h"
 
 namespace bp = boost::python;
@@ -222,28 +155,28 @@ struct IFormFactor_wrapper : IFormFactor, bp::wrapper< IFormFactor > {
         return IParameterized::createParameterTree( );
     }
 
-    virtual void printParameters(  ) const  {
-        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
-            func_printParameters(  );
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
         else{
-            this->IParameterized::printParameters(  );
+            return this->ISample::getCompositeSample(  );
         }
     }
     
-    void default_printParameters(  ) const  {
-        IParameterized::printParameters( );
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
         else{
-            this->ISample::print_structure(  );
+            this->IParameterized::printParameters(  );
         }
     }
     
-    void default_print_structure(  ) {
-        ISample::print_structure( );
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
     }
 
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
@@ -293,79 +226,200 @@ struct IFormFactor_wrapper : IFormFactor, bp::wrapper< IFormFactor > {
 
 void register_IFormFactor_class(){
 
-    bp::class_< IFormFactor_wrapper, bp::bases< ISample >, boost::noncopyable >( "IFormFactor", bp::init< >() )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IFormFactor * ( ::IFormFactor::* )(  ) const)(&::IFormFactor::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( IFormFactor_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&IFormFactor_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , bp::pure_virtual( (::complex_t ( ::IFormFactor::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactor::evaluate) )
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getHeight)
-            , (double ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getNumberOfStochasticParameters)
-            , (int ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getVolume)
-            , (double ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_getVolume) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( IFormFactor_wrapper::* )( ::complex_t const & ) )(&IFormFactor_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IFormFactor_wrapper::* )(  ) )(&IFormFactor_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IFormFactor_wrapper::* )(  ) )(&IFormFactor_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IFormFactor_wrapper::* )(  ) const)(&IFormFactor_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( IFormFactor_wrapper::* )(  ) )(&IFormFactor_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IFormFactor_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IFormFactor_wrapper::* )( ::std::string const &,double ) )(&IFormFactor_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IFormFactor_wrapper::* )(  ) )(&IFormFactor_wrapper::default_setParametersAreChanged) );
+    { //::IFormFactor
+        typedef bp::class_< IFormFactor_wrapper, bp::bases< ISample >, boost::noncopyable > IFormFactor_exposer_t;
+        IFormFactor_exposer_t IFormFactor_exposer = IFormFactor_exposer_t( "IFormFactor", bp::init< >() );
+        bp::scope IFormFactor_scope( IFormFactor_exposer );
+        { //::IFormFactor::clone
+        
+            typedef ::IFormFactor * ( ::IFormFactor::*clone_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IFormFactor::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( IFormFactor_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            IFormFactor_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&IFormFactor_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactor::evaluate
+        
+            typedef ::complex_t ( ::IFormFactor::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            IFormFactor_exposer.def( 
+                "evaluate"
+                , bp::pure_virtual( evaluate_function_type(&::IFormFactor::evaluate) )
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::IFormFactor::getHeight
+        
+            typedef double ( ::IFormFactor::*getHeight_function_type )(  ) const;
+            typedef double ( IFormFactor_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactor::getHeight)
+                , default_getHeight_function_type(&IFormFactor_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactor::getNumberOfStochasticParameters
+        
+            typedef int ( ::IFormFactor::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( IFormFactor_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::IFormFactor::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&IFormFactor_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( IFormFactor_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&IFormFactor_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactor::getVolume
+        
+            typedef double ( ::IFormFactor::*getVolume_function_type )(  ) const;
+            typedef double ( IFormFactor_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactor::getVolume)
+                , default_getVolume_function_type(&IFormFactor_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( IFormFactor_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&IFormFactor_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( IFormFactor_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            IFormFactor_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&IFormFactor_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IFormFactor_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IFormFactor_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IFormFactor_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IFormFactor_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IFormFactor_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IFormFactor_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IFormFactor_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IFormFactor_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IFormFactor_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IFormFactor_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IFormFactor_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IFormFactor_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IFormFactor_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IFormFactor_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IFormFactor_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IFormFactor_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IFormFactor_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IFormFactor_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IFormFactor_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IFormFactor_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IFormFactor_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IFormFactorBorn.pypp.cpp b/Core/PythonAPI/src/IFormFactorBorn.pypp.cpp
index e021f69fb1909e6e462dcc0777e60f19611c695b..3e2faa106d9a69bcd6cc18c916a3bbc5dacace60 100644
--- a/Core/PythonAPI/src/IFormFactorBorn.pypp.cpp
+++ b/Core/PythonAPI/src/IFormFactorBorn.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IFormFactorBorn.pypp.h"
 
 namespace bp = boost::python;
@@ -174,6 +107,18 @@ struct IFormFactorBorn_wrapper : IFormFactorBorn, bp::wrapper< IFormFactorBorn >
         return IParameterized::createParameterTree( );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getHeight(  ) const  {
         if( bp::override func_getHeight = this->get_override( "getHeight" ) )
             return func_getHeight(  );
@@ -234,18 +179,6 @@ struct IFormFactorBorn_wrapper : IFormFactorBorn, bp::wrapper< IFormFactorBorn >
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -305,84 +238,212 @@ struct IFormFactorBorn_wrapper : IFormFactorBorn, bp::wrapper< IFormFactorBorn >
 
 void register_IFormFactorBorn_class(){
 
-    bp::class_< IFormFactorBorn_wrapper, bp::bases< IFormFactor >, boost::noncopyable >( "IFormFactorBorn", bp::init< >() )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IFormFactorBorn * ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactorBorn::evaluate)
-            , (::complex_t ( IFormFactorBorn_wrapper::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&IFormFactorBorn_wrapper::default_evaluate)
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "evaluate_for_q"
-            , bp::pure_virtual( (::complex_t ( ::IFormFactorBorn::* )( ::cvector_t const & ) const)(&::IFormFactorBorn::evaluate_for_q) )
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorBorn::* )(  ) const)(&::IFormFactorBorn::getVolume)
-            , (double ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_getVolume) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IFormFactorBorn_wrapper::* )(  ) )(&IFormFactorBorn_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IFormFactorBorn_wrapper::* )(  ) )(&IFormFactorBorn_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( IFormFactorBorn_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&IFormFactorBorn_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getHeight)
-            , (double ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_getHeight) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getNumberOfStochasticParameters)
-            , (int ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getRadius)
-            , (double ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_getRadius) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IFormFactorBorn_wrapper::* )(  ) const)(&IFormFactorBorn_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( IFormFactorBorn_wrapper::* )(  ) )(&IFormFactorBorn_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IFormFactorBorn_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactor::* )( ::complex_t const & ) )(&::IFormFactor::setAmbientRefractiveIndex)
-            , (void ( IFormFactorBorn_wrapper::* )( ::complex_t const & ) )(&IFormFactorBorn_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IFormFactorBorn_wrapper::* )( ::std::string const &,double ) )(&IFormFactorBorn_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IFormFactorBorn_wrapper::* )(  ) )(&IFormFactorBorn_wrapper::default_setParametersAreChanged) );
+    { //::IFormFactorBorn
+        typedef bp::class_< IFormFactorBorn_wrapper, bp::bases< IFormFactor >, boost::noncopyable > IFormFactorBorn_exposer_t;
+        IFormFactorBorn_exposer_t IFormFactorBorn_exposer = IFormFactorBorn_exposer_t( "IFormFactorBorn", bp::init< >() );
+        bp::scope IFormFactorBorn_scope( IFormFactorBorn_exposer );
+        { //::IFormFactorBorn::clone
+        
+            typedef ::IFormFactorBorn * ( ::IFormFactorBorn::*clone_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IFormFactorBorn::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorBorn::evaluate
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            typedef ::complex_t ( IFormFactorBorn_wrapper::*default_evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::IFormFactorBorn::evaluate)
+                , default_evaluate_function_type(&IFormFactorBorn_wrapper::default_evaluate)
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::IFormFactorBorn::evaluate_for_q
+        
+            typedef ::complex_t ( ::IFormFactorBorn::*evaluate_for_q_function_type )( ::cvector_t const & ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "evaluate_for_q"
+                , bp::pure_virtual( evaluate_for_q_function_type(&::IFormFactorBorn::evaluate_for_q) )
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::IFormFactorBorn::getVolume
+        
+            typedef double ( ::IFormFactorBorn::*getVolume_function_type )(  ) const;
+            typedef double ( IFormFactorBorn_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorBorn::getVolume)
+                , default_getVolume_function_type(&IFormFactorBorn_wrapper::default_getVolume) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IFormFactorBorn_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IFormFactorBorn_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IFormFactorBorn_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IFormFactorBorn_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IFormFactorBorn_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IFormFactorBorn_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( IFormFactorBorn_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&IFormFactorBorn_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IFormFactorBorn_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IFormFactorBorn_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IFormFactorBorn_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IFormFactorBorn_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getHeight
+        
+            typedef double ( ::IFormFactor::*getHeight_function_type )(  ) const;
+            typedef double ( IFormFactorBorn_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactor::getHeight)
+                , default_getHeight_function_type(&IFormFactorBorn_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactor::getNumberOfStochasticParameters
+        
+            typedef int ( ::IFormFactor::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( IFormFactorBorn_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::IFormFactor::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&IFormFactorBorn_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IFormFactor::getRadius
+        
+            typedef double ( ::IFormFactor::*getRadius_function_type )(  ) const;
+            typedef double ( IFormFactorBorn_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactor::getRadius)
+                , default_getRadius_function_type(&IFormFactorBorn_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( IFormFactorBorn_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&IFormFactorBorn_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IFormFactorBorn_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IFormFactorBorn_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IFormFactorBorn_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IFormFactorBorn_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IFormFactorBorn_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IFormFactor::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactor::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( IFormFactorBorn_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            IFormFactorBorn_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactor::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&IFormFactorBorn_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IFormFactorBorn_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IFormFactorBorn_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IFormFactorBorn_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IFormFactorBorn_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IFormFactorBorn_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IFormFactorBorn_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp b/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp
index a055f1869e58fd76b56e792c0330d4dee8cb7fa6..37ffbc13a4c24330626679f368a577933d23070e 100644
--- a/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp
+++ b/Core/PythonAPI/src/IFormFactorDecorator.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IFormFactorDecorator.pypp.h"
 
 namespace bp = boost::python;
@@ -191,6 +124,18 @@ struct IFormFactorDecorator_wrapper : IFormFactorDecorator, bp::wrapper< IFormFa
         return func_evaluate( boost::ref(k_i), boost::ref(k_f_bin), alpha_i, alpha_f );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual int getNumberOfStochasticParameters(  ) const  {
         if( bp::override func_getNumberOfStochasticParameters = this->get_override( "getNumberOfStochasticParameters" ) )
             return func_getNumberOfStochasticParameters(  );
@@ -227,18 +172,6 @@ struct IFormFactorDecorator_wrapper : IFormFactorDecorator, bp::wrapper< IFormFa
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -286,79 +219,200 @@ struct IFormFactorDecorator_wrapper : IFormFactorDecorator, bp::wrapper< IFormFa
 
 void register_IFormFactorDecorator_class(){
 
-    bp::class_< IFormFactorDecorator_wrapper, bp::bases< IFormFactor >, boost::noncopyable >( "IFormFactorDecorator", bp::no_init )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IFormFactorDecorator * ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getHeight"
-            , (double ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::getHeight)
-            , (double ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_getHeight) )    
-        .def( 
-            "getRadius"
-            , (double ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::getRadius)
-            , (double ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_getRadius) )    
-        .def( 
-            "getVolume"
-            , (double ( ::IFormFactorDecorator::* )(  ) const)(&::IFormFactorDecorator::getVolume)
-            , (double ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_getVolume) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::IFormFactorDecorator::* )( ::complex_t const & ) )(&::IFormFactorDecorator::setAmbientRefractiveIndex)
-            , (void ( IFormFactorDecorator_wrapper::* )( ::complex_t const & ) )(&IFormFactorDecorator_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IFormFactorDecorator_wrapper::* )(  ) )(&IFormFactorDecorator_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IFormFactorDecorator_wrapper::* )(  ) )(&IFormFactorDecorator_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createDistributedFormFactors"
-            , (void ( ::IFormFactor::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&::IFormFactor::createDistributedFormFactors)
-            , (void ( IFormFactorDecorator_wrapper::* )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const)(&IFormFactorDecorator_wrapper::default_createDistributedFormFactors)
-            , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , bp::pure_virtual( (::complex_t ( ::IFormFactor::* )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const)(&::IFormFactor::evaluate) )
-            , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) )    
-        .def( 
-            "getNumberOfStochasticParameters"
-            , (int ( ::IFormFactor::* )(  ) const)(&::IFormFactor::getNumberOfStochasticParameters)
-            , (int ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_getNumberOfStochasticParameters) )    
-        .def( 
-            "isDistributedFormFactor"
-            , (bool ( ::IFormFactor::* )(  ) const)(&::IFormFactor::isDistributedFormFactor)
-            , (bool ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_isDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IFormFactorDecorator_wrapper::* )(  ) const)(&IFormFactorDecorator_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( IFormFactorDecorator_wrapper::* )(  ) )(&IFormFactorDecorator_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IFormFactorDecorator_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IFormFactorDecorator_wrapper::* )( ::std::string const &,double ) )(&IFormFactorDecorator_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IFormFactorDecorator_wrapper::* )(  ) )(&IFormFactorDecorator_wrapper::default_setParametersAreChanged) );
+    { //::IFormFactorDecorator
+        typedef bp::class_< IFormFactorDecorator_wrapper, bp::bases< IFormFactor >, boost::noncopyable > IFormFactorDecorator_exposer_t;
+        IFormFactorDecorator_exposer_t IFormFactorDecorator_exposer = IFormFactorDecorator_exposer_t( "IFormFactorDecorator", bp::no_init );
+        bp::scope IFormFactorDecorator_scope( IFormFactorDecorator_exposer );
+        { //::IFormFactorDecorator::clone
+        
+            typedef ::IFormFactorDecorator * ( ::IFormFactorDecorator::*clone_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IFormFactorDecorator::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactorDecorator::getHeight
+        
+            typedef double ( ::IFormFactorDecorator::*getHeight_function_type )(  ) const;
+            typedef double ( IFormFactorDecorator_wrapper::*default_getHeight_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getHeight"
+                , getHeight_function_type(&::IFormFactorDecorator::getHeight)
+                , default_getHeight_function_type(&IFormFactorDecorator_wrapper::default_getHeight) );
+        
+        }
+        { //::IFormFactorDecorator::getRadius
+        
+            typedef double ( ::IFormFactorDecorator::*getRadius_function_type )(  ) const;
+            typedef double ( IFormFactorDecorator_wrapper::*default_getRadius_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getRadius"
+                , getRadius_function_type(&::IFormFactorDecorator::getRadius)
+                , default_getRadius_function_type(&IFormFactorDecorator_wrapper::default_getRadius) );
+        
+        }
+        { //::IFormFactorDecorator::getVolume
+        
+            typedef double ( ::IFormFactorDecorator::*getVolume_function_type )(  ) const;
+            typedef double ( IFormFactorDecorator_wrapper::*default_getVolume_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getVolume"
+                , getVolume_function_type(&::IFormFactorDecorator::getVolume)
+                , default_getVolume_function_type(&IFormFactorDecorator_wrapper::default_getVolume) );
+        
+        }
+        { //::IFormFactorDecorator::setAmbientRefractiveIndex
+        
+            typedef void ( ::IFormFactorDecorator::*setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            typedef void ( IFormFactorDecorator_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t const & ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::IFormFactorDecorator::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&IFormFactorDecorator_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IFormFactorDecorator_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IFormFactorDecorator_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IFormFactorDecorator_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IFormFactorDecorator_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IFormFactor::createDistributedFormFactors
+        
+            typedef void ( ::IFormFactor::*createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            typedef void ( IFormFactorDecorator_wrapper::*default_createDistributedFormFactors_function_type )( ::std::vector< IFormFactor* > &,::std::vector< double > &,::size_t ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "createDistributedFormFactors"
+                , createDistributedFormFactors_function_type(&::IFormFactor::createDistributedFormFactors)
+                , default_createDistributedFormFactors_function_type(&IFormFactorDecorator_wrapper::default_createDistributedFormFactors)
+                , ( bp::arg("form_factors"), bp::arg("probabilities"), bp::arg("nbr_samples") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IFormFactorDecorator_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IFormFactorDecorator_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IFormFactor::evaluate
+        
+            typedef ::complex_t ( ::IFormFactor::*evaluate_function_type )( ::cvector_t const &,::Bin1DCVector const &,double,double ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "evaluate"
+                , bp::pure_virtual( evaluate_function_type(&::IFormFactor::evaluate) )
+                , ( bp::arg("k_i"), bp::arg("k_f_bin"), bp::arg("alpha_i"), bp::arg("alpha_f") ) );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IFormFactorDecorator_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IFormFactorDecorator_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IFormFactor::getNumberOfStochasticParameters
+        
+            typedef int ( ::IFormFactor::*getNumberOfStochasticParameters_function_type )(  ) const;
+            typedef int ( IFormFactorDecorator_wrapper::*default_getNumberOfStochasticParameters_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "getNumberOfStochasticParameters"
+                , getNumberOfStochasticParameters_function_type(&::IFormFactor::getNumberOfStochasticParameters)
+                , default_getNumberOfStochasticParameters_function_type(&IFormFactorDecorator_wrapper::default_getNumberOfStochasticParameters) );
+        
+        }
+        { //::IFormFactor::isDistributedFormFactor
+        
+            typedef bool ( ::IFormFactor::*isDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( IFormFactorDecorator_wrapper::*default_isDistributedFormFactor_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "isDistributedFormFactor"
+                , isDistributedFormFactor_function_type(&::IFormFactor::isDistributedFormFactor)
+                , default_isDistributedFormFactor_function_type(&IFormFactorDecorator_wrapper::default_isDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IFormFactorDecorator_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IFormFactorDecorator_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IFormFactorDecorator_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IFormFactorDecorator_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IFormFactorDecorator_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IFormFactorDecorator_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IFormFactorDecorator_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IFormFactorDecorator_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IFormFactorDecorator_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IFormFactorDecorator_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IInterferenceFunction.pypp.cpp b/Core/PythonAPI/src/IInterferenceFunction.pypp.cpp
index 9476ae2b0084b094f1aa30a69363ecd58a8bc3f9..edc707f6d80ebeedaa7f3ac9122b86aa4258c4b5 100644
--- a/Core/PythonAPI/src/IInterferenceFunction.pypp.cpp
+++ b/Core/PythonAPI/src/IInterferenceFunction.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IInterferenceFunction.pypp.h"
 
 namespace bp = boost::python;
@@ -150,28 +83,28 @@ struct IInterferenceFunction_wrapper : IInterferenceFunction, bp::wrapper< IInte
         return IParameterized::createParameterTree( );
     }
 
-    virtual void printParameters(  ) const  {
-        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
-            func_printParameters(  );
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
         else{
-            this->IParameterized::printParameters(  );
+            return this->ISample::getCompositeSample(  );
         }
     }
     
-    void default_printParameters(  ) const  {
-        IParameterized::printParameters( );
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
         else{
-            this->ISample::print_structure(  );
+            this->IParameterized::printParameters(  );
         }
     }
     
-    void default_print_structure(  ) {
-        ISample::print_structure( );
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
     }
 
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
@@ -221,52 +154,131 @@ struct IInterferenceFunction_wrapper : IInterferenceFunction, bp::wrapper< IInte
 
 void register_IInterferenceFunction_class(){
 
-    bp::class_< IInterferenceFunction_wrapper, bp::bases< ISample >, boost::noncopyable >( "IInterferenceFunction" )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IInterferenceFunction * ( ::IInterferenceFunction::* )(  ) const)(&::IInterferenceFunction::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , bp::pure_virtual( (double ( ::IInterferenceFunction::* )( ::cvector_t const & ) const)(&::IInterferenceFunction::evaluate) )
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getKappa"
-            , (double ( ::IInterferenceFunction::* )(  ) const)(&::IInterferenceFunction::getKappa)
-            , (double ( IInterferenceFunction_wrapper::* )(  ) const)(&IInterferenceFunction_wrapper::default_getKappa) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IInterferenceFunction_wrapper::* )(  ) )(&IInterferenceFunction_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IInterferenceFunction_wrapper::* )(  ) )(&IInterferenceFunction_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IInterferenceFunction_wrapper::* )(  ) const)(&IInterferenceFunction_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IInterferenceFunction_wrapper::* )(  ) const)(&IInterferenceFunction_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( IInterferenceFunction_wrapper::* )(  ) )(&IInterferenceFunction_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IInterferenceFunction_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IInterferenceFunction_wrapper::* )( ::std::string const &,double ) )(&IInterferenceFunction_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IInterferenceFunction_wrapper::* )(  ) )(&IInterferenceFunction_wrapper::default_setParametersAreChanged) );
+    { //::IInterferenceFunction
+        typedef bp::class_< IInterferenceFunction_wrapper, bp::bases< ISample >, boost::noncopyable > IInterferenceFunction_exposer_t;
+        IInterferenceFunction_exposer_t IInterferenceFunction_exposer = IInterferenceFunction_exposer_t( "IInterferenceFunction" );
+        bp::scope IInterferenceFunction_scope( IInterferenceFunction_exposer );
+        { //::IInterferenceFunction::clone
+        
+            typedef ::IInterferenceFunction * ( ::IInterferenceFunction::*clone_function_type )(  ) const;
+            
+            IInterferenceFunction_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IInterferenceFunction::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IInterferenceFunction::evaluate
+        
+            typedef double ( ::IInterferenceFunction::*evaluate_function_type )( ::cvector_t const & ) const;
+            
+            IInterferenceFunction_exposer.def( 
+                "evaluate"
+                , bp::pure_virtual( evaluate_function_type(&::IInterferenceFunction::evaluate) )
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::IInterferenceFunction::getKappa
+        
+            typedef double ( ::IInterferenceFunction::*getKappa_function_type )(  ) const;
+            typedef double ( IInterferenceFunction_wrapper::*default_getKappa_function_type )(  ) const;
+            
+            IInterferenceFunction_exposer.def( 
+                "getKappa"
+                , getKappa_function_type(&::IInterferenceFunction::getKappa)
+                , default_getKappa_function_type(&IInterferenceFunction_wrapper::default_getKappa) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IInterferenceFunction_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IInterferenceFunction_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IInterferenceFunction_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IInterferenceFunction_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IInterferenceFunction_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IInterferenceFunction_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IInterferenceFunction_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IInterferenceFunction_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IInterferenceFunction_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( IInterferenceFunction_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            IInterferenceFunction_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&IInterferenceFunction_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IInterferenceFunction_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IInterferenceFunction_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IInterferenceFunction_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IInterferenceFunction_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IInterferenceFunction_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IInterferenceFunction_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IInterferenceFunction_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IInterferenceFunction_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IInterferenceFunction_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IInterferenceFunction_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IInterferenceFunction_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/IMaterial.pypp.cpp b/Core/PythonAPI/src/IMaterial.pypp.cpp
index 386830c7634988c08fec216552f5f3ae1a80603d..1a1997a5f361c34b79ace156dcf0633d265f56e5 100644
--- a/Core/PythonAPI/src/IMaterial.pypp.cpp
+++ b/Core/PythonAPI/src/IMaterial.pypp.cpp
@@ -1,89 +1,26 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IMaterial.pypp.h"
 
 namespace bp = boost::python;
 
 void register_IMaterial_class(){
 
-    bp::class_< IMaterial >( "IMaterial", bp::init< std::string const & >(( bp::arg("name") )) )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::IMaterial
+        typedef bp::class_< IMaterial > IMaterial_exposer_t;
+        IMaterial_exposer_t IMaterial_exposer = IMaterial_exposer_t( "IMaterial", bp::init< std::string const & >(( bp::arg("name") )) );
+        bp::scope IMaterial_scope( IMaterial_exposer );
+        IMaterial_exposer.def( bp::init< IMaterial const & >(( bp::arg("other") )) );
+    }
 
 }
diff --git a/Core/PythonAPI/src/IParameterized.pypp.cpp b/Core/PythonAPI/src/IParameterized.pypp.cpp
index 8eaed8c59657f819c5d1eecbed05aa7478eb670b..f0b3f8f700634b3874fca16980f45367965e4c3d 100644
--- a/Core/PythonAPI/src/IParameterized.pypp.cpp
+++ b/Core/PythonAPI/src/IParameterized.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IParameterized.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/PythonAPI/src/IResolutionFunction2D.pypp.cpp b/Core/PythonAPI/src/IResolutionFunction2D.pypp.cpp
index 54817a4098ea789b3d0a45d8e9f7d307705b9082..41b775dc6300d331c48bd8883a0c05ff65e7c393 100644
--- a/Core/PythonAPI/src/IResolutionFunction2D.pypp.cpp
+++ b/Core/PythonAPI/src/IResolutionFunction2D.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "IResolutionFunction2D.pypp.h"
 
 namespace bp = boost::python;
@@ -197,44 +130,108 @@ struct IResolutionFunction2D_wrapper : IResolutionFunction2D, bp::wrapper< IReso
 
 void register_IResolutionFunction2D_class(){
 
-    bp::class_< IResolutionFunction2D_wrapper, bp::bases< IParameterized >, boost::noncopyable >( "IResolutionFunction2D" )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IResolutionFunction2D * ( ::IResolutionFunction2D::* )(  ) const)(&::IResolutionFunction2D::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluateCDF"
-            , bp::pure_virtual( (double ( ::IResolutionFunction2D::* )( double,double ) const)(&::IResolutionFunction2D::evaluateCDF) )
-            , ( bp::arg("x"), bp::arg("y") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( IResolutionFunction2D_wrapper::* )(  ) )(&IResolutionFunction2D_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( IResolutionFunction2D_wrapper::* )(  ) )(&IResolutionFunction2D_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( IResolutionFunction2D_wrapper::* )(  ) const)(&IResolutionFunction2D_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( IResolutionFunction2D_wrapper::* )(  ) const)(&IResolutionFunction2D_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &IResolutionFunction2D_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( IResolutionFunction2D_wrapper::* )( ::std::string const &,double ) )(&IResolutionFunction2D_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( IResolutionFunction2D_wrapper::* )(  ) )(&IResolutionFunction2D_wrapper::default_setParametersAreChanged) );
+    { //::IResolutionFunction2D
+        typedef bp::class_< IResolutionFunction2D_wrapper, bp::bases< IParameterized >, boost::noncopyable > IResolutionFunction2D_exposer_t;
+        IResolutionFunction2D_exposer_t IResolutionFunction2D_exposer = IResolutionFunction2D_exposer_t( "IResolutionFunction2D" );
+        bp::scope IResolutionFunction2D_scope( IResolutionFunction2D_exposer );
+        { //::IResolutionFunction2D::clone
+        
+            typedef ::IResolutionFunction2D * ( ::IResolutionFunction2D::*clone_function_type )(  ) const;
+            
+            IResolutionFunction2D_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IResolutionFunction2D::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IResolutionFunction2D::evaluateCDF
+        
+            typedef double ( ::IResolutionFunction2D::*evaluateCDF_function_type )( double,double ) const;
+            
+            IResolutionFunction2D_exposer.def( 
+                "evaluateCDF"
+                , bp::pure_virtual( evaluateCDF_function_type(&::IResolutionFunction2D::evaluateCDF) )
+                , ( bp::arg("x"), bp::arg("y") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( IResolutionFunction2D_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            IResolutionFunction2D_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&IResolutionFunction2D_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( IResolutionFunction2D_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            IResolutionFunction2D_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&IResolutionFunction2D_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( IResolutionFunction2D_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            IResolutionFunction2D_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&IResolutionFunction2D_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( IResolutionFunction2D_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            IResolutionFunction2D_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&IResolutionFunction2D_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            IResolutionFunction2D_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &IResolutionFunction2D_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( IResolutionFunction2D_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            IResolutionFunction2D_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&IResolutionFunction2D_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( IResolutionFunction2D_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            IResolutionFunction2D_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&IResolutionFunction2D_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ISample.pypp.cpp b/Core/PythonAPI/src/ISample.pypp.cpp
index 4dbad5ffbb9760e808b740341adfab4036f6ae57..a7ca208854443339a437c309b4560ff208cbf088 100644
--- a/Core/PythonAPI/src/ISample.pypp.cpp
+++ b/Core/PythonAPI/src/ISample.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ISample.pypp.h"
 
 namespace bp = boost::python;
@@ -104,16 +37,16 @@ struct ISample_wrapper : ISample, bp::wrapper< ISample > {
         return ISample::clone( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
         else{
-            this->ISample::print_structure(  );
+            return this->ISample::getCompositeSample(  );
         }
     }
     
-    void default_print_structure(  ) {
-        ISample::print_structure( );
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
     }
 
     virtual bool areParametersChanged(  ) {
@@ -211,46 +144,121 @@ struct ISample_wrapper : ISample, bp::wrapper< ISample > {
 
 void register_ISample_class(){
 
-    bp::class_< ISample_wrapper, bp::bases< IParameterized, ICloneable >, boost::noncopyable >( "ISample", bp::init< >() )    
-        .def( 
-            "clone"
-            , (::ISample * ( ::ISample::* )(  ) const)(&::ISample::clone)
-            , (::ISample * ( ISample_wrapper::* )(  ) const)(&ISample_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( ISample_wrapper::* )(  ) )(&ISample_wrapper::default_print_structure) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ISample_wrapper::* )(  ) )(&ISample_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ISample_wrapper::* )(  ) )(&ISample_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ISample_wrapper::* )(  ) const)(&ISample_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ISample_wrapper::* )(  ) const)(&ISample_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ISample_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ISample_wrapper::* )( ::std::string const &,double ) )(&ISample_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ISample_wrapper::* )(  ) )(&ISample_wrapper::default_setParametersAreChanged) )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::ISample
+        typedef bp::class_< ISample_wrapper, bp::bases< IParameterized, ICloneable >, boost::noncopyable > ISample_exposer_t;
+        ISample_exposer_t ISample_exposer = ISample_exposer_t( "ISample", bp::init< >() );
+        bp::scope ISample_scope( ISample_exposer );
+        { //::ISample::clone
+        
+            typedef ::ISample * ( ::ISample::*clone_function_type )(  ) const;
+            typedef ::ISample * ( ISample_wrapper::*default_clone_function_type )(  ) const;
+            
+            ISample_exposer.def( 
+                "clone"
+                , clone_function_type(&::ISample::clone)
+                , default_clone_function_type(&ISample_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( ISample_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            ISample_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ISample_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ISample::print_structure
+        
+            typedef void ( ::ISample::*print_structure_function_type )(  ) ;
+            
+            ISample_exposer.def( 
+                "print_structure"
+                , print_structure_function_type( &::ISample::print_structure ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ISample_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ISample_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ISample_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ISample_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ISample_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ISample_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ISample_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ISample_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ISample_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ISample_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ISample_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ISample_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ISample_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ISample_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ISample_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ISample_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ISample_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ISample_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ISample_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ISample_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ISampleBuilder.pypp.cpp b/Core/PythonAPI/src/ISampleBuilder.pypp.cpp
index a3373b6d83964705a6e6feb6316faacc23b55210..48973a8d6aef66c0db0cb3851104b14058e89232 100644
--- a/Core/PythonAPI/src/ISampleBuilder.pypp.cpp
+++ b/Core/PythonAPI/src/ISampleBuilder.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ISampleBuilder.pypp.h"
 
 namespace bp = boost::python;
@@ -206,41 +139,100 @@ struct ISampleBuilder_wrapper : ISampleBuilder, bp::wrapper< ISampleBuilder > {
 
 void register_ISampleBuilder_class(){
 
-    bp::class_< ISampleBuilder_wrapper, bp::bases< IParameterized > >( "ISampleBuilder", bp::init< >() )    
-        .def( 
-            "buildSample"
-            , (::ISample * ( ::ISampleBuilder::* )(  ) const)(&::ISampleBuilder::buildSample)
-            , (::ISample * ( ISampleBuilder_wrapper::* )(  ) const)(&ISampleBuilder_wrapper::default_buildSample)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ISampleBuilder_wrapper::* )(  ) )(&ISampleBuilder_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ISampleBuilder_wrapper::* )(  ) )(&ISampleBuilder_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ISampleBuilder_wrapper::* )(  ) const)(&ISampleBuilder_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ISampleBuilder_wrapper::* )(  ) const)(&ISampleBuilder_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ISampleBuilder_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ISampleBuilder_wrapper::* )( ::std::string const &,double ) )(&ISampleBuilder_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ISampleBuilder_wrapper::* )(  ) )(&ISampleBuilder_wrapper::default_setParametersAreChanged) );
+    { //::ISampleBuilder
+        typedef bp::class_< ISampleBuilder_wrapper, bp::bases< IParameterized > > ISampleBuilder_exposer_t;
+        ISampleBuilder_exposer_t ISampleBuilder_exposer = ISampleBuilder_exposer_t( "ISampleBuilder", bp::init< >() );
+        bp::scope ISampleBuilder_scope( ISampleBuilder_exposer );
+        { //::ISampleBuilder::buildSample
+        
+            typedef ::ISample * ( ::ISampleBuilder::*buildSample_function_type )(  ) const;
+            typedef ::ISample * ( ISampleBuilder_wrapper::*default_buildSample_function_type )(  ) const;
+            
+            ISampleBuilder_exposer.def( 
+                "buildSample"
+                , buildSample_function_type(&::ISampleBuilder::buildSample)
+                , default_buildSample_function_type(&ISampleBuilder_wrapper::default_buildSample)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ISampleBuilder_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ISampleBuilder_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ISampleBuilder_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ISampleBuilder_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ISampleBuilder_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ISampleBuilder_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ISampleBuilder_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ISampleBuilder_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ISampleBuilder_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ISampleBuilder_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ISampleBuilder_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ISampleBuilder_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ISampleBuilder_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ISampleBuilder_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ISampleBuilder_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ISampleBuilder_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ISampleBuilder_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ISampleBuilder_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ISampleBuilder_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ISampleBuilder_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ISelectionRule.pypp.cpp b/Core/PythonAPI/src/ISelectionRule.pypp.cpp
index 5113ce8edec516c96a3ec436c059f93059f3cb65..48736d558cda8fdefa4116367b6d61c9245cbc54 100644
--- a/Core/PythonAPI/src/ISelectionRule.pypp.cpp
+++ b/Core/PythonAPI/src/ISelectionRule.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ISelectionRule.pypp.h"
 
 namespace bp = boost::python;
@@ -104,14 +37,30 @@ struct ISelectionRule_wrapper : ISelectionRule, bp::wrapper< ISelectionRule > {
 
 void register_ISelectionRule_class(){
 
-    bp::class_< ISelectionRule_wrapper, boost::noncopyable >( "ISelectionRule" )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::ISelectionRule * ( ::ISelectionRule::* )(  ) const)(&::ISelectionRule::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "coordinateSelected"
-            , bp::pure_virtual( (bool ( ::ISelectionRule::* )( ::IndexVector3D const & ) const)(&::ISelectionRule::coordinateSelected) )
-            , ( bp::arg("coordinate") ) );
+    { //::ISelectionRule
+        typedef bp::class_< ISelectionRule_wrapper, boost::noncopyable > ISelectionRule_exposer_t;
+        ISelectionRule_exposer_t ISelectionRule_exposer = ISelectionRule_exposer_t( "ISelectionRule" );
+        bp::scope ISelectionRule_scope( ISelectionRule_exposer );
+        { //::ISelectionRule::clone
+        
+            typedef ::ISelectionRule * ( ::ISelectionRule::*clone_function_type )(  ) const;
+            
+            ISelectionRule_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::ISelectionRule::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISelectionRule::coordinateSelected
+        
+            typedef bool ( ::ISelectionRule::*coordinateSelected_function_type )( ::IndexVector3D const & ) const;
+            
+            ISelectionRule_exposer.def( 
+                "coordinateSelected"
+                , bp::pure_virtual( coordinateSelected_function_type(&::ISelectionRule::coordinateSelected) )
+                , ( bp::arg("coordinate") ) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ISimulation.pypp.cpp b/Core/PythonAPI/src/ISimulation.pypp.cpp
deleted file mode 100644
index d001953c8431b780905b4504143c715272fe9e9f..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/ISimulation.pypp.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "ISimulation.pypp.h"
-
-namespace bp = boost::python;
-
-struct ISimulation_wrapper : ISimulation, bp::wrapper< ISimulation > {
-
-    ISimulation_wrapper()
-    : ISimulation()
-      , bp::wrapper< ISimulation >(){
-        // null constructor
-        
-    }
-
-    virtual ::ISimulation * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->ISimulation::clone(  );
-        }
-    }
-    
-    ::ISimulation * default_clone(  ) const  {
-        return ISimulation::clone( );
-    }
-
-    virtual void run(  ) {
-        if( bp::override func_run = this->get_override( "run" ) )
-            func_run(  );
-        else{
-            this->ISimulation::run(  );
-        }
-    }
-    
-    void default_run(  ) {
-        ISimulation::run( );
-    }
-
-};
-
-void register_ISimulation_class(){
-
-    bp::class_< ISimulation_wrapper, bp::bases< ICloneable >, boost::noncopyable >( "ISimulation" )    
-        .def( 
-            "clone"
-            , (::ISimulation * ( ::ISimulation::* )(  ) const)(&::ISimulation::clone)
-            , (::ISimulation * ( ISimulation_wrapper::* )(  ) const)(&ISimulation_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "run"
-            , (void ( ::ISimulation::* )(  ) )(&::ISimulation::run)
-            , (void ( ISimulation_wrapper::* )(  ) )(&ISimulation_wrapper::default_run) );
-
-}
diff --git a/Core/PythonAPI/src/IStochasticParameter.pypp.cpp b/Core/PythonAPI/src/IStochasticParameter.pypp.cpp
deleted file mode 100644
index 68ab2d76584ce7814512fe3a3343dcfd2e846f01..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/IStochasticParameter.pypp.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "IStochasticParameter.pypp.h"
-
-namespace bp = boost::python;
-
-struct IStochasticParameter_wrapper : IStochasticParameter, bp::wrapper< IStochasticParameter > {
-
-    IStochasticParameter_wrapper()
-    : IStochasticParameter()
-      , bp::wrapper< IStochasticParameter >(){
-        // null constructor
-        
-    }
-
-    virtual void setToAverage(  ){
-        bp::override func_setToAverage = this->get_override( "setToAverage" );
-        func_setToAverage(  );
-    }
-
-    virtual void setToRandom(  ){
-        bp::override func_setToRandom = this->get_override( "setToRandom" );
-        func_setToRandom(  );
-    }
-
-    virtual ::ICloneable * clone(  ) const {
-        bp::override func_clone = this->get_override( "clone" );
-        return func_clone(  );
-    }
-
-};
-
-void register_IStochasticParameter_class(){
-
-    bp::class_< IStochasticParameter_wrapper, bp::bases< ICloneable >, boost::noncopyable >( "IStochasticParameter" )    
-        .def( 
-            "setToAverage"
-            , bp::pure_virtual( (void ( ::IStochasticParameter::* )(  ) )(&::IStochasticParameter::setToAverage) ) )    
-        .def( 
-            "setToRandom"
-            , bp::pure_virtual( (void ( ::IStochasticParameter::* )(  ) )(&::IStochasticParameter::setToRandom) ) )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::ICloneable * ( ::ICloneable::* )(  ) const)(&::ICloneable::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() );
-
-}
diff --git a/Core/PythonAPI/src/ITransform3D.pypp.cpp b/Core/PythonAPI/src/ITransform3D.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..445f4162c984c5e9f1c62900d48de7b04ffcd6be
--- /dev/null
+++ b/Core/PythonAPI/src/ITransform3D.pypp.cpp
@@ -0,0 +1,68 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "PythonCoreList.h"
+#include "ITransform3D.pypp.h"
+
+namespace bp = boost::python;
+
+struct ITransform3D_wrapper : Geometry::ITransform3D, bp::wrapper< Geometry::ITransform3D > {
+
+    ITransform3D_wrapper(Geometry::ITransform3D const & arg )
+    : Geometry::ITransform3D( arg )
+      , bp::wrapper< Geometry::ITransform3D >(){
+        // copy constructor
+        
+    }
+
+    ITransform3D_wrapper()
+    : Geometry::ITransform3D()
+      , bp::wrapper< Geometry::ITransform3D >(){
+        // null constructor
+        
+    }
+
+    virtual void print( ::std::ostream & ostr ) const  {
+        if( bp::override func_print = this->get_override( "print" ) )
+            func_print( boost::ref(ostr) );
+        else{
+            this->Geometry::ITransform3D::print( boost::ref(ostr) );
+        }
+    }
+    
+    void default_print( ::std::ostream & ostr ) const  {
+        Geometry::ITransform3D::print( boost::ref(ostr) );
+    }
+
+};
+
+void register_ITransform3D_class(){
+
+    { //::Geometry::ITransform3D
+        typedef bp::class_< ITransform3D_wrapper > ITransform3D_exposer_t;
+        ITransform3D_exposer_t ITransform3D_exposer = ITransform3D_exposer_t( "ITransform3D" );
+        bp::scope ITransform3D_scope( ITransform3D_exposer );
+        { //::Geometry::ITransform3D::print
+        
+            typedef void ( ::Geometry::ITransform3D::*print_function_type )( ::std::ostream & ) const;
+            typedef void ( ITransform3D_wrapper::*default_print_function_type )( ::std::ostream & ) const;
+            
+            ITransform3D_exposer.def( 
+                "print"
+                , print_function_type(&::Geometry::ITransform3D::print)
+                , default_print_function_type(&ITransform3D_wrapper::default_print)
+                , ( bp::arg("ostr") ) );
+        
+        }
+        bp::register_ptr_to_python< boost::shared_ptr< Geometry::ITransform3D > >();
+    }
+
+}
diff --git a/Core/PythonAPI/src/IndexVector3D.pypp.cpp b/Core/PythonAPI/src/IndexVector3D.pypp.cpp
deleted file mode 100644
index 573d670b8268c1b87f5b22f1aff2fd76ea7d5054..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/IndexVector3D.pypp.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "IndexVector3D.pypp.h"
-
-namespace bp = boost::python;
-
-void register_IndexVector3D_class(){
-
-    { //::Geometry::BasicVector3D< int >
-        typedef bp::class_< Geometry::BasicVector3D< int > > IndexVector3D_exposer_t;
-        IndexVector3D_exposer_t IndexVector3D_exposer = IndexVector3D_exposer_t( "IndexVector3D", bp::init< >() );
-        bp::scope IndexVector3D_scope( IndexVector3D_exposer );
-        IndexVector3D_exposer.def( bp::init< int const &, int const &, int const & >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) );
-        IndexVector3D_exposer.def( bp::self *= bp::other< double >() );
-        IndexVector3D_exposer.def( bp::self += bp::self );
-        IndexVector3D_exposer.def( bp::self -= bp::self );
-        IndexVector3D_exposer.def( bp::self /= bp::other< double >() );
-        { //::Geometry::BasicVector3D< int >::operator=
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef ::Geometry::BasicVector3D< int > & ( exported_class_t::*assign_function_type )( ::Geometry::BasicVector3D< int > const & ) ;
-            
-            IndexVector3D_exposer.def( 
-                "assign"
-                , assign_function_type( &::Geometry::BasicVector3D< int >::operator= )
-                , ( bp::arg("v") )
-                , bp::return_self< >() );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::operator[]
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef int ( exported_class_t::*__getitem___function_type )( int ) const;
-            
-            IndexVector3D_exposer.def( 
-                "__getitem__"
-                , __getitem___function_type( &::Geometry::BasicVector3D< int >::operator[] )
-                , ( bp::arg("i") ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::operator[]
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef int & ( exported_class_t::*__getitem___function_type )( int ) ;
-            
-            IndexVector3D_exposer.def( 
-                "__getitem__"
-                , __getitem___function_type( &::Geometry::BasicVector3D< int >::operator[] )
-                , ( bp::arg("i") )
-                , bp::return_value_policy< bp::copy_non_const_reference >() );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::setLambdaAlphaPhi
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef void ( exported_class_t::*setLambdaAlphaPhi_function_type )( int const &,int const &,int const & ) ;
-            
-            IndexVector3D_exposer.def( 
-                "setLambdaAlphaPhi"
-                , setLambdaAlphaPhi_function_type( &::Geometry::BasicVector3D< int >::setLambdaAlphaPhi )
-                , ( bp::arg("_lambda"), bp::arg("_alpha"), bp::arg("_phi") ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::setX
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef void ( exported_class_t::*setX_function_type )( int const & ) ;
-            
-            IndexVector3D_exposer.def( 
-                "setX"
-                , setX_function_type( &::Geometry::BasicVector3D< int >::setX )
-                , ( bp::arg("a") ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::setXYZ
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef void ( exported_class_t::*setXYZ_function_type )( int const &,int const &,int const & ) ;
-            
-            IndexVector3D_exposer.def( 
-                "setXYZ"
-                , setXYZ_function_type( &::Geometry::BasicVector3D< int >::setXYZ )
-                , ( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::setY
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef void ( exported_class_t::*setY_function_type )( int const & ) ;
-            
-            IndexVector3D_exposer.def( 
-                "setY"
-                , setY_function_type( &::Geometry::BasicVector3D< int >::setY )
-                , ( bp::arg("a") ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::setZ
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef void ( exported_class_t::*setZ_function_type )( int const & ) ;
-            
-            IndexVector3D_exposer.def( 
-                "setZ"
-                , setZ_function_type( &::Geometry::BasicVector3D< int >::setZ )
-                , ( bp::arg("a") ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::x
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef int ( exported_class_t::*x_function_type )(  ) const;
-            
-            IndexVector3D_exposer.def( 
-                "x"
-                , x_function_type( &::Geometry::BasicVector3D< int >::x ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::y
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef int ( exported_class_t::*y_function_type )(  ) const;
-            
-            IndexVector3D_exposer.def( 
-                "y"
-                , y_function_type( &::Geometry::BasicVector3D< int >::y ) );
-        
-        }
-        { //::Geometry::BasicVector3D< int >::z
-        
-            typedef Geometry::BasicVector3D< int > exported_class_t;
-            typedef int ( exported_class_t::*z_function_type )(  ) const;
-            
-            IndexVector3D_exposer.def( 
-                "z"
-                , z_function_type( &::Geometry::BasicVector3D< int >::z ) );
-        
-        }
-    }
-
-}
diff --git a/Core/PythonAPI/src/Instrument.pypp.cpp b/Core/PythonAPI/src/Instrument.pypp.cpp
index f2ea94a88b67ea2ca20f649b1f22c1f63ec3b772..5bfa2f37bcfc2743da0d415230f711da9b666968 100644
--- a/Core/PythonAPI/src/Instrument.pypp.cpp
+++ b/Core/PythonAPI/src/Instrument.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Instrument.pypp.h"
 
 namespace bp = boost::python;
@@ -194,82 +127,206 @@ struct Instrument_wrapper : Instrument, bp::wrapper< Instrument > {
 
 void register_Instrument_class(){
 
-    bp::class_< Instrument_wrapper, bp::bases< IParameterized > >( "Instrument", bp::init< >() )    
-        .def( bp::init< Instrument const & >(( bp::arg("other") )) )    
-        .def( 
-            "getBeam"
-            , (::Beam ( ::Instrument::* )(  ) const)( &::Instrument::getBeam ) )    
-        .def( 
-            "getDetector"
-            , (::Detector ( ::Instrument::* )(  ) const)( &::Instrument::getDetector ) )    
-        .def( 
-            "getDetectorAxis"
-            , (::IAxis const & ( ::Instrument::* )( ::size_t ) const)( &::Instrument::getDetectorAxis )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::copy_const_reference >() )    
-        .def( 
-            "getDetectorDimension"
-            , (::size_t ( ::Instrument::* )(  ) const)( &::Instrument::getDetectorDimension ) )    
-        .def( 
-            "getIntensity"
-            , (double ( ::Instrument::* )(  ) const)( &::Instrument::getIntensity ) )    
-        .def( 
-            "matchDetectorParameters"
-            , (void ( ::Instrument::* )( ::OutputData< double > const & ) )( &::Instrument::matchDetectorParameters )
-            , ( bp::arg("output_data") ) )    
-        .def( 
-            "setBeam"
-            , (void ( ::Instrument::* )( ::Beam ) )( &::Instrument::setBeam )
-            , ( bp::arg("beam") ) )    
-        .def( 
-            "setBeamIntensity"
-            , (void ( ::Instrument::* )( double ) )( &::Instrument::setBeamIntensity )
-            , ( bp::arg("intensity") ) )    
-        .def( 
-            "setBeamParameters"
-            , (void ( ::Instrument::* )( double,double,double ) )( &::Instrument::setBeamParameters )
-            , ( bp::arg("lambda"), bp::arg("alpha_i"), bp::arg("phi_i") ) )    
-        .def( 
-            "setDetectorParameters"
-            , (void ( ::Instrument::* )( ::size_t,double,double,::size_t,double,double,bool ) )( &::Instrument::setDetectorParameters )
-            , ( bp::arg("n_phi"), bp::arg("phi_f_min"), bp::arg("phi_f_max"), bp::arg("n_alpha"), bp::arg("alpha_f_min"), bp::arg("alpha_f_max"), bp::arg("isgisaxs_style")=(bool)(false) ) )    
-        .def( 
-            "setDetectorParameters"
-            , (void ( ::Instrument::* )( ::DetectorParameters const & ) )( &::Instrument::setDetectorParameters )
-            , ( bp::arg("params") ) )    
-        .def( 
-            "setDetectorResolutionFunction"
-            , (void ( ::Instrument::* )( ::IResolutionFunction2D const & ) )( &::Instrument::setDetectorResolutionFunction )
-            , ( bp::arg("p_resolution_function") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( Instrument_wrapper::* )(  ) )(&Instrument_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( Instrument_wrapper::* )(  ) )(&Instrument_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( Instrument_wrapper::* )(  ) const)(&Instrument_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( Instrument_wrapper::* )(  ) const)(&Instrument_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &Instrument_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( Instrument_wrapper::* )( ::std::string const &,double ) )(&Instrument_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( Instrument_wrapper::* )(  ) )(&Instrument_wrapper::default_setParametersAreChanged) );
+    { //::Instrument
+        typedef bp::class_< Instrument_wrapper, bp::bases< IParameterized > > Instrument_exposer_t;
+        Instrument_exposer_t Instrument_exposer = Instrument_exposer_t( "Instrument", bp::init< >() );
+        bp::scope Instrument_scope( Instrument_exposer );
+        Instrument_exposer.def( bp::init< Instrument const & >(( bp::arg("other") )) );
+        { //::Instrument::getBeam
+        
+            typedef ::Beam ( ::Instrument::*getBeam_function_type )(  ) const;
+            
+            Instrument_exposer.def( 
+                "getBeam"
+                , getBeam_function_type( &::Instrument::getBeam ) );
+        
+        }
+        { //::Instrument::getDetector
+        
+            typedef ::Detector ( ::Instrument::*getDetector_function_type )(  ) const;
+            
+            Instrument_exposer.def( 
+                "getDetector"
+                , getDetector_function_type( &::Instrument::getDetector ) );
+        
+        }
+        { //::Instrument::getDetectorAxis
+        
+            typedef ::IAxis const & ( ::Instrument::*getDetectorAxis_function_type )( ::size_t ) const;
+            
+            Instrument_exposer.def( 
+                "getDetectorAxis"
+                , getDetectorAxis_function_type( &::Instrument::getDetectorAxis )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::copy_const_reference >() );
+        
+        }
+        { //::Instrument::getDetectorDimension
+        
+            typedef ::size_t ( ::Instrument::*getDetectorDimension_function_type )(  ) const;
+            
+            Instrument_exposer.def( 
+                "getDetectorDimension"
+                , getDetectorDimension_function_type( &::Instrument::getDetectorDimension ) );
+        
+        }
+        { //::Instrument::getIntensity
+        
+            typedef double ( ::Instrument::*getIntensity_function_type )(  ) const;
+            
+            Instrument_exposer.def( 
+                "getIntensity"
+                , getIntensity_function_type( &::Instrument::getIntensity ) );
+        
+        }
+        { //::Instrument::matchDetectorParameters
+        
+            typedef void ( ::Instrument::*matchDetectorParameters_function_type )( ::OutputData< double > const & ) ;
+            
+            Instrument_exposer.def( 
+                "matchDetectorParameters"
+                , matchDetectorParameters_function_type( &::Instrument::matchDetectorParameters )
+                , ( bp::arg("output_data") ) );
+        
+        }
+        { //::Instrument::setBeam
+        
+            typedef void ( ::Instrument::*setBeam_function_type )( ::Beam ) ;
+            
+            Instrument_exposer.def( 
+                "setBeam"
+                , setBeam_function_type( &::Instrument::setBeam )
+                , ( bp::arg("beam") ) );
+        
+        }
+        { //::Instrument::setBeamIntensity
+        
+            typedef void ( ::Instrument::*setBeamIntensity_function_type )( double ) ;
+            
+            Instrument_exposer.def( 
+                "setBeamIntensity"
+                , setBeamIntensity_function_type( &::Instrument::setBeamIntensity )
+                , ( bp::arg("intensity") ) );
+        
+        }
+        { //::Instrument::setBeamParameters
+        
+            typedef void ( ::Instrument::*setBeamParameters_function_type )( double,double,double ) ;
+            
+            Instrument_exposer.def( 
+                "setBeamParameters"
+                , setBeamParameters_function_type( &::Instrument::setBeamParameters )
+                , ( bp::arg("lambda"), bp::arg("alpha_i"), bp::arg("phi_i") ) );
+        
+        }
+        { //::Instrument::setDetectorParameters
+        
+            typedef void ( ::Instrument::*setDetectorParameters_function_type )( ::size_t,double,double,::size_t,double,double,bool ) ;
+            
+            Instrument_exposer.def( 
+                "setDetectorParameters"
+                , setDetectorParameters_function_type( &::Instrument::setDetectorParameters )
+                , ( bp::arg("n_phi"), bp::arg("phi_f_min"), bp::arg("phi_f_max"), bp::arg("n_alpha"), bp::arg("alpha_f_min"), bp::arg("alpha_f_max"), bp::arg("isgisaxs_style")=(bool)(false) ) );
+        
+        }
+        { //::Instrument::setDetectorParameters
+        
+            typedef void ( ::Instrument::*setDetectorParameters_function_type )( ::DetectorParameters const & ) ;
+            
+            Instrument_exposer.def( 
+                "setDetectorParameters"
+                , setDetectorParameters_function_type( &::Instrument::setDetectorParameters )
+                , ( bp::arg("params") ) );
+        
+        }
+        { //::Instrument::setDetectorResolutionFunction
+        
+            typedef void ( ::Instrument::*setDetectorResolutionFunction_function_type )( ::IResolutionFunction2D const & ) ;
+            
+            Instrument_exposer.def( 
+                "setDetectorResolutionFunction"
+                , setDetectorResolutionFunction_function_type( &::Instrument::setDetectorResolutionFunction )
+                , ( bp::arg("p_resolution_function") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Instrument_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Instrument_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Instrument_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Instrument_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Instrument_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Instrument_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Instrument_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Instrument_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Instrument_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Instrument_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Instrument_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Instrument_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Instrument_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Instrument_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Instrument_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Instrument_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Instrument_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Instrument_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Instrument_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Instrument_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/InterferenceFunction1DParaCrystal.pypp.cpp b/Core/PythonAPI/src/InterferenceFunction1DParaCrystal.pypp.cpp
index 1102a0d0701c311c1695f16a0e45260ee693a363..6445acb91f30cd5cd2b7aceec4bf40502c44a11a 100644
--- a/Core/PythonAPI/src/InterferenceFunction1DParaCrystal.pypp.cpp
+++ b/Core/PythonAPI/src/InterferenceFunction1DParaCrystal.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "InterferenceFunction1DParaCrystal.pypp.h"
 
 namespace bp = boost::python;
@@ -164,28 +97,28 @@ struct InterferenceFunction1DParaCrystal_wrapper : InterferenceFunction1DParaCry
         return IParameterized::createParameterTree( );
     }
 
-    virtual void printParameters(  ) const  {
-        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
-            func_printParameters(  );
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
         else{
-            this->IParameterized::printParameters(  );
+            return this->ISample::getCompositeSample(  );
         }
     }
     
-    void default_printParameters(  ) const  {
-        IParameterized::printParameters( );
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
         else{
-            this->ISample::print_structure(  );
+            this->IParameterized::printParameters(  );
         }
     }
     
-    void default_print_structure(  ) {
-        ISample::print_structure( );
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
     }
 
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
@@ -235,62 +168,155 @@ struct InterferenceFunction1DParaCrystal_wrapper : InterferenceFunction1DParaCry
 
 void register_InterferenceFunction1DParaCrystal_class(){
 
-    bp::class_< InterferenceFunction1DParaCrystal_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable >( "InterferenceFunction1DParaCrystal", bp::init< double, double, bp::optional< double > >(( bp::arg("peak_distance"), bp::arg("width"), bp::arg("corr_length")=0.0 )) )    
-        .def( 
-            "FTGaussianCorrLength"
-            , (::complex_t ( ::InterferenceFunction1DParaCrystal::* )( double ) const)( &::InterferenceFunction1DParaCrystal::FTGaussianCorrLength )
-            , ( bp::arg("qpar") ) )    
-        .def( 
-            "clone"
-            , (::InterferenceFunction1DParaCrystal * ( ::InterferenceFunction1DParaCrystal::* )(  ) const)(&::InterferenceFunction1DParaCrystal::clone)
-            , (::InterferenceFunction1DParaCrystal * ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction1DParaCrystal_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (double ( ::InterferenceFunction1DParaCrystal::* )( ::cvector_t const & ) const)(&::InterferenceFunction1DParaCrystal::evaluate)
-            , (double ( InterferenceFunction1DParaCrystal_wrapper::* )( ::cvector_t const & ) const)(&InterferenceFunction1DParaCrystal_wrapper::default_evaluate)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "getKappa"
-            , (double ( ::InterferenceFunction1DParaCrystal::* )(  ) const)(&::InterferenceFunction1DParaCrystal::getKappa)
-            , (double ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction1DParaCrystal_wrapper::default_getKappa) )    
-        .def( 
-            "setKappa"
-            , (void ( ::InterferenceFunction1DParaCrystal::* )( double ) )( &::InterferenceFunction1DParaCrystal::setKappa )
-            , ( bp::arg("kappa") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction1DParaCrystal_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction1DParaCrystal_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction1DParaCrystal_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction1DParaCrystal_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction1DParaCrystal_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &InterferenceFunction1DParaCrystal_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( InterferenceFunction1DParaCrystal_wrapper::* )( ::std::string const &,double ) )(&InterferenceFunction1DParaCrystal_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( InterferenceFunction1DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction1DParaCrystal_wrapper::default_setParametersAreChanged) );
+    { //::InterferenceFunction1DParaCrystal
+        typedef bp::class_< InterferenceFunction1DParaCrystal_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable > InterferenceFunction1DParaCrystal_exposer_t;
+        InterferenceFunction1DParaCrystal_exposer_t InterferenceFunction1DParaCrystal_exposer = InterferenceFunction1DParaCrystal_exposer_t( "InterferenceFunction1DParaCrystal", bp::init< double, double, bp::optional< double > >(( bp::arg("peak_distance"), bp::arg("width"), bp::arg("corr_length")=0.0 )) );
+        bp::scope InterferenceFunction1DParaCrystal_scope( InterferenceFunction1DParaCrystal_exposer );
+        { //::InterferenceFunction1DParaCrystal::FTGaussianCorrLength
+        
+            typedef ::complex_t ( ::InterferenceFunction1DParaCrystal::*FTGaussianCorrLength_function_type )( double ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "FTGaussianCorrLength"
+                , FTGaussianCorrLength_function_type( &::InterferenceFunction1DParaCrystal::FTGaussianCorrLength )
+                , ( bp::arg("qpar") ) );
+        
+        }
+        { //::InterferenceFunction1DParaCrystal::clone
+        
+            typedef ::InterferenceFunction1DParaCrystal * ( ::InterferenceFunction1DParaCrystal::*clone_function_type )(  ) const;
+            typedef ::InterferenceFunction1DParaCrystal * ( InterferenceFunction1DParaCrystal_wrapper::*default_clone_function_type )(  ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "clone"
+                , clone_function_type(&::InterferenceFunction1DParaCrystal::clone)
+                , default_clone_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::InterferenceFunction1DParaCrystal::evaluate
+        
+            typedef double ( ::InterferenceFunction1DParaCrystal::*evaluate_function_type )( ::cvector_t const & ) const;
+            typedef double ( InterferenceFunction1DParaCrystal_wrapper::*default_evaluate_function_type )( ::cvector_t const & ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::InterferenceFunction1DParaCrystal::evaluate)
+                , default_evaluate_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_evaluate)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::InterferenceFunction1DParaCrystal::getKappa
+        
+            typedef double ( ::InterferenceFunction1DParaCrystal::*getKappa_function_type )(  ) const;
+            typedef double ( InterferenceFunction1DParaCrystal_wrapper::*default_getKappa_function_type )(  ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "getKappa"
+                , getKappa_function_type(&::InterferenceFunction1DParaCrystal::getKappa)
+                , default_getKappa_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_getKappa) );
+        
+        }
+        { //::InterferenceFunction1DParaCrystal::setKappa
+        
+            typedef void ( ::InterferenceFunction1DParaCrystal::*setKappa_function_type )( double ) ;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "setKappa"
+                , setKappa_function_type( &::InterferenceFunction1DParaCrystal::setKappa )
+                , ( bp::arg("kappa") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( InterferenceFunction1DParaCrystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( InterferenceFunction1DParaCrystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( InterferenceFunction1DParaCrystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( InterferenceFunction1DParaCrystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( InterferenceFunction1DParaCrystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &InterferenceFunction1DParaCrystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( InterferenceFunction1DParaCrystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( InterferenceFunction1DParaCrystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            InterferenceFunction1DParaCrystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&InterferenceFunction1DParaCrystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/InterferenceFunction2DLattice.pypp.cpp b/Core/PythonAPI/src/InterferenceFunction2DLattice.pypp.cpp
index 31c34671afdc6b26092687ed48c3cb0e6f874a1f..292350d77d242f7310d06b6cd739bdb02043e04c 100644
--- a/Core/PythonAPI/src/InterferenceFunction2DLattice.pypp.cpp
+++ b/Core/PythonAPI/src/InterferenceFunction2DLattice.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "InterferenceFunction2DLattice.pypp.h"
 
 namespace bp = boost::python;
@@ -152,6 +85,18 @@ struct InterferenceFunction2DLattice_wrapper : InterferenceFunction2DLattice, bp
         return IParameterized::createParameterTree( );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getKappa(  ) const  {
         if( bp::override func_getKappa = this->get_override( "getKappa" ) )
             return func_getKappa(  );
@@ -176,18 +121,6 @@ struct InterferenceFunction2DLattice_wrapper : InterferenceFunction2DLattice, bp
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -235,58 +168,145 @@ struct InterferenceFunction2DLattice_wrapper : InterferenceFunction2DLattice, bp
 
 void register_InterferenceFunction2DLattice_class(){
 
-    bp::class_< InterferenceFunction2DLattice_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable >( "InterferenceFunction2DLattice", bp::init< Lattice2DIFParameters const & >(( bp::arg("lattice_params") )) )    
-        .def( 
-            "clone"
-            , (::InterferenceFunction2DLattice * ( ::InterferenceFunction2DLattice::* )(  ) const)(&::InterferenceFunction2DLattice::clone)
-            , (::InterferenceFunction2DLattice * ( InterferenceFunction2DLattice_wrapper::* )(  ) const)(&InterferenceFunction2DLattice_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (double ( ::InterferenceFunction2DLattice::* )( ::cvector_t const & ) const)(&::InterferenceFunction2DLattice::evaluate)
-            , (double ( InterferenceFunction2DLattice_wrapper::* )( ::cvector_t const & ) const)(&InterferenceFunction2DLattice_wrapper::default_evaluate)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "setProbabilityDistribution"
-            , (void ( ::InterferenceFunction2DLattice::* )( ::IFTDistribution2D const & ) )( &::InterferenceFunction2DLattice::setProbabilityDistribution )
-            , ( bp::arg("pdf") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( InterferenceFunction2DLattice_wrapper::* )(  ) )(&InterferenceFunction2DLattice_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( InterferenceFunction2DLattice_wrapper::* )(  ) )(&InterferenceFunction2DLattice_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( InterferenceFunction2DLattice_wrapper::* )(  ) const)(&InterferenceFunction2DLattice_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getKappa"
-            , (double ( ::IInterferenceFunction::* )(  ) const)(&::IInterferenceFunction::getKappa)
-            , (double ( InterferenceFunction2DLattice_wrapper::* )(  ) const)(&InterferenceFunction2DLattice_wrapper::default_getKappa) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( InterferenceFunction2DLattice_wrapper::* )(  ) const)(&InterferenceFunction2DLattice_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( InterferenceFunction2DLattice_wrapper::* )(  ) )(&InterferenceFunction2DLattice_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &InterferenceFunction2DLattice_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( InterferenceFunction2DLattice_wrapper::* )( ::std::string const &,double ) )(&InterferenceFunction2DLattice_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( InterferenceFunction2DLattice_wrapper::* )(  ) )(&InterferenceFunction2DLattice_wrapper::default_setParametersAreChanged) );
+    { //::InterferenceFunction2DLattice
+        typedef bp::class_< InterferenceFunction2DLattice_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable > InterferenceFunction2DLattice_exposer_t;
+        InterferenceFunction2DLattice_exposer_t InterferenceFunction2DLattice_exposer = InterferenceFunction2DLattice_exposer_t( "InterferenceFunction2DLattice", bp::init< Lattice2DIFParameters const & >(( bp::arg("lattice_params") )) );
+        bp::scope InterferenceFunction2DLattice_scope( InterferenceFunction2DLattice_exposer );
+        { //::InterferenceFunction2DLattice::clone
+        
+            typedef ::InterferenceFunction2DLattice * ( ::InterferenceFunction2DLattice::*clone_function_type )(  ) const;
+            typedef ::InterferenceFunction2DLattice * ( InterferenceFunction2DLattice_wrapper::*default_clone_function_type )(  ) const;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "clone"
+                , clone_function_type(&::InterferenceFunction2DLattice::clone)
+                , default_clone_function_type(&InterferenceFunction2DLattice_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::InterferenceFunction2DLattice::evaluate
+        
+            typedef double ( ::InterferenceFunction2DLattice::*evaluate_function_type )( ::cvector_t const & ) const;
+            typedef double ( InterferenceFunction2DLattice_wrapper::*default_evaluate_function_type )( ::cvector_t const & ) const;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::InterferenceFunction2DLattice::evaluate)
+                , default_evaluate_function_type(&InterferenceFunction2DLattice_wrapper::default_evaluate)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::InterferenceFunction2DLattice::setProbabilityDistribution
+        
+            typedef void ( ::InterferenceFunction2DLattice::*setProbabilityDistribution_function_type )( ::IFTDistribution2D const & ) ;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "setProbabilityDistribution"
+                , setProbabilityDistribution_function_type( &::InterferenceFunction2DLattice::setProbabilityDistribution )
+                , ( bp::arg("pdf") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( InterferenceFunction2DLattice_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&InterferenceFunction2DLattice_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( InterferenceFunction2DLattice_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&InterferenceFunction2DLattice_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( InterferenceFunction2DLattice_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&InterferenceFunction2DLattice_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( InterferenceFunction2DLattice_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&InterferenceFunction2DLattice_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IInterferenceFunction::getKappa
+        
+            typedef double ( ::IInterferenceFunction::*getKappa_function_type )(  ) const;
+            typedef double ( InterferenceFunction2DLattice_wrapper::*default_getKappa_function_type )(  ) const;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "getKappa"
+                , getKappa_function_type(&::IInterferenceFunction::getKappa)
+                , default_getKappa_function_type(&InterferenceFunction2DLattice_wrapper::default_getKappa) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( InterferenceFunction2DLattice_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&InterferenceFunction2DLattice_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &InterferenceFunction2DLattice_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( InterferenceFunction2DLattice_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&InterferenceFunction2DLattice_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( InterferenceFunction2DLattice_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            InterferenceFunction2DLattice_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&InterferenceFunction2DLattice_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/InterferenceFunction2DParaCrystal.pypp.cpp b/Core/PythonAPI/src/InterferenceFunction2DParaCrystal.pypp.cpp
index 825c08a8f6941b2aee14b0e92025513b73a38649..3b56c7218cf0d7e9ed346238eb4a054566301b67 100644
--- a/Core/PythonAPI/src/InterferenceFunction2DParaCrystal.pypp.cpp
+++ b/Core/PythonAPI/src/InterferenceFunction2DParaCrystal.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "InterferenceFunction2DParaCrystal.pypp.h"
 
 namespace bp = boost::python;
@@ -152,6 +85,18 @@ struct InterferenceFunction2DParaCrystal_wrapper : InterferenceFunction2DParaCry
         return IParameterized::createParameterTree( );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getKappa(  ) const  {
         if( bp::override func_getKappa = this->get_override( "getKappa" ) )
             return func_getKappa(  );
@@ -176,18 +121,6 @@ struct InterferenceFunction2DParaCrystal_wrapper : InterferenceFunction2DParaCry
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -235,78 +168,189 @@ struct InterferenceFunction2DParaCrystal_wrapper : InterferenceFunction2DParaCry
 
 void register_InterferenceFunction2DParaCrystal_class(){
 
-    bp::class_< InterferenceFunction2DParaCrystal_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable >( "InterferenceFunction2DParaCrystal", bp::init< double, double, double, bp::optional< double, double > >(( bp::arg("length_1"), bp::arg("length_2"), bp::arg("alpha_lattice"), bp::arg("xi")=0.0, bp::arg("corr_length")=0.0 )) )    
-        .def( 
-            "clone"
-            , (::InterferenceFunction2DParaCrystal * ( ::InterferenceFunction2DParaCrystal::* )(  ) const)(&::InterferenceFunction2DParaCrystal::clone)
-            , (::InterferenceFunction2DParaCrystal * ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction2DParaCrystal_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createHexagonal"
-            , (::InterferenceFunction2DParaCrystal * (*)( double,double,double,double ))( &::InterferenceFunction2DParaCrystal::createHexagonal )
-            , ( bp::arg("peak_distance"), bp::arg("corr_length")=0.0, bp::arg("domain_size_1")=0.0, bp::arg("domain_size_2")=0.0 )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createSquare"
-            , (::InterferenceFunction2DParaCrystal * (*)( double,double,double,double ))( &::InterferenceFunction2DParaCrystal::createSquare )
-            , ( bp::arg("peak_distance"), bp::arg("corr_length")=0.0, bp::arg("domain_size_1")=0.0, bp::arg("domain_size_2")=0.0 )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (double ( ::InterferenceFunction2DParaCrystal::* )( ::cvector_t const & ) const)(&::InterferenceFunction2DParaCrystal::evaluate)
-            , (double ( InterferenceFunction2DParaCrystal_wrapper::* )( ::cvector_t const & ) const)(&InterferenceFunction2DParaCrystal_wrapper::default_evaluate)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "setDomainSizes"
-            , (void ( ::InterferenceFunction2DParaCrystal::* )( double,double ) )( &::InterferenceFunction2DParaCrystal::setDomainSizes )
-            , ( bp::arg("size_1"), bp::arg("size_2") ) )    
-        .def( 
-            "setIntegrationOverXi"
-            , (void ( ::InterferenceFunction2DParaCrystal::* )( bool ) )( &::InterferenceFunction2DParaCrystal::setIntegrationOverXi )
-            , ( bp::arg("integrate_xi") ) )    
-        .def( 
-            "setProbabilityDistributions"
-            , (void ( ::InterferenceFunction2DParaCrystal::* )( ::IFTDistribution2D const &,::IFTDistribution2D const & ) )( &::InterferenceFunction2DParaCrystal::setProbabilityDistributions )
-            , ( bp::arg("pdf_1"), bp::arg("pdf_2") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction2DParaCrystal_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction2DParaCrystal_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction2DParaCrystal_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getKappa"
-            , (double ( ::IInterferenceFunction::* )(  ) const)(&::IInterferenceFunction::getKappa)
-            , (double ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction2DParaCrystal_wrapper::default_getKappa) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) const)(&InterferenceFunction2DParaCrystal_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction2DParaCrystal_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &InterferenceFunction2DParaCrystal_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( InterferenceFunction2DParaCrystal_wrapper::* )( ::std::string const &,double ) )(&InterferenceFunction2DParaCrystal_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( InterferenceFunction2DParaCrystal_wrapper::* )(  ) )(&InterferenceFunction2DParaCrystal_wrapper::default_setParametersAreChanged) )    
-        .staticmethod( "createHexagonal" )    
-        .staticmethod( "createSquare" );
+    { //::InterferenceFunction2DParaCrystal
+        typedef bp::class_< InterferenceFunction2DParaCrystal_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable > InterferenceFunction2DParaCrystal_exposer_t;
+        InterferenceFunction2DParaCrystal_exposer_t InterferenceFunction2DParaCrystal_exposer = InterferenceFunction2DParaCrystal_exposer_t( "InterferenceFunction2DParaCrystal", bp::init< double, double, double, bp::optional< double, double > >(( bp::arg("length_1"), bp::arg("length_2"), bp::arg("alpha_lattice"), bp::arg("xi")=0.0, bp::arg("corr_length")=0.0 )) );
+        bp::scope InterferenceFunction2DParaCrystal_scope( InterferenceFunction2DParaCrystal_exposer );
+        { //::InterferenceFunction2DParaCrystal::clone
+        
+            typedef ::InterferenceFunction2DParaCrystal * ( ::InterferenceFunction2DParaCrystal::*clone_function_type )(  ) const;
+            typedef ::InterferenceFunction2DParaCrystal * ( InterferenceFunction2DParaCrystal_wrapper::*default_clone_function_type )(  ) const;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "clone"
+                , clone_function_type(&::InterferenceFunction2DParaCrystal::clone)
+                , default_clone_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::InterferenceFunction2DParaCrystal::createHexagonal
+        
+            typedef ::InterferenceFunction2DParaCrystal * ( *createHexagonal_function_type )( double,double,double,double );
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "createHexagonal"
+                , createHexagonal_function_type( &::InterferenceFunction2DParaCrystal::createHexagonal )
+                , ( bp::arg("peak_distance"), bp::arg("corr_length")=0.0, bp::arg("domain_size_1")=0.0, bp::arg("domain_size_2")=0.0 )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::InterferenceFunction2DParaCrystal::createSquare
+        
+            typedef ::InterferenceFunction2DParaCrystal * ( *createSquare_function_type )( double,double,double,double );
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "createSquare"
+                , createSquare_function_type( &::InterferenceFunction2DParaCrystal::createSquare )
+                , ( bp::arg("peak_distance"), bp::arg("corr_length")=0.0, bp::arg("domain_size_1")=0.0, bp::arg("domain_size_2")=0.0 )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::InterferenceFunction2DParaCrystal::evaluate
+        
+            typedef double ( ::InterferenceFunction2DParaCrystal::*evaluate_function_type )( ::cvector_t const & ) const;
+            typedef double ( InterferenceFunction2DParaCrystal_wrapper::*default_evaluate_function_type )( ::cvector_t const & ) const;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::InterferenceFunction2DParaCrystal::evaluate)
+                , default_evaluate_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_evaluate)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::InterferenceFunction2DParaCrystal::setDomainSizes
+        
+            typedef void ( ::InterferenceFunction2DParaCrystal::*setDomainSizes_function_type )( double,double ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "setDomainSizes"
+                , setDomainSizes_function_type( &::InterferenceFunction2DParaCrystal::setDomainSizes )
+                , ( bp::arg("size_1"), bp::arg("size_2") ) );
+        
+        }
+        { //::InterferenceFunction2DParaCrystal::setIntegrationOverXi
+        
+            typedef void ( ::InterferenceFunction2DParaCrystal::*setIntegrationOverXi_function_type )( bool ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "setIntegrationOverXi"
+                , setIntegrationOverXi_function_type( &::InterferenceFunction2DParaCrystal::setIntegrationOverXi )
+                , ( bp::arg("integrate_xi") ) );
+        
+        }
+        { //::InterferenceFunction2DParaCrystal::setProbabilityDistributions
+        
+            typedef void ( ::InterferenceFunction2DParaCrystal::*setProbabilityDistributions_function_type )( ::IFTDistribution2D const &,::IFTDistribution2D const & ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "setProbabilityDistributions"
+                , setProbabilityDistributions_function_type( &::InterferenceFunction2DParaCrystal::setProbabilityDistributions )
+                , ( bp::arg("pdf_1"), bp::arg("pdf_2") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( InterferenceFunction2DParaCrystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( InterferenceFunction2DParaCrystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( InterferenceFunction2DParaCrystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( InterferenceFunction2DParaCrystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IInterferenceFunction::getKappa
+        
+            typedef double ( ::IInterferenceFunction::*getKappa_function_type )(  ) const;
+            typedef double ( InterferenceFunction2DParaCrystal_wrapper::*default_getKappa_function_type )(  ) const;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "getKappa"
+                , getKappa_function_type(&::IInterferenceFunction::getKappa)
+                , default_getKappa_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_getKappa) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( InterferenceFunction2DParaCrystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &InterferenceFunction2DParaCrystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( InterferenceFunction2DParaCrystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( InterferenceFunction2DParaCrystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            InterferenceFunction2DParaCrystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&InterferenceFunction2DParaCrystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+        InterferenceFunction2DParaCrystal_exposer.staticmethod( "createHexagonal" );
+        InterferenceFunction2DParaCrystal_exposer.staticmethod( "createSquare" );
+    }
 
 }
diff --git a/Core/PythonAPI/src/InterferenceFunctionNone.pypp.cpp b/Core/PythonAPI/src/InterferenceFunctionNone.pypp.cpp
index ba46e6370c7a661b31ae6a157e719e7a0e4386a0..3c3a578f1ae12209ebd5e2b13424bb12e56762ba 100644
--- a/Core/PythonAPI/src/InterferenceFunctionNone.pypp.cpp
+++ b/Core/PythonAPI/src/InterferenceFunctionNone.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "InterferenceFunctionNone.pypp.h"
 
 namespace bp = boost::python;
@@ -152,6 +85,18 @@ struct InterferenceFunctionNone_wrapper : InterferenceFunctionNone, bp::wrapper<
         return IParameterized::createParameterTree( );
     }
 
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ISample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
+    }
+
     virtual double getKappa(  ) const  {
         if( bp::override func_getKappa = this->get_override( "getKappa" ) )
             return func_getKappa(  );
@@ -176,18 +121,6 @@ struct InterferenceFunctionNone_wrapper : InterferenceFunctionNone, bp::wrapper<
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -235,54 +168,135 @@ struct InterferenceFunctionNone_wrapper : InterferenceFunctionNone, bp::wrapper<
 
 void register_InterferenceFunctionNone_class(){
 
-    bp::class_< InterferenceFunctionNone_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable >( "InterferenceFunctionNone", bp::init< >() )    
-        .def( 
-            "clone"
-            , (::InterferenceFunctionNone * ( ::InterferenceFunctionNone::* )(  ) const)(&::InterferenceFunctionNone::clone)
-            , (::InterferenceFunctionNone * ( InterferenceFunctionNone_wrapper::* )(  ) const)(&InterferenceFunctionNone_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluate"
-            , (double ( ::InterferenceFunctionNone::* )( ::cvector_t const & ) const)(&::InterferenceFunctionNone::evaluate)
-            , (double ( InterferenceFunctionNone_wrapper::* )( ::cvector_t const & ) const)(&InterferenceFunctionNone_wrapper::default_evaluate)
-            , ( bp::arg("q") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( InterferenceFunctionNone_wrapper::* )(  ) )(&InterferenceFunctionNone_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( InterferenceFunctionNone_wrapper::* )(  ) )(&InterferenceFunctionNone_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( InterferenceFunctionNone_wrapper::* )(  ) const)(&InterferenceFunctionNone_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getKappa"
-            , (double ( ::IInterferenceFunction::* )(  ) const)(&::IInterferenceFunction::getKappa)
-            , (double ( InterferenceFunctionNone_wrapper::* )(  ) const)(&InterferenceFunctionNone_wrapper::default_getKappa) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( InterferenceFunctionNone_wrapper::* )(  ) const)(&InterferenceFunctionNone_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( InterferenceFunctionNone_wrapper::* )(  ) )(&InterferenceFunctionNone_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &InterferenceFunctionNone_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( InterferenceFunctionNone_wrapper::* )( ::std::string const &,double ) )(&InterferenceFunctionNone_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( InterferenceFunctionNone_wrapper::* )(  ) )(&InterferenceFunctionNone_wrapper::default_setParametersAreChanged) );
+    { //::InterferenceFunctionNone
+        typedef bp::class_< InterferenceFunctionNone_wrapper, bp::bases< IInterferenceFunction >, boost::noncopyable > InterferenceFunctionNone_exposer_t;
+        InterferenceFunctionNone_exposer_t InterferenceFunctionNone_exposer = InterferenceFunctionNone_exposer_t( "InterferenceFunctionNone", bp::init< >() );
+        bp::scope InterferenceFunctionNone_scope( InterferenceFunctionNone_exposer );
+        { //::InterferenceFunctionNone::clone
+        
+            typedef ::InterferenceFunctionNone * ( ::InterferenceFunctionNone::*clone_function_type )(  ) const;
+            typedef ::InterferenceFunctionNone * ( InterferenceFunctionNone_wrapper::*default_clone_function_type )(  ) const;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "clone"
+                , clone_function_type(&::InterferenceFunctionNone::clone)
+                , default_clone_function_type(&InterferenceFunctionNone_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::InterferenceFunctionNone::evaluate
+        
+            typedef double ( ::InterferenceFunctionNone::*evaluate_function_type )( ::cvector_t const & ) const;
+            typedef double ( InterferenceFunctionNone_wrapper::*default_evaluate_function_type )( ::cvector_t const & ) const;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "evaluate"
+                , evaluate_function_type(&::InterferenceFunctionNone::evaluate)
+                , default_evaluate_function_type(&InterferenceFunctionNone_wrapper::default_evaluate)
+                , ( bp::arg("q") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( InterferenceFunctionNone_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&InterferenceFunctionNone_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( InterferenceFunctionNone_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&InterferenceFunctionNone_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( InterferenceFunctionNone_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&InterferenceFunctionNone_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( InterferenceFunctionNone_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&InterferenceFunctionNone_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IInterferenceFunction::getKappa
+        
+            typedef double ( ::IInterferenceFunction::*getKappa_function_type )(  ) const;
+            typedef double ( InterferenceFunctionNone_wrapper::*default_getKappa_function_type )(  ) const;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "getKappa"
+                , getKappa_function_type(&::IInterferenceFunction::getKappa)
+                , default_getKappa_function_type(&InterferenceFunctionNone_wrapper::default_getKappa) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( InterferenceFunctionNone_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&InterferenceFunctionNone_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            InterferenceFunctionNone_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &InterferenceFunctionNone_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( InterferenceFunctionNone_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&InterferenceFunctionNone_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( InterferenceFunctionNone_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            InterferenceFunctionNone_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&InterferenceFunctionNone_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Lattice.pypp.cpp b/Core/PythonAPI/src/Lattice.pypp.cpp
index b6c4fcc38a3c7dec6383aba27da5804c74496a4e..d6af1a21a6580442f423766e2f55824fcb568840 100644
--- a/Core/PythonAPI/src/Lattice.pypp.cpp
+++ b/Core/PythonAPI/src/Lattice.pypp.cpp
@@ -1,109 +1,76 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Lattice.pypp.h"
 
 namespace bp = boost::python;
 
 void register_Lattice_class(){
 
-    bp::class_< Lattice >( "Lattice", bp::init< >() )    
-        .def( bp::init< kvector_t const &, kvector_t const &, kvector_t const & >(( bp::arg("a1"), bp::arg("a2"), bp::arg("a3") )) )    
-        .def( bp::init< Lattice const & >(( bp::arg("lattice") )) )    
-        .def( 
-            "createTrigonalLattice"
-            , (::Lattice (*)( double,double ))( &::Lattice::createTrigonalLattice )
-            , ( bp::arg("a"), bp::arg("c") )
-            , bp::return_value_policy< bp::return_by_value >() )    
-        .def( 
-            "getBasisVectorA"
-            , (::kvector_t ( ::Lattice::* )(  ) const)( &::Lattice::getBasisVectorA ) )    
-        .def( 
-            "getBasisVectorB"
-            , (::kvector_t ( ::Lattice::* )(  ) const)( &::Lattice::getBasisVectorB ) )    
-        .def( 
-            "getBasisVectorC"
-            , (::kvector_t ( ::Lattice::* )(  ) const)( &::Lattice::getBasisVectorC ) )    
-        .def( 
-            "setSelectionRule"
-            , (void ( ::Lattice::* )( ::ISelectionRule const & ) )( &::Lattice::setSelectionRule )
-            , ( bp::arg("p_selection_rule") ) )    
-        .staticmethod( "createTrigonalLattice" );
+    { //::Lattice
+        typedef bp::class_< Lattice > Lattice_exposer_t;
+        Lattice_exposer_t Lattice_exposer = Lattice_exposer_t( "Lattice", bp::init< >() );
+        bp::scope Lattice_scope( Lattice_exposer );
+        Lattice_exposer.def( bp::init< kvector_t const &, kvector_t const &, kvector_t const & >(( bp::arg("a1"), bp::arg("a2"), bp::arg("a3") )) );
+        Lattice_exposer.def( bp::init< Lattice const & >(( bp::arg("lattice") )) );
+        { //::Lattice::createTrigonalLattice
+        
+            typedef ::Lattice ( *createTrigonalLattice_function_type )( double,double );
+            
+            Lattice_exposer.def( 
+                "createTrigonalLattice"
+                , createTrigonalLattice_function_type( &::Lattice::createTrigonalLattice )
+                , ( bp::arg("a"), bp::arg("c") )
+                , bp::return_value_policy< bp::return_by_value >() );
+        
+        }
+        { //::Lattice::getBasisVectorA
+        
+            typedef ::kvector_t ( ::Lattice::*getBasisVectorA_function_type )(  ) const;
+            
+            Lattice_exposer.def( 
+                "getBasisVectorA"
+                , getBasisVectorA_function_type( &::Lattice::getBasisVectorA ) );
+        
+        }
+        { //::Lattice::getBasisVectorB
+        
+            typedef ::kvector_t ( ::Lattice::*getBasisVectorB_function_type )(  ) const;
+            
+            Lattice_exposer.def( 
+                "getBasisVectorB"
+                , getBasisVectorB_function_type( &::Lattice::getBasisVectorB ) );
+        
+        }
+        { //::Lattice::getBasisVectorC
+        
+            typedef ::kvector_t ( ::Lattice::*getBasisVectorC_function_type )(  ) const;
+            
+            Lattice_exposer.def( 
+                "getBasisVectorC"
+                , getBasisVectorC_function_type( &::Lattice::getBasisVectorC ) );
+        
+        }
+        { //::Lattice::setSelectionRule
+        
+            typedef void ( ::Lattice::*setSelectionRule_function_type )( ::ISelectionRule const & ) ;
+            
+            Lattice_exposer.def( 
+                "setSelectionRule"
+                , setSelectionRule_function_type( &::Lattice::setSelectionRule )
+                , ( bp::arg("p_selection_rule") ) );
+        
+        }
+        Lattice_exposer.staticmethod( "createTrigonalLattice" );
+    }
 
 }
diff --git a/Core/PythonAPI/src/Lattice2DIFParameters.pypp.cpp b/Core/PythonAPI/src/Lattice2DIFParameters.pypp.cpp
index cc9a20f3e8ca51c49db1d5dfd4619788407e15a8..7038740a8fa3379d1de87d4de52a088c71d8c0cc 100644
--- a/Core/PythonAPI/src/Lattice2DIFParameters.pypp.cpp
+++ b/Core/PythonAPI/src/Lattice2DIFParameters.pypp.cpp
@@ -1,96 +1,33 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Lattice2DIFParameters.pypp.h"
 
 namespace bp = boost::python;
 
 void register_Lattice2DIFParameters_class(){
 
-    bp::class_< Lattice2DIFParameters >( "Lattice2DIFParameters", bp::init< >() )    
-        .def_readwrite( "m_angle", &Lattice2DIFParameters::m_angle )    
-        .def_readwrite( "m_corr_length_1", &Lattice2DIFParameters::m_corr_length_1 )    
-        .def_readwrite( "m_corr_length_2", &Lattice2DIFParameters::m_corr_length_2 )    
-        .def_readwrite( "m_domain_size_1", &Lattice2DIFParameters::m_domain_size_1 )    
-        .def_readwrite( "m_domain_size_2", &Lattice2DIFParameters::m_domain_size_2 )    
-        .def_readwrite( "m_length_1", &Lattice2DIFParameters::m_length_1 )    
-        .def_readwrite( "m_length_2", &Lattice2DIFParameters::m_length_2 )    
-        .def_readwrite( "m_xi", &Lattice2DIFParameters::m_xi );
+    { //::Lattice2DIFParameters
+        typedef bp::class_< Lattice2DIFParameters > Lattice2DIFParameters_exposer_t;
+        Lattice2DIFParameters_exposer_t Lattice2DIFParameters_exposer = Lattice2DIFParameters_exposer_t( "Lattice2DIFParameters", bp::init< >() );
+        bp::scope Lattice2DIFParameters_scope( Lattice2DIFParameters_exposer );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_angle", &Lattice2DIFParameters::m_angle );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_corr_length_1", &Lattice2DIFParameters::m_corr_length_1 );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_corr_length_2", &Lattice2DIFParameters::m_corr_length_2 );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_domain_size_1", &Lattice2DIFParameters::m_domain_size_1 );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_domain_size_2", &Lattice2DIFParameters::m_domain_size_2 );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_length_1", &Lattice2DIFParameters::m_length_1 );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_length_2", &Lattice2DIFParameters::m_length_2 );
+        Lattice2DIFParameters_exposer.def_readwrite( "m_xi", &Lattice2DIFParameters::m_xi );
+    }
 
 }
diff --git a/Core/PythonAPI/src/LatticeBasis.pypp.cpp b/Core/PythonAPI/src/LatticeBasis.pypp.cpp
index 9044b53508567044aef06ae72891bc1aa1137494..3f764054a3f3ab7f1ff77ee94b2fa07464646054 100644
--- a/Core/PythonAPI/src/LatticeBasis.pypp.cpp
+++ b/Core/PythonAPI/src/LatticeBasis.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "LatticeBasis.pypp.h"
 
 namespace bp = boost::python;
@@ -200,18 +133,6 @@ struct LatticeBasis_wrapper : LatticeBasis, bp::wrapper< LatticeBasis > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -271,71 +192,167 @@ struct LatticeBasis_wrapper : LatticeBasis, bp::wrapper< LatticeBasis > {
 
 void register_LatticeBasis_class(){
 
-    bp::class_< LatticeBasis_wrapper, bp::bases< Particle >, boost::noncopyable >( "LatticeBasis", bp::init< >() )    
-        .def( 
-            "addParticle"
-            , (void ( ::LatticeBasis::* )( ::Particle const &,::std::vector< Geometry::BasicVector3D<double> > ) )( &::LatticeBasis::addParticle )
-            , ( bp::arg("particle"), bp::arg("positions") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( LatticeBasis_wrapper::* )(  ) )(&LatticeBasis_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( LatticeBasis_wrapper::* )(  ) )(&LatticeBasis_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( LatticeBasis_wrapper::* )(  ) )(&LatticeBasis_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t const ( ::Particle::* )(  ) const)(&::Particle::getRefractiveIndex)
-            , (::complex_t const ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_getRefractiveIndex) )    
-        .def( 
-            "getSimpleFormFactor"
-            , (::IFormFactor const * ( ::Particle::* )(  ) const)(&::Particle::getSimpleFormFactor)
-            , (::IFormFactor const * ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_getSimpleFormFactor)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "hasDistributedFormFactor"
-            , (bool ( ::Particle::* )(  ) const)(&::Particle::hasDistributedFormFactor)
-            , (bool ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_hasDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( LatticeBasis_wrapper::* )(  ) )(&LatticeBasis_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &LatticeBasis_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( LatticeBasis_wrapper::* )( ::std::string const &,double ) )(&LatticeBasis_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( LatticeBasis_wrapper::* )(  ) )(&LatticeBasis_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( LatticeBasis_wrapper::* )(  ) const)(&LatticeBasis_wrapper::default_size) );
+    { //::LatticeBasis
+        typedef bp::class_< LatticeBasis_wrapper, bp::bases< Particle >, boost::noncopyable > LatticeBasis_exposer_t;
+        LatticeBasis_exposer_t LatticeBasis_exposer = LatticeBasis_exposer_t( "LatticeBasis", bp::init< >() );
+        bp::scope LatticeBasis_scope( LatticeBasis_exposer );
+        { //::LatticeBasis::addParticle
+        
+            typedef void ( ::LatticeBasis::*addParticle_function_type )( ::Particle const &,::std::vector< Geometry::BasicVector3D<double> > ) ;
+            
+            LatticeBasis_exposer.def( 
+                "addParticle"
+                , addParticle_function_type( &::LatticeBasis::addParticle )
+                , ( bp::arg("particle"), bp::arg("positions") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( LatticeBasis_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            LatticeBasis_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&LatticeBasis_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( LatticeBasis_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            LatticeBasis_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&LatticeBasis_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( LatticeBasis_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&LatticeBasis_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( LatticeBasis_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            LatticeBasis_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LatticeBasis_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( LatticeBasis_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LatticeBasis_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Particle::getRefractiveIndex
+        
+            typedef ::complex_t const ( ::Particle::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t const ( LatticeBasis_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::Particle::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&LatticeBasis_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::Particle::getSimpleFormFactor
+        
+            typedef ::IFormFactor const * ( ::Particle::*getSimpleFormFactor_function_type )(  ) const;
+            typedef ::IFormFactor const * ( LatticeBasis_wrapper::*default_getSimpleFormFactor_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "getSimpleFormFactor"
+                , getSimpleFormFactor_function_type(&::Particle::getSimpleFormFactor)
+                , default_getSimpleFormFactor_function_type(&LatticeBasis_wrapper::default_getSimpleFormFactor)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Particle::hasDistributedFormFactor
+        
+            typedef bool ( ::Particle::*hasDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( LatticeBasis_wrapper::*default_hasDistributedFormFactor_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "hasDistributedFormFactor"
+                , hasDistributedFormFactor_function_type(&::Particle::hasDistributedFormFactor)
+                , default_hasDistributedFormFactor_function_type(&LatticeBasis_wrapper::default_hasDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( LatticeBasis_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&LatticeBasis_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            LatticeBasis_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &LatticeBasis_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( LatticeBasis_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            LatticeBasis_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&LatticeBasis_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( LatticeBasis_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            LatticeBasis_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&LatticeBasis_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( LatticeBasis_wrapper::*default_size_function_type )(  ) const;
+            
+            LatticeBasis_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&LatticeBasis_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Layer.pypp.cpp b/Core/PythonAPI/src/Layer.pypp.cpp
index d141a2db077890fd01e000600b572d8a513b4a1c..ac27644de2e7a6264a2d2f0e4770f276412e145f 100644
--- a/Core/PythonAPI/src/Layer.pypp.cpp
+++ b/Core/PythonAPI/src/Layer.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Layer.pypp.h"
 
 namespace bp = boost::python;
@@ -92,8 +25,8 @@ struct Layer_wrapper : Layer, bp::wrapper< Layer > {
     
     }
 
-    Layer_wrapper(::IMaterial const * p_material, double thickness=0 )
-    : Layer( boost::python::ptr(p_material), thickness )
+    Layer_wrapper(::IMaterial const * material, double thickness=0 )
+    : Layer( boost::python::ptr(material), thickness )
       , bp::wrapper< Layer >(){
         // constructor
     
@@ -154,40 +87,28 @@ struct Layer_wrapper : Layer, bp::wrapper< Layer > {
         return Layer::getThickness( );
     }
 
-    virtual bool hasDWBASimulation(  ) const  {
-        if( bp::override func_hasDWBASimulation = this->get_override( "hasDWBASimulation" ) )
-            return func_hasDWBASimulation(  );
-        else{
-            return this->Layer::hasDWBASimulation(  );
-        }
-    }
-    
-    bool default_hasDWBASimulation(  ) const  {
-        return Layer::hasDWBASimulation( );
-    }
-
-    virtual void setMaterial( ::IMaterial const * p_material ) {
+    virtual void setMaterial( ::IMaterial const * material ) {
         if( bp::override func_setMaterial = this->get_override( "setMaterial" ) )
-            func_setMaterial( boost::python::ptr(p_material) );
+            func_setMaterial( boost::python::ptr(material) );
         else{
-            this->Layer::setMaterial( boost::python::ptr(p_material) );
+            this->Layer::setMaterial( boost::python::ptr(material) );
         }
     }
     
-    void default_setMaterial( ::IMaterial const * p_material ) {
-        Layer::setMaterial( boost::python::ptr(p_material) );
+    void default_setMaterial( ::IMaterial const * material ) {
+        Layer::setMaterial( boost::python::ptr(material) );
     }
 
-    virtual void setMaterial( ::IMaterial const * p_material, double thickness ) {
+    virtual void setMaterial( ::IMaterial const * material, double thickness ) {
         if( bp::override func_setMaterial = this->get_override( "setMaterial" ) )
-            func_setMaterial( boost::python::ptr(p_material), thickness );
+            func_setMaterial( boost::python::ptr(material), thickness );
         else{
-            this->Layer::setMaterial( boost::python::ptr(p_material), thickness );
+            this->Layer::setMaterial( boost::python::ptr(material), thickness );
         }
     }
     
-    void default_setMaterial( ::IMaterial const * p_material, double thickness ) {
-        Layer::setMaterial( boost::python::ptr(p_material), thickness );
+    void default_setMaterial( ::IMaterial const * material, double thickness ) {
+        Layer::setMaterial( boost::python::ptr(material), thickness );
     }
 
     virtual void setThickness( double thickness ) {
@@ -274,18 +195,6 @@ struct Layer_wrapper : Layer, bp::wrapper< Layer > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -345,93 +254,207 @@ struct Layer_wrapper : Layer, bp::wrapper< Layer > {
 
 void register_Layer_class(){
 
-    bp::class_< Layer_wrapper, bp::bases< ICompositeSample >, boost::noncopyable >( "Layer", bp::init< >() )    
-        .def( bp::init< IMaterial const *, bp::optional< double > >(( bp::arg("p_material"), bp::arg("thickness")=0 )) )    
-        .def( bp::init< Layer const & >(( bp::arg("other") )) )    
-        .def( 
-            "clone"
-            , (::Layer * ( ::Layer::* )(  ) const)(&::Layer::clone)
-            , (::Layer * ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getMaterial"
-            , (::IMaterial const * ( ::Layer::* )(  ) const)(&::Layer::getMaterial)
-            , (::IMaterial const * ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_getMaterial)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t ( ::Layer::* )(  ) const)(&::Layer::getRefractiveIndex)
-            , (::complex_t ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_getRefractiveIndex) )    
-        .def( 
-            "getThickness"
-            , (double ( ::Layer::* )(  ) const)(&::Layer::getThickness)
-            , (double ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_getThickness) )    
-        .def( 
-            "hasDWBASimulation"
-            , (bool ( ::Layer::* )(  ) const)(&::Layer::hasDWBASimulation)
-            , (bool ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_hasDWBASimulation) )    
-        .def( 
-            "setMaterial"
-            , (void ( ::Layer::* )( ::IMaterial const * ) )(&::Layer::setMaterial)
-            , (void ( Layer_wrapper::* )( ::IMaterial const * ) )(&Layer_wrapper::default_setMaterial)
-            , ( bp::arg("p_material") ) )    
-        .def( 
-            "setMaterial"
-            , (void ( ::Layer::* )( ::IMaterial const *,double ) )(&::Layer::setMaterial)
-            , (void ( Layer_wrapper::* )( ::IMaterial const *,double ) )(&Layer_wrapper::default_setMaterial)
-            , ( bp::arg("p_material"), bp::arg("thickness") ) )    
-        .def( 
-            "setThickness"
-            , (void ( ::Layer::* )( double ) )(&::Layer::setThickness)
-            , (void ( Layer_wrapper::* )( double ) )(&Layer_wrapper::default_setThickness)
-            , ( bp::arg("thickness") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( Layer_wrapper::* )(  ) )(&Layer_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( Layer_wrapper::* )(  ) )(&Layer_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( Layer_wrapper::* )(  ) )(&Layer_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( Layer_wrapper::* )(  ) )(&Layer_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &Layer_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( Layer_wrapper::* )( ::std::string const &,double ) )(&Layer_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( Layer_wrapper::* )(  ) )(&Layer_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( Layer_wrapper::* )(  ) const)(&Layer_wrapper::default_size) );
+    { //::Layer
+        typedef bp::class_< Layer_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > Layer_exposer_t;
+        Layer_exposer_t Layer_exposer = Layer_exposer_t( "Layer", bp::init< >() );
+        bp::scope Layer_scope( Layer_exposer );
+        Layer_exposer.def( bp::init< IMaterial const *, bp::optional< double > >(( bp::arg("material"), bp::arg("thickness")=0 )) );
+        Layer_exposer.def( bp::init< Layer const & >(( bp::arg("other") )) );
+        { //::Layer::clone
+        
+            typedef ::Layer * ( ::Layer::*clone_function_type )(  ) const;
+            typedef ::Layer * ( Layer_wrapper::*default_clone_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "clone"
+                , clone_function_type(&::Layer::clone)
+                , default_clone_function_type(&Layer_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Layer::getMaterial
+        
+            typedef ::IMaterial const * ( ::Layer::*getMaterial_function_type )(  ) const;
+            typedef ::IMaterial const * ( Layer_wrapper::*default_getMaterial_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "getMaterial"
+                , getMaterial_function_type(&::Layer::getMaterial)
+                , default_getMaterial_function_type(&Layer_wrapper::default_getMaterial)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Layer::getRefractiveIndex
+        
+            typedef ::complex_t ( ::Layer::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t ( Layer_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::Layer::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&Layer_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::Layer::getThickness
+        
+            typedef double ( ::Layer::*getThickness_function_type )(  ) const;
+            typedef double ( Layer_wrapper::*default_getThickness_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "getThickness"
+                , getThickness_function_type(&::Layer::getThickness)
+                , default_getThickness_function_type(&Layer_wrapper::default_getThickness) );
+        
+        }
+        { //::Layer::setMaterial
+        
+            typedef void ( ::Layer::*setMaterial_function_type )( ::IMaterial const * ) ;
+            typedef void ( Layer_wrapper::*default_setMaterial_function_type )( ::IMaterial const * ) ;
+            
+            Layer_exposer.def( 
+                "setMaterial"
+                , setMaterial_function_type(&::Layer::setMaterial)
+                , default_setMaterial_function_type(&Layer_wrapper::default_setMaterial)
+                , ( bp::arg("material") ) );
+        
+        }
+        { //::Layer::setMaterial
+        
+            typedef void ( ::Layer::*setMaterial_function_type )( ::IMaterial const *,double ) ;
+            typedef void ( Layer_wrapper::*default_setMaterial_function_type )( ::IMaterial const *,double ) ;
+            
+            Layer_exposer.def( 
+                "setMaterial"
+                , setMaterial_function_type(&::Layer::setMaterial)
+                , default_setMaterial_function_type(&Layer_wrapper::default_setMaterial)
+                , ( bp::arg("material"), bp::arg("thickness") ) );
+        
+        }
+        { //::Layer::setThickness
+        
+            typedef void ( ::Layer::*setThickness_function_type )( double ) ;
+            typedef void ( Layer_wrapper::*default_setThickness_function_type )( double ) ;
+            
+            Layer_exposer.def( 
+                "setThickness"
+                , setThickness_function_type(&::Layer::setThickness)
+                , default_setThickness_function_type(&Layer_wrapper::default_setThickness)
+                , ( bp::arg("thickness") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Layer_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Layer_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Layer_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Layer_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Layer_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Layer_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Layer_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Layer_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( Layer_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            Layer_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&Layer_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( Layer_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&Layer_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Layer_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Layer_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Layer_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Layer_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Layer_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Layer_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Layer_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Layer_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Layer_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Layer_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( Layer_wrapper::*default_size_function_type )(  ) const;
+            
+            Layer_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&Layer_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/LayerDWBASimulation.pypp.cpp b/Core/PythonAPI/src/LayerDWBASimulation.pypp.cpp
deleted file mode 100644
index 0cf9a43c1747ef03a95797ffc451531e1ae9bff7..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/LayerDWBASimulation.pypp.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "LayerDWBASimulation.pypp.h"
-
-namespace bp = boost::python;
-
-struct LayerDWBASimulation_wrapper : LayerDWBASimulation, bp::wrapper< LayerDWBASimulation > {
-
-    LayerDWBASimulation_wrapper( )
-    : LayerDWBASimulation( )
-      , bp::wrapper< LayerDWBASimulation >(){
-        // null constructor
-    
-    }
-
-    virtual ::LayerDWBASimulation * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->LayerDWBASimulation::clone(  );
-        }
-    }
-    
-    ::LayerDWBASimulation * default_clone(  ) const  {
-        return LayerDWBASimulation::clone( );
-    }
-
-    virtual void run(  ) {
-        if( bp::override func_run = this->get_override( "run" ) )
-            func_run(  );
-        else{
-            this->ISimulation::run(  );
-        }
-    }
-    
-    void default_run(  ) {
-        ISimulation::run( );
-    }
-
-};
-
-void register_LayerDWBASimulation_class(){
-
-    bp::class_< LayerDWBASimulation_wrapper, boost::noncopyable >( "LayerDWBASimulation", bp::init< >() )    
-        .def( 
-            "clone"
-            , (::LayerDWBASimulation * ( ::LayerDWBASimulation::* )(  ) const)(&::LayerDWBASimulation::clone)
-            , (::LayerDWBASimulation * ( LayerDWBASimulation_wrapper::* )(  ) const)(&LayerDWBASimulation_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "setKzAndRTFunctions"
-            , (void ( ::LayerDWBASimulation::* )( ::IDoubleToComplexMap const &,::IDoubleToPairOfComplexMap const & ) )( &::LayerDWBASimulation::setKzAndRTFunctions )
-            , ( bp::arg("kz_function"), bp::arg("rt_map") ) )    
-        .def( 
-            "setKzFunction"
-            , (void ( ::LayerDWBASimulation::* )( ::IDoubleToComplexMap const & ) )( &::LayerDWBASimulation::setKzFunction )
-            , ( bp::arg("kz_function") ) )    
-        .def( 
-            "setReflectionTransmissionFunction"
-            , (void ( ::LayerDWBASimulation::* )( ::IDoubleToPairOfComplexMap const & ) )( &::LayerDWBASimulation::setReflectionTransmissionFunction )
-            , ( bp::arg("rt_map") ) )    
-        .def( 
-            "run"
-            , (void ( ::ISimulation::* )(  ) )(&::ISimulation::run)
-            , (void ( LayerDWBASimulation_wrapper::* )(  ) )(&LayerDWBASimulation_wrapper::default_run) );
-
-}
diff --git a/Core/PythonAPI/src/LayerDecorator.pypp.cpp b/Core/PythonAPI/src/LayerDecorator.pypp.cpp
index 1521fc77221b1b3255a38992cba932a1b547be7e..bef21ce99444d1d9c8ac699f642b9a2a125ef91e 100644
--- a/Core/PythonAPI/src/LayerDecorator.pypp.cpp
+++ b/Core/PythonAPI/src/LayerDecorator.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "LayerDecorator.pypp.h"
 
 namespace bp = boost::python;
@@ -92,6 +25,90 @@ struct LayerDecorator_wrapper : LayerDecorator, bp::wrapper< LayerDecorator > {
     
     }
 
+    virtual ::LayerDecorator * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->LayerDecorator::clone(  );
+        }
+    }
+    
+    ::LayerDecorator * default_clone(  ) const  {
+        return LayerDecorator::clone( );
+    }
+
+    virtual ::IMaterial const * getMaterial(  ) const  {
+        if( bp::override func_getMaterial = this->get_override( "getMaterial" ) )
+            return func_getMaterial(  );
+        else{
+            return this->LayerDecorator::getMaterial(  );
+        }
+    }
+    
+    ::IMaterial const * default_getMaterial(  ) const  {
+        return LayerDecorator::getMaterial( );
+    }
+
+    virtual ::complex_t getRefractiveIndex(  ) const  {
+        if( bp::override func_getRefractiveIndex = this->get_override( "getRefractiveIndex" ) )
+            return func_getRefractiveIndex(  );
+        else{
+            return this->LayerDecorator::getRefractiveIndex(  );
+        }
+    }
+    
+    ::complex_t default_getRefractiveIndex(  ) const  {
+        return LayerDecorator::getRefractiveIndex( );
+    }
+
+    virtual double getThickness(  ) const  {
+        if( bp::override func_getThickness = this->get_override( "getThickness" ) )
+            return func_getThickness(  );
+        else{
+            return this->LayerDecorator::getThickness(  );
+        }
+    }
+    
+    double default_getThickness(  ) const  {
+        return LayerDecorator::getThickness( );
+    }
+
+    virtual double getTotalParticleSurfaceDensity(  ) const  {
+        if( bp::override func_getTotalParticleSurfaceDensity = this->get_override( "getTotalParticleSurfaceDensity" ) )
+            return func_getTotalParticleSurfaceDensity(  );
+        else{
+            return this->LayerDecorator::getTotalParticleSurfaceDensity(  );
+        }
+    }
+    
+    double default_getTotalParticleSurfaceDensity(  ) const  {
+        return LayerDecorator::getTotalParticleSurfaceDensity( );
+    }
+
+    virtual void init_parameters(  ) {
+        if( bp::override func_init_parameters = this->get_override( "init_parameters" ) )
+            func_init_parameters(  );
+        else{
+            this->LayerDecorator::init_parameters(  );
+        }
+    }
+    
+    void default_init_parameters(  ) {
+        LayerDecorator::init_parameters( );
+    }
+
+    virtual void setThickness( double thickness ) {
+        if( bp::override func_setThickness = this->get_override( "setThickness" ) )
+            func_setThickness( thickness );
+        else{
+            this->LayerDecorator::setThickness( thickness );
+        }
+    }
+    
+    void default_setThickness( double thickness ) {
+        LayerDecorator::setThickness( thickness );
+    }
+
     virtual bool areParametersChanged(  ) {
         if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
             return func_areParametersChanged(  );
@@ -152,18 +169,6 @@ struct LayerDecorator_wrapper : LayerDecorator, bp::wrapper< LayerDecorator > {
         return ICompositeSample::getCompositeSample( );
     }
 
-    virtual ::complex_t getRefractiveIndex(  ) const  {
-        if( bp::override func_getRefractiveIndex = this->get_override( "getRefractiveIndex" ) )
-            return func_getRefractiveIndex(  );
-        else{
-            return this->Layer::getRefractiveIndex(  );
-        }
-    }
-    
-    ::complex_t default_getRefractiveIndex(  ) const  {
-        return Layer::getRefractiveIndex( );
-    }
-
     virtual void printParameters(  ) const  {
         if( bp::override func_printParameters = this->get_override( "printParameters" ) )
             func_printParameters(  );
@@ -176,18 +181,6 @@ struct LayerDecorator_wrapper : LayerDecorator, bp::wrapper< LayerDecorator > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -247,58 +240,223 @@ struct LayerDecorator_wrapper : LayerDecorator, bp::wrapper< LayerDecorator > {
 
 void register_LayerDecorator_class(){
 
-    bp::class_< LayerDecorator_wrapper, bp::bases< Layer >, boost::noncopyable >( "LayerDecorator", bp::init< Layer const &, IDecoration const & >(( bp::arg("layer"), bp::arg("decoration") )) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( LayerDecorator_wrapper::* )(  ) )(&LayerDecorator_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( LayerDecorator_wrapper::* )(  ) )(&LayerDecorator_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( LayerDecorator_wrapper::* )(  ) const)(&LayerDecorator_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( LayerDecorator_wrapper::* )(  ) )(&LayerDecorator_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( LayerDecorator_wrapper::* )(  ) const)(&LayerDecorator_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t ( ::Layer::* )(  ) const)(&::Layer::getRefractiveIndex)
-            , (::complex_t ( LayerDecorator_wrapper::* )(  ) const)(&LayerDecorator_wrapper::default_getRefractiveIndex) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( LayerDecorator_wrapper::* )(  ) const)(&LayerDecorator_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( LayerDecorator_wrapper::* )(  ) )(&LayerDecorator_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &LayerDecorator_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( LayerDecorator_wrapper::* )( ::std::string const &,double ) )(&LayerDecorator_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( LayerDecorator_wrapper::* )(  ) )(&LayerDecorator_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( LayerDecorator_wrapper::* )(  ) const)(&LayerDecorator_wrapper::default_size) );
+    { //::LayerDecorator
+        typedef bp::class_< LayerDecorator_wrapper, bp::bases< Layer >, boost::noncopyable > LayerDecorator_exposer_t;
+        LayerDecorator_exposer_t LayerDecorator_exposer = LayerDecorator_exposer_t( "LayerDecorator", bp::init< Layer const &, IDecoration const & >(( bp::arg("layer"), bp::arg("decoration") )) );
+        bp::scope LayerDecorator_scope( LayerDecorator_exposer );
+        { //::LayerDecorator::clone
+        
+            typedef ::LayerDecorator * ( ::LayerDecorator::*clone_function_type )(  ) const;
+            typedef ::LayerDecorator * ( LayerDecorator_wrapper::*default_clone_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "clone"
+                , clone_function_type(&::LayerDecorator::clone)
+                , default_clone_function_type(&LayerDecorator_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::LayerDecorator::getDecoratedLayer
+        
+            typedef ::Layer const * ( ::LayerDecorator::*getDecoratedLayer_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getDecoratedLayer"
+                , getDecoratedLayer_function_type( &::LayerDecorator::getDecoratedLayer )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::LayerDecorator::getDecoration
+        
+            typedef ::IDecoration const * ( ::LayerDecorator::*getDecoration_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getDecoration"
+                , getDecoration_function_type( &::LayerDecorator::getDecoration )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::LayerDecorator::getMaterial
+        
+            typedef ::IMaterial const * ( ::LayerDecorator::*getMaterial_function_type )(  ) const;
+            typedef ::IMaterial const * ( LayerDecorator_wrapper::*default_getMaterial_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getMaterial"
+                , getMaterial_function_type(&::LayerDecorator::getMaterial)
+                , default_getMaterial_function_type(&LayerDecorator_wrapper::default_getMaterial)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::LayerDecorator::getRefractiveIndex
+        
+            typedef ::complex_t ( ::LayerDecorator::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t ( LayerDecorator_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::LayerDecorator::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&LayerDecorator_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::LayerDecorator::getThickness
+        
+            typedef double ( ::LayerDecorator::*getThickness_function_type )(  ) const;
+            typedef double ( LayerDecorator_wrapper::*default_getThickness_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getThickness"
+                , getThickness_function_type(&::LayerDecorator::getThickness)
+                , default_getThickness_function_type(&LayerDecorator_wrapper::default_getThickness) );
+        
+        }
+        { //::LayerDecorator::getTotalParticleSurfaceDensity
+        
+            typedef double ( ::LayerDecorator::*getTotalParticleSurfaceDensity_function_type )(  ) const;
+            typedef double ( LayerDecorator_wrapper::*default_getTotalParticleSurfaceDensity_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getTotalParticleSurfaceDensity"
+                , getTotalParticleSurfaceDensity_function_type(&::LayerDecorator::getTotalParticleSurfaceDensity)
+                , default_getTotalParticleSurfaceDensity_function_type(&LayerDecorator_wrapper::default_getTotalParticleSurfaceDensity) );
+        
+        }
+        { //::LayerDecorator::init_parameters
+        
+            typedef void ( ::LayerDecorator::*init_parameters_function_type )(  ) ;
+            typedef void ( LayerDecorator_wrapper::*default_init_parameters_function_type )(  ) ;
+            
+            LayerDecorator_exposer.def( 
+                "init_parameters"
+                , init_parameters_function_type(&::LayerDecorator::init_parameters)
+                , default_init_parameters_function_type(&LayerDecorator_wrapper::default_init_parameters) );
+        
+        }
+        { //::LayerDecorator::setThickness
+        
+            typedef void ( ::LayerDecorator::*setThickness_function_type )( double ) ;
+            typedef void ( LayerDecorator_wrapper::*default_setThickness_function_type )( double ) ;
+            
+            LayerDecorator_exposer.def( 
+                "setThickness"
+                , setThickness_function_type(&::LayerDecorator::setThickness)
+                , default_setThickness_function_type(&LayerDecorator_wrapper::default_setThickness)
+                , ( bp::arg("thickness") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( LayerDecorator_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            LayerDecorator_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&LayerDecorator_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( LayerDecorator_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            LayerDecorator_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&LayerDecorator_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( LayerDecorator_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&LayerDecorator_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( LayerDecorator_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            LayerDecorator_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LayerDecorator_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( LayerDecorator_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LayerDecorator_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( LayerDecorator_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&LayerDecorator_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            LayerDecorator_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &LayerDecorator_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( LayerDecorator_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            LayerDecorator_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&LayerDecorator_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( LayerDecorator_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            LayerDecorator_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&LayerDecorator_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( LayerDecorator_wrapper::*default_size_function_type )(  ) const;
+            
+            LayerDecorator_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&LayerDecorator_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/LayerDecoratorDWBASimulation.pypp.cpp b/Core/PythonAPI/src/LayerDecoratorDWBASimulation.pypp.cpp
deleted file mode 100644
index cda3ef8133eeee2ea2ae9ef6fe2e0ce6bc62cdd5..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/LayerDecoratorDWBASimulation.pypp.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "LayerDecoratorDWBASimulation.pypp.h"
-
-namespace bp = boost::python;
-
-struct LayerDecoratorDWBASimulation_wrapper : LayerDecoratorDWBASimulation, bp::wrapper< LayerDecoratorDWBASimulation > {
-
-    virtual ::LayerDecoratorDWBASimulation * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->LayerDecoratorDWBASimulation::clone(  );
-        }
-    }
-    
-    ::LayerDecoratorDWBASimulation * default_clone(  ) const  {
-        return LayerDecoratorDWBASimulation::clone( );
-    }
-
-    virtual void init( ::Simulation const & simulation ) {
-        if( bp::override func_init = this->get_override( "init" ) )
-            func_init( boost::ref(simulation) );
-        else{
-            this->LayerDecoratorDWBASimulation::init( boost::ref(simulation) );
-        }
-    }
-    
-    void default_init( ::Simulation const & simulation ) {
-        LayerDecoratorDWBASimulation::init( boost::ref(simulation) );
-    }
-
-    virtual void run(  ) {
-        if( bp::override func_run = this->get_override( "run" ) )
-            func_run(  );
-        else{
-            this->LayerDecoratorDWBASimulation::run(  );
-        }
-    }
-    
-    void default_run(  ) {
-        LayerDecoratorDWBASimulation::run( );
-    }
-
-};
-
-void register_LayerDecoratorDWBASimulation_class(){
-
-    bp::class_< LayerDecoratorDWBASimulation_wrapper, bp::bases< LayerDWBASimulation >, boost::noncopyable >( "LayerDecoratorDWBASimulation", bp::no_init )    
-        .def( 
-            "clone"
-            , (::LayerDecoratorDWBASimulation * ( ::LayerDecoratorDWBASimulation::* )(  ) const)(&::LayerDecoratorDWBASimulation::clone)
-            , (::LayerDecoratorDWBASimulation * ( LayerDecoratorDWBASimulation_wrapper::* )(  ) const)(&LayerDecoratorDWBASimulation_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "init"
-            , (void ( ::LayerDecoratorDWBASimulation::* )( ::Simulation const & ) )(&::LayerDecoratorDWBASimulation::init)
-            , (void ( LayerDecoratorDWBASimulation_wrapper::* )( ::Simulation const & ) )(&LayerDecoratorDWBASimulation_wrapper::default_init)
-            , ( bp::arg("simulation") ) )    
-        .def( 
-            "run"
-            , (void ( ::LayerDecoratorDWBASimulation::* )(  ) )(&::LayerDecoratorDWBASimulation::run)
-            , (void ( LayerDecoratorDWBASimulation_wrapper::* )(  ) )(&LayerDecoratorDWBASimulation_wrapper::default_run) );
-
-}
diff --git a/Core/PythonAPI/src/LayerInterface.pypp.cpp b/Core/PythonAPI/src/LayerInterface.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..267c7c1a6568fa243eaf04dbab058216cb7edc45
--- /dev/null
+++ b/Core/PythonAPI/src/LayerInterface.pypp.cpp
@@ -0,0 +1,335 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "__call_policies.pypp.hpp"
+#include "__convenience.pypp.hpp"
+#include "PythonCoreList.h"
+#include "LayerInterface.pypp.h"
+
+namespace bp = boost::python;
+
+struct LayerInterface_wrapper : LayerInterface, bp::wrapper< LayerInterface > {
+
+    virtual bool areParametersChanged(  ) {
+        if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
+            return func_areParametersChanged(  );
+        else{
+            return this->IParameterized::areParametersChanged(  );
+        }
+    }
+    
+    bool default_areParametersChanged(  ) {
+        return IParameterized::areParametersChanged( );
+    }
+
+    virtual void clearParameterPool(  ) {
+        if( bp::override func_clearParameterPool = this->get_override( "clearParameterPool" ) )
+            func_clearParameterPool(  );
+        else{
+            this->IParameterized::clearParameterPool(  );
+        }
+    }
+    
+    void default_clearParameterPool(  ) {
+        IParameterized::clearParameterPool( );
+    }
+
+    virtual ::ICompositeSample * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->ICompositeSample::clone(  );
+        }
+    }
+    
+    ::ICompositeSample * default_clone(  ) const  {
+        return ICompositeSample::clone( );
+    }
+
+    virtual ::ParameterPool * createParameterTree(  ) const  {
+        if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
+            return func_createParameterTree(  );
+        else{
+            return this->IParameterized::createParameterTree(  );
+        }
+    }
+    
+    ::ParameterPool * default_createParameterTree(  ) const  {
+        return IParameterized::createParameterTree( );
+    }
+
+    virtual ::ICompositeSample * getCompositeSample(  ) {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ICompositeSample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample * default_getCompositeSample(  ) {
+        return ICompositeSample::getCompositeSample( );
+    }
+
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
+        else{
+            return this->ICompositeSample::getCompositeSample(  );
+        }
+    }
+    
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ICompositeSample::getCompositeSample( );
+    }
+
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
+        else{
+            this->IParameterized::printParameters(  );
+        }
+    }
+    
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
+    }
+
+    virtual void registerParameter( ::std::string const & name, double * parpointer ) {
+        namespace bpl = boost::python;
+        if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
+            bpl::object py_result = bpl::call<bpl::object>( func_registerParameter.ptr(), name, parpointer );
+        }
+        else{
+            IParameterized::registerParameter( name, parpointer );
+        }
+    }
+    
+    static void default_registerParameter( ::IParameterized & inst, ::std::string const & name, long unsigned int parpointer ){
+        if( dynamic_cast< LayerInterface_wrapper * >( boost::addressof( inst ) ) ){
+            inst.::IParameterized::registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+        else{
+            inst.registerParameter(name, reinterpret_cast< double * >( parpointer ));
+        }
+    }
+
+    virtual bool setParameterValue( ::std::string const & name, double value ) {
+        if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
+            return func_setParameterValue( name, value );
+        else{
+            return this->IParameterized::setParameterValue( name, value );
+        }
+    }
+    
+    bool default_setParameterValue( ::std::string const & name, double value ) {
+        return IParameterized::setParameterValue( name, value );
+    }
+
+    virtual void setParametersAreChanged(  ) {
+        if( bp::override func_setParametersAreChanged = this->get_override( "setParametersAreChanged" ) )
+            func_setParametersAreChanged(  );
+        else{
+            this->IParameterized::setParametersAreChanged(  );
+        }
+    }
+    
+    void default_setParametersAreChanged(  ) {
+        IParameterized::setParametersAreChanged( );
+    }
+
+    virtual ::size_t size(  ) const  {
+        if( bp::override func_size = this->get_override( "size" ) )
+            return func_size(  );
+        else{
+            return this->ICompositeSample::size(  );
+        }
+    }
+    
+    ::size_t default_size(  ) const  {
+        return ICompositeSample::size( );
+    }
+
+};
+
+void register_LayerInterface_class(){
+
+    { //::LayerInterface
+        typedef bp::class_< LayerInterface_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > LayerInterface_exposer_t;
+        LayerInterface_exposer_t LayerInterface_exposer = LayerInterface_exposer_t( "LayerInterface", bp::no_init );
+        bp::scope LayerInterface_scope( LayerInterface_exposer );
+        { //::LayerInterface::getLayerBottom
+        
+            typedef ::Layer const * ( ::LayerInterface::*getLayerBottom_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "getLayerBottom"
+                , getLayerBottom_function_type( &::LayerInterface::getLayerBottom )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::LayerInterface::getLayerTop
+        
+            typedef ::Layer const * ( ::LayerInterface::*getLayerTop_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "getLayerTop"
+                , getLayerTop_function_type( &::LayerInterface::getLayerTop )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::LayerInterface::getRoughness
+        
+            typedef ::LayerRoughness const * ( ::LayerInterface::*getRoughness_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "getRoughness"
+                , getRoughness_function_type( &::LayerInterface::getRoughness )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::LayerInterface::setRoughness
+        
+            typedef void ( ::LayerInterface::*setRoughness_function_type )( ::LayerRoughness const & ) ;
+            
+            LayerInterface_exposer.def( 
+                "setRoughness"
+                , setRoughness_function_type( &::LayerInterface::setRoughness )
+                , ( bp::arg("roughness") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( LayerInterface_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            LayerInterface_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&LayerInterface_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( LayerInterface_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            LayerInterface_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&LayerInterface_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::ICompositeSample::clone
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*clone_function_type )(  ) const;
+            typedef ::ICompositeSample * ( LayerInterface_wrapper::*default_clone_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "clone"
+                , clone_function_type(&::ICompositeSample::clone)
+                , default_clone_function_type(&LayerInterface_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( LayerInterface_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&LayerInterface_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( LayerInterface_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            LayerInterface_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LayerInterface_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( LayerInterface_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LayerInterface_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( LayerInterface_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&LayerInterface_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            LayerInterface_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &LayerInterface_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( LayerInterface_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            LayerInterface_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&LayerInterface_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( LayerInterface_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            LayerInterface_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&LayerInterface_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( LayerInterface_wrapper::*default_size_function_type )(  ) const;
+            
+            LayerInterface_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&LayerInterface_wrapper::default_size) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/LayerRoughness.pypp.cpp b/Core/PythonAPI/src/LayerRoughness.pypp.cpp
index b80e3f0be2f2beba6acdd5f5235d80fa8a65a402..af4d30e3f8c51ea065f070dca389ea63ef09c9d3 100644
--- a/Core/PythonAPI/src/LayerRoughness.pypp.cpp
+++ b/Core/PythonAPI/src/LayerRoughness.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "LayerRoughness.pypp.h"
 
 namespace bp = boost::python;
@@ -147,28 +80,28 @@ struct LayerRoughness_wrapper : LayerRoughness, bp::wrapper< LayerRoughness > {
         return IParameterized::createParameterTree( );
     }
 
-    virtual void printParameters(  ) const  {
-        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
-            func_printParameters(  );
+    virtual ::ICompositeSample const * getCompositeSample(  ) const  {
+        if( bp::override func_getCompositeSample = this->get_override( "getCompositeSample" ) )
+            return func_getCompositeSample(  );
         else{
-            this->IParameterized::printParameters(  );
+            return this->ISample::getCompositeSample(  );
         }
     }
     
-    void default_printParameters(  ) const  {
-        IParameterized::printParameters( );
+    ::ICompositeSample const * default_getCompositeSample(  ) const  {
+        return ISample::getCompositeSample( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
+    virtual void printParameters(  ) const  {
+        if( bp::override func_printParameters = this->get_override( "printParameters" ) )
+            func_printParameters(  );
         else{
-            this->ISample::print_structure(  );
+            this->IParameterized::printParameters(  );
         }
     }
     
-    void default_print_structure(  ) {
-        ISample::print_structure( );
+    void default_printParameters(  ) const  {
+        IParameterized::printParameters( );
     }
 
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
@@ -218,68 +151,190 @@ struct LayerRoughness_wrapper : LayerRoughness, bp::wrapper< LayerRoughness > {
 
 void register_LayerRoughness_class(){
 
-    bp::class_< LayerRoughness_wrapper, boost::noncopyable >( "LayerRoughness", bp::init< >() )    
-        .def( bp::init< double, double, double >(( bp::arg("sigma"), bp::arg("hurstParameter"), bp::arg("latteralCorrLength") )) )    
-        .def( 
-            "clone"
-            , (::LayerRoughness * ( ::LayerRoughness::* )(  ) const)(&::LayerRoughness::clone)
-            , (::LayerRoughness * ( LayerRoughness_wrapper::* )(  ) const)(&LayerRoughness_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getHurstParameter"
-            , (double ( ::LayerRoughness::* )(  ) const)( &::LayerRoughness::getHurstParameter ) )    
-        .def( 
-            "getLatteralCorrLength"
-            , (double ( ::LayerRoughness::* )(  ) const)( &::LayerRoughness::getLatteralCorrLength ) )    
-        .def( 
-            "getSigma"
-            , (double ( ::LayerRoughness::* )(  ) const)( &::LayerRoughness::getSigma ) )    
-        .def( 
-            "setHurstParameter"
-            , (void ( ::LayerRoughness::* )( double ) )( &::LayerRoughness::setHurstParameter )
-            , ( bp::arg("hurstParameter") ) )    
-        .def( 
-            "setLatteralCorrLength"
-            , (void ( ::LayerRoughness::* )( double ) )( &::LayerRoughness::setLatteralCorrLength )
-            , ( bp::arg("latteralCorrLength") ) )    
-        .def( 
-            "setSigma"
-            , (void ( ::LayerRoughness::* )( double ) )( &::LayerRoughness::setSigma )
-            , ( bp::arg("sigma") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( LayerRoughness_wrapper::* )(  ) )(&LayerRoughness_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( LayerRoughness_wrapper::* )(  ) )(&LayerRoughness_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( LayerRoughness_wrapper::* )(  ) const)(&LayerRoughness_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( LayerRoughness_wrapper::* )(  ) const)(&LayerRoughness_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( LayerRoughness_wrapper::* )(  ) )(&LayerRoughness_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &LayerRoughness_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( LayerRoughness_wrapper::* )( ::std::string const &,double ) )(&LayerRoughness_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( LayerRoughness_wrapper::* )(  ) )(&LayerRoughness_wrapper::default_setParametersAreChanged) )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::LayerRoughness
+        typedef bp::class_< LayerRoughness_wrapper, boost::noncopyable > LayerRoughness_exposer_t;
+        LayerRoughness_exposer_t LayerRoughness_exposer = LayerRoughness_exposer_t( "LayerRoughness", bp::init< >() );
+        bp::scope LayerRoughness_scope( LayerRoughness_exposer );
+        LayerRoughness_exposer.def( bp::init< double, double, double >(( bp::arg("sigma"), bp::arg("hurstParameter"), bp::arg("latteralCorrLength") )) );
+        { //::LayerRoughness::clone
+        
+            typedef ::LayerRoughness * ( ::LayerRoughness::*clone_function_type )(  ) const;
+            typedef ::LayerRoughness * ( LayerRoughness_wrapper::*default_clone_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "clone"
+                , clone_function_type(&::LayerRoughness::clone)
+                , default_clone_function_type(&LayerRoughness_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::LayerRoughness::getCorrFun
+        
+            typedef double ( ::LayerRoughness::*getCorrFun_function_type )( ::kvector_t const & ) const;
+            
+            LayerRoughness_exposer.def( 
+                "getCorrFun"
+                , getCorrFun_function_type( &::LayerRoughness::getCorrFun )
+                , ( bp::arg("k") ) );
+        
+        }
+        { //::LayerRoughness::getHurstParameter
+        
+            typedef double ( ::LayerRoughness::*getHurstParameter_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "getHurstParameter"
+                , getHurstParameter_function_type( &::LayerRoughness::getHurstParameter ) );
+        
+        }
+        { //::LayerRoughness::getLatteralCorrLength
+        
+            typedef double ( ::LayerRoughness::*getLatteralCorrLength_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "getLatteralCorrLength"
+                , getLatteralCorrLength_function_type( &::LayerRoughness::getLatteralCorrLength ) );
+        
+        }
+        { //::LayerRoughness::getSigma
+        
+            typedef double ( ::LayerRoughness::*getSigma_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "getSigma"
+                , getSigma_function_type( &::LayerRoughness::getSigma ) );
+        
+        }
+        { //::LayerRoughness::getSpectralFun
+        
+            typedef double ( ::LayerRoughness::*getSpectralFun_function_type )( ::kvector_t const & ) const;
+            
+            LayerRoughness_exposer.def( 
+                "getSpectralFun"
+                , getSpectralFun_function_type( &::LayerRoughness::getSpectralFun )
+                , ( bp::arg("kvec") ) );
+        
+        }
+        { //::LayerRoughness::setHurstParameter
+        
+            typedef void ( ::LayerRoughness::*setHurstParameter_function_type )( double ) ;
+            
+            LayerRoughness_exposer.def( 
+                "setHurstParameter"
+                , setHurstParameter_function_type( &::LayerRoughness::setHurstParameter )
+                , ( bp::arg("hurstParameter") ) );
+        
+        }
+        { //::LayerRoughness::setLatteralCorrLength
+        
+            typedef void ( ::LayerRoughness::*setLatteralCorrLength_function_type )( double ) ;
+            
+            LayerRoughness_exposer.def( 
+                "setLatteralCorrLength"
+                , setLatteralCorrLength_function_type( &::LayerRoughness::setLatteralCorrLength )
+                , ( bp::arg("latteralCorrLength") ) );
+        
+        }
+        { //::LayerRoughness::setSigma
+        
+            typedef void ( ::LayerRoughness::*setSigma_function_type )( double ) ;
+            
+            LayerRoughness_exposer.def( 
+                "setSigma"
+                , setSigma_function_type( &::LayerRoughness::setSigma )
+                , ( bp::arg("sigma") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( LayerRoughness_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            LayerRoughness_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&LayerRoughness_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( LayerRoughness_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            LayerRoughness_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&LayerRoughness_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( LayerRoughness_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&LayerRoughness_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ISample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( LayerRoughness_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ISample::getCompositeSample)
+                , default_getCompositeSample_function_type(&LayerRoughness_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( LayerRoughness_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            LayerRoughness_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&LayerRoughness_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            LayerRoughness_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &LayerRoughness_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( LayerRoughness_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            LayerRoughness_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&LayerRoughness_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( LayerRoughness_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            LayerRoughness_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&LayerRoughness_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/MaterialManager.pypp.cpp b/Core/PythonAPI/src/MaterialManager.pypp.cpp
index 342ba53eba095e2522be9d788e7d58237949c0b3..7afeded7e785645d419ccd1c17c151e39602deaf 100644
--- a/Core/PythonAPI/src/MaterialManager.pypp.cpp
+++ b/Core/PythonAPI/src/MaterialManager.pypp.cpp
@@ -1,106 +1,60 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "MaterialManager.pypp.h"
 
 namespace bp = boost::python;
 
 void register_MaterialManager_class(){
 
-    bp::class_< MaterialManager, bp::bases< ISingleton< MaterialManager > >, boost::noncopyable >( "MaterialManager", bp::no_init )    
-        .def( 
-            "getHomogeneousMaterial"
-            , (::IMaterial const * (*)( ::std::string const &,::complex_t const & ))( &::MaterialManager::getHomogeneousMaterial )
-            , ( bp::arg("name"), bp::arg("refractive_index") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getHomogeneousMaterial"
-            , (::IMaterial const * (*)( ::std::string const &,double,double ))( &::MaterialManager::getHomogeneousMaterial )
-            , ( bp::arg("name"), bp::arg("refractive_index_real"), bp::arg("refractive_index_imag") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getMaterial"
-            , (::IMaterial const * (*)( ::std::string const & ))( &::MaterialManager::getMaterial )
-            , ( bp::arg("name") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .staticmethod( "getHomogeneousMaterial" )    
-        .staticmethod( "getMaterial" )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::MaterialManager
+        typedef bp::class_< MaterialManager, boost::noncopyable > MaterialManager_exposer_t;
+        MaterialManager_exposer_t MaterialManager_exposer = MaterialManager_exposer_t( "MaterialManager", bp::no_init );
+        bp::scope MaterialManager_scope( MaterialManager_exposer );
+        { //::MaterialManager::getHomogeneousMaterial
+        
+            typedef ::IMaterial const * ( *getHomogeneousMaterial_function_type )( ::std::string const &,::complex_t const & );
+            
+            MaterialManager_exposer.def( 
+                "getHomogeneousMaterial"
+                , getHomogeneousMaterial_function_type( &::MaterialManager::getHomogeneousMaterial )
+                , ( bp::arg("name"), bp::arg("refractive_index") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MaterialManager::getHomogeneousMaterial
+        
+            typedef ::IMaterial const * ( *getHomogeneousMaterial_function_type )( ::std::string const &,double,double );
+            
+            MaterialManager_exposer.def( 
+                "getHomogeneousMaterial"
+                , getHomogeneousMaterial_function_type( &::MaterialManager::getHomogeneousMaterial )
+                , ( bp::arg("name"), bp::arg("refractive_index_real"), bp::arg("refractive_index_imag") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MaterialManager::getMaterial
+        
+            typedef ::IMaterial const * ( *getMaterial_function_type )( ::std::string const & );
+            
+            MaterialManager_exposer.def( 
+                "getMaterial"
+                , getMaterial_function_type( &::MaterialManager::getMaterial )
+                , ( bp::arg("name") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        MaterialManager_exposer.staticmethod( "getHomogeneousMaterial" );
+        MaterialManager_exposer.staticmethod( "getMaterial" );
+    }
 
 }
diff --git a/Core/PythonAPI/src/MaterialManagerSingleton_t.pypp.cpp b/Core/PythonAPI/src/MaterialManagerSingleton_t.pypp.cpp
deleted file mode 100644
index e9912017dd283e26d4742948dd77bdcff57f10ff..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/MaterialManagerSingleton_t.pypp.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "MaterialManagerSingleton_t.pypp.h"
-
-namespace bp = boost::python;
-
-void register_MaterialManagerSingleton_t_class(){
-
-    bp::class_< ISingleton< MaterialManager >, boost::noncopyable >( "MaterialManagerSingleton_t", bp::no_init )    
-        .def( 
-            "instance"
-            , (::MaterialManager & (*)(  ))( &::ISingleton< MaterialManager >::instance )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .staticmethod( "instance" );
-
-}
diff --git a/Core/PythonAPI/src/MesoCrystal.pypp.cpp b/Core/PythonAPI/src/MesoCrystal.pypp.cpp
index 865e3a3080d45787e2b9e751d031d7d39e254baf..cfb60d884f80a12e17d86b5c9262254b68f3ae0d 100644
--- a/Core/PythonAPI/src/MesoCrystal.pypp.cpp
+++ b/Core/PythonAPI/src/MesoCrystal.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "MesoCrystal.pypp.h"
 
 namespace bp = boost::python;
@@ -116,18 +49,6 @@ struct MesoCrystal_wrapper : MesoCrystal, bp::wrapper< MesoCrystal > {
         IParameterized::clearParameterPool( );
     }
 
-    virtual ::IFormFactor * createFormFactor(  ) const  {
-        if( bp::override func_createFormFactor = this->get_override( "createFormFactor" ) )
-            return func_createFormFactor(  );
-        else{
-            return this->Particle::createFormFactor(  );
-        }
-    }
-    
-    ::IFormFactor * default_createFormFactor(  ) const  {
-        return Particle::createFormFactor( );
-    }
-
     virtual ::ParameterPool * createParameterTree(  ) const  {
         if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
             return func_createParameterTree(  );
@@ -200,18 +121,6 @@ struct MesoCrystal_wrapper : MesoCrystal, bp::wrapper< MesoCrystal > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -231,18 +140,6 @@ struct MesoCrystal_wrapper : MesoCrystal, bp::wrapper< MesoCrystal > {
         }
     }
 
-    virtual void setAmbientRefractiveIndex( ::complex_t refractive_index ) {
-        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
-            func_setAmbientRefractiveIndex( refractive_index );
-        else{
-            this->Particle::setAmbientRefractiveIndex( refractive_index );
-        }
-    }
-    
-    void default_setAmbientRefractiveIndex( ::complex_t refractive_index ) {
-        Particle::setAmbientRefractiveIndex( refractive_index );
-    }
-
     virtual bool setParameterValue( ::std::string const & name, double value ) {
         if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
             return func_setParameterValue( name, value );
@@ -283,72 +180,145 @@ struct MesoCrystal_wrapper : MesoCrystal, bp::wrapper< MesoCrystal > {
 
 void register_MesoCrystal_class(){
 
-    bp::class_< MesoCrystal_wrapper, bp::bases< Particle >, boost::noncopyable >( "MesoCrystal", bp::init< IClusteredParticles const &, IFormFactor & >(( bp::arg("particle_structure"), bp::arg("form_factor") )) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( MesoCrystal_wrapper::* )(  ) )(&MesoCrystal_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( MesoCrystal_wrapper::* )(  ) )(&MesoCrystal_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createFormFactor"
-            , (::IFormFactor * ( ::Particle::* )(  ) const)(&::Particle::createFormFactor)
-            , (::IFormFactor * ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_createFormFactor)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( MesoCrystal_wrapper::* )(  ) )(&MesoCrystal_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t const ( ::Particle::* )(  ) const)(&::Particle::getRefractiveIndex)
-            , (::complex_t const ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_getRefractiveIndex) )    
-        .def( 
-            "hasDistributedFormFactor"
-            , (bool ( ::Particle::* )(  ) const)(&::Particle::hasDistributedFormFactor)
-            , (bool ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_hasDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( MesoCrystal_wrapper::* )(  ) )(&MesoCrystal_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &MesoCrystal_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::Particle::* )( ::complex_t ) )(&::Particle::setAmbientRefractiveIndex)
-            , (void ( MesoCrystal_wrapper::* )( ::complex_t ) )(&MesoCrystal_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( MesoCrystal_wrapper::* )( ::std::string const &,double ) )(&MesoCrystal_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( MesoCrystal_wrapper::* )(  ) )(&MesoCrystal_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( MesoCrystal_wrapper::* )(  ) const)(&MesoCrystal_wrapper::default_size) );
+    { //::MesoCrystal
+        typedef bp::class_< MesoCrystal_wrapper, bp::bases< Particle >, boost::noncopyable > MesoCrystal_exposer_t;
+        MesoCrystal_exposer_t MesoCrystal_exposer = MesoCrystal_exposer_t( "MesoCrystal", bp::init< IClusteredParticles const &, IFormFactor & >(( bp::arg("particle_structure"), bp::arg("form_factor") )) );
+        bp::scope MesoCrystal_scope( MesoCrystal_exposer );
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( MesoCrystal_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&MesoCrystal_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( MesoCrystal_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&MesoCrystal_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( MesoCrystal_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&MesoCrystal_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( MesoCrystal_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&MesoCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( MesoCrystal_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&MesoCrystal_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Particle::getRefractiveIndex
+        
+            typedef ::complex_t const ( ::Particle::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t const ( MesoCrystal_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::Particle::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&MesoCrystal_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::Particle::hasDistributedFormFactor
+        
+            typedef bool ( ::Particle::*hasDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( MesoCrystal_wrapper::*default_hasDistributedFormFactor_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "hasDistributedFormFactor"
+                , hasDistributedFormFactor_function_type(&::Particle::hasDistributedFormFactor)
+                , default_hasDistributedFormFactor_function_type(&MesoCrystal_wrapper::default_hasDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( MesoCrystal_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&MesoCrystal_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            MesoCrystal_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &MesoCrystal_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( MesoCrystal_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            MesoCrystal_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&MesoCrystal_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( MesoCrystal_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            MesoCrystal_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&MesoCrystal_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( MesoCrystal_wrapper::*default_size_function_type )(  ) const;
+            
+            MesoCrystal_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&MesoCrystal_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/MultiLayer.pypp.cpp b/Core/PythonAPI/src/MultiLayer.pypp.cpp
index 774ee8c349bfca4070bcaaf88baca28df0072841..0e4ca455a6b52b60d3d2e868fe8549a82a2eacef 100644
--- a/Core/PythonAPI/src/MultiLayer.pypp.cpp
+++ b/Core/PythonAPI/src/MultiLayer.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "MultiLayer.pypp.h"
 
 namespace bp = boost::python;
@@ -92,6 +25,18 @@ struct MultiLayer_wrapper : MultiLayer, bp::wrapper< MultiLayer > {
     
     }
 
+    virtual ::MultiLayer * clone(  ) const  {
+        if( bp::override func_clone = this->get_override( "clone" ) )
+            return func_clone(  );
+        else{
+            return this->MultiLayer::clone(  );
+        }
+    }
+    
+    ::MultiLayer * default_clone(  ) const  {
+        return MultiLayer::clone( );
+    }
+
     virtual bool areParametersChanged(  ) {
         if( bp::override func_areParametersChanged = this->get_override( "areParametersChanged" ) )
             return func_areParametersChanged(  );
@@ -164,18 +109,6 @@ struct MultiLayer_wrapper : MultiLayer, bp::wrapper< MultiLayer > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -235,63 +168,285 @@ struct MultiLayer_wrapper : MultiLayer, bp::wrapper< MultiLayer > {
 
 void register_MultiLayer_class(){
 
-    bp::class_< MultiLayer_wrapper, bp::bases< ICompositeSample >, boost::noncopyable >( "MultiLayer", bp::init< >() )    
-        .def( 
-            "addLayer"
-            , (void ( ::MultiLayer::* )( ::Layer const & ) )( &::MultiLayer::addLayer )
-            , ( bp::arg("p_child") ) )    
-        .def( 
-            "addLayerWithTopRoughness"
-            , (void ( ::MultiLayer::* )( ::Layer const &,::LayerRoughness const & ) )( &::MultiLayer::addLayerWithTopRoughness )
-            , ( bp::arg("layer"), bp::arg("roughness") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( MultiLayer_wrapper::* )(  ) )(&MultiLayer_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( MultiLayer_wrapper::* )(  ) )(&MultiLayer_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( MultiLayer_wrapper::* )(  ) const)(&MultiLayer_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( MultiLayer_wrapper::* )(  ) )(&MultiLayer_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( MultiLayer_wrapper::* )(  ) const)(&MultiLayer_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( MultiLayer_wrapper::* )(  ) const)(&MultiLayer_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( MultiLayer_wrapper::* )(  ) )(&MultiLayer_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &MultiLayer_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( MultiLayer_wrapper::* )( ::std::string const &,double ) )(&MultiLayer_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( MultiLayer_wrapper::* )(  ) )(&MultiLayer_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( MultiLayer_wrapper::* )(  ) const)(&MultiLayer_wrapper::default_size) )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::MultiLayer
+        typedef bp::class_< MultiLayer_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > MultiLayer_exposer_t;
+        MultiLayer_exposer_t MultiLayer_exposer = MultiLayer_exposer_t( "MultiLayer", bp::init< >() );
+        bp::scope MultiLayer_scope( MultiLayer_exposer );
+        { //::MultiLayer::addLayer
+        
+            typedef void ( ::MultiLayer::*addLayer_function_type )( ::Layer const & ) ;
+            
+            MultiLayer_exposer.def( 
+                "addLayer"
+                , addLayer_function_type( &::MultiLayer::addLayer )
+                , ( bp::arg("p_child") ) );
+        
+        }
+        { //::MultiLayer::addLayerWithTopRoughness
+        
+            typedef void ( ::MultiLayer::*addLayerWithTopRoughness_function_type )( ::Layer const &,::LayerRoughness const & ) ;
+            
+            MultiLayer_exposer.def( 
+                "addLayerWithTopRoughness"
+                , addLayerWithTopRoughness_function_type( &::MultiLayer::addLayerWithTopRoughness )
+                , ( bp::arg("layer"), bp::arg("roughness") ) );
+        
+        }
+        { //::MultiLayer::clear
+        
+            typedef void ( ::MultiLayer::*clear_function_type )(  ) ;
+            
+            MultiLayer_exposer.def( 
+                "clear"
+                , clear_function_type( &::MultiLayer::clear ) );
+        
+        }
+        { //::MultiLayer::clone
+        
+            typedef ::MultiLayer * ( ::MultiLayer::*clone_function_type )(  ) const;
+            typedef ::MultiLayer * ( MultiLayer_wrapper::*default_clone_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "clone"
+                , clone_function_type(&::MultiLayer::clone)
+                , default_clone_function_type(&MultiLayer_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::MultiLayer::getCrossCorrLength
+        
+            typedef double ( ::MultiLayer::*getCrossCorrLength_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "getCrossCorrLength"
+                , getCrossCorrLength_function_type( &::MultiLayer::getCrossCorrLength ) );
+        
+        }
+        { //::MultiLayer::getCrossCorrSpectralFun
+        
+            typedef double ( ::MultiLayer::*getCrossCorrSpectralFun_function_type )( ::kvector_t const &,::size_t,::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getCrossCorrSpectralFun"
+                , getCrossCorrSpectralFun_function_type( &::MultiLayer::getCrossCorrSpectralFun )
+                , ( bp::arg("kvec"), bp::arg("j"), bp::arg("k") ) );
+        
+        }
+        { //::MultiLayer::getLayer
+        
+            typedef ::Layer const * ( ::MultiLayer::*getLayer_function_type )( ::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getLayer"
+                , getLayer_function_type( &::MultiLayer::getLayer )
+                , ( bp::arg("i_layer") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MultiLayer::getLayerBottomInterface
+        
+            typedef ::LayerInterface const * ( ::MultiLayer::*getLayerBottomInterface_function_type )( ::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getLayerBottomInterface"
+                , getLayerBottomInterface_function_type( &::MultiLayer::getLayerBottomInterface )
+                , ( bp::arg("i_layer") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MultiLayer::getLayerBottomZ
+        
+            typedef double ( ::MultiLayer::*getLayerBottomZ_function_type )( ::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getLayerBottomZ"
+                , getLayerBottomZ_function_type( &::MultiLayer::getLayerBottomZ )
+                , ( bp::arg("i_layer") ) );
+        
+        }
+        { //::MultiLayer::getLayerInterface
+        
+            typedef ::LayerInterface const * ( ::MultiLayer::*getLayerInterface_function_type )( ::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getLayerInterface"
+                , getLayerInterface_function_type( &::MultiLayer::getLayerInterface )
+                , ( bp::arg("i_interface") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MultiLayer::getLayerThickness
+        
+            typedef double ( ::MultiLayer::*getLayerThickness_function_type )( ::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getLayerThickness"
+                , getLayerThickness_function_type( &::MultiLayer::getLayerThickness )
+                , ( bp::arg("i_layer") ) );
+        
+        }
+        { //::MultiLayer::getLayerTopInterface
+        
+            typedef ::LayerInterface const * ( ::MultiLayer::*getLayerTopInterface_function_type )( ::size_t ) const;
+            
+            MultiLayer_exposer.def( 
+                "getLayerTopInterface"
+                , getLayerTopInterface_function_type( &::MultiLayer::getLayerTopInterface )
+                , ( bp::arg("i_layer") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MultiLayer::getNumberOfInterfaces
+        
+            typedef ::size_t ( ::MultiLayer::*getNumberOfInterfaces_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "getNumberOfInterfaces"
+                , getNumberOfInterfaces_function_type( &::MultiLayer::getNumberOfInterfaces ) );
+        
+        }
+        { //::MultiLayer::getNumberOfLayers
+        
+            typedef ::size_t ( ::MultiLayer::*getNumberOfLayers_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "getNumberOfLayers"
+                , getNumberOfLayers_function_type( &::MultiLayer::getNumberOfLayers ) );
+        
+        }
+        { //::MultiLayer::setCrossCorrLength
+        
+            typedef void ( ::MultiLayer::*setCrossCorrLength_function_type )( double ) ;
+            
+            MultiLayer_exposer.def( 
+                "setCrossCorrLength"
+                , setCrossCorrLength_function_type( &::MultiLayer::setCrossCorrLength )
+                , ( bp::arg("crossCorrLength") ) );
+        
+        }
+        { //::MultiLayer::setLayerThickness
+        
+            typedef void ( ::MultiLayer::*setLayerThickness_function_type )( ::size_t,double ) ;
+            
+            MultiLayer_exposer.def( 
+                "setLayerThickness"
+                , setLayerThickness_function_type( &::MultiLayer::setLayerThickness )
+                , ( bp::arg("i_layer"), bp::arg("thickness") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( MultiLayer_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            MultiLayer_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&MultiLayer_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( MultiLayer_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            MultiLayer_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&MultiLayer_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( MultiLayer_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&MultiLayer_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( MultiLayer_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            MultiLayer_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&MultiLayer_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( MultiLayer_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&MultiLayer_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( MultiLayer_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&MultiLayer_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            MultiLayer_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &MultiLayer_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( MultiLayer_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            MultiLayer_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&MultiLayer_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( MultiLayer_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            MultiLayer_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&MultiLayer_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( MultiLayer_wrapper::*default_size_function_type )(  ) const;
+            
+            MultiLayer_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&MultiLayer_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/MultiLayerDWBASimulation.pypp.cpp b/Core/PythonAPI/src/MultiLayerDWBASimulation.pypp.cpp
deleted file mode 100644
index 75a2c458b0730cf223ec4955a6bee7885566eba7..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/MultiLayerDWBASimulation.pypp.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "MultiLayerDWBASimulation.pypp.h"
-
-namespace bp = boost::python;
-
-struct MultiLayerDWBASimulation_wrapper : MultiLayerDWBASimulation, bp::wrapper< MultiLayerDWBASimulation > {
-
-    virtual ::MultiLayerDWBASimulation * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->MultiLayerDWBASimulation::clone(  );
-        }
-    }
-    
-    ::MultiLayerDWBASimulation * default_clone(  ) const  {
-        return MultiLayerDWBASimulation::clone( );
-    }
-
-    virtual void init( ::Simulation const & simulation ) {
-        if( bp::override func_init = this->get_override( "init" ) )
-            func_init( boost::ref(simulation) );
-        else{
-            this->MultiLayerDWBASimulation::init( boost::ref(simulation) );
-        }
-    }
-    
-    void default_init( ::Simulation const & simulation ) {
-        MultiLayerDWBASimulation::init( boost::ref(simulation) );
-    }
-
-    virtual void run(  ) {
-        if( bp::override func_run = this->get_override( "run" ) )
-            func_run(  );
-        else{
-            this->MultiLayerDWBASimulation::run(  );
-        }
-    }
-    
-    void default_run(  ) {
-        MultiLayerDWBASimulation::run( );
-    }
-
-    virtual void setThreadInfo( ::ThreadInfo const & thread_info ) {
-        if( bp::override func_setThreadInfo = this->get_override( "setThreadInfo" ) )
-            func_setThreadInfo( boost::ref(thread_info) );
-        else{
-            this->MultiLayerDWBASimulation::setThreadInfo( boost::ref(thread_info) );
-        }
-    }
-    
-    void default_setThreadInfo( ::ThreadInfo const & thread_info ) {
-        MultiLayerDWBASimulation::setThreadInfo( boost::ref(thread_info) );
-    }
-
-};
-
-void register_MultiLayerDWBASimulation_class(){
-
-    bp::class_< MultiLayerDWBASimulation_wrapper, boost::noncopyable >( "MultiLayerDWBASimulation", bp::no_init )    
-        .def( 
-            "clone"
-            , (::MultiLayerDWBASimulation * ( ::MultiLayerDWBASimulation::* )(  ) const)(&::MultiLayerDWBASimulation::clone)
-            , (::MultiLayerDWBASimulation * ( MultiLayerDWBASimulation_wrapper::* )(  ) const)(&MultiLayerDWBASimulation_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "init"
-            , (void ( ::MultiLayerDWBASimulation::* )( ::Simulation const & ) )(&::MultiLayerDWBASimulation::init)
-            , (void ( MultiLayerDWBASimulation_wrapper::* )( ::Simulation const & ) )(&MultiLayerDWBASimulation_wrapper::default_init)
-            , ( bp::arg("simulation") ) )    
-        .def( 
-            "run"
-            , (void ( ::MultiLayerDWBASimulation::* )(  ) )(&::MultiLayerDWBASimulation::run)
-            , (void ( MultiLayerDWBASimulation_wrapper::* )(  ) )(&MultiLayerDWBASimulation_wrapper::default_run) )    
-        .def( 
-            "setThreadInfo"
-            , (void ( ::MultiLayerDWBASimulation::* )( ::ThreadInfo const & ) )(&::MultiLayerDWBASimulation::setThreadInfo)
-            , (void ( MultiLayerDWBASimulation_wrapper::* )( ::ThreadInfo const & ) )(&MultiLayerDWBASimulation_wrapper::default_setThreadInfo)
-            , ( bp::arg("thread_info") ) );
-
-}
diff --git a/Core/PythonAPI/src/OpticalFresnel.pypp.cpp b/Core/PythonAPI/src/OpticalFresnel.pypp.cpp
deleted file mode 100644
index aab0b1a46b4a36ddeb777d06ffc5329bba2c0779..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/OpticalFresnel.pypp.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "OpticalFresnel.pypp.h"
-
-namespace bp = boost::python;
-
-struct OpticalFresnel_wrapper : OpticalFresnel, bp::wrapper< OpticalFresnel > {
-
-    OpticalFresnel_wrapper( )
-    : OpticalFresnel( )
-      , bp::wrapper< OpticalFresnel >(){
-        // null constructor
-    
-    }
-
-    virtual ::ISimulation * clone(  ) const  {
-        if( bp::override func_clone = this->get_override( "clone" ) )
-            return func_clone(  );
-        else{
-            return this->ISimulation::clone(  );
-        }
-    }
-    
-    ::ISimulation * default_clone(  ) const  {
-        return ISimulation::clone( );
-    }
-
-    virtual void run(  ) {
-        if( bp::override func_run = this->get_override( "run" ) )
-            func_run(  );
-        else{
-            this->ISimulation::run(  );
-        }
-    }
-    
-    void default_run(  ) {
-        ISimulation::run( );
-    }
-
-};
-
-void register_OpticalFresnel_class(){
-
-    { //::OpticalFresnel
-        typedef bp::class_< OpticalFresnel_wrapper, bp::bases< ISimulation >, boost::noncopyable > OpticalFresnel_exposer_t;
-        OpticalFresnel_exposer_t OpticalFresnel_exposer = OpticalFresnel_exposer_t( "OpticalFresnel", bp::init< >() );
-        bp::scope OpticalFresnel_scope( OpticalFresnel_exposer );
-        bp::class_< OpticalFresnel::FresnelCoeff >( "FresnelCoeff", bp::init< >() )    
-            .def( bp::self == bp::self )    
-            .def_readwrite( "R", &OpticalFresnel::FresnelCoeff::R )    
-            .def_readwrite( "T", &OpticalFresnel::FresnelCoeff::T )    
-            .def_readwrite( "X", &OpticalFresnel::FresnelCoeff::X )    
-            .def_readwrite( "kz", &OpticalFresnel::FresnelCoeff::kz )    
-            .def_readwrite( "r", &OpticalFresnel::FresnelCoeff::r )    
-            .def_readwrite( "rb", &OpticalFresnel::FresnelCoeff::rb )    
-            .def_readwrite( "t", &OpticalFresnel::FresnelCoeff::t )    
-            .def_readwrite( "tb", &OpticalFresnel::FresnelCoeff::tb );
-        bp::class_< OpticalFresnel::MultiLayerCoeff >( "MultiLayerCoeff" )    
-            .def( 
-                "clear"
-                , (void ( ::OpticalFresnel::MultiLayerCoeff::* )(  ) )( &::OpticalFresnel::MultiLayerCoeff::clear ) )    
-            .def( 
-                "__getitem__"
-                , (::OpticalFresnel::FresnelCoeff & ( ::OpticalFresnel::MultiLayerCoeff::* )( ::size_t ) )( &::OpticalFresnel::MultiLayerCoeff::operator[] )
-                , ( bp::arg("i") )
-                , bp::return_internal_reference< >() )    
-            .def( 
-                "__getitem__"
-                , (::OpticalFresnel::FresnelCoeff const & ( ::OpticalFresnel::MultiLayerCoeff::* )( ::size_t ) const)( &::OpticalFresnel::MultiLayerCoeff::operator[] )
-                , ( bp::arg("i") )
-                , bp::return_value_policy< bp::copy_const_reference >() )    
-            .def( 
-                "resize"
-                , (void ( ::OpticalFresnel::MultiLayerCoeff::* )( ::size_t ) )( &::OpticalFresnel::MultiLayerCoeff::resize )
-                , ( bp::arg("size") ) )    
-            .def( 
-                "size"
-                , (::size_t ( ::OpticalFresnel::MultiLayerCoeff::* )(  ) const)( &::OpticalFresnel::MultiLayerCoeff::size ) );
-        { //::OpticalFresnel::execute
-        
-            typedef void ( ::OpticalFresnel::*execute_function_type )( ::MultiLayer const &,::kvector_t const &,::OpticalFresnel::MultiLayerCoeff & ) ;
-            
-            OpticalFresnel_exposer.def( 
-                "execute"
-                , execute_function_type( &::OpticalFresnel::execute )
-                , ( bp::arg("sample"), bp::arg("k"), bp::arg("coeff") ) );
-        
-        }
-        { //::ISimulation::clone
-        
-            typedef ::ISimulation * ( ::ISimulation::*clone_function_type )(  ) const;
-            typedef ::ISimulation * ( OpticalFresnel_wrapper::*default_clone_function_type )(  ) const;
-            
-            OpticalFresnel_exposer.def( 
-                "clone"
-                , clone_function_type(&::ISimulation::clone)
-                , default_clone_function_type(&OpticalFresnel_wrapper::default_clone)
-                , bp::return_value_policy< bp::manage_new_object >() );
-        
-        }
-        { //::ISimulation::run
-        
-            typedef void ( ::ISimulation::*run_function_type )(  ) ;
-            typedef void ( OpticalFresnel_wrapper::*default_run_function_type )(  ) ;
-            
-            OpticalFresnel_exposer.def( 
-                "run"
-                , run_function_type(&::ISimulation::run)
-                , default_run_function_type(&OpticalFresnel_wrapper::default_run) );
-        
-        }
-    }
-
-}
diff --git a/Core/PythonAPI/src/OutputDataIOFactory.pypp.cpp b/Core/PythonAPI/src/OutputDataIOFactory.pypp.cpp
index 40fb9960b50af816b25359f3e2ebd72551d16907..d762f61a6877a637fbe1f0dde7fc9e69ae1d78f4 100644
--- a/Core/PythonAPI/src/OutputDataIOFactory.pypp.cpp
+++ b/Core/PythonAPI/src/OutputDataIOFactory.pypp.cpp
@@ -1,109 +1,70 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "OutputDataIOFactory.pypp.h"
 
 namespace bp = boost::python;
 
 void register_OutputDataIOFactory_class(){
 
-    bp::class_< OutputDataIOFactory >( "OutputDataIOFactory", bp::init< >() )    
-        .def( 
-            "getOutputData"
-            , (::OutputData< double > * (*)( ::std::string const & ))( &::OutputDataIOFactory::getOutputData )
-            , ( bp::arg("file_name") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getReader"
-            , (::boost::shared_ptr< OutputDataReader > (*)( ::std::string const & ))( &::OutputDataIOFactory::getReader )
-            , ( bp::arg("file_name") ) )    
-        .def( 
-            "getWriter"
-            , (::boost::shared_ptr< OutputDataWriter > (*)( ::std::string const & ))( &::OutputDataIOFactory::getWriter )
-            , ( bp::arg("file_name") ) )    
-        .def( 
-            "writeOutputData"
-            , (void (*)( ::OutputData< double > const &,::std::string const & ))( &::OutputDataIOFactory::writeOutputData )
-            , ( bp::arg("data"), bp::arg("file_name") ) )    
-        .staticmethod( "getOutputData" )    
-        .staticmethod( "getReader" )    
-        .staticmethod( "getWriter" )    
-        .staticmethod( "writeOutputData" );
+    { //::OutputDataIOFactory
+        typedef bp::class_< OutputDataIOFactory > OutputDataIOFactory_exposer_t;
+        OutputDataIOFactory_exposer_t OutputDataIOFactory_exposer = OutputDataIOFactory_exposer_t( "OutputDataIOFactory", bp::init< >() );
+        bp::scope OutputDataIOFactory_scope( OutputDataIOFactory_exposer );
+        { //::OutputDataIOFactory::getOutputData
+        
+            typedef ::OutputData< double > * ( *getOutputData_function_type )( ::std::string const & );
+            
+            OutputDataIOFactory_exposer.def( 
+                "getOutputData"
+                , getOutputData_function_type( &::OutputDataIOFactory::getOutputData )
+                , ( bp::arg("file_name") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::OutputDataIOFactory::getReader
+        
+            typedef ::boost::shared_ptr< OutputDataReader > ( *getReader_function_type )( ::std::string const & );
+            
+            OutputDataIOFactory_exposer.def( 
+                "getReader"
+                , getReader_function_type( &::OutputDataIOFactory::getReader )
+                , ( bp::arg("file_name") ) );
+        
+        }
+        { //::OutputDataIOFactory::getWriter
+        
+            typedef ::boost::shared_ptr< OutputDataWriter > ( *getWriter_function_type )( ::std::string const & );
+            
+            OutputDataIOFactory_exposer.def( 
+                "getWriter"
+                , getWriter_function_type( &::OutputDataIOFactory::getWriter )
+                , ( bp::arg("file_name") ) );
+        
+        }
+        { //::OutputDataIOFactory::writeOutputData
+        
+            typedef void ( *writeOutputData_function_type )( ::OutputData< double > const &,::std::string const & );
+            
+            OutputDataIOFactory_exposer.def( 
+                "writeOutputData"
+                , writeOutputData_function_type( &::OutputDataIOFactory::writeOutputData )
+                , ( bp::arg("data"), bp::arg("file_name") ) );
+        
+        }
+        OutputDataIOFactory_exposer.staticmethod( "getOutputData" );
+        OutputDataIOFactory_exposer.staticmethod( "getReader" );
+        OutputDataIOFactory_exposer.staticmethod( "getWriter" );
+        OutputDataIOFactory_exposer.staticmethod( "writeOutputData" );
+    }
 
 }
diff --git a/Core/PythonAPI/src/ParameterPool.pypp.cpp b/Core/PythonAPI/src/ParameterPool.pypp.cpp
index b603b509b17b4c3f2fd24df3c03a3c0f80f77bdb..914cffcceb87c743ab97a780af190e5900711dce 100644
--- a/Core/PythonAPI/src/ParameterPool.pypp.cpp
+++ b/Core/PythonAPI/src/ParameterPool.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ParameterPool.pypp.h"
 
 namespace bp = boost::python;
@@ -106,43 +39,101 @@ struct ParameterPool_wrapper : ParameterPool, bp::wrapper< ParameterPool > {
 
 void register_ParameterPool_class(){
 
-    bp::class_< ParameterPool_wrapper, bp::bases< ICloneable >, boost::noncopyable >( "ParameterPool", bp::init< >() )    
-        .def( 
-            "addParameter"
-            , (bool ( ::ParameterPool::* )( ::std::string const &,::RealParameterWrapper ) )( &::ParameterPool::addParameter )
-            , ( bp::arg("name"), bp::arg("par") ) )    
-        .def( 
-            "clear"
-            , (void ( ::ParameterPool::* )(  ) )( &::ParameterPool::clear ) )    
-        .def( 
-            "clone"
-            , (::ParameterPool * ( ::ParameterPool::* )(  ) const)(&::ParameterPool::clone)
-            , (::ParameterPool * ( ParameterPool_wrapper::* )(  ) const)(&ParameterPool_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "cloneWithPrefix"
-            , (::ParameterPool * ( ::ParameterPool::* )( ::std::string const & ) const)( &::ParameterPool::cloneWithPrefix )
-            , ( bp::arg("prefix") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "fixRatioBetweenParameters"
-            , (int ( ::ParameterPool::* )( ::std::string const &,::std::string const &,double ) )( &::ParameterPool::fixRatioBetweenParameters )
-            , ( bp::arg("to_change"), bp::arg("source"), bp::arg("ratio") ) )    
-        .def( 
-            "getParameter"
-            , (::RealParameterWrapper ( ::ParameterPool::* )( ::std::string const & ) const)( &::ParameterPool::getParameter )
-            , ( bp::arg("name") ) )    
-        .def( 
-            "setMatchedParametersValue"
-            , (int ( ::ParameterPool::* )( ::std::string const &,double ) )( &::ParameterPool::setMatchedParametersValue )
-            , ( bp::arg("wildcards"), bp::arg("value") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::ParameterPool::* )( ::std::string const &,double ) )( &::ParameterPool::setParameterValue )
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ParameterPool::* )(  ) const)( &::ParameterPool::size ) )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::ParameterPool
+        typedef bp::class_< ParameterPool_wrapper, bp::bases< ICloneable >, boost::noncopyable > ParameterPool_exposer_t;
+        ParameterPool_exposer_t ParameterPool_exposer = ParameterPool_exposer_t( "ParameterPool", bp::init< >() );
+        bp::scope ParameterPool_scope( ParameterPool_exposer );
+        { //::ParameterPool::addParameter
+        
+            typedef bool ( ::ParameterPool::*addParameter_function_type )( ::std::string const &,::RealParameterWrapper ) ;
+            
+            ParameterPool_exposer.def( 
+                "addParameter"
+                , addParameter_function_type( &::ParameterPool::addParameter )
+                , ( bp::arg("name"), bp::arg("par") ) );
+        
+        }
+        { //::ParameterPool::clear
+        
+            typedef void ( ::ParameterPool::*clear_function_type )(  ) ;
+            
+            ParameterPool_exposer.def( 
+                "clear"
+                , clear_function_type( &::ParameterPool::clear ) );
+        
+        }
+        { //::ParameterPool::clone
+        
+            typedef ::ParameterPool * ( ::ParameterPool::*clone_function_type )(  ) const;
+            typedef ::ParameterPool * ( ParameterPool_wrapper::*default_clone_function_type )(  ) const;
+            
+            ParameterPool_exposer.def( 
+                "clone"
+                , clone_function_type(&::ParameterPool::clone)
+                , default_clone_function_type(&ParameterPool_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ParameterPool::cloneWithPrefix
+        
+            typedef ::ParameterPool * ( ::ParameterPool::*cloneWithPrefix_function_type )( ::std::string const & ) const;
+            
+            ParameterPool_exposer.def( 
+                "cloneWithPrefix"
+                , cloneWithPrefix_function_type( &::ParameterPool::cloneWithPrefix )
+                , ( bp::arg("prefix") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ParameterPool::fixRatioBetweenParameters
+        
+            typedef int ( ::ParameterPool::*fixRatioBetweenParameters_function_type )( ::std::string const &,::std::string const &,double ) ;
+            
+            ParameterPool_exposer.def( 
+                "fixRatioBetweenParameters"
+                , fixRatioBetweenParameters_function_type( &::ParameterPool::fixRatioBetweenParameters )
+                , ( bp::arg("to_change"), bp::arg("source"), bp::arg("ratio") ) );
+        
+        }
+        { //::ParameterPool::getParameter
+        
+            typedef ::RealParameterWrapper ( ::ParameterPool::*getParameter_function_type )( ::std::string const & ) const;
+            
+            ParameterPool_exposer.def( 
+                "getParameter"
+                , getParameter_function_type( &::ParameterPool::getParameter )
+                , ( bp::arg("name") ) );
+        
+        }
+        { //::ParameterPool::setMatchedParametersValue
+        
+            typedef int ( ::ParameterPool::*setMatchedParametersValue_function_type )( ::std::string const &,double ) ;
+            
+            ParameterPool_exposer.def( 
+                "setMatchedParametersValue"
+                , setMatchedParametersValue_function_type( &::ParameterPool::setMatchedParametersValue )
+                , ( bp::arg("wildcards"), bp::arg("value") ) );
+        
+        }
+        { //::ParameterPool::setParameterValue
+        
+            typedef bool ( ::ParameterPool::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ParameterPool_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type( &::ParameterPool::setParameterValue )
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::ParameterPool::size
+        
+            typedef ::size_t ( ::ParameterPool::*size_function_type )(  ) const;
+            
+            ParameterPool_exposer.def( 
+                "size"
+                , size_function_type( &::ParameterPool::size ) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Particle.pypp.cpp b/Core/PythonAPI/src/Particle.pypp.cpp
index a3ef0900c8d2ed71c24f8eb922499276ddf4f6f6..3171b00202308237e29c212329981f62cfa160ed 100644
--- a/Core/PythonAPI/src/Particle.pypp.cpp
+++ b/Core/PythonAPI/src/Particle.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Particle.pypp.h"
 
 namespace bp = boost::python;
@@ -236,18 +169,6 @@ struct Particle_wrapper : Particle, bp::wrapper< Particle > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -307,82 +228,193 @@ struct Particle_wrapper : Particle, bp::wrapper< Particle > {
 
 void register_Particle_class(){
 
-    bp::class_< Particle_wrapper, bp::bases< ICompositeSample >, boost::noncopyable >( "Particle", bp::init< complex_t const &, IFormFactor const & >(( bp::arg("refractive_index"), bp::arg("form_factor") )) )    
-        .def( 
-            "clone"
-            , (::Particle * ( ::Particle::* )(  ) const)(&::Particle::clone)
-            , (::Particle * ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createFormFactor"
-            , (::IFormFactor * ( ::Particle::* )(  ) const)(&::Particle::createFormFactor)
-            , (::IFormFactor * ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_createFormFactor)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t const ( ::Particle::* )(  ) const)(&::Particle::getRefractiveIndex)
-            , (::complex_t const ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_getRefractiveIndex) )    
-        .def( 
-            "getSimpleFormFactor"
-            , (::IFormFactor const * ( ::Particle::* )(  ) const)(&::Particle::getSimpleFormFactor)
-            , (::IFormFactor const * ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_getSimpleFormFactor)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "hasDistributedFormFactor"
-            , (bool ( ::Particle::* )(  ) const)(&::Particle::hasDistributedFormFactor)
-            , (bool ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_hasDistributedFormFactor) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::Particle::* )( ::complex_t ) )(&::Particle::setAmbientRefractiveIndex)
-            , (void ( Particle_wrapper::* )( ::complex_t ) )(&Particle_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( Particle_wrapper::* )(  ) )(&Particle_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( Particle_wrapper::* )(  ) )(&Particle_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( Particle_wrapper::* )(  ) )(&Particle_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( Particle_wrapper::* )(  ) )(&Particle_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &Particle_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( Particle_wrapper::* )( ::std::string const &,double ) )(&Particle_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( Particle_wrapper::* )(  ) )(&Particle_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( Particle_wrapper::* )(  ) const)(&Particle_wrapper::default_size) );
+    { //::Particle
+        typedef bp::class_< Particle_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > Particle_exposer_t;
+        Particle_exposer_t Particle_exposer = Particle_exposer_t( "Particle", bp::init< complex_t const &, IFormFactor const & >(( bp::arg("refractive_index"), bp::arg("form_factor") )) );
+        bp::scope Particle_scope( Particle_exposer );
+        { //::Particle::clone
+        
+            typedef ::Particle * ( ::Particle::*clone_function_type )(  ) const;
+            typedef ::Particle * ( Particle_wrapper::*default_clone_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "clone"
+                , clone_function_type(&::Particle::clone)
+                , default_clone_function_type(&Particle_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Particle::createFormFactor
+        
+            typedef ::IFormFactor * ( ::Particle::*createFormFactor_function_type )(  ) const;
+            typedef ::IFormFactor * ( Particle_wrapper::*default_createFormFactor_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "createFormFactor"
+                , createFormFactor_function_type(&::Particle::createFormFactor)
+                , default_createFormFactor_function_type(&Particle_wrapper::default_createFormFactor)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Particle::getRefractiveIndex
+        
+            typedef ::complex_t const ( ::Particle::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t const ( Particle_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::Particle::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&Particle_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::Particle::getSimpleFormFactor
+        
+            typedef ::IFormFactor const * ( ::Particle::*getSimpleFormFactor_function_type )(  ) const;
+            typedef ::IFormFactor const * ( Particle_wrapper::*default_getSimpleFormFactor_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "getSimpleFormFactor"
+                , getSimpleFormFactor_function_type(&::Particle::getSimpleFormFactor)
+                , default_getSimpleFormFactor_function_type(&Particle_wrapper::default_getSimpleFormFactor)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Particle::hasDistributedFormFactor
+        
+            typedef bool ( ::Particle::*hasDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( Particle_wrapper::*default_hasDistributedFormFactor_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "hasDistributedFormFactor"
+                , hasDistributedFormFactor_function_type(&::Particle::hasDistributedFormFactor)
+                , default_hasDistributedFormFactor_function_type(&Particle_wrapper::default_hasDistributedFormFactor) );
+        
+        }
+        { //::Particle::setAmbientRefractiveIndex
+        
+            typedef void ( ::Particle::*setAmbientRefractiveIndex_function_type )( ::complex_t ) ;
+            typedef void ( Particle_wrapper::*default_setAmbientRefractiveIndex_function_type )( ::complex_t ) ;
+            
+            Particle_exposer.def( 
+                "setAmbientRefractiveIndex"
+                , setAmbientRefractiveIndex_function_type(&::Particle::setAmbientRefractiveIndex)
+                , default_setAmbientRefractiveIndex_function_type(&Particle_wrapper::default_setAmbientRefractiveIndex)
+                , ( bp::arg("refractive_index") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Particle_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Particle_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Particle_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Particle_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Particle_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Particle_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Particle_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Particle_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( Particle_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            Particle_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&Particle_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( Particle_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&Particle_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Particle_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Particle_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Particle_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Particle_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Particle_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Particle_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Particle_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Particle_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Particle_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Particle_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( Particle_wrapper::*default_size_function_type )(  ) const;
+            
+            Particle_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&Particle_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ParticleBuilder.pypp.cpp b/Core/PythonAPI/src/ParticleBuilder.pypp.cpp
index 9fff8e7be8f3e8b197712ca11794763ebb3ae941..93b411aa2fb961848e4604eefab757bf995bd37f 100644
--- a/Core/PythonAPI/src/ParticleBuilder.pypp.cpp
+++ b/Core/PythonAPI/src/ParticleBuilder.pypp.cpp
@@ -1,96 +1,45 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ParticleBuilder.pypp.h"
 
 namespace bp = boost::python;
 
 void register_ParticleBuilder_class(){
 
-    bp::class_< ParticleBuilder >( "ParticleBuilder", bp::init< >() )    
-        .def( 
-            "plantParticles"
-            , (void ( ::ParticleBuilder::* )( ::ParticleDecoration & ) )( &::ParticleBuilder::plantParticles )
-            , ( bp::arg("decor") ) )    
-        .def( 
-            "setPrototype"
-            , (void ( ::ParticleBuilder::* )( ::Particle const &,::std::string,::StochasticParameter< double > const &,double ) )( &::ParticleBuilder::setPrototype )
-            , ( bp::arg("particle"), bp::arg("name"), bp::arg("param"), bp::arg("scale")=1.0e+0 ) );
+    { //::ParticleBuilder
+        typedef bp::class_< ParticleBuilder > ParticleBuilder_exposer_t;
+        ParticleBuilder_exposer_t ParticleBuilder_exposer = ParticleBuilder_exposer_t( "ParticleBuilder", bp::init< >() );
+        bp::scope ParticleBuilder_scope( ParticleBuilder_exposer );
+        { //::ParticleBuilder::plantParticles
+        
+            typedef void ( ::ParticleBuilder::*plantParticles_function_type )( ::ParticleDecoration & ) ;
+            
+            ParticleBuilder_exposer.def( 
+                "plantParticles"
+                , plantParticles_function_type( &::ParticleBuilder::plantParticles )
+                , ( bp::arg("decor") ) );
+        
+        }
+        { //::ParticleBuilder::setPrototype
+        
+            typedef void ( ::ParticleBuilder::*setPrototype_function_type )( ::Particle const &,::std::string,::StochasticParameter< double > const &,double ) ;
+            
+            ParticleBuilder_exposer.def( 
+                "setPrototype"
+                , setPrototype_function_type( &::ParticleBuilder::setPrototype )
+                , ( bp::arg("particle"), bp::arg("name"), bp::arg("param"), bp::arg("scale")=1.0e+0 ) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ParticleCoreShell.pypp.cpp b/Core/PythonAPI/src/ParticleCoreShell.pypp.cpp
index c4008deccc6a23460ef2fb1d6ccc1373f5770806..b6dc83f2ff707cacd1f48e63edcab8edf96a8438 100644
--- a/Core/PythonAPI/src/ParticleCoreShell.pypp.cpp
+++ b/Core/PythonAPI/src/ParticleCoreShell.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ParticleCoreShell.pypp.h"
 
 namespace bp = boost::python;
@@ -116,18 +49,6 @@ struct ParticleCoreShell_wrapper : ParticleCoreShell, bp::wrapper< ParticleCoreS
         IParameterized::clearParameterPool( );
     }
 
-    virtual ::IFormFactor * createFormFactor(  ) const  {
-        if( bp::override func_createFormFactor = this->get_override( "createFormFactor" ) )
-            return func_createFormFactor(  );
-        else{
-            return this->Particle::createFormFactor(  );
-        }
-    }
-    
-    ::IFormFactor * default_createFormFactor(  ) const  {
-        return Particle::createFormFactor( );
-    }
-
     virtual ::ParameterPool * createParameterTree(  ) const  {
         if( bp::override func_createParameterTree = this->get_override( "createParameterTree" ) )
             return func_createParameterTree(  );
@@ -200,18 +121,6 @@ struct ParticleCoreShell_wrapper : ParticleCoreShell, bp::wrapper< ParticleCoreS
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -231,18 +140,6 @@ struct ParticleCoreShell_wrapper : ParticleCoreShell, bp::wrapper< ParticleCoreS
         }
     }
 
-    virtual void setAmbientRefractiveIndex( ::complex_t refractive_index ) {
-        if( bp::override func_setAmbientRefractiveIndex = this->get_override( "setAmbientRefractiveIndex" ) )
-            func_setAmbientRefractiveIndex( refractive_index );
-        else{
-            this->Particle::setAmbientRefractiveIndex( refractive_index );
-        }
-    }
-    
-    void default_setAmbientRefractiveIndex( ::complex_t refractive_index ) {
-        Particle::setAmbientRefractiveIndex( refractive_index );
-    }
-
     virtual bool setParameterValue( ::std::string const & name, double value ) {
         if( bp::override func_setParameterValue = this->get_override( "setParameterValue" ) )
             return func_setParameterValue( name, value );
@@ -283,72 +180,145 @@ struct ParticleCoreShell_wrapper : ParticleCoreShell, bp::wrapper< ParticleCoreS
 
 void register_ParticleCoreShell_class(){
 
-    bp::class_< ParticleCoreShell_wrapper, bp::bases< Particle >, boost::noncopyable >( "ParticleCoreShell", bp::init< Particle const &, Particle const &, kvector_t >(( bp::arg("shell"), bp::arg("core"), bp::arg("relative_core_position") )) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ParticleCoreShell_wrapper::* )(  ) )(&ParticleCoreShell_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ParticleCoreShell_wrapper::* )(  ) )(&ParticleCoreShell_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createFormFactor"
-            , (::IFormFactor * ( ::Particle::* )(  ) const)(&::Particle::createFormFactor)
-            , (::IFormFactor * ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_createFormFactor)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( ParticleCoreShell_wrapper::* )(  ) )(&ParticleCoreShell_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRefractiveIndex"
-            , (::complex_t const ( ::Particle::* )(  ) const)(&::Particle::getRefractiveIndex)
-            , (::complex_t const ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_getRefractiveIndex) )    
-        .def( 
-            "hasDistributedFormFactor"
-            , (bool ( ::Particle::* )(  ) const)(&::Particle::hasDistributedFormFactor)
-            , (bool ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_hasDistributedFormFactor) )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( ParticleCoreShell_wrapper::* )(  ) )(&ParticleCoreShell_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ParticleCoreShell_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setAmbientRefractiveIndex"
-            , (void ( ::Particle::* )( ::complex_t ) )(&::Particle::setAmbientRefractiveIndex)
-            , (void ( ParticleCoreShell_wrapper::* )( ::complex_t ) )(&ParticleCoreShell_wrapper::default_setAmbientRefractiveIndex)
-            , ( bp::arg("refractive_index") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ParticleCoreShell_wrapper::* )( ::std::string const &,double ) )(&ParticleCoreShell_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ParticleCoreShell_wrapper::* )(  ) )(&ParticleCoreShell_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( ParticleCoreShell_wrapper::* )(  ) const)(&ParticleCoreShell_wrapper::default_size) );
+    { //::ParticleCoreShell
+        typedef bp::class_< ParticleCoreShell_wrapper, bp::bases< Particle >, boost::noncopyable > ParticleCoreShell_exposer_t;
+        ParticleCoreShell_exposer_t ParticleCoreShell_exposer = ParticleCoreShell_exposer_t( "ParticleCoreShell", bp::init< Particle const &, Particle const &, kvector_t >(( bp::arg("shell"), bp::arg("core"), bp::arg("relative_core_position") )) );
+        bp::scope ParticleCoreShell_scope( ParticleCoreShell_exposer );
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ParticleCoreShell_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ParticleCoreShell_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ParticleCoreShell_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ParticleCoreShell_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ParticleCoreShell_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ParticleCoreShell_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ParticleCoreShell_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ParticleCoreShell_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ParticleCoreShell_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( ParticleCoreShell_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            ParticleCoreShell_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ParticleCoreShell_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( ParticleCoreShell_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            ParticleCoreShell_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ParticleCoreShell_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Particle::getRefractiveIndex
+        
+            typedef ::complex_t const ( ::Particle::*getRefractiveIndex_function_type )(  ) const;
+            typedef ::complex_t const ( ParticleCoreShell_wrapper::*default_getRefractiveIndex_function_type )(  ) const;
+            
+            ParticleCoreShell_exposer.def( 
+                "getRefractiveIndex"
+                , getRefractiveIndex_function_type(&::Particle::getRefractiveIndex)
+                , default_getRefractiveIndex_function_type(&ParticleCoreShell_wrapper::default_getRefractiveIndex) );
+        
+        }
+        { //::Particle::hasDistributedFormFactor
+        
+            typedef bool ( ::Particle::*hasDistributedFormFactor_function_type )(  ) const;
+            typedef bool ( ParticleCoreShell_wrapper::*default_hasDistributedFormFactor_function_type )(  ) const;
+            
+            ParticleCoreShell_exposer.def( 
+                "hasDistributedFormFactor"
+                , hasDistributedFormFactor_function_type(&::Particle::hasDistributedFormFactor)
+                , default_hasDistributedFormFactor_function_type(&ParticleCoreShell_wrapper::default_hasDistributedFormFactor) );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ParticleCoreShell_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ParticleCoreShell_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ParticleCoreShell_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ParticleCoreShell_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ParticleCoreShell_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ParticleCoreShell_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ParticleCoreShell_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ParticleCoreShell_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ParticleCoreShell_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ParticleCoreShell_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ParticleCoreShell_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( ParticleCoreShell_wrapper::*default_size_function_type )(  ) const;
+            
+            ParticleCoreShell_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&ParticleCoreShell_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ParticleDecoration.pypp.cpp b/Core/PythonAPI/src/ParticleDecoration.pypp.cpp
index b28f621f03265153b4d6771a5f874af08937bd28..742bfa395f4b9536f359d940418f96d385fa40b0 100644
--- a/Core/PythonAPI/src/ParticleDecoration.pypp.cpp
+++ b/Core/PythonAPI/src/ParticleDecoration.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ParticleDecoration.pypp.h"
 
 namespace bp = boost::python;
@@ -236,18 +169,6 @@ struct ParticleDecoration_wrapper : ParticleDecoration, bp::wrapper< ParticleDec
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -307,103 +228,244 @@ struct ParticleDecoration_wrapper : ParticleDecoration, bp::wrapper< ParticleDec
 
 void register_ParticleDecoration_class(){
 
-    bp::class_< ParticleDecoration_wrapper, bp::bases< IDecoration >, boost::noncopyable >( "ParticleDecoration", bp::init< >() )    
-        .def( 
-            "addInterferenceFunction"
-            , (void ( ::ParticleDecoration::* )( ::IInterferenceFunction const & ) )( &::ParticleDecoration::addInterferenceFunction )
-            , ( bp::arg("interference_function") ) )    
-        .def( 
-            "addParticle"
-            , (void ( ::ParticleDecoration::* )( ::Particle const &,::Geometry::Transform3D const &,double,double ) )( &::ParticleDecoration::addParticle )
-            , ( bp::arg("particle"), bp::arg("transform"), bp::arg("depth")=0, bp::arg("abundance")=1.0e+0 ) )    
-        .def( 
-            "addParticle"
-            , (void ( ::ParticleDecoration::* )( ::Particle const &,double,double ) )( &::ParticleDecoration::addParticle )
-            , ( bp::arg("particle"), bp::arg("depth")=0.0, bp::arg("abundance")=1.0e+0 ) )    
-        .def( 
-            "addParticleInfo"
-            , (void ( ::ParticleDecoration::* )( ::ParticleInfo const & ) )( &::ParticleDecoration::addParticleInfo )
-            , ( bp::arg("info") ) )    
-        .def( 
-            "clone"
-            , (::ParticleDecoration * ( ::ParticleDecoration::* )(  ) const)(&::ParticleDecoration::clone)
-            , (::ParticleDecoration * ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getAbundanceFractionOfParticle"
-            , (double ( ::ParticleDecoration::* )( ::size_t ) const)(&::ParticleDecoration::getAbundanceFractionOfParticle)
-            , (double ( ParticleDecoration_wrapper::* )( ::size_t ) const)(&ParticleDecoration_wrapper::default_getAbundanceFractionOfParticle)
-            , ( bp::arg("index") ) )    
-        .def( 
-            "getInterferenceFunction"
-            , (::IInterferenceFunction const * ( ::ParticleDecoration::* )( ::size_t ) const)( &::ParticleDecoration::getInterferenceFunction )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getInterferenceFunctions"
-            , (::SafePointerVector< IInterferenceFunction > ( ::ParticleDecoration::* )(  ) const)(&::ParticleDecoration::getInterferenceFunctions)
-            , (::SafePointerVector< IInterferenceFunction > ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_getInterferenceFunctions) )    
-        .def( 
-            "getNumberOfInterferenceFunctions"
-            , (::size_t ( ::ParticleDecoration::* )(  ) const)(&::ParticleDecoration::getNumberOfInterferenceFunctions)
-            , (::size_t ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_getNumberOfInterferenceFunctions) )    
-        .def( 
-            "getNumberOfParticles"
-            , (::size_t ( ::ParticleDecoration::* )(  ) const)(&::ParticleDecoration::getNumberOfParticles)
-            , (::size_t ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_getNumberOfParticles) )    
-        .def( 
-            "getParticleInfo"
-            , (::ParticleInfo const * ( ::ParticleDecoration::* )( ::size_t ) const)(&::ParticleDecoration::getParticleInfo)
-            , (::ParticleInfo const * ( ParticleDecoration_wrapper::* )( ::size_t ) const)(&ParticleDecoration_wrapper::default_getParticleInfo)
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ParticleDecoration_wrapper::* )(  ) )(&ParticleDecoration_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ParticleDecoration_wrapper::* )(  ) )(&ParticleDecoration_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( ParticleDecoration_wrapper::* )(  ) )(&ParticleDecoration_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( ParticleDecoration_wrapper::* )(  ) )(&ParticleDecoration_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ParticleDecoration_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ParticleDecoration_wrapper::* )( ::std::string const &,double ) )(&ParticleDecoration_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ParticleDecoration_wrapper::* )(  ) )(&ParticleDecoration_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( ParticleDecoration_wrapper::* )(  ) const)(&ParticleDecoration_wrapper::default_size) );
+    { //::ParticleDecoration
+        typedef bp::class_< ParticleDecoration_wrapper, bp::bases< IDecoration >, boost::noncopyable > ParticleDecoration_exposer_t;
+        ParticleDecoration_exposer_t ParticleDecoration_exposer = ParticleDecoration_exposer_t( "ParticleDecoration", bp::init< >() );
+        bp::scope ParticleDecoration_scope( ParticleDecoration_exposer );
+        { //::ParticleDecoration::addInterferenceFunction
+        
+            typedef void ( ::ParticleDecoration::*addInterferenceFunction_function_type )( ::IInterferenceFunction const & ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "addInterferenceFunction"
+                , addInterferenceFunction_function_type( &::ParticleDecoration::addInterferenceFunction )
+                , ( bp::arg("interference_function") ) );
+        
+        }
+        { //::ParticleDecoration::addParticle
+        
+            typedef void ( ::ParticleDecoration::*addParticle_function_type )( ::Particle const &,::Geometry::PTransform3D const &,double,double ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "addParticle"
+                , addParticle_function_type( &::ParticleDecoration::addParticle )
+                , ( bp::arg("p_particle"), bp::arg("transform"), bp::arg("depth")=0, bp::arg("abundance")=1.0e+0 ) );
+        
+        }
+        { //::ParticleDecoration::addParticle
+        
+            typedef void ( ::ParticleDecoration::*addParticle_function_type )( ::Particle const &,double,double ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "addParticle"
+                , addParticle_function_type( &::ParticleDecoration::addParticle )
+                , ( bp::arg("particle"), bp::arg("depth")=0.0, bp::arg("abundance")=1.0e+0 ) );
+        
+        }
+        { //::ParticleDecoration::addParticleInfo
+        
+            typedef void ( ::ParticleDecoration::*addParticleInfo_function_type )( ::ParticleInfo const & ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "addParticleInfo"
+                , addParticleInfo_function_type( &::ParticleDecoration::addParticleInfo )
+                , ( bp::arg("info") ) );
+        
+        }
+        { //::ParticleDecoration::clone
+        
+            typedef ::ParticleDecoration * ( ::ParticleDecoration::*clone_function_type )(  ) const;
+            typedef ::ParticleDecoration * ( ParticleDecoration_wrapper::*default_clone_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "clone"
+                , clone_function_type(&::ParticleDecoration::clone)
+                , default_clone_function_type(&ParticleDecoration_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ParticleDecoration::getAbundanceFractionOfParticle
+        
+            typedef double ( ::ParticleDecoration::*getAbundanceFractionOfParticle_function_type )( ::size_t ) const;
+            typedef double ( ParticleDecoration_wrapper::*default_getAbundanceFractionOfParticle_function_type )( ::size_t ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getAbundanceFractionOfParticle"
+                , getAbundanceFractionOfParticle_function_type(&::ParticleDecoration::getAbundanceFractionOfParticle)
+                , default_getAbundanceFractionOfParticle_function_type(&ParticleDecoration_wrapper::default_getAbundanceFractionOfParticle)
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::ParticleDecoration::getInterferenceFunction
+        
+            typedef ::IInterferenceFunction const * ( ::ParticleDecoration::*getInterferenceFunction_function_type )( ::size_t ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getInterferenceFunction"
+                , getInterferenceFunction_function_type( &::ParticleDecoration::getInterferenceFunction )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ParticleDecoration::getInterferenceFunctions
+        
+            typedef ::SafePointerVector< IInterferenceFunction > ( ::ParticleDecoration::*getInterferenceFunctions_function_type )(  ) const;
+            typedef ::SafePointerVector< IInterferenceFunction > ( ParticleDecoration_wrapper::*default_getInterferenceFunctions_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getInterferenceFunctions"
+                , getInterferenceFunctions_function_type(&::ParticleDecoration::getInterferenceFunctions)
+                , default_getInterferenceFunctions_function_type(&ParticleDecoration_wrapper::default_getInterferenceFunctions) );
+        
+        }
+        { //::ParticleDecoration::getNumberOfInterferenceFunctions
+        
+            typedef ::size_t ( ::ParticleDecoration::*getNumberOfInterferenceFunctions_function_type )(  ) const;
+            typedef ::size_t ( ParticleDecoration_wrapper::*default_getNumberOfInterferenceFunctions_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getNumberOfInterferenceFunctions"
+                , getNumberOfInterferenceFunctions_function_type(&::ParticleDecoration::getNumberOfInterferenceFunctions)
+                , default_getNumberOfInterferenceFunctions_function_type(&ParticleDecoration_wrapper::default_getNumberOfInterferenceFunctions) );
+        
+        }
+        { //::ParticleDecoration::getNumberOfParticles
+        
+            typedef ::size_t ( ::ParticleDecoration::*getNumberOfParticles_function_type )(  ) const;
+            typedef ::size_t ( ParticleDecoration_wrapper::*default_getNumberOfParticles_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getNumberOfParticles"
+                , getNumberOfParticles_function_type(&::ParticleDecoration::getNumberOfParticles)
+                , default_getNumberOfParticles_function_type(&ParticleDecoration_wrapper::default_getNumberOfParticles) );
+        
+        }
+        { //::ParticleDecoration::getParticleInfo
+        
+            typedef ::ParticleInfo const * ( ::ParticleDecoration::*getParticleInfo_function_type )( ::size_t ) const;
+            typedef ::ParticleInfo const * ( ParticleDecoration_wrapper::*default_getParticleInfo_function_type )( ::size_t ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getParticleInfo"
+                , getParticleInfo_function_type(&::ParticleDecoration::getParticleInfo)
+                , default_getParticleInfo_function_type(&ParticleDecoration_wrapper::default_getParticleInfo)
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ParticleDecoration_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ParticleDecoration_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ParticleDecoration_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ParticleDecoration_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ParticleDecoration_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ParticleDecoration_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( ParticleDecoration_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ParticleDecoration_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( ParticleDecoration_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ParticleDecoration_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ParticleDecoration_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ParticleDecoration_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ParticleDecoration_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ParticleDecoration_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ParticleDecoration_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ParticleDecoration_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ParticleDecoration_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ParticleDecoration_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ParticleDecoration_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( ParticleDecoration_wrapper::*default_size_function_type )(  ) const;
+            
+            ParticleDecoration_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&ParticleDecoration_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/ParticleInfo.pypp.cpp b/Core/PythonAPI/src/ParticleInfo.pypp.cpp
index ecf34ddeb64665848cecdb20c525db5f66c5783e..99bdb2b15ab2c7d6e59242ed1169fea744595334 100644
--- a/Core/PythonAPI/src/ParticleInfo.pypp.cpp
+++ b/Core/PythonAPI/src/ParticleInfo.pypp.cpp
@@ -1,92 +1,32 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ParticleInfo.pypp.h"
 
 namespace bp = boost::python;
 
 struct ParticleInfo_wrapper : ParticleInfo, bp::wrapper< ParticleInfo > {
 
-    ParticleInfo_wrapper(::Particle const & p_particle, ::Geometry::Transform3D const & transform, double depth=0, double abundance=0 )
-    : ParticleInfo( boost::ref(p_particle), boost::ref(transform), depth, abundance )
+    ParticleInfo_wrapper(::Particle const & p_particle, ::Geometry::PTransform3D const & transform, double depth=0, double abundance=0 )
+    : ParticleInfo( boost::ref(p_particle), transform, depth, abundance )
+      , bp::wrapper< ParticleInfo >(){
+        // constructor
+    
+    }
+
+    ParticleInfo_wrapper(::Particle const & p_particle, double depth=0, double abundance=0 )
+    : ParticleInfo( boost::ref(p_particle), depth, abundance )
       , bp::wrapper< ParticleInfo >(){
         // constructor
     
@@ -176,18 +116,6 @@ struct ParticleInfo_wrapper : ParticleInfo, bp::wrapper< ParticleInfo > {
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -247,85 +175,203 @@ struct ParticleInfo_wrapper : ParticleInfo, bp::wrapper< ParticleInfo > {
 
 void register_ParticleInfo_class(){
 
-    bp::class_< ParticleInfo_wrapper, bp::bases< ICompositeSample >, boost::noncopyable >( "ParticleInfo", bp::init< Particle const &, Geometry::Transform3D const &, bp::optional< double, double > >(( bp::arg("p_particle"), bp::arg("transform"), bp::arg("depth")=0, bp::arg("abundance")=0 )) )    
-        .def( 
-            "clone"
-            , (::ParticleInfo * ( ::ParticleInfo::* )(  ) const)(&::ParticleInfo::clone)
-            , (::ParticleInfo * ( ParticleInfo_wrapper::* )(  ) const)(&ParticleInfo_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getAbundance"
-            , (double ( ::ParticleInfo::* )(  ) const)( &::ParticleInfo::getAbundance ) )    
-        .def( 
-            "getDepth"
-            , (double ( ::ParticleInfo::* )(  ) const)( &::ParticleInfo::getDepth ) )    
-        .def( 
-            "getParticle"
-            , (::Particle const * ( ::ParticleInfo::* )(  ) const)( &::ParticleInfo::getParticle )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getTransform3D"
-            , (::Geometry::Transform3D const * ( ::ParticleInfo::* )(  ) const)( &::ParticleInfo::getTransform3D )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "setAbundance"
-            , (void ( ::ParticleInfo::* )( double ) )( &::ParticleInfo::setAbundance )
-            , ( bp::arg("abundance") ) )    
-        .def( 
-            "setDepth"
-            , (void ( ::ParticleInfo::* )( double ) )( &::ParticleInfo::setDepth )
-            , ( bp::arg("depth") ) )    
-        .def( 
-            "setTransform"
-            , (void ( ::ParticleInfo::* )( ::Geometry::Transform3D const & ) )( &::ParticleInfo::setTransform )
-            , ( bp::arg("transform") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ParticleInfo_wrapper::* )(  ) )(&ParticleInfo_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ParticleInfo_wrapper::* )(  ) )(&ParticleInfo_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ParticleInfo_wrapper::* )(  ) const)(&ParticleInfo_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( ParticleInfo_wrapper::* )(  ) )(&ParticleInfo_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( ParticleInfo_wrapper::* )(  ) const)(&ParticleInfo_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ParticleInfo_wrapper::* )(  ) const)(&ParticleInfo_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( ParticleInfo_wrapper::* )(  ) )(&ParticleInfo_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ParticleInfo_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ParticleInfo_wrapper::* )( ::std::string const &,double ) )(&ParticleInfo_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ParticleInfo_wrapper::* )(  ) )(&ParticleInfo_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( ParticleInfo_wrapper::* )(  ) const)(&ParticleInfo_wrapper::default_size) );
+    { //::ParticleInfo
+        typedef bp::class_< ParticleInfo_wrapper, bp::bases< ICompositeSample >, boost::noncopyable > ParticleInfo_exposer_t;
+        ParticleInfo_exposer_t ParticleInfo_exposer = ParticleInfo_exposer_t( "ParticleInfo", bp::init< Particle const &, Geometry::PTransform3D const &, bp::optional< double, double > >(( bp::arg("p_particle"), bp::arg("transform"), bp::arg("depth")=0, bp::arg("abundance")=0 )) );
+        bp::scope ParticleInfo_scope( ParticleInfo_exposer );
+        ParticleInfo_exposer.def( bp::init< Particle const &, bp::optional< double, double > >(( bp::arg("p_particle"), bp::arg("depth")=0, bp::arg("abundance")=0 )) );
+        { //::ParticleInfo::clone
+        
+            typedef ::ParticleInfo * ( ::ParticleInfo::*clone_function_type )(  ) const;
+            typedef ::ParticleInfo * ( ParticleInfo_wrapper::*default_clone_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "clone"
+                , clone_function_type(&::ParticleInfo::clone)
+                , default_clone_function_type(&ParticleInfo_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ParticleInfo::getAbundance
+        
+            typedef double ( ::ParticleInfo::*getAbundance_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "getAbundance"
+                , getAbundance_function_type( &::ParticleInfo::getAbundance ) );
+        
+        }
+        { //::ParticleInfo::getDepth
+        
+            typedef double ( ::ParticleInfo::*getDepth_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "getDepth"
+                , getDepth_function_type( &::ParticleInfo::getDepth ) );
+        
+        }
+        { //::ParticleInfo::getPTransform3D
+        
+            typedef ::Geometry::PTransform3D const ( ::ParticleInfo::*getPTransform3D_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "getPTransform3D"
+                , getPTransform3D_function_type( &::ParticleInfo::getPTransform3D ) );
+        
+        }
+        { //::ParticleInfo::getParticle
+        
+            typedef ::Particle const * ( ::ParticleInfo::*getParticle_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "getParticle"
+                , getParticle_function_type( &::ParticleInfo::getParticle )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ParticleInfo::setAbundance
+        
+            typedef void ( ::ParticleInfo::*setAbundance_function_type )( double ) ;
+            
+            ParticleInfo_exposer.def( 
+                "setAbundance"
+                , setAbundance_function_type( &::ParticleInfo::setAbundance )
+                , ( bp::arg("abundance") ) );
+        
+        }
+        { //::ParticleInfo::setDepth
+        
+            typedef void ( ::ParticleInfo::*setDepth_function_type )( double ) ;
+            
+            ParticleInfo_exposer.def( 
+                "setDepth"
+                , setDepth_function_type( &::ParticleInfo::setDepth )
+                , ( bp::arg("depth") ) );
+        
+        }
+        { //::ParticleInfo::setTransform
+        
+            typedef void ( ::ParticleInfo::*setTransform_function_type )( ::Geometry::PTransform3D const & ) ;
+            
+            ParticleInfo_exposer.def( 
+                "setTransform"
+                , setTransform_function_type( &::ParticleInfo::setTransform )
+                , ( bp::arg("transform") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ParticleInfo_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ParticleInfo_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ParticleInfo_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ParticleInfo_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ParticleInfo_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ParticleInfo_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ParticleInfo_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ParticleInfo_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( ParticleInfo_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            ParticleInfo_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ParticleInfo_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( ParticleInfo_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&ParticleInfo_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ParticleInfo_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ParticleInfo_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ParticleInfo_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ParticleInfo_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ParticleInfo_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ParticleInfo_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ParticleInfo_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ParticleInfo_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ParticleInfo_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ParticleInfo_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( ParticleInfo_wrapper::*default_size_function_type )(  ) const;
+            
+            ParticleInfo_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&ParticleInfo_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/PositionParticleInfo.pypp.cpp b/Core/PythonAPI/src/PositionParticleInfo.pypp.cpp
index c0be766bbac000b465f77668b65b7717d72a869d..3bf887b5e8a05890462982137d961704ea6cb65d 100644
--- a/Core/PythonAPI/src/PositionParticleInfo.pypp.cpp
+++ b/Core/PythonAPI/src/PositionParticleInfo.pypp.cpp
@@ -1,92 +1,25 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "PositionParticleInfo.pypp.h"
 
 namespace bp = boost::python;
 
 struct PositionParticleInfo_wrapper : PositionParticleInfo, bp::wrapper< PositionParticleInfo > {
 
-    PositionParticleInfo_wrapper(::Particle const & particle, ::Geometry::Transform3D const & transform, ::kvector_t position, double abundance=0 )
-    : PositionParticleInfo( boost::ref(particle), boost::ref(transform), position, abundance )
+    PositionParticleInfo_wrapper(::Particle const & particle, ::Geometry::PTransform3D const & transform, ::kvector_t position, double abundance=0 )
+    : PositionParticleInfo( boost::ref(particle), transform, position, abundance )
       , bp::wrapper< PositionParticleInfo >(){
         // constructor
     
@@ -183,18 +116,6 @@ struct PositionParticleInfo_wrapper : PositionParticleInfo, bp::wrapper< Positio
         IParameterized::printParameters( );
     }
 
-    virtual void print_structure(  ) {
-        if( bp::override func_print_structure = this->get_override( "print_structure" ) )
-            func_print_structure(  );
-        else{
-            this->ISample::print_structure(  );
-        }
-    }
-    
-    void default_print_structure(  ) {
-        ISample::print_structure( );
-    }
-
     virtual void registerParameter( ::std::string const & name, double * parpointer ) {
         namespace bpl = boost::python;
         if( bpl::override func_registerParameter = this->get_override( "registerParameter" ) ){
@@ -254,71 +175,165 @@ struct PositionParticleInfo_wrapper : PositionParticleInfo, bp::wrapper< Positio
 
 void register_PositionParticleInfo_class(){
 
-    bp::class_< PositionParticleInfo_wrapper, bp::bases< ParticleInfo >, boost::noncopyable >( "PositionParticleInfo", bp::init< Particle const &, Geometry::Transform3D const &, kvector_t, bp::optional< double > >(( bp::arg("particle"), bp::arg("transform"), bp::arg("position"), bp::arg("abundance")=0 )) )    
-        .def( bp::init< Particle const &, kvector_t, bp::optional< double > >(( bp::arg("particle"), bp::arg("position"), bp::arg("abundance")=0 )) )    
-        .def( 
-            "clone"
-            , (::PositionParticleInfo * ( ::PositionParticleInfo::* )(  ) const)(&::PositionParticleInfo::clone)
-            , (::PositionParticleInfo * ( PositionParticleInfo_wrapper::* )(  ) const)(&PositionParticleInfo_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getParticle"
-            , (::Particle const * ( ::PositionParticleInfo::* )(  ) const)( &::PositionParticleInfo::getParticle )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getPosition"
-            , (::kvector_t ( ::PositionParticleInfo::* )(  ) const)( &::PositionParticleInfo::getPosition ) )    
-        .def( 
-            "setPosition"
-            , (void ( ::PositionParticleInfo::* )( ::kvector_t ) )( &::PositionParticleInfo::setPosition )
-            , ( bp::arg("position") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( PositionParticleInfo_wrapper::* )(  ) )(&PositionParticleInfo_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( PositionParticleInfo_wrapper::* )(  ) )(&PositionParticleInfo_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( PositionParticleInfo_wrapper::* )(  ) const)(&PositionParticleInfo_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample * ( ::ICompositeSample::* )(  ) )(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample * ( PositionParticleInfo_wrapper::* )(  ) )(&PositionParticleInfo_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getCompositeSample"
-            , (::ICompositeSample const * ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::getCompositeSample)
-            , (::ICompositeSample const * ( PositionParticleInfo_wrapper::* )(  ) const)(&PositionParticleInfo_wrapper::default_getCompositeSample)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( PositionParticleInfo_wrapper::* )(  ) const)(&PositionParticleInfo_wrapper::default_printParameters) )    
-        .def( 
-            "print_structure"
-            , (void ( ::ISample::* )(  ) )(&::ISample::print_structure)
-            , (void ( PositionParticleInfo_wrapper::* )(  ) )(&PositionParticleInfo_wrapper::default_print_structure) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &PositionParticleInfo_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( PositionParticleInfo_wrapper::* )( ::std::string const &,double ) )(&PositionParticleInfo_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( PositionParticleInfo_wrapper::* )(  ) )(&PositionParticleInfo_wrapper::default_setParametersAreChanged) )    
-        .def( 
-            "size"
-            , (::size_t ( ::ICompositeSample::* )(  ) const)(&::ICompositeSample::size)
-            , (::size_t ( PositionParticleInfo_wrapper::* )(  ) const)(&PositionParticleInfo_wrapper::default_size) );
+    { //::PositionParticleInfo
+        typedef bp::class_< PositionParticleInfo_wrapper, bp::bases< ParticleInfo >, boost::noncopyable > PositionParticleInfo_exposer_t;
+        PositionParticleInfo_exposer_t PositionParticleInfo_exposer = PositionParticleInfo_exposer_t( "PositionParticleInfo", bp::init< Particle const &, Geometry::PTransform3D const &, kvector_t, bp::optional< double > >(( bp::arg("particle"), bp::arg("transform"), bp::arg("position"), bp::arg("abundance")=0 )) );
+        bp::scope PositionParticleInfo_scope( PositionParticleInfo_exposer );
+        PositionParticleInfo_exposer.def( bp::init< Particle const &, kvector_t, bp::optional< double > >(( bp::arg("particle"), bp::arg("position"), bp::arg("abundance")=0 )) );
+        { //::PositionParticleInfo::clone
+        
+            typedef ::PositionParticleInfo * ( ::PositionParticleInfo::*clone_function_type )(  ) const;
+            typedef ::PositionParticleInfo * ( PositionParticleInfo_wrapper::*default_clone_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "clone"
+                , clone_function_type(&::PositionParticleInfo::clone)
+                , default_clone_function_type(&PositionParticleInfo_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::PositionParticleInfo::getParticle
+        
+            typedef ::Particle const * ( ::PositionParticleInfo::*getParticle_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "getParticle"
+                , getParticle_function_type( &::PositionParticleInfo::getParticle )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::PositionParticleInfo::getPosition
+        
+            typedef ::kvector_t ( ::PositionParticleInfo::*getPosition_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "getPosition"
+                , getPosition_function_type( &::PositionParticleInfo::getPosition ) );
+        
+        }
+        { //::PositionParticleInfo::setPosition
+        
+            typedef void ( ::PositionParticleInfo::*setPosition_function_type )( ::kvector_t ) ;
+            
+            PositionParticleInfo_exposer.def( 
+                "setPosition"
+                , setPosition_function_type( &::PositionParticleInfo::setPosition )
+                , ( bp::arg("position") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( PositionParticleInfo_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            PositionParticleInfo_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&PositionParticleInfo_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( PositionParticleInfo_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            PositionParticleInfo_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&PositionParticleInfo_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( PositionParticleInfo_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&PositionParticleInfo_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) ;
+            typedef ::ICompositeSample * ( PositionParticleInfo_wrapper::*default_getCompositeSample_function_type )(  ) ;
+            
+            PositionParticleInfo_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&PositionParticleInfo_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::ICompositeSample::getCompositeSample
+        
+            typedef ::ICompositeSample const * ( ::ICompositeSample::*getCompositeSample_function_type )(  ) const;
+            typedef ::ICompositeSample const * ( PositionParticleInfo_wrapper::*default_getCompositeSample_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "getCompositeSample"
+                , getCompositeSample_function_type(&::ICompositeSample::getCompositeSample)
+                , default_getCompositeSample_function_type(&PositionParticleInfo_wrapper::default_getCompositeSample)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( PositionParticleInfo_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&PositionParticleInfo_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            PositionParticleInfo_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &PositionParticleInfo_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( PositionParticleInfo_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            PositionParticleInfo_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&PositionParticleInfo_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( PositionParticleInfo_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            PositionParticleInfo_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&PositionParticleInfo_wrapper::default_setParametersAreChanged) );
+        
+        }
+        { //::ICompositeSample::size
+        
+            typedef ::size_t ( ::ICompositeSample::*size_function_type )(  ) const;
+            typedef ::size_t ( PositionParticleInfo_wrapper::*default_size_function_type )(  ) const;
+            
+            PositionParticleInfo_exposer.def( 
+                "size"
+                , size_function_type(&::ICompositeSample::size)
+                , default_size_function_type(&PositionParticleInfo_wrapper::default_size) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/PythonPlusplusHelper.cpp b/Core/PythonAPI/src/PythonCoreExposer.cpp
similarity index 50%
rename from Core/PythonAPI/src/PythonPlusplusHelper.cpp
rename to Core/PythonAPI/src/PythonCoreExposer.cpp
index 151dde965ed578685abd3ffc05245e4347b0efc4..1a0a4137f3f0cdf8127b5e7e9dd8e38a5e725b4d 100644
--- a/Core/PythonAPI/src/PythonPlusplusHelper.cpp
+++ b/Core/PythonAPI/src/PythonCoreExposer.cpp
@@ -13,29 +13,26 @@
 //
 // ************************************************************************** //
 
-#include "PythonPlusplusHelper.h"
-#include "OpticalFresnel.h"
+#include "PythonCoreExposer.h"
 
-//! operator== is necessary to make pyplusplus/boost happy during exposing of FresnelCoeff to python using boost::vector_indexing_suite
-bool OpticalFresnel::FresnelCoeff::operator==(OpticalFresnel::FresnelCoeff const& other) const
-{
-    if(kz != other.kz ||
-       r  != other.r  ||
-       t  != other.t  ||
-       rb != other.rb ||
-       tb != other.tb ||
-       X  != other.X  ||
-       R  != other.R  ||
-       T  != other.T )
-    {
-        return false;
-    } else {
-        return true;
-    }
-}
-
-
-//template BasicVector3D<double> operator/ <double, double> (const BasicVector3D<double>& v, double a);
+//#include "OpticalFresnel.h"
+// operator== is necessary to make pyplusplus/boost happy during exposing of FresnelCoeff to python using boost::vector_indexing_suite
+//bool OpticalFresnel::FresnelCoeff::operator==(OpticalFresnel::FresnelCoeff const& other) const
+//{
+//    if(kz != other.kz ||
+//       r  != other.r  ||
+//       t  != other.t  ||
+//       rb != other.rb ||
+//       tb != other.tb ||
+//       X  != other.X  ||
+//       R  != other.R  ||
+//       T  != other.T )
+//    {
+//        return false;
+//    } else {
+//        return true;
+//    }
+//}
 
 
 
diff --git a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
index ea9e68f12e1c56d619105f169effe436dacbc12f..3bad3113fb18596a94eced00a426f9db4a214f17 100644
--- a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
+++ b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
@@ -1,88 +1,32 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "PythonInterface_free_functions.pypp.h"
 
 namespace bp = boost::python;
 
 void register_free_functions(){
 
+    { //::MathFunctions::GenerateNormalRandom
+    
+        typedef double ( *GenerateNormalRandom_function_type )( double,double );
+        
+        bp::def( 
+            "GenerateNormalRandom"
+            , GenerateNormalRandom_function_type( &::MathFunctions::GenerateNormalRandom )
+            , ( bp::arg("average"), bp::arg("std_dev") ) );
+    
+    }
+
     { //::GetOutputData
     
         typedef ::PyObject * ( *GetOutputData_function_type )( ::Simulation const & );
diff --git a/Core/PythonAPI/src/PythonInterface_global_variables.pypp.cpp b/Core/PythonAPI/src/PythonInterface_global_variables.pypp.cpp
index 5a9a331b7dcab3d17118232f278c753af22a4cac..5d1add1c3715c32e564ef88a0b5a13bcb4548e71 100644
--- a/Core/PythonAPI/src/PythonInterface_global_variables.pypp.cpp
+++ b/Core/PythonAPI/src/PythonInterface_global_variables.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "PythonInterface_global_variables.pypp.h"
 
 namespace bp = boost::python;
@@ -97,12 +30,6 @@ void register_global_variables(){
 
     bp::scope().attr("degree") = Units::degree;
 
-    bp::scope().attr("dumm32") = pyplusplus::aliases::dumm32;
-
-    bp::scope().attr("dummy1") = pyplusplus::aliases::dummy1;
-
-    bp::scope().attr("dummy2") = pyplusplus::aliases::dummy2;
-
     bp::scope().attr("meter") = Units::meter;
 
     bp::scope().attr("micrometer") = Units::micrometer;
diff --git a/Core/PythonAPI/src/PythonModule.cpp b/Core/PythonAPI/src/PythonModule.cpp
index 9ac7538d0e9cb81601a00d07d4f7d4579713b3ca..70193c43aeb9bdd2d6c65ca515e397e1d0833d42 100644
--- a/Core/PythonAPI/src/PythonModule.cpp
+++ b/Core/PythonAPI/src/PythonModule.cpp
@@ -1,99 +1,96 @@
 #include "Python.h"
-#define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY 
 #include "numpy/arrayobject.h"
 // the order of 3 guys above is important
 
-#include "Bin1D.pypp.h"
-#include "Bin1DCVector.pypp.h"
-#include "Crystal.pypp.h"
-#include "cvector_t.pypp.h"
-#include "DiffuseDWBASimulation.pypp.h"
-#include "DiffuseParticleInfo.pypp.h"
-#include "FormFactorBox.pypp.h"
-#include "FormFactorCrystal.pypp.h"
-#include "FormFactorCylinder.pypp.h"
-#include "FormFactorDecoratorDebyeWaller.pypp.h"
-#include "FormFactorFullSphere.pypp.h"
-#include "FormFactorGauss.pypp.h"
-#include "FormFactorLorentz.pypp.h"
-#include "FormFactorParallelepiped.pypp.h"
-#include "FormFactorPrism3.pypp.h"
-#include "FormFactorPyramid.pypp.h"
-#include "FormFactorSphereGaussianRadius.pypp.h"
-#include "FTDistribution2DCauchy.pypp.h"
-#include "HomogeneousMaterial.pypp.h"
-#include "ICloneable.pypp.h"
-#include "IClusteredParticles.pypp.h"
-#include "ICompositeSample.pypp.h"
-#include "IDecoration.pypp.h"
-#include "IFormFactor.pypp.h"
-#include "IFormFactorBorn.pypp.h"
-#include "IFormFactorDecorator.pypp.h"
-#include "IFTDistribution1D.pypp.h"
-#include "IFTDistribution2D.pypp.h"
-#include "IInterferenceFunction.pypp.h"
-#include "IMaterial.pypp.h"
-#include "IndexVector3D.pypp.h"
-#include "Instrument.pypp.h"
-#include "InterferenceFunction1DParaCrystal.pypp.h"
-#include "InterferenceFunction2DLattice.pypp.h"
-#include "InterferenceFunction2DParaCrystal.pypp.h"
-#include "InterferenceFunctionNone.pypp.h"
-#include "IParameterized.pypp.h"
-#include "IResolutionFunction2D.pypp.h"
-#include "ISample.pypp.h"
-#include "ISampleBuilder.pypp.h"
-#include "ISelectionRule.pypp.h"
-#include "ISimulation.pypp.h"
-#include "IStochasticParameter.pypp.h"
-#include "kvector_t.pypp.h"
-#include "Lattice.pypp.h"
-#include "Lattice2DIFParameters.pypp.h"
-#include "LatticeBasis.pypp.h"
-#include "Layer.pypp.h"
-#include "LayerDecorator.pypp.h"
-#include "LayerDecoratorDWBASimulation.pypp.h"
-#include "LayerDWBASimulation.pypp.h"
-#include "LayerRoughness.pypp.h"
-#include "MaterialManager.pypp.h"
-#include "MaterialManagerSingleton_t.pypp.h"
-#include "MesoCrystal.pypp.h"
-#include "MultiLayer.pypp.h"
-#include "MultiLayerDWBASimulation.pypp.h"
-#include "ndimdata_t.pypp.h"
-#include "OpticalFresnel.pypp.h"
-#include "OutputDataIOFactory.pypp.h"
-#include "ParameterPool.pypp.h"
-#include "Particle.pypp.h"
-#include "ParticleBuilder.pypp.h"
-#include "ParticleCoreShell.pypp.h"
-#include "ParticleDecoration.pypp.h"
-#include "ParticleInfo.pypp.h"
-#include "PositionParticleInfo.pypp.h"
-#include "PythonInterface_free_functions.pypp.h"
-#include "PythonInterface_global_variables.pypp.h"
-#include "RealParameterWrapper.pypp.h"
-#include "ResolutionFunction2DSimple.pypp.h"
-#include "Rotate3D.pypp.h"
-#include "RotateX3D.pypp.h"
-#include "RotateY3D.pypp.h"
-#include "RotateZ3D.pypp.h"
-#include "SimpleSelectionRule.pypp.h"
-#include "Simulation.pypp.h"
-#include "SimulationParameters.pypp.h"
-#include "StochasticDoubleGate.pypp.h"
-#include "StochasticDoubleGaussian.pypp.h"
-#include "StochasticParameter_t.pypp.h"
-#include "StochasticSampledParameter.pypp.h"
-#include "Transform3D.pypp.h"
-#include "vdouble1d_t.pypp.h"
-#include "vector_DiffuseParticleInfoPtr_t.pypp.h"
-#include "vector_IFormFactorPtr_t.pypp.h"
-#include "vector_integer_t.pypp.h"
-#include "vector_kvector_t.pypp.h"
-#include "vector_longinteger_t.pypp.h"
-#include "__call_policies.pypp.hpp"
-#include "__convenience.pypp.hpp"
+#include "Beam.pypp.h" 
+#include "Bin1D.pypp.h" 
+#include "Bin1DCVector.pypp.h" 
+#include "Crystal.pypp.h" 
+#include "cvector_t.pypp.h" 
+#include "Detector.pypp.h" 
+#include "FormFactorBox.pypp.h" 
+#include "FormFactorCone.pypp.h" 
+#include "FormFactorCrystal.pypp.h" 
+#include "FormFactorCylinder.pypp.h" 
+#include "FormFactorDecoratorDebyeWaller.pypp.h" 
+#include "FormFactorEllipsoid.pypp.h" 
+#include "FormFactorFullSphere.pypp.h" 
+#include "FormFactorFullSpheroid.pypp.h" 
+#include "FormFactorGauss.pypp.h" 
+#include "FormFactorHemiSpheroid.pypp.h" 
+#include "FormFactorLorentz.pypp.h" 
+#include "FormFactorParallelepiped.pypp.h" 
+#include "FormFactorPrism3.pypp.h" 
+#include "FormFactorPrism6.pypp.h" 
+#include "FormFactorPyramid.pypp.h" 
+#include "FormFactorSphere.pypp.h" 
+#include "FormFactorSphereGaussianRadius.pypp.h" 
+#include "FTDistribution2DCauchy.pypp.h" 
+#include "HomogeneousMaterial.pypp.h" 
+#include "IAxis.pypp.h" 
+#include "ICloneable.pypp.h" 
+#include "IClusteredParticles.pypp.h" 
+#include "ICompositeSample.pypp.h" 
+#include "IDecoration.pypp.h" 
+#include "IDetectorResolution.pypp.h" 
+#include "IFormFactor.pypp.h" 
+#include "IFormFactorBorn.pypp.h" 
+#include "IFormFactorDecorator.pypp.h" 
+#include "IFTDistribution2D.pypp.h" 
+#include "IInterferenceFunction.pypp.h" 
+#include "IMaterial.pypp.h" 
+#include "Instrument.pypp.h" 
+#include "InterferenceFunction1DParaCrystal.pypp.h" 
+#include "InterferenceFunction2DLattice.pypp.h" 
+#include "InterferenceFunction2DParaCrystal.pypp.h" 
+#include "InterferenceFunctionNone.pypp.h" 
+#include "IParameterized.pypp.h" 
+#include "IResolutionFunction2D.pypp.h" 
+#include "ISample.pypp.h" 
+#include "ISampleBuilder.pypp.h" 
+#include "ISelectionRule.pypp.h" 
+#include "ITransform3D.pypp.h" 
+#include "kvector_t.pypp.h" 
+#include "Lattice.pypp.h" 
+#include "Lattice2DIFParameters.pypp.h" 
+#include "LatticeBasis.pypp.h" 
+#include "Layer.pypp.h" 
+#include "LayerDecorator.pypp.h" 
+#include "LayerInterface.pypp.h" 
+#include "LayerRoughness.pypp.h" 
+#include "MaterialManager.pypp.h" 
+#include "MesoCrystal.pypp.h" 
+#include "MultiLayer.pypp.h" 
+#include "ndimdata_t.pypp.h" 
+#include "OutputDataIOFactory.pypp.h" 
+#include "ParameterPool.pypp.h" 
+#include "Particle.pypp.h" 
+#include "ParticleBuilder.pypp.h" 
+#include "ParticleCoreShell.pypp.h" 
+#include "ParticleDecoration.pypp.h" 
+#include "ParticleInfo.pypp.h" 
+#include "PositionParticleInfo.pypp.h" 
+#include "PythonInterface_free_functions.pypp.h" 
+#include "PythonInterface_global_variables.pypp.h" 
+#include "RealParameterWrapper.pypp.h" 
+#include "ResolutionFunction2DSimple.pypp.h" 
+#include "RotateY_3D.pypp.h" 
+#include "RotateZ_3D.pypp.h" 
+#include "SimpleSelectionRule.pypp.h" 
+#include "Simulation.pypp.h" 
+#include "SimulationParameters.pypp.h" 
+#include "StochasticDoubleGate.pypp.h" 
+#include "StochasticDoubleGaussian.pypp.h" 
+#include "StochasticParameter_t.pypp.h" 
+#include "StochasticSampledParameter.pypp.h" 
+#include "vdouble1d_t.pypp.h" 
+#include "vector_IFormFactorPtr_t.pypp.h" 
+#include "vector_integer_t.pypp.h" 
+#include "vector_kvector_t.pypp.h" 
+#include "vector_longinteger_t.pypp.h" 
+#include "__call_policies.pypp.hpp" 
+#include "__convenience.pypp.hpp" 
 
 #include "PythonListConverter.h"
 
@@ -104,54 +101,52 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     register_vdouble1d_t_class();
     register_vector_IFormFactorPtr_t_class();
     register_vector_kvector_t_class();
-    register_vector_DiffuseParticleInfoPtr_t_class();
+    register_IParameterized_class();
+    register_Beam_class();
     register_Bin1D_class();
     register_Bin1DCVector_class();
     register_ICloneable_class();
-    register_IParameterized_class();
     register_ISample_class();
     register_ICompositeSample_class();
     register_IClusteredParticles_class();
     register_Crystal_class();
-    register_LayerDWBASimulation_class();
-    register_DiffuseDWBASimulation_class();
-    register_Transform3D_class();
-    register_ParticleInfo_class();
-    register_DiffuseParticleInfo_class();
+    register_Detector_class();
     register_IFTDistribution2D_class();
     register_FTDistribution2DCauchy_class();
     register_IFormFactor_class();
     register_IFormFactorBorn_class();
     register_FormFactorBox_class();
+    register_FormFactorCone_class();
     register_FormFactorCrystal_class();
     register_FormFactorCylinder_class();
     register_IFormFactorDecorator_class();
     register_FormFactorDecoratorDebyeWaller_class();
+    register_FormFactorEllipsoid_class();
     register_FormFactorFullSphere_class();
+    register_FormFactorFullSpheroid_class();
     register_FormFactorGauss_class();
+    register_FormFactorHemiSpheroid_class();
     register_FormFactorLorentz_class();
     register_FormFactorParallelepiped_class();
     register_FormFactorPrism3_class();
+    register_FormFactorPrism6_class();
     register_FormFactorPyramid_class();
+    register_FormFactorSphere_class();
     register_FormFactorSphereGaussianRadius_class();
     register_kvector_t_class();
-    register_IndexVector3D_class();
     register_cvector_t_class();
-    register_Rotate3D_class();
-    register_RotateX3D_class();
-    register_RotateY3D_class();
-    register_RotateZ3D_class();
+    register_ITransform3D_class();
+    register_RotateY_3D_class();
+    register_RotateZ_3D_class();
     register_IMaterial_class();
     register_HomogeneousMaterial_class();
+    register_IAxis_class();
     register_IDecoration_class();
-    register_IFTDistribution1D_class();
+    register_IDetectorResolution_class();
     register_IInterferenceFunction_class();
     register_IResolutionFunction2D_class();
     register_ISampleBuilder_class();
     register_ISelectionRule_class();
-    register_ISimulation_class();
-    register_MaterialManagerSingleton_t_class();
-    register_IStochasticParameter_class();
     register_Instrument_class();
     register_InterferenceFunction1DParaCrystal_class();
     register_InterferenceFunction2DLattice_class();
@@ -163,19 +158,18 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     register_LatticeBasis_class();
     register_Layer_class();
     register_LayerDecorator_class();
-    register_LayerDecoratorDWBASimulation_class();
+    register_LayerInterface_class();
     register_LayerRoughness_class();
     register_MaterialManager_class();
     register_MesoCrystal_class();
     register_MultiLayer_class();
-    register_MultiLayerDWBASimulation_class();
-    register_OpticalFresnel_class();
     register_ndimdata_t_class();
     register_OutputDataIOFactory_class();
     register_ParameterPool_class();
     register_ParticleBuilder_class();
     register_ParticleCoreShell_class();
     register_ParticleDecoration_class();
+    register_ParticleInfo_class();
     register_PositionParticleInfo_class();
     register_RealParameterWrapper_class();
     register_ResolutionFunction2DSimple_class();
@@ -201,5 +195,3 @@ BOOST_PYTHON_MODULE(libBornAgainCore){
     http://docs.scipy.org/doc/numpy/reference/c-api.array.html#import_array
     */
 }
-
-
diff --git a/Core/PythonAPI/src/RealParameterWrapper.pypp.cpp b/Core/PythonAPI/src/RealParameterWrapper.pypp.cpp
index e0f208dc8270578d97187566c3926efc7adc1556..de90d64ef19bbbcb1f3fb8e3c14ca98fa0667a7f 100644
--- a/Core/PythonAPI/src/RealParameterWrapper.pypp.cpp
+++ b/Core/PythonAPI/src/RealParameterWrapper.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "RealParameterWrapper.pypp.h"
 
 namespace bp = boost::python;
@@ -127,7 +60,6 @@ void register_RealParameterWrapper_class(){
                 , ( bp::arg("value") ) );
         
         }
-        RealParameterWrapper_exposer.def( bp::self_ns::str( bp::self ) );
     }
 
 }
diff --git a/Core/PythonAPI/src/ResolutionFunction2DSimple.pypp.cpp b/Core/PythonAPI/src/ResolutionFunction2DSimple.pypp.cpp
index a2bd416c6f3c48692bca0c5767573d7f0c2196f8..c607587eab0ffd99e151b0118fc973e1cf0132c8 100644
--- a/Core/PythonAPI/src/ResolutionFunction2DSimple.pypp.cpp
+++ b/Core/PythonAPI/src/ResolutionFunction2DSimple.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ResolutionFunction2DSimple.pypp.h"
 
 namespace bp = boost::python;
@@ -211,46 +144,112 @@ struct ResolutionFunction2DSimple_wrapper : ResolutionFunction2DSimple, bp::wrap
 
 void register_ResolutionFunction2DSimple_class(){
 
-    bp::class_< ResolutionFunction2DSimple_wrapper, bp::bases< IResolutionFunction2D >, boost::noncopyable >( "ResolutionFunction2DSimple", bp::init< double, double >(( bp::arg("sigma_x"), bp::arg("sigma_y") )) )    
-        .def( 
-            "clone"
-            , (::ResolutionFunction2DSimple * ( ::ResolutionFunction2DSimple::* )(  ) const)(&::ResolutionFunction2DSimple::clone)
-            , (::ResolutionFunction2DSimple * ( ResolutionFunction2DSimple_wrapper::* )(  ) const)(&ResolutionFunction2DSimple_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "evaluateCDF"
-            , (double ( ::ResolutionFunction2DSimple::* )( double,double ) const)(&::ResolutionFunction2DSimple::evaluateCDF)
-            , (double ( ResolutionFunction2DSimple_wrapper::* )( double,double ) const)(&ResolutionFunction2DSimple_wrapper::default_evaluateCDF)
-            , ( bp::arg("x"), bp::arg("y") ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( ResolutionFunction2DSimple_wrapper::* )(  ) )(&ResolutionFunction2DSimple_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( ResolutionFunction2DSimple_wrapper::* )(  ) )(&ResolutionFunction2DSimple_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( ResolutionFunction2DSimple_wrapper::* )(  ) const)(&ResolutionFunction2DSimple_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( ResolutionFunction2DSimple_wrapper::* )(  ) const)(&ResolutionFunction2DSimple_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &ResolutionFunction2DSimple_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( ResolutionFunction2DSimple_wrapper::* )( ::std::string const &,double ) )(&ResolutionFunction2DSimple_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( ResolutionFunction2DSimple_wrapper::* )(  ) )(&ResolutionFunction2DSimple_wrapper::default_setParametersAreChanged) );
+    { //::ResolutionFunction2DSimple
+        typedef bp::class_< ResolutionFunction2DSimple_wrapper, bp::bases< IResolutionFunction2D >, boost::noncopyable > ResolutionFunction2DSimple_exposer_t;
+        ResolutionFunction2DSimple_exposer_t ResolutionFunction2DSimple_exposer = ResolutionFunction2DSimple_exposer_t( "ResolutionFunction2DSimple", bp::init< double, double >(( bp::arg("sigma_x"), bp::arg("sigma_y") )) );
+        bp::scope ResolutionFunction2DSimple_scope( ResolutionFunction2DSimple_exposer );
+        { //::ResolutionFunction2DSimple::clone
+        
+            typedef ::ResolutionFunction2DSimple * ( ::ResolutionFunction2DSimple::*clone_function_type )(  ) const;
+            typedef ::ResolutionFunction2DSimple * ( ResolutionFunction2DSimple_wrapper::*default_clone_function_type )(  ) const;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "clone"
+                , clone_function_type(&::ResolutionFunction2DSimple::clone)
+                , default_clone_function_type(&ResolutionFunction2DSimple_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ResolutionFunction2DSimple::evaluateCDF
+        
+            typedef double ( ::ResolutionFunction2DSimple::*evaluateCDF_function_type )( double,double ) const;
+            typedef double ( ResolutionFunction2DSimple_wrapper::*default_evaluateCDF_function_type )( double,double ) const;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "evaluateCDF"
+                , evaluateCDF_function_type(&::ResolutionFunction2DSimple::evaluateCDF)
+                , default_evaluateCDF_function_type(&ResolutionFunction2DSimple_wrapper::default_evaluateCDF)
+                , ( bp::arg("x"), bp::arg("y") ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( ResolutionFunction2DSimple_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&ResolutionFunction2DSimple_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( ResolutionFunction2DSimple_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&ResolutionFunction2DSimple_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( ResolutionFunction2DSimple_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&ResolutionFunction2DSimple_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( ResolutionFunction2DSimple_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&ResolutionFunction2DSimple_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &ResolutionFunction2DSimple_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( ResolutionFunction2DSimple_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&ResolutionFunction2DSimple_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( ResolutionFunction2DSimple_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            ResolutionFunction2DSimple_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&ResolutionFunction2DSimple_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Rotate3D.pypp.cpp b/Core/PythonAPI/src/Rotate3D.pypp.cpp
deleted file mode 100644
index 845dc0d7e70015b99e84f0ff96f207eb8adc1180..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/Rotate3D.pypp.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "Rotate3D.pypp.h"
-
-namespace bp = boost::python;
-
-void register_Rotate3D_class(){
-
-    bp::class_< Geometry::Rotate3D, bp::bases< Geometry::Transform3D > >( "Rotate3D", bp::init< >() )    
-        .def( bp::init< double, Geometry::BasicVector3D< double > const &, Geometry::BasicVector3D< double > const & >(( bp::arg("a"), bp::arg("p1"), bp::arg("p2") )) )    
-        .def( bp::init< double, Geometry::BasicVector3D< double > const & >(( bp::arg("a"), bp::arg("v") )) );
-
-}
diff --git a/Core/PythonAPI/src/RotateX3D.pypp.cpp b/Core/PythonAPI/src/RotateX3D.pypp.cpp
deleted file mode 100644
index a7df8abb6e02c709f9bc4065eba241f67ac139a8..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/RotateX3D.pypp.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "RotateX3D.pypp.h"
-
-namespace bp = boost::python;
-
-void register_RotateX3D_class(){
-
-    bp::class_< Geometry::RotateX3D, bp::bases< Geometry::Rotate3D > >( "RotateX3D", bp::init< >() )    
-        .def( bp::init< double >(( bp::arg("a") )) );
-
-}
diff --git a/Core/PythonAPI/src/RotateY3D.pypp.cpp b/Core/PythonAPI/src/RotateY3D.pypp.cpp
deleted file mode 100644
index 814c5a146724afaa9cde07d8262e75f41c336982..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/RotateY3D.pypp.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "RotateY3D.pypp.h"
-
-namespace bp = boost::python;
-
-void register_RotateY3D_class(){
-
-    bp::class_< Geometry::RotateY3D, bp::bases< Geometry::Rotate3D > >( "RotateY3D", bp::init< >() )    
-        .def( bp::init< double >(( bp::arg("a") )) );
-
-}
diff --git a/Core/PythonAPI/src/RotateY_3D.pypp.cpp b/Core/PythonAPI/src/RotateY_3D.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6e5f4d29836e4457b904e226a981e7b3026df602
--- /dev/null
+++ b/Core/PythonAPI/src/RotateY_3D.pypp.cpp
@@ -0,0 +1,67 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "PythonCoreList.h"
+#include "RotateY_3D.pypp.h"
+
+namespace bp = boost::python;
+
+struct RotateY_3D_wrapper : Geometry::RotateY_3D, bp::wrapper< Geometry::RotateY_3D > {
+
+    RotateY_3D_wrapper(Geometry::RotateY_3D const & arg )
+    : Geometry::RotateY_3D( arg )
+      , bp::wrapper< Geometry::RotateY_3D >(){
+        // copy constructor
+        
+    }
+
+    RotateY_3D_wrapper(double a )
+    : Geometry::RotateY_3D( a )
+      , bp::wrapper< Geometry::RotateY_3D >(){
+        // constructor
+    
+    }
+
+    virtual void print( ::std::ostream & ostr ) const  {
+        if( bp::override func_print = this->get_override( "print" ) )
+            func_print( boost::ref(ostr) );
+        else{
+            this->Geometry::RotateY_3D::print( boost::ref(ostr) );
+        }
+    }
+    
+    void default_print( ::std::ostream & ostr ) const  {
+        Geometry::RotateY_3D::print( boost::ref(ostr) );
+    }
+
+};
+
+void register_RotateY_3D_class(){
+
+    { //::Geometry::RotateY_3D
+        typedef bp::class_< RotateY_3D_wrapper, bp::bases< Geometry::ITransform3D > > RotateY_3D_exposer_t;
+        RotateY_3D_exposer_t RotateY_3D_exposer = RotateY_3D_exposer_t( "RotateY_3D", bp::init< double >(( bp::arg("a") )) );
+        bp::scope RotateY_3D_scope( RotateY_3D_exposer );
+        { //::Geometry::RotateY_3D::print
+        
+            typedef void ( ::Geometry::RotateY_3D::*print_function_type )( ::std::ostream & ) const;
+            typedef void ( RotateY_3D_wrapper::*default_print_function_type )( ::std::ostream & ) const;
+            
+            RotateY_3D_exposer.def( 
+                "print"
+                , print_function_type(&::Geometry::RotateY_3D::print)
+                , default_print_function_type(&RotateY_3D_wrapper::default_print)
+                , ( bp::arg("ostr") ) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/RotateZ_3D.pypp.cpp b/Core/PythonAPI/src/RotateZ_3D.pypp.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..659a51c1edbabe49952091a365e69788ea4664a8
--- /dev/null
+++ b/Core/PythonAPI/src/RotateZ_3D.pypp.cpp
@@ -0,0 +1,67 @@
+// This file has been generated by Py++.
+
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
+#include "Macros.h"
+GCC_DIAG_OFF(unused-parameter);
+GCC_DIAG_OFF(missing-field-initializers);
+#include "boost/python.hpp"
+GCC_DIAG_ON(unused-parameter);
+GCC_DIAG_ON(missing-field-initializers);
+#include "PythonCoreList.h"
+#include "RotateZ_3D.pypp.h"
+
+namespace bp = boost::python;
+
+struct RotateZ_3D_wrapper : Geometry::RotateZ_3D, bp::wrapper< Geometry::RotateZ_3D > {
+
+    RotateZ_3D_wrapper(Geometry::RotateZ_3D const & arg )
+    : Geometry::RotateZ_3D( arg )
+      , bp::wrapper< Geometry::RotateZ_3D >(){
+        // copy constructor
+        
+    }
+
+    RotateZ_3D_wrapper(double a )
+    : Geometry::RotateZ_3D( a )
+      , bp::wrapper< Geometry::RotateZ_3D >(){
+        // constructor
+    
+    }
+
+    virtual void print( ::std::ostream & ostr ) const  {
+        if( bp::override func_print = this->get_override( "print" ) )
+            func_print( boost::ref(ostr) );
+        else{
+            this->Geometry::RotateZ_3D::print( boost::ref(ostr) );
+        }
+    }
+    
+    void default_print( ::std::ostream & ostr ) const  {
+        Geometry::RotateZ_3D::print( boost::ref(ostr) );
+    }
+
+};
+
+void register_RotateZ_3D_class(){
+
+    { //::Geometry::RotateZ_3D
+        typedef bp::class_< RotateZ_3D_wrapper, bp::bases< Geometry::ITransform3D > > RotateZ_3D_exposer_t;
+        RotateZ_3D_exposer_t RotateZ_3D_exposer = RotateZ_3D_exposer_t( "RotateZ_3D", bp::init< double >(( bp::arg("a") )) );
+        bp::scope RotateZ_3D_scope( RotateZ_3D_exposer );
+        { //::Geometry::RotateZ_3D::print
+        
+            typedef void ( ::Geometry::RotateZ_3D::*print_function_type )( ::std::ostream & ) const;
+            typedef void ( RotateZ_3D_wrapper::*default_print_function_type )( ::std::ostream & ) const;
+            
+            RotateZ_3D_exposer.def( 
+                "print"
+                , print_function_type(&::Geometry::RotateZ_3D::print)
+                , default_print_function_type(&RotateZ_3D_wrapper::default_print)
+                , ( bp::arg("ostr") ) );
+        
+        }
+    }
+
+}
diff --git a/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp b/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp
index a00043f9ff96d160fd25224387281671ce946e9b..cb07c7da7f228d0ed0627c2ad86dc6ba479e1229 100644
--- a/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp
+++ b/Core/PythonAPI/src/SimpleSelectionRule.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "SimpleSelectionRule.pypp.h"
 
 namespace bp = boost::python;
@@ -125,16 +58,34 @@ struct SimpleSelectionRule_wrapper : SimpleSelectionRule, bp::wrapper< SimpleSel
 
 void register_SimpleSelectionRule_class(){
 
-    bp::class_< SimpleSelectionRule_wrapper, bp::bases< ISelectionRule > >( "SimpleSelectionRule", bp::init< int, int, int, int >(( bp::arg("a"), bp::arg("b"), bp::arg("c"), bp::arg("modulus") )) )    
-        .def( 
-            "clone"
-            , (::SimpleSelectionRule * ( ::SimpleSelectionRule::* )(  ) const)(&::SimpleSelectionRule::clone)
-            , (::SimpleSelectionRule * ( SimpleSelectionRule_wrapper::* )(  ) const)(&SimpleSelectionRule_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "coordinateSelected"
-            , (bool ( ::SimpleSelectionRule::* )( ::IndexVector3D const & ) const)(&::SimpleSelectionRule::coordinateSelected)
-            , (bool ( SimpleSelectionRule_wrapper::* )( ::IndexVector3D const & ) const)(&SimpleSelectionRule_wrapper::default_coordinateSelected)
-            , ( bp::arg("coordinate") ) );
+    { //::SimpleSelectionRule
+        typedef bp::class_< SimpleSelectionRule_wrapper, bp::bases< ISelectionRule > > SimpleSelectionRule_exposer_t;
+        SimpleSelectionRule_exposer_t SimpleSelectionRule_exposer = SimpleSelectionRule_exposer_t( "SimpleSelectionRule", bp::init< int, int, int, int >(( bp::arg("a"), bp::arg("b"), bp::arg("c"), bp::arg("modulus") )) );
+        bp::scope SimpleSelectionRule_scope( SimpleSelectionRule_exposer );
+        { //::SimpleSelectionRule::clone
+        
+            typedef ::SimpleSelectionRule * ( ::SimpleSelectionRule::*clone_function_type )(  ) const;
+            typedef ::SimpleSelectionRule * ( SimpleSelectionRule_wrapper::*default_clone_function_type )(  ) const;
+            
+            SimpleSelectionRule_exposer.def( 
+                "clone"
+                , clone_function_type(&::SimpleSelectionRule::clone)
+                , default_clone_function_type(&SimpleSelectionRule_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::SimpleSelectionRule::coordinateSelected
+        
+            typedef bool ( ::SimpleSelectionRule::*coordinateSelected_function_type )( ::IndexVector3D const & ) const;
+            typedef bool ( SimpleSelectionRule_wrapper::*default_coordinateSelected_function_type )( ::IndexVector3D const & ) const;
+            
+            SimpleSelectionRule_exposer.def( 
+                "coordinateSelected"
+                , coordinateSelected_function_type(&::SimpleSelectionRule::coordinateSelected)
+                , default_coordinateSelected_function_type(&SimpleSelectionRule_wrapper::default_coordinateSelected)
+                , ( bp::arg("coordinate") ) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Simulation.pypp.cpp b/Core/PythonAPI/src/Simulation.pypp.cpp
index b591130ee1d4249b6a4a3314d462fef65aca308e..4a0a0b5b561ff3efd20fe0149a6807c07dfa9fc4 100644
--- a/Core/PythonAPI/src/Simulation.pypp.cpp
+++ b/Core/PythonAPI/src/Simulation.pypp.cpp
@@ -1,84 +1,17 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 #include "__call_policies.pypp.hpp"
 #include "__convenience.pypp.hpp"
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "Simulation.pypp.h"
 
 namespace bp = boost::python;
@@ -199,116 +132,295 @@ struct Simulation_wrapper : Simulation, bp::wrapper< Simulation > {
 
 void register_Simulation_class(){
 
-    bp::class_< Simulation_wrapper, bp::bases< IParameterized, ICloneable >, boost::noncopyable >( "Simulation", bp::init< >() )    
-        .def( 
-            "clone"
-            , (::Simulation * ( ::Simulation::* )(  ) const)(&::Simulation::clone)
-            , (::Simulation * ( Simulation_wrapper::* )(  ) const)(&Simulation_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getInstrument"
-            , (::Instrument const & ( ::Simulation::* )(  ) const)( &::Simulation::getInstrument )
-            , bp::return_value_policy< bp::copy_const_reference >() )    
-        .def( 
-            "getOutputData"
-            , (::OutputData< double > const * ( ::Simulation::* )(  ) const)( &::Simulation::getOutputData )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getOutputDataClone"
-            , (::OutputData< double > * ( ::Simulation::* )(  ) const)( &::Simulation::getOutputDataClone )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getSample"
-            , (::ISample * ( ::Simulation::* )(  ) const)( &::Simulation::getSample )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getSimulationParameters"
-            , (::SimulationParameters ( ::Simulation::* )(  ) const)( &::Simulation::getSimulationParameters ) )    
-        .def( 
-            "normalize"
-            , (void ( ::Simulation::* )(  ) )( &::Simulation::normalize ) )    
-        .def( 
-            "prepareSimulation"
-            , (void ( ::Simulation::* )(  ) )( &::Simulation::prepareSimulation ) )    
-        .def( 
-            "runSimulation"
-            , (void ( ::Simulation::* )(  ) )( &::Simulation::runSimulation ) )    
-        .def( 
-            "runSimulationElement"
-            , (void ( ::Simulation::* )( ::size_t ) )( &::Simulation::runSimulationElement )
-            , ( bp::arg("index") ) )    
-        .def( 
-            "setBeamIntensity"
-            , (void ( ::Simulation::* )( double ) )( &::Simulation::setBeamIntensity )
-            , ( bp::arg("intensity") ) )    
-        .def( 
-            "setBeamParameters"
-            , (void ( ::Simulation::* )( double,double,double ) )( &::Simulation::setBeamParameters )
-            , ( bp::arg("lambda"), bp::arg("alpha_i"), bp::arg("phi_i") ) )    
-        .def( 
-            "setDetectorParameters"
-            , (void ( ::Simulation::* )( ::OutputData< double > const & ) )( &::Simulation::setDetectorParameters )
-            , ( bp::arg("output_data") ) )    
-        .def( 
-            "setDetectorParameters"
-            , (void ( ::Simulation::* )( ::size_t,double,double,::size_t,double,double,bool ) )( &::Simulation::setDetectorParameters )
-            , ( bp::arg("n_phi"), bp::arg("phi_f_min"), bp::arg("phi_f_max"), bp::arg("n_alpha"), bp::arg("alpha_f_min"), bp::arg("alpha_f_max"), bp::arg("isgisaxs_style")=(bool)(false) ) )    
-        .def( 
-            "setDetectorParameters"
-            , (void ( ::Simulation::* )( ::DetectorParameters const & ) )( &::Simulation::setDetectorParameters )
-            , ( bp::arg("params") ) )    
-        .def( 
-            "setDetectorResolutionFunction"
-            , (void ( ::Simulation::* )( ::IResolutionFunction2D const & ) )( &::Simulation::setDetectorResolutionFunction )
-            , ( bp::arg("p_resolution_function") ) )    
-        .def( 
-            "setInstrument"
-            , (void ( ::Simulation::* )( ::Instrument const & ) )( &::Simulation::setInstrument )
-            , ( bp::arg("instrument") ) )    
-        .def( 
-            "setSample"
-            , (void ( ::Simulation::* )( ::ISample const & ) )( &::Simulation::setSample )
-            , ( bp::arg("sample") ) )    
-        .def( 
-            "setSampleBuilder"
-            , (void ( ::Simulation::* )( ::ISampleBuilder const * ) )( &::Simulation::setSampleBuilder )
-            , ( bp::arg("p_sample_builder") ) )    
-        .def( 
-            "setSimulationParameters"
-            , (void ( ::Simulation::* )( ::SimulationParameters const & ) )( &::Simulation::setSimulationParameters )
-            , ( bp::arg("sim_params") ) )    
-        .def( 
-            "smearIntensityFromZAxisTilting"
-            , (void ( ::Simulation::* )(  ) )( &::Simulation::smearIntensityFromZAxisTilting ) )    
-        .def( 
-            "areParametersChanged"
-            , (bool ( ::IParameterized::* )(  ) )(&::IParameterized::areParametersChanged)
-            , (bool ( Simulation_wrapper::* )(  ) )(&Simulation_wrapper::default_areParametersChanged) )    
-        .def( 
-            "clearParameterPool"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::clearParameterPool)
-            , (void ( Simulation_wrapper::* )(  ) )(&Simulation_wrapper::default_clearParameterPool) )    
-        .def( 
-            "createParameterTree"
-            , (::ParameterPool * ( ::IParameterized::* )(  ) const)(&::IParameterized::createParameterTree)
-            , (::ParameterPool * ( Simulation_wrapper::* )(  ) const)(&Simulation_wrapper::default_createParameterTree)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "printParameters"
-            , (void ( ::IParameterized::* )(  ) const)(&::IParameterized::printParameters)
-            , (void ( Simulation_wrapper::* )(  ) const)(&Simulation_wrapper::default_printParameters) )    
-        .def( 
-            "registerParameter"
-            , (void (*)( ::IParameterized &,::std::string const &,long unsigned int ))( &Simulation_wrapper::default_registerParameter )
-            , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) )    
-        .def( 
-            "setParameterValue"
-            , (bool ( ::IParameterized::* )( ::std::string const &,double ) )(&::IParameterized::setParameterValue)
-            , (bool ( Simulation_wrapper::* )( ::std::string const &,double ) )(&Simulation_wrapper::default_setParameterValue)
-            , ( bp::arg("name"), bp::arg("value") ) )    
-        .def( 
-            "setParametersAreChanged"
-            , (void ( ::IParameterized::* )(  ) )(&::IParameterized::setParametersAreChanged)
-            , (void ( Simulation_wrapper::* )(  ) )(&Simulation_wrapper::default_setParametersAreChanged) );
+    { //::Simulation
+        typedef bp::class_< Simulation_wrapper, bp::bases< IParameterized, ICloneable >, boost::noncopyable > Simulation_exposer_t;
+        Simulation_exposer_t Simulation_exposer = Simulation_exposer_t( "Simulation", bp::init< >() );
+        bp::scope Simulation_scope( Simulation_exposer );
+        { //::Simulation::clone
+        
+            typedef ::Simulation * ( ::Simulation::*clone_function_type )(  ) const;
+            typedef ::Simulation * ( Simulation_wrapper::*default_clone_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "clone"
+                , clone_function_type(&::Simulation::clone)
+                , default_clone_function_type(&Simulation_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::Simulation::getInstrument
+        
+            typedef ::Instrument const & ( ::Simulation::*getInstrument_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "getInstrument"
+                , getInstrument_function_type( &::Simulation::getInstrument )
+                , bp::return_value_policy< bp::copy_const_reference >() );
+        
+        }
+        { //::Simulation::getOutputData
+        
+            typedef ::OutputData< double > const * ( ::Simulation::*getOutputData_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "getOutputData"
+                , getOutputData_function_type( &::Simulation::getOutputData )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Simulation::getOutputDataClone
+        
+            typedef ::OutputData< double > * ( ::Simulation::*getOutputDataClone_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "getOutputDataClone"
+                , getOutputDataClone_function_type( &::Simulation::getOutputDataClone )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Simulation::getSample
+        
+            typedef ::ISample * ( ::Simulation::*getSample_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "getSample"
+                , getSample_function_type( &::Simulation::getSample )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::Simulation::getSimulationParameters
+        
+            typedef ::SimulationParameters ( ::Simulation::*getSimulationParameters_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "getSimulationParameters"
+                , getSimulationParameters_function_type( &::Simulation::getSimulationParameters ) );
+        
+        }
+        { //::Simulation::normalize
+        
+            typedef void ( ::Simulation::*normalize_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "normalize"
+                , normalize_function_type( &::Simulation::normalize ) );
+        
+        }
+        { //::Simulation::prepareSimulation
+        
+            typedef void ( ::Simulation::*prepareSimulation_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "prepareSimulation"
+                , prepareSimulation_function_type( &::Simulation::prepareSimulation ) );
+        
+        }
+        { //::Simulation::runSimulation
+        
+            typedef void ( ::Simulation::*runSimulation_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "runSimulation"
+                , runSimulation_function_type( &::Simulation::runSimulation ) );
+        
+        }
+        { //::Simulation::runSimulationElement
+        
+            typedef void ( ::Simulation::*runSimulationElement_function_type )( ::size_t ) ;
+            
+            Simulation_exposer.def( 
+                "runSimulationElement"
+                , runSimulationElement_function_type( &::Simulation::runSimulationElement )
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::Simulation::setBeamIntensity
+        
+            typedef void ( ::Simulation::*setBeamIntensity_function_type )( double ) ;
+            
+            Simulation_exposer.def( 
+                "setBeamIntensity"
+                , setBeamIntensity_function_type( &::Simulation::setBeamIntensity )
+                , ( bp::arg("intensity") ) );
+        
+        }
+        { //::Simulation::setBeamParameters
+        
+            typedef void ( ::Simulation::*setBeamParameters_function_type )( double,double,double ) ;
+            
+            Simulation_exposer.def( 
+                "setBeamParameters"
+                , setBeamParameters_function_type( &::Simulation::setBeamParameters )
+                , ( bp::arg("lambda"), bp::arg("alpha_i"), bp::arg("phi_i") ) );
+        
+        }
+        { //::Simulation::setDetectorParameters
+        
+            typedef void ( ::Simulation::*setDetectorParameters_function_type )( ::OutputData< double > const & ) ;
+            
+            Simulation_exposer.def( 
+                "setDetectorParameters"
+                , setDetectorParameters_function_type( &::Simulation::setDetectorParameters )
+                , ( bp::arg("output_data") ) );
+        
+        }
+        { //::Simulation::setDetectorParameters
+        
+            typedef void ( ::Simulation::*setDetectorParameters_function_type )( ::size_t,double,double,::size_t,double,double,bool ) ;
+            
+            Simulation_exposer.def( 
+                "setDetectorParameters"
+                , setDetectorParameters_function_type( &::Simulation::setDetectorParameters )
+                , ( bp::arg("n_phi"), bp::arg("phi_f_min"), bp::arg("phi_f_max"), bp::arg("n_alpha"), bp::arg("alpha_f_min"), bp::arg("alpha_f_max"), bp::arg("isgisaxs_style")=(bool)(false) ) );
+        
+        }
+        { //::Simulation::setDetectorParameters
+        
+            typedef void ( ::Simulation::*setDetectorParameters_function_type )( ::DetectorParameters const & ) ;
+            
+            Simulation_exposer.def( 
+                "setDetectorParameters"
+                , setDetectorParameters_function_type( &::Simulation::setDetectorParameters )
+                , ( bp::arg("params") ) );
+        
+        }
+        { //::Simulation::setDetectorResolutionFunction
+        
+            typedef void ( ::Simulation::*setDetectorResolutionFunction_function_type )( ::IResolutionFunction2D const & ) ;
+            
+            Simulation_exposer.def( 
+                "setDetectorResolutionFunction"
+                , setDetectorResolutionFunction_function_type( &::Simulation::setDetectorResolutionFunction )
+                , ( bp::arg("p_resolution_function") ) );
+        
+        }
+        { //::Simulation::setInstrument
+        
+            typedef void ( ::Simulation::*setInstrument_function_type )( ::Instrument const & ) ;
+            
+            Simulation_exposer.def( 
+                "setInstrument"
+                , setInstrument_function_type( &::Simulation::setInstrument )
+                , ( bp::arg("instrument") ) );
+        
+        }
+        { //::Simulation::setSample
+        
+            typedef void ( ::Simulation::*setSample_function_type )( ::ISample const & ) ;
+            
+            Simulation_exposer.def( 
+                "setSample"
+                , setSample_function_type( &::Simulation::setSample )
+                , ( bp::arg("sample") ) );
+        
+        }
+        { //::Simulation::setSampleBuilder
+        
+            typedef void ( ::Simulation::*setSampleBuilder_function_type )( ::ISampleBuilder const * ) ;
+            
+            Simulation_exposer.def( 
+                "setSampleBuilder"
+                , setSampleBuilder_function_type( &::Simulation::setSampleBuilder )
+                , ( bp::arg("p_sample_builder") ) );
+        
+        }
+        { //::Simulation::setSimulationParameters
+        
+            typedef void ( ::Simulation::*setSimulationParameters_function_type )( ::SimulationParameters const & ) ;
+            
+            Simulation_exposer.def( 
+                "setSimulationParameters"
+                , setSimulationParameters_function_type( &::Simulation::setSimulationParameters )
+                , ( bp::arg("sim_params") ) );
+        
+        }
+        { //::Simulation::smearIntensityFromZAxisTilting
+        
+            typedef void ( ::Simulation::*smearIntensityFromZAxisTilting_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "smearIntensityFromZAxisTilting"
+                , smearIntensityFromZAxisTilting_function_type( &::Simulation::smearIntensityFromZAxisTilting ) );
+        
+        }
+        { //::IParameterized::areParametersChanged
+        
+            typedef bool ( ::IParameterized::*areParametersChanged_function_type )(  ) ;
+            typedef bool ( Simulation_wrapper::*default_areParametersChanged_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "areParametersChanged"
+                , areParametersChanged_function_type(&::IParameterized::areParametersChanged)
+                , default_areParametersChanged_function_type(&Simulation_wrapper::default_areParametersChanged) );
+        
+        }
+        { //::IParameterized::clearParameterPool
+        
+            typedef void ( ::IParameterized::*clearParameterPool_function_type )(  ) ;
+            typedef void ( Simulation_wrapper::*default_clearParameterPool_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "clearParameterPool"
+                , clearParameterPool_function_type(&::IParameterized::clearParameterPool)
+                , default_clearParameterPool_function_type(&Simulation_wrapper::default_clearParameterPool) );
+        
+        }
+        { //::IParameterized::createParameterTree
+        
+            typedef ::ParameterPool * ( ::IParameterized::*createParameterTree_function_type )(  ) const;
+            typedef ::ParameterPool * ( Simulation_wrapper::*default_createParameterTree_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "createParameterTree"
+                , createParameterTree_function_type(&::IParameterized::createParameterTree)
+                , default_createParameterTree_function_type(&Simulation_wrapper::default_createParameterTree)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IParameterized::printParameters
+        
+            typedef void ( ::IParameterized::*printParameters_function_type )(  ) const;
+            typedef void ( Simulation_wrapper::*default_printParameters_function_type )(  ) const;
+            
+            Simulation_exposer.def( 
+                "printParameters"
+                , printParameters_function_type(&::IParameterized::printParameters)
+                , default_printParameters_function_type(&Simulation_wrapper::default_printParameters) );
+        
+        }
+        { //::IParameterized::registerParameter
+        
+            typedef void ( *default_registerParameter_function_type )( ::IParameterized &,::std::string const &,long unsigned int );
+            
+            Simulation_exposer.def( 
+                "registerParameter"
+                , default_registerParameter_function_type( &Simulation_wrapper::default_registerParameter )
+                , ( bp::arg("inst"), bp::arg("name"), bp::arg("parpointer") ) );
+        
+        }
+        { //::IParameterized::setParameterValue
+        
+            typedef bool ( ::IParameterized::*setParameterValue_function_type )( ::std::string const &,double ) ;
+            typedef bool ( Simulation_wrapper::*default_setParameterValue_function_type )( ::std::string const &,double ) ;
+            
+            Simulation_exposer.def( 
+                "setParameterValue"
+                , setParameterValue_function_type(&::IParameterized::setParameterValue)
+                , default_setParameterValue_function_type(&Simulation_wrapper::default_setParameterValue)
+                , ( bp::arg("name"), bp::arg("value") ) );
+        
+        }
+        { //::IParameterized::setParametersAreChanged
+        
+            typedef void ( ::IParameterized::*setParametersAreChanged_function_type )(  ) ;
+            typedef void ( Simulation_wrapper::*default_setParametersAreChanged_function_type )(  ) ;
+            
+            Simulation_exposer.def( 
+                "setParametersAreChanged"
+                , setParametersAreChanged_function_type(&::IParameterized::setParametersAreChanged)
+                , default_setParametersAreChanged_function_type(&Simulation_wrapper::default_setParametersAreChanged) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/SimulationParameters.pypp.cpp b/Core/PythonAPI/src/SimulationParameters.pypp.cpp
index d7fa65536afbb8443b36b652f2beac071cc29852..4bf463718d40e0628870d3f466066ed07b367a3f 100644
--- a/Core/PythonAPI/src/SimulationParameters.pypp.cpp
+++ b/Core/PythonAPI/src/SimulationParameters.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "SimulationParameters.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/PythonAPI/src/StochasticDoubleGate.pypp.cpp b/Core/PythonAPI/src/StochasticDoubleGate.pypp.cpp
index 132b908edc594f7019eb0c18aac6bf255e95c481..ea0d2bcc00b58e26f953ab1f8c5b8d497e51565b 100644
--- a/Core/PythonAPI/src/StochasticDoubleGate.pypp.cpp
+++ b/Core/PythonAPI/src/StochasticDoubleGate.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "StochasticDoubleGate.pypp.h"
 
 namespace bp = boost::python;
@@ -166,35 +99,89 @@ struct StochasticDoubleGate_wrapper : StochasticDoubleGate, bp::wrapper< Stochas
 
 void register_StochasticDoubleGate_class(){
 
-    bp::class_< StochasticDoubleGate_wrapper, bp::bases< StochasticParameter< double > >, boost::noncopyable >( "StochasticDoubleGate", bp::init< double, double >(( bp::arg("min"), bp::arg("max") )) )    
-        .def( 
-            "clone"
-            , (::StochasticDoubleGate * ( ::StochasticDoubleGate::* )(  ) const)(&::StochasticDoubleGate::clone)
-            , (::StochasticDoubleGate * ( StochasticDoubleGate_wrapper::* )(  ) const)(&StochasticDoubleGate_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getFWHM"
-            , (double ( ::StochasticDoubleGate::* )(  ) const)(&::StochasticDoubleGate::getFWHM)
-            , (double ( StochasticDoubleGate_wrapper::* )(  ) const)(&StochasticDoubleGate_wrapper::default_getFWHM) )    
-        .def( 
-            "getStdDev"
-            , (double ( ::StochasticDoubleGate::* )(  ) const)( &::StochasticDoubleGate::getStdDev ) )    
-        .def( 
-            "probabilityDensity"
-            , (double ( ::StochasticDoubleGate::* )( double ) const)(&::StochasticDoubleGate::probabilityDensity)
-            , (double ( StochasticDoubleGate_wrapper::* )( double ) const)(&StochasticDoubleGate_wrapper::default_probabilityDensity)
-            , ( bp::arg("value") ) )    
-        .def( 
-            "setToRandom"
-            , (void ( ::StochasticDoubleGate::* )(  ) )(&::StochasticDoubleGate::setToRandom)
-            , (void ( StochasticDoubleGate_wrapper::* )(  ) )(&StochasticDoubleGate_wrapper::default_setToRandom) )    
-        .def( 
-            "getRandom"
-            , (double ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::getRandom)
-            , (double ( StochasticDoubleGate_wrapper::* )(  ) )(&StochasticDoubleGate_wrapper::default_getRandom) )    
-        .def( 
-            "setToAverage"
-            , (void ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::setToAverage)
-            , (void ( StochasticDoubleGate_wrapper::* )(  ) )(&StochasticDoubleGate_wrapper::default_setToAverage) );
+    { //::StochasticDoubleGate
+        typedef bp::class_< StochasticDoubleGate_wrapper, bp::bases< StochasticParameter< double > >, boost::noncopyable > StochasticDoubleGate_exposer_t;
+        StochasticDoubleGate_exposer_t StochasticDoubleGate_exposer = StochasticDoubleGate_exposer_t( "StochasticDoubleGate", bp::init< double, double >(( bp::arg("min"), bp::arg("max") )) );
+        bp::scope StochasticDoubleGate_scope( StochasticDoubleGate_exposer );
+        { //::StochasticDoubleGate::clone
+        
+            typedef ::StochasticDoubleGate * ( ::StochasticDoubleGate::*clone_function_type )(  ) const;
+            typedef ::StochasticDoubleGate * ( StochasticDoubleGate_wrapper::*default_clone_function_type )(  ) const;
+            
+            StochasticDoubleGate_exposer.def( 
+                "clone"
+                , clone_function_type(&::StochasticDoubleGate::clone)
+                , default_clone_function_type(&StochasticDoubleGate_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::StochasticDoubleGate::getFWHM
+        
+            typedef double ( ::StochasticDoubleGate::*getFWHM_function_type )(  ) const;
+            typedef double ( StochasticDoubleGate_wrapper::*default_getFWHM_function_type )(  ) const;
+            
+            StochasticDoubleGate_exposer.def( 
+                "getFWHM"
+                , getFWHM_function_type(&::StochasticDoubleGate::getFWHM)
+                , default_getFWHM_function_type(&StochasticDoubleGate_wrapper::default_getFWHM) );
+        
+        }
+        { //::StochasticDoubleGate::getStdDev
+        
+            typedef double ( ::StochasticDoubleGate::*getStdDev_function_type )(  ) const;
+            
+            StochasticDoubleGate_exposer.def( 
+                "getStdDev"
+                , getStdDev_function_type( &::StochasticDoubleGate::getStdDev ) );
+        
+        }
+        { //::StochasticDoubleGate::probabilityDensity
+        
+            typedef double ( ::StochasticDoubleGate::*probabilityDensity_function_type )( double ) const;
+            typedef double ( StochasticDoubleGate_wrapper::*default_probabilityDensity_function_type )( double ) const;
+            
+            StochasticDoubleGate_exposer.def( 
+                "probabilityDensity"
+                , probabilityDensity_function_type(&::StochasticDoubleGate::probabilityDensity)
+                , default_probabilityDensity_function_type(&StochasticDoubleGate_wrapper::default_probabilityDensity)
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::StochasticDoubleGate::setToRandom
+        
+            typedef void ( ::StochasticDoubleGate::*setToRandom_function_type )(  ) ;
+            typedef void ( StochasticDoubleGate_wrapper::*default_setToRandom_function_type )(  ) ;
+            
+            StochasticDoubleGate_exposer.def( 
+                "setToRandom"
+                , setToRandom_function_type(&::StochasticDoubleGate::setToRandom)
+                , default_setToRandom_function_type(&StochasticDoubleGate_wrapper::default_setToRandom) );
+        
+        }
+        { //::StochasticParameter< double >::getRandom
+        
+            typedef StochasticDoubleGate exported_class_t;
+            typedef double ( exported_class_t::*getRandom_function_type )(  ) ;
+            typedef double ( StochasticDoubleGate_wrapper::*default_getRandom_function_type )(  ) ;
+            
+            StochasticDoubleGate_exposer.def( 
+                "getRandom"
+                , getRandom_function_type(&::StochasticParameter< double >::getRandom)
+                , default_getRandom_function_type(&StochasticDoubleGate_wrapper::default_getRandom) );
+        
+        }
+        { //::StochasticParameter< double >::setToAverage
+        
+            typedef StochasticDoubleGate exported_class_t;
+            typedef void ( exported_class_t::*setToAverage_function_type )(  ) ;
+            typedef void ( StochasticDoubleGate_wrapper::*default_setToAverage_function_type )(  ) ;
+            
+            StochasticDoubleGate_exposer.def( 
+                "setToAverage"
+                , setToAverage_function_type(&::StochasticParameter< double >::setToAverage)
+                , default_setToAverage_function_type(&StochasticDoubleGate_wrapper::default_setToAverage) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/StochasticDoubleGaussian.pypp.cpp b/Core/PythonAPI/src/StochasticDoubleGaussian.pypp.cpp
index 68e5877cc33d36b2ee8ffdd891c986dcb545a35c..820e29c3e451eda7af03306e5dd63852ca7c9913 100644
--- a/Core/PythonAPI/src/StochasticDoubleGaussian.pypp.cpp
+++ b/Core/PythonAPI/src/StochasticDoubleGaussian.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "StochasticDoubleGaussian.pypp.h"
 
 namespace bp = boost::python;
@@ -166,35 +99,89 @@ struct StochasticDoubleGaussian_wrapper : StochasticDoubleGaussian, bp::wrapper<
 
 void register_StochasticDoubleGaussian_class(){
 
-    bp::class_< StochasticDoubleGaussian_wrapper, bp::bases< StochasticParameter< double > >, boost::noncopyable >( "StochasticDoubleGaussian", bp::init< double, double >(( bp::arg("average"), bp::arg("std_dev") )) )    
-        .def( 
-            "clone"
-            , (::StochasticDoubleGaussian * ( ::StochasticDoubleGaussian::* )(  ) const)(&::StochasticDoubleGaussian::clone)
-            , (::StochasticDoubleGaussian * ( StochasticDoubleGaussian_wrapper::* )(  ) const)(&StochasticDoubleGaussian_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getFWHM"
-            , (double ( ::StochasticDoubleGaussian::* )(  ) const)(&::StochasticDoubleGaussian::getFWHM)
-            , (double ( StochasticDoubleGaussian_wrapper::* )(  ) const)(&StochasticDoubleGaussian_wrapper::default_getFWHM) )    
-        .def( 
-            "getStdDev"
-            , (double ( ::StochasticDoubleGaussian::* )(  ) const)( &::StochasticDoubleGaussian::getStdDev ) )    
-        .def( 
-            "probabilityDensity"
-            , (double ( ::StochasticDoubleGaussian::* )( double ) const)(&::StochasticDoubleGaussian::probabilityDensity)
-            , (double ( StochasticDoubleGaussian_wrapper::* )( double ) const)(&StochasticDoubleGaussian_wrapper::default_probabilityDensity)
-            , ( bp::arg("value") ) )    
-        .def( 
-            "setToRandom"
-            , (void ( ::StochasticDoubleGaussian::* )(  ) )(&::StochasticDoubleGaussian::setToRandom)
-            , (void ( StochasticDoubleGaussian_wrapper::* )(  ) )(&StochasticDoubleGaussian_wrapper::default_setToRandom) )    
-        .def( 
-            "getRandom"
-            , (double ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::getRandom)
-            , (double ( StochasticDoubleGaussian_wrapper::* )(  ) )(&StochasticDoubleGaussian_wrapper::default_getRandom) )    
-        .def( 
-            "setToAverage"
-            , (void ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::setToAverage)
-            , (void ( StochasticDoubleGaussian_wrapper::* )(  ) )(&StochasticDoubleGaussian_wrapper::default_setToAverage) );
+    { //::StochasticDoubleGaussian
+        typedef bp::class_< StochasticDoubleGaussian_wrapper, bp::bases< StochasticParameter< double > >, boost::noncopyable > StochasticDoubleGaussian_exposer_t;
+        StochasticDoubleGaussian_exposer_t StochasticDoubleGaussian_exposer = StochasticDoubleGaussian_exposer_t( "StochasticDoubleGaussian", bp::init< double, double >(( bp::arg("average"), bp::arg("std_dev") )) );
+        bp::scope StochasticDoubleGaussian_scope( StochasticDoubleGaussian_exposer );
+        { //::StochasticDoubleGaussian::clone
+        
+            typedef ::StochasticDoubleGaussian * ( ::StochasticDoubleGaussian::*clone_function_type )(  ) const;
+            typedef ::StochasticDoubleGaussian * ( StochasticDoubleGaussian_wrapper::*default_clone_function_type )(  ) const;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "clone"
+                , clone_function_type(&::StochasticDoubleGaussian::clone)
+                , default_clone_function_type(&StochasticDoubleGaussian_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::StochasticDoubleGaussian::getFWHM
+        
+            typedef double ( ::StochasticDoubleGaussian::*getFWHM_function_type )(  ) const;
+            typedef double ( StochasticDoubleGaussian_wrapper::*default_getFWHM_function_type )(  ) const;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "getFWHM"
+                , getFWHM_function_type(&::StochasticDoubleGaussian::getFWHM)
+                , default_getFWHM_function_type(&StochasticDoubleGaussian_wrapper::default_getFWHM) );
+        
+        }
+        { //::StochasticDoubleGaussian::getStdDev
+        
+            typedef double ( ::StochasticDoubleGaussian::*getStdDev_function_type )(  ) const;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "getStdDev"
+                , getStdDev_function_type( &::StochasticDoubleGaussian::getStdDev ) );
+        
+        }
+        { //::StochasticDoubleGaussian::probabilityDensity
+        
+            typedef double ( ::StochasticDoubleGaussian::*probabilityDensity_function_type )( double ) const;
+            typedef double ( StochasticDoubleGaussian_wrapper::*default_probabilityDensity_function_type )( double ) const;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "probabilityDensity"
+                , probabilityDensity_function_type(&::StochasticDoubleGaussian::probabilityDensity)
+                , default_probabilityDensity_function_type(&StochasticDoubleGaussian_wrapper::default_probabilityDensity)
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::StochasticDoubleGaussian::setToRandom
+        
+            typedef void ( ::StochasticDoubleGaussian::*setToRandom_function_type )(  ) ;
+            typedef void ( StochasticDoubleGaussian_wrapper::*default_setToRandom_function_type )(  ) ;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "setToRandom"
+                , setToRandom_function_type(&::StochasticDoubleGaussian::setToRandom)
+                , default_setToRandom_function_type(&StochasticDoubleGaussian_wrapper::default_setToRandom) );
+        
+        }
+        { //::StochasticParameter< double >::getRandom
+        
+            typedef StochasticDoubleGaussian exported_class_t;
+            typedef double ( exported_class_t::*getRandom_function_type )(  ) ;
+            typedef double ( StochasticDoubleGaussian_wrapper::*default_getRandom_function_type )(  ) ;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "getRandom"
+                , getRandom_function_type(&::StochasticParameter< double >::getRandom)
+                , default_getRandom_function_type(&StochasticDoubleGaussian_wrapper::default_getRandom) );
+        
+        }
+        { //::StochasticParameter< double >::setToAverage
+        
+            typedef StochasticDoubleGaussian exported_class_t;
+            typedef void ( exported_class_t::*setToAverage_function_type )(  ) ;
+            typedef void ( StochasticDoubleGaussian_wrapper::*default_setToAverage_function_type )(  ) ;
+            
+            StochasticDoubleGaussian_exposer.def( 
+                "setToAverage"
+                , setToAverage_function_type(&::StochasticParameter< double >::setToAverage)
+                , default_setToAverage_function_type(&StochasticDoubleGaussian_wrapper::default_setToAverage) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/StochasticParameter_t.pypp.cpp b/Core/PythonAPI/src/StochasticParameter_t.pypp.cpp
index 08814825336764bac8121914deab08f3ec2f8633..1c7f4060708c9de5ed217052a0046dc0d45ae2ba 100644
--- a/Core/PythonAPI/src/StochasticParameter_t.pypp.cpp
+++ b/Core/PythonAPI/src/StochasticParameter_t.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "StochasticParameter_t.pypp.h"
 
 namespace bp = boost::python;
@@ -145,35 +78,97 @@ struct StochasticParameter_less__double__greater__wrapper : StochasticParameter<
 
 void register_StochasticParameter_t_class(){
 
-    bp::class_< StochasticParameter_less__double__greater__wrapper, bp::bases< IStochasticParameter >, boost::noncopyable >( "StochasticParameter_t", bp::init< double >(( bp::arg("average") )) )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::StochasticParameter< double > * ( ::StochasticParameter<double>::* )(  ) const)(&::StochasticParameter< double >::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getAverage"
-            , (double ( ::StochasticParameter<double>::* )(  ) )( &::StochasticParameter< double >::getAverage ) )    
-        .def( 
-            "getCurrent"
-            , (double ( ::StochasticParameter<double>::* )(  ) const)( &::StochasticParameter< double >::getCurrent ) )    
-        .def( 
-            "getFWHM"
-            , (double ( ::StochasticParameter<double>::* )(  ) const)(&::StochasticParameter< double >::getFWHM)
-            , (double ( StochasticParameter_less__double__greater__wrapper::* )(  ) const)(&StochasticParameter_less__double__greater__wrapper::default_getFWHM) )    
-        .def( 
-            "getRandom"
-            , (double ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::getRandom)
-            , (double ( StochasticParameter_less__double__greater__wrapper::* )(  ) )(&StochasticParameter_less__double__greater__wrapper::default_getRandom) )    
-        .def( 
-            "probabilityDensity"
-            , bp::pure_virtual( (double ( ::StochasticParameter<double>::* )( double ) const)(&::StochasticParameter< double >::probabilityDensity) )
-            , ( bp::arg("value") ) )    
-        .def( 
-            "setToAverage"
-            , (void ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::setToAverage)
-            , (void ( StochasticParameter_less__double__greater__wrapper::* )(  ) )(&StochasticParameter_less__double__greater__wrapper::default_setToAverage) )    
-        .def( 
-            "setToRandom"
-            , bp::pure_virtual( (void ( ::IStochasticParameter::* )(  ) )(&::IStochasticParameter::setToRandom) ) );
+    { //::StochasticParameter< double >
+        typedef bp::class_< StochasticParameter_less__double__greater__wrapper, boost::noncopyable > StochasticParameter_t_exposer_t;
+        StochasticParameter_t_exposer_t StochasticParameter_t_exposer = StochasticParameter_t_exposer_t( "StochasticParameter_t", bp::init< double >(( bp::arg("average") )) );
+        bp::scope StochasticParameter_t_scope( StochasticParameter_t_exposer );
+        { //::StochasticParameter< double >::clone
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef ::StochasticParameter<double> * ( exported_class_t::*clone_function_type )(  ) const;
+            
+            StochasticParameter_t_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::StochasticParameter< double >::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::StochasticParameter< double >::getAverage
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef double ( exported_class_t::*getAverage_function_type )(  ) ;
+            
+            StochasticParameter_t_exposer.def( 
+                "getAverage"
+                , getAverage_function_type( &::StochasticParameter< double >::getAverage ) );
+        
+        }
+        { //::StochasticParameter< double >::getCurrent
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef double ( exported_class_t::*getCurrent_function_type )(  ) const;
+            
+            StochasticParameter_t_exposer.def( 
+                "getCurrent"
+                , getCurrent_function_type( &::StochasticParameter< double >::getCurrent ) );
+        
+        }
+        { //::StochasticParameter< double >::getFWHM
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef double ( exported_class_t::*getFWHM_function_type )(  ) const;
+            typedef double ( StochasticParameter_less__double__greater__wrapper::*default_getFWHM_function_type )(  ) const;
+            
+            StochasticParameter_t_exposer.def( 
+                "getFWHM"
+                , getFWHM_function_type(&::StochasticParameter< double >::getFWHM)
+                , default_getFWHM_function_type(&StochasticParameter_less__double__greater__wrapper::default_getFWHM) );
+        
+        }
+        { //::StochasticParameter< double >::getRandom
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef double ( exported_class_t::*getRandom_function_type )(  ) ;
+            typedef double ( StochasticParameter_less__double__greater__wrapper::*default_getRandom_function_type )(  ) ;
+            
+            StochasticParameter_t_exposer.def( 
+                "getRandom"
+                , getRandom_function_type(&::StochasticParameter< double >::getRandom)
+                , default_getRandom_function_type(&StochasticParameter_less__double__greater__wrapper::default_getRandom) );
+        
+        }
+        { //::StochasticParameter< double >::probabilityDensity
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef double ( exported_class_t::*probabilityDensity_function_type )( double ) const;
+            
+            StochasticParameter_t_exposer.def( 
+                "probabilityDensity"
+                , bp::pure_virtual( probabilityDensity_function_type(&::StochasticParameter< double >::probabilityDensity) )
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::StochasticParameter< double >::setToAverage
+        
+            typedef StochasticParameter< double > exported_class_t;
+            typedef void ( exported_class_t::*setToAverage_function_type )(  ) ;
+            typedef void ( StochasticParameter_less__double__greater__wrapper::*default_setToAverage_function_type )(  ) ;
+            
+            StochasticParameter_t_exposer.def( 
+                "setToAverage"
+                , setToAverage_function_type(&::StochasticParameter< double >::setToAverage)
+                , default_setToAverage_function_type(&StochasticParameter_less__double__greater__wrapper::default_setToAverage) );
+        
+        }
+        { //::IStochasticParameter::setToRandom
+        
+            typedef void ( ::IStochasticParameter::*setToRandom_function_type )(  ) ;
+            
+            StochasticParameter_t_exposer.def( 
+                "setToRandom"
+                , bp::pure_virtual( setToRandom_function_type(&::IStochasticParameter::setToRandom) ) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/StochasticSampledParameter.pypp.cpp b/Core/PythonAPI/src/StochasticSampledParameter.pypp.cpp
index 7c6ac01dd1e47320cb0f216f8f4efbc2cdf3edc1..26fc062960c37ebca48c2c814e930d4a27534734 100644
--- a/Core/PythonAPI/src/StochasticSampledParameter.pypp.cpp
+++ b/Core/PythonAPI/src/StochasticSampledParameter.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "StochasticSampledParameter.pypp.h"
 
 namespace bp = boost::python;
@@ -173,48 +106,121 @@ struct StochasticSampledParameter_wrapper : StochasticSampledParameter, bp::wrap
 
 void register_StochasticSampledParameter_class(){
 
-    bp::class_< StochasticSampledParameter_wrapper, bp::bases< StochasticParameter< double > >, boost::noncopyable >( "StochasticSampledParameter", bp::init< StochasticParameter< double > const &, size_t, double, double >(( bp::arg("par"), bp::arg("nbins"), bp::arg("xmin"), bp::arg("xmax") )) )    
-        .def( bp::init< StochasticParameter< double > const &, size_t, bp::optional< int > >(( bp::arg("par"), bp::arg("nbins"), bp::arg("nfwhm")=(int)(3) )) )    
-        .def( 
-            "clone"
-            , (::StochasticSampledParameter * ( ::StochasticSampledParameter::* )(  ) const)(&::StochasticSampledParameter::clone)
-            , (::StochasticSampledParameter * ( StochasticSampledParameter_wrapper::* )(  ) const)(&StochasticSampledParameter_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getBinValue"
-            , (double ( ::StochasticSampledParameter::* )( ::size_t ) const)( &::StochasticSampledParameter::getBinValue )
-            , ( bp::arg("ibin") ) )    
-        .def( 
-            "getNbins"
-            , (::size_t ( ::StochasticSampledParameter::* )(  ) const)( &::StochasticSampledParameter::getNbins ) )    
-        .def( 
-            "getNormalizedProbability"
-            , (double ( ::StochasticSampledParameter::* )( ::size_t ) const)( &::StochasticSampledParameter::getNormalizedProbability )
-            , ( bp::arg("ibin") ) )    
-        .def( 
-            "probabilityBinDensity"
-            , (double ( ::StochasticSampledParameter::* )( ::size_t ) const)( &::StochasticSampledParameter::probabilityBinDensity )
-            , ( bp::arg("ibin") ) )    
-        .def( 
-            "probabilityDensity"
-            , (double ( ::StochasticSampledParameter::* )( double ) const)(&::StochasticSampledParameter::probabilityDensity)
-            , (double ( StochasticSampledParameter_wrapper::* )( double ) const)(&StochasticSampledParameter_wrapper::default_probabilityDensity)
-            , ( bp::arg("value") ) )    
-        .def( 
-            "setToRandom"
-            , (void ( ::StochasticSampledParameter::* )(  ) )(&::StochasticSampledParameter::setToRandom)
-            , (void ( StochasticSampledParameter_wrapper::* )(  ) )(&StochasticSampledParameter_wrapper::default_setToRandom) )    
-        .def( 
-            "getFWHM"
-            , (double ( ::StochasticParameter<double>::* )(  ) const)(&::StochasticParameter< double >::getFWHM)
-            , (double ( StochasticSampledParameter_wrapper::* )(  ) const)(&StochasticSampledParameter_wrapper::default_getFWHM) )    
-        .def( 
-            "getRandom"
-            , (double ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::getRandom)
-            , (double ( StochasticSampledParameter_wrapper::* )(  ) )(&StochasticSampledParameter_wrapper::default_getRandom) )    
-        .def( 
-            "setToAverage"
-            , (void ( ::StochasticParameter<double>::* )(  ) )(&::StochasticParameter< double >::setToAverage)
-            , (void ( StochasticSampledParameter_wrapper::* )(  ) )(&StochasticSampledParameter_wrapper::default_setToAverage) );
+    { //::StochasticSampledParameter
+        typedef bp::class_< StochasticSampledParameter_wrapper, bp::bases< StochasticParameter< double > >, boost::noncopyable > StochasticSampledParameter_exposer_t;
+        StochasticSampledParameter_exposer_t StochasticSampledParameter_exposer = StochasticSampledParameter_exposer_t( "StochasticSampledParameter", bp::init< StochasticParameter< double > const &, size_t, double, double >(( bp::arg("par"), bp::arg("nbins"), bp::arg("xmin"), bp::arg("xmax") )) );
+        bp::scope StochasticSampledParameter_scope( StochasticSampledParameter_exposer );
+        StochasticSampledParameter_exposer.def( bp::init< StochasticParameter< double > const &, size_t, bp::optional< int > >(( bp::arg("par"), bp::arg("nbins"), bp::arg("nfwhm")=(int)(3) )) );
+        { //::StochasticSampledParameter::clone
+        
+            typedef ::StochasticSampledParameter * ( ::StochasticSampledParameter::*clone_function_type )(  ) const;
+            typedef ::StochasticSampledParameter * ( StochasticSampledParameter_wrapper::*default_clone_function_type )(  ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "clone"
+                , clone_function_type(&::StochasticSampledParameter::clone)
+                , default_clone_function_type(&StochasticSampledParameter_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::StochasticSampledParameter::getBinValue
+        
+            typedef double ( ::StochasticSampledParameter::*getBinValue_function_type )( ::size_t ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "getBinValue"
+                , getBinValue_function_type( &::StochasticSampledParameter::getBinValue )
+                , ( bp::arg("ibin") ) );
+        
+        }
+        { //::StochasticSampledParameter::getNbins
+        
+            typedef ::size_t ( ::StochasticSampledParameter::*getNbins_function_type )(  ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "getNbins"
+                , getNbins_function_type( &::StochasticSampledParameter::getNbins ) );
+        
+        }
+        { //::StochasticSampledParameter::getNormalizedProbability
+        
+            typedef double ( ::StochasticSampledParameter::*getNormalizedProbability_function_type )( ::size_t ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "getNormalizedProbability"
+                , getNormalizedProbability_function_type( &::StochasticSampledParameter::getNormalizedProbability )
+                , ( bp::arg("ibin") ) );
+        
+        }
+        { //::StochasticSampledParameter::probabilityBinDensity
+        
+            typedef double ( ::StochasticSampledParameter::*probabilityBinDensity_function_type )( ::size_t ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "probabilityBinDensity"
+                , probabilityBinDensity_function_type( &::StochasticSampledParameter::probabilityBinDensity )
+                , ( bp::arg("ibin") ) );
+        
+        }
+        { //::StochasticSampledParameter::probabilityDensity
+        
+            typedef double ( ::StochasticSampledParameter::*probabilityDensity_function_type )( double ) const;
+            typedef double ( StochasticSampledParameter_wrapper::*default_probabilityDensity_function_type )( double ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "probabilityDensity"
+                , probabilityDensity_function_type(&::StochasticSampledParameter::probabilityDensity)
+                , default_probabilityDensity_function_type(&StochasticSampledParameter_wrapper::default_probabilityDensity)
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::StochasticSampledParameter::setToRandom
+        
+            typedef void ( ::StochasticSampledParameter::*setToRandom_function_type )(  ) ;
+            typedef void ( StochasticSampledParameter_wrapper::*default_setToRandom_function_type )(  ) ;
+            
+            StochasticSampledParameter_exposer.def( 
+                "setToRandom"
+                , setToRandom_function_type(&::StochasticSampledParameter::setToRandom)
+                , default_setToRandom_function_type(&StochasticSampledParameter_wrapper::default_setToRandom) );
+        
+        }
+        { //::StochasticParameter< double >::getFWHM
+        
+            typedef StochasticSampledParameter exported_class_t;
+            typedef double ( exported_class_t::*getFWHM_function_type )(  ) const;
+            typedef double ( StochasticSampledParameter_wrapper::*default_getFWHM_function_type )(  ) const;
+            
+            StochasticSampledParameter_exposer.def( 
+                "getFWHM"
+                , getFWHM_function_type(&::StochasticParameter< double >::getFWHM)
+                , default_getFWHM_function_type(&StochasticSampledParameter_wrapper::default_getFWHM) );
+        
+        }
+        { //::StochasticParameter< double >::getRandom
+        
+            typedef StochasticSampledParameter exported_class_t;
+            typedef double ( exported_class_t::*getRandom_function_type )(  ) ;
+            typedef double ( StochasticSampledParameter_wrapper::*default_getRandom_function_type )(  ) ;
+            
+            StochasticSampledParameter_exposer.def( 
+                "getRandom"
+                , getRandom_function_type(&::StochasticParameter< double >::getRandom)
+                , default_getRandom_function_type(&StochasticSampledParameter_wrapper::default_getRandom) );
+        
+        }
+        { //::StochasticParameter< double >::setToAverage
+        
+            typedef StochasticSampledParameter exported_class_t;
+            typedef void ( exported_class_t::*setToAverage_function_type )(  ) ;
+            typedef void ( StochasticSampledParameter_wrapper::*default_setToAverage_function_type )(  ) ;
+            
+            StochasticSampledParameter_exposer.def( 
+                "setToAverage"
+                , setToAverage_function_type(&::StochasticParameter< double >::setToAverage)
+                , default_setToAverage_function_type(&StochasticSampledParameter_wrapper::default_setToAverage) );
+        
+        }
+    }
 
 }
diff --git a/Core/PythonAPI/src/Transform3D.pypp.cpp b/Core/PythonAPI/src/Transform3D.pypp.cpp
deleted file mode 100644
index 62c820d7e10c116642190765a354585f3fdbe446..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/Transform3D.pypp.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "Transform3D.pypp.h"
-
-namespace bp = boost::python;
-
-void register_Transform3D_class(){
-
-    { //::Geometry::Transform3D
-        typedef bp::class_< Geometry::Transform3D > Transform3D_exposer_t;
-        Transform3D_exposer_t Transform3D_exposer = Transform3D_exposer_t( "Transform3D", bp::init< >() );
-        bp::scope Transform3D_scope( Transform3D_exposer );
-        bp::class_< Geometry::Transform3D::Transform3D_row, boost::noncopyable >( "Transform3D_row", bp::init< Geometry::Transform3D const &, int >(( bp::arg("r"), bp::arg("i") )) )    
-            .def( 
-                "__getitem__"
-                , (double ( ::Geometry::Transform3D::Transform3D_row::* )( int ) const)( &::Geometry::Transform3D::Transform3D_row::operator[] )
-                , ( bp::arg("jj") ) );
-        Transform3D_exposer.def( bp::init< Geometry::Transform3D const & >(( bp::arg("m") )) );
-        { //::Geometry::Transform3D::inverse
-        
-            typedef ::Geometry::Transform3D ( ::Geometry::Transform3D::*inverse_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "inverse"
-                , inverse_function_type( &::Geometry::Transform3D::inverse ) );
-        
-        }
-        { //::Geometry::Transform3D::operator()
-        
-            typedef double ( ::Geometry::Transform3D::*__call___function_type )( int,int ) const;
-            
-            Transform3D_exposer.def( 
-                "__call__"
-                , __call___function_type( &::Geometry::Transform3D::operator() )
-                , ( bp::arg("arg0"), bp::arg("arg1") ) );
-        
-        }
-        Transform3D_exposer.def( bp::self * bp::self );
-        { //::Geometry::Transform3D::operator=
-        
-            typedef ::Geometry::Transform3D & ( ::Geometry::Transform3D::*assign_function_type )( ::Geometry::Transform3D const & ) ;
-            
-            Transform3D_exposer.def( 
-                "assign"
-                , assign_function_type( &::Geometry::Transform3D::operator= )
-                , ( bp::arg("m") )
-                , bp::return_self< >() );
-        
-        }
-        { //::Geometry::Transform3D::operator[]
-        
-            typedef ::Geometry::Transform3D::Transform3D_row const ( ::Geometry::Transform3D::*__getitem___function_type )( int ) const;
-            
-            Transform3D_exposer.def( 
-                "__getitem__"
-                , __getitem___function_type( &::Geometry::Transform3D::operator[] )
-                , ( bp::arg("i") ) );
-        
-        }
-        { //::Geometry::Transform3D::setIdentity
-        
-            typedef void ( ::Geometry::Transform3D::*setIdentity_function_type )(  ) ;
-            
-            Transform3D_exposer.def( 
-                "setIdentity"
-                , setIdentity_function_type( &::Geometry::Transform3D::setIdentity ) );
-        
-        }
-        { //::Geometry::Transform3D::xx
-        
-            typedef double ( ::Geometry::Transform3D::*xx_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "xx"
-                , xx_function_type( &::Geometry::Transform3D::xx ) );
-        
-        }
-        { //::Geometry::Transform3D::xy
-        
-            typedef double ( ::Geometry::Transform3D::*xy_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "xy"
-                , xy_function_type( &::Geometry::Transform3D::xy ) );
-        
-        }
-        { //::Geometry::Transform3D::xz
-        
-            typedef double ( ::Geometry::Transform3D::*xz_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "xz"
-                , xz_function_type( &::Geometry::Transform3D::xz ) );
-        
-        }
-        { //::Geometry::Transform3D::yx
-        
-            typedef double ( ::Geometry::Transform3D::*yx_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "yx"
-                , yx_function_type( &::Geometry::Transform3D::yx ) );
-        
-        }
-        { //::Geometry::Transform3D::yy
-        
-            typedef double ( ::Geometry::Transform3D::*yy_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "yy"
-                , yy_function_type( &::Geometry::Transform3D::yy ) );
-        
-        }
-        { //::Geometry::Transform3D::yz
-        
-            typedef double ( ::Geometry::Transform3D::*yz_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "yz"
-                , yz_function_type( &::Geometry::Transform3D::yz ) );
-        
-        }
-        { //::Geometry::Transform3D::zx
-        
-            typedef double ( ::Geometry::Transform3D::*zx_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "zx"
-                , zx_function_type( &::Geometry::Transform3D::zx ) );
-        
-        }
-        { //::Geometry::Transform3D::zy
-        
-            typedef double ( ::Geometry::Transform3D::*zy_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "zy"
-                , zy_function_type( &::Geometry::Transform3D::zy ) );
-        
-        }
-        { //::Geometry::Transform3D::zz
-        
-            typedef double ( ::Geometry::Transform3D::*zz_function_type )(  ) const;
-            
-            Transform3D_exposer.def( 
-                "zz"
-                , zz_function_type( &::Geometry::Transform3D::zz ) );
-        
-        }
-        Transform3D_exposer.def_readonly( "Identity", Geometry::Transform3D::Identity );
-    }
-
-}
diff --git a/Core/PythonAPI/src/cvector_t.pypp.cpp b/Core/PythonAPI/src/cvector_t.pypp.cpp
index ae4e0129e4ffe855b766d9fb51c49cfd261cb676..3b6bd8e5f4a607c26a85d62dd42bad6605348b51 100644
--- a/Core/PythonAPI/src/cvector_t.pypp.cpp
+++ b/Core/PythonAPI/src/cvector_t.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "cvector_t.pypp.h"
 
 namespace bp = boost::python;
@@ -87,7 +20,7 @@ void register_cvector_t_class(){
         typedef bp::class_< Geometry::BasicVector3D< std::complex< double > > > cvector_t_exposer_t;
         cvector_t_exposer_t cvector_t_exposer = cvector_t_exposer_t( "cvector_t", bp::init< >() );
         bp::scope cvector_t_scope( cvector_t_exposer );
-        cvector_t_exposer.def( bp::init< std::complex< double > const &, std::complex< double > const &, std::complex< double > const & >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) );
+        cvector_t_exposer.def( bp::init< std::complex< double >, std::complex< double >, std::complex< double > >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) );
         { //::Geometry::BasicVector3D< std::complex< double > >::cross
         
             typedef Geometry::BasicVector3D< std::complex< double > > exported_class_t;
@@ -243,18 +176,6 @@ void register_cvector_t_class(){
                 , setZ_function_type( &::Geometry::BasicVector3D< std::complex< double > >::setZ )
                 , ( bp::arg("a") ) );
         
-        }
-        { //::Geometry::BasicVector3D< std::complex< double > >::transform
-        
-            typedef Geometry::BasicVector3D< std::complex< double > > exported_class_t;
-            typedef ::Geometry::BasicVector3D< std::complex< double > > & ( exported_class_t::*transform_function_type )( ::Geometry::Transform3D const & ) ;
-            
-            cvector_t_exposer.def( 
-                "transform"
-                , transform_function_type( &::Geometry::BasicVector3D< std::complex< double > >::transform )
-                , ( bp::arg("m") )
-                , bp::return_value_policy< bp::reference_existing_object >() );
-        
         }
         { //::Geometry::BasicVector3D< std::complex< double > >::x
         
@@ -286,9 +207,6 @@ void register_cvector_t_class(){
                 , z_function_type( &::Geometry::BasicVector3D< std::complex< double > >::z ) );
         
         }
-        cvector_t_exposer.def( bp::self + bp::self );
-        cvector_t_exposer.def( bp::self - bp::self );
-        cvector_t_exposer.def( bp::self / bp::other< double >() );
     }
 
 }
diff --git a/Core/PythonAPI/src/kvector_t.pypp.cpp b/Core/PythonAPI/src/kvector_t.pypp.cpp
index 70de3b61385fcc634f1f29fa1078568c355fdbce..8726306026eb44074444eb3bf89f560d202e4037 100644
--- a/Core/PythonAPI/src/kvector_t.pypp.cpp
+++ b/Core/PythonAPI/src/kvector_t.pypp.cpp
@@ -1,82 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "kvector_t.pypp.h"
 
 namespace bp = boost::python;
@@ -87,7 +20,7 @@ void register_kvector_t_class(){
         typedef bp::class_< Geometry::BasicVector3D< double > > kvector_t_exposer_t;
         kvector_t_exposer_t kvector_t_exposer = kvector_t_exposer_t( "kvector_t", bp::init< >() );
         bp::scope kvector_t_scope( kvector_t_exposer );
-        kvector_t_exposer.def( bp::init< double const &, double const &, double const & >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) );
+        kvector_t_exposer.def( bp::init< double, double, double >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) );
         { //::Geometry::BasicVector3D< double >::cross
         
             typedef Geometry::BasicVector3D< double > exported_class_t;
@@ -243,18 +176,6 @@ void register_kvector_t_class(){
                 , setZ_function_type( &::Geometry::BasicVector3D< double >::setZ )
                 , ( bp::arg("a") ) );
         
-        }
-        { //::Geometry::BasicVector3D< double >::transform
-        
-            typedef Geometry::BasicVector3D< double > exported_class_t;
-            typedef ::Geometry::BasicVector3D< double > & ( exported_class_t::*transform_function_type )( ::Geometry::Transform3D const & ) ;
-            
-            kvector_t_exposer.def( 
-                "transform"
-                , transform_function_type( &::Geometry::BasicVector3D< double >::transform )
-                , ( bp::arg("m") )
-                , bp::return_value_policy< bp::reference_existing_object >() );
-        
         }
         { //::Geometry::BasicVector3D< double >::x
         
@@ -286,7 +207,6 @@ void register_kvector_t_class(){
                 , z_function_type( &::Geometry::BasicVector3D< double >::z ) );
         
         }
-        kvector_t_exposer.def( bp::self_ns::str( bp::self ) );
         kvector_t_exposer.def( bp::self - bp::self );
         kvector_t_exposer.def( bp::self + bp::self );
         kvector_t_exposer.def( bp::other< double >() * bp::self );
diff --git a/Core/PythonAPI/src/ndimdata_t.pypp.cpp b/Core/PythonAPI/src/ndimdata_t.pypp.cpp
index 03d1f31121642e63cd9ca8cfc28c51c9c65f24a9..2553ec6532b3ed04b86e96555a9e1504ea4820eb 100644
--- a/Core/PythonAPI/src/ndimdata_t.pypp.cpp
+++ b/Core/PythonAPI/src/ndimdata_t.pypp.cpp
@@ -1,210 +1,313 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "ndimdata_t.pypp.h"
 
 namespace bp = boost::python;
 
 void register_ndimdata_t_class(){
 
-    bp::class_< OutputData< double >, boost::noncopyable >( "ndimdata_t", bp::init< >() )    
-        .def( 
-            "addAxis"
-            , (void ( ::OutputData<double>::* )( ::IAxis const & ) )( &::OutputData< double >::addAxis )
-            , ( bp::arg("new_axis") ) )    
-        .def( 
-            "addAxis"
-            , (void ( ::OutputData<double>::* )( ::std::string const &,::size_t,double,double ) )( &::OutputData< double >::addAxis )
-            , ( bp::arg("name"), bp::arg("size"), bp::arg("start"), bp::arg("end") ) )    
-        .def( 
-            "addMask"
-            , (void ( ::OutputData<double>::* )( ::Mask const & ) )( &::OutputData< double >::addMask )
-            , ( bp::arg("mask") ) )    
-        .def( 
-            "clear"
-            , (void ( ::OutputData<double>::* )(  ) )( &::OutputData< double >::clear ) )    
-        .def( 
-            "clone"
-            , (::OutputData< double > * ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::clone )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "copyFrom"
-            , (void ( ::OutputData<double>::* )( ::OutputData< double > const & ) )( &::OutputData< double >::copyFrom )
-            , ( bp::arg("other") ) )    
-        .def( 
-            "getAllSizes"
-            , (::std::vector< unsigned long > ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::getAllSizes ) )    
-        .def( 
-            "getAllocatedSize"
-            , (::size_t ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::getAllocatedSize ) )    
-        .def( 
-            "getAxis"
-            , (::IAxis const * ( ::OutputData<double>::* )( ::size_t ) const)( &::OutputData< double >::getAxis )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getAxis"
-            , (::IAxis const * ( ::OutputData<double>::* )( ::std::string const & ) const)( &::OutputData< double >::getAxis )
-            , ( bp::arg("label") )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getAxisIndex"
-            , (::size_t ( ::OutputData<double>::* )( ::std::string const & ) const)( &::OutputData< double >::getAxisIndex )
-            , ( bp::arg("label") ) )    
-        .def( 
-            "getBinOfAxis"
-            , (::Bin1D ( ::OutputData<double>::* )( ::std::string const &,::size_t ) const)( &::OutputData< double >::getBinOfAxis )
-            , ( bp::arg("axis_name"), bp::arg("index") ) )    
-        .def( 
-            "getIndexOfAxis"
-            , (::size_t ( ::OutputData<double>::* )( ::std::string const &,::size_t ) const)( &::OutputData< double >::getIndexOfAxis )
-            , ( bp::arg("axis_name"), bp::arg("total_index") ) )    
-        .def( 
-            "getMask"
-            , (::Mask * ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::getMask )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRank"
-            , (::size_t ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::getRank ) )    
-        .def( 
-            "getRawDataVector"
-            , (::std::vector< double > ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::getRawDataVector ) )    
-        .def( 
-            "getValueOfAxis"
-            , (double ( ::OutputData<double>::* )( ::std::string const &,::size_t ) const)( &::OutputData< double >::getValueOfAxis )
-            , ( bp::arg("axis_name"), bp::arg("index") ) )    
-        .def( 
-            "hasSameDimensions"
-            , (bool ( ::OutputData<double>::* )( ::OutputData< double > const & ) const)( &::OutputData< double >::hasSameDimensions )
-            , ( bp::arg("right") ) )    
-        .def( 
-            "hasSameShape"
-            , (bool ( ::OutputData<double>::* )( ::OutputData< double > const & ) const)( &::OutputData< double >::hasSameShape )
-            , ( bp::arg("right") ) )    
-        .def( bp::self *= bp::self )    
-        .def( bp::self += bp::self )    
-        .def( bp::self -= bp::self )    
-        .def( bp::self /= bp::self )    
-        .def( 
-            "__getitem__"
-            , (double & ( ::OutputData<double>::* )( ::size_t ) )( &::OutputData< double >::operator[] )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::copy_non_const_reference >() )    
-        .def( 
-            "__getitem__"
-            , (double const & ( ::OutputData<double>::* )( ::size_t ) const)( &::OutputData< double >::operator[] )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::copy_const_reference >() )    
-        .def( 
-            "removeAllMasks"
-            , (void ( ::OutputData<double>::* )(  ) )( &::OutputData< double >::removeAllMasks ) )    
-        .def( 
-            "scaleAll"
-            , (void ( ::OutputData<double>::* )( double const & ) )( &::OutputData< double >::scaleAll )
-            , ( bp::arg("factor") ) )    
-        .def( 
-            "setAllTo"
-            , (void ( ::OutputData<double>::* )( double const & ) )( &::OutputData< double >::setAllTo )
-            , ( bp::arg("value") ) )    
-        .def( 
-            "setMask"
-            , (void ( ::OutputData<double>::* )( ::Mask const & ) )( &::OutputData< double >::setMask )
-            , ( bp::arg("mask") ) )    
-        .def( 
-            "setRawDataVector"
-            , (void ( ::OutputData<double>::* )( ::std::vector< double > const & ) )( &::OutputData< double >::setRawDataVector )
-            , ( bp::arg("data_vector") ) )    
-        .def( 
-            "toCoordinate"
-            , (int ( ::OutputData<double>::* )( ::size_t,::size_t ) const)( &::OutputData< double >::toCoordinate )
-            , ( bp::arg("index"), bp::arg("i_selected_axis") ) )    
-        .def( 
-            "toCoordinates"
-            , (::std::vector< int > ( ::OutputData<double>::* )( ::size_t ) const)( &::OutputData< double >::toCoordinates )
-            , ( bp::arg("index") ) )    
-        .def( 
-            "toIndex"
-            , (::size_t ( ::OutputData<double>::* )( ::std::vector< int > ) const)( &::OutputData< double >::toIndex )
-            , ( bp::arg("coordinates") ) )    
-        .def( 
-            "totalSum"
-            , (double ( ::OutputData<double>::* )(  ) const)( &::OutputData< double >::totalSum ) )    
-        .def("__setitem__", &pyplusplus_setitem<OutputData<double >,int,double> );
+    { //::OutputData< double >
+        typedef bp::class_< OutputData< double >, boost::noncopyable > ndimdata_t_exposer_t;
+        ndimdata_t_exposer_t ndimdata_t_exposer = ndimdata_t_exposer_t( "ndimdata_t", bp::init< >() );
+        bp::scope ndimdata_t_scope( ndimdata_t_exposer );
+        { //::OutputData< double >::addAxis
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*addAxis_function_type )( ::IAxis const & ) ;
+            
+            ndimdata_t_exposer.def( 
+                "addAxis"
+                , addAxis_function_type( &::OutputData< double >::addAxis )
+                , ( bp::arg("new_axis") ) );
+        
+        }
+        { //::OutputData< double >::addAxis
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*addAxis_function_type )( ::std::string const &,::size_t,double,double ) ;
+            
+            ndimdata_t_exposer.def( 
+                "addAxis"
+                , addAxis_function_type( &::OutputData< double >::addAxis )
+                , ( bp::arg("name"), bp::arg("size"), bp::arg("start"), bp::arg("end") ) );
+        
+        }
+        { //::OutputData< double >::clear
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*clear_function_type )(  ) ;
+            
+            ndimdata_t_exposer.def( 
+                "clear"
+                , clear_function_type( &::OutputData< double >::clear ) );
+        
+        }
+        { //::OutputData< double >::clone
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::OutputData< double > * ( exported_class_t::*clone_function_type )(  ) const;
+            
+            ndimdata_t_exposer.def( 
+                "clone"
+                , clone_function_type( &::OutputData< double >::clone )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::OutputData< double >::copyFrom
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*copyFrom_function_type )( ::OutputData< double > const & ) ;
+            
+            ndimdata_t_exposer.def( 
+                "copyFrom"
+                , copyFrom_function_type( &::OutputData< double >::copyFrom )
+                , ( bp::arg("other") ) );
+        
+        }
+        { //::OutputData< double >::getAllSizes
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::std::vector< unsigned long > ( exported_class_t::*getAllSizes_function_type )(  ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getAllSizes"
+                , getAllSizes_function_type( &::OutputData< double >::getAllSizes ) );
+        
+        }
+        { //::OutputData< double >::getAllocatedSize
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::size_t ( exported_class_t::*getAllocatedSize_function_type )(  ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getAllocatedSize"
+                , getAllocatedSize_function_type( &::OutputData< double >::getAllocatedSize ) );
+        
+        }
+        { //::OutputData< double >::getAxis
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::IAxis const * ( exported_class_t::*getAxis_function_type )( ::size_t ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getAxis"
+                , getAxis_function_type( &::OutputData< double >::getAxis )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::OutputData< double >::getAxis
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::IAxis const * ( exported_class_t::*getAxis_function_type )( ::std::string const & ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getAxis"
+                , getAxis_function_type( &::OutputData< double >::getAxis )
+                , ( bp::arg("label") )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::OutputData< double >::getAxisIndex
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::size_t ( exported_class_t::*getAxisIndex_function_type )( ::std::string const & ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getAxisIndex"
+                , getAxisIndex_function_type( &::OutputData< double >::getAxisIndex )
+                , ( bp::arg("label") ) );
+        
+        }
+        { //::OutputData< double >::getIndexOfAxis
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::size_t ( exported_class_t::*getIndexOfAxis_function_type )( ::std::string const &,::size_t ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getIndexOfAxis"
+                , getIndexOfAxis_function_type( &::OutputData< double >::getIndexOfAxis )
+                , ( bp::arg("axis_name"), bp::arg("total_index") ) );
+        
+        }
+        { //::OutputData< double >::getRank
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::size_t ( exported_class_t::*getRank_function_type )(  ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getRank"
+                , getRank_function_type( &::OutputData< double >::getRank ) );
+        
+        }
+        { //::OutputData< double >::getRawDataVector
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::std::vector< double > ( exported_class_t::*getRawDataVector_function_type )(  ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getRawDataVector"
+                , getRawDataVector_function_type( &::OutputData< double >::getRawDataVector ) );
+        
+        }
+        { //::OutputData< double >::getValueOfAxis
+        
+            typedef OutputData< double > exported_class_t;
+            typedef double ( exported_class_t::*getValueOfAxis_function_type )( ::std::string const &,::size_t ) const;
+            
+            ndimdata_t_exposer.def( 
+                "getValueOfAxis"
+                , getValueOfAxis_function_type( &::OutputData< double >::getValueOfAxis )
+                , ( bp::arg("axis_name"), bp::arg("index") ) );
+        
+        }
+        { //::OutputData< double >::hasSameDimensions
+        
+            typedef OutputData< double > exported_class_t;
+            typedef bool ( exported_class_t::*hasSameDimensions_function_type )( ::OutputData< double > const & ) const;
+            
+            ndimdata_t_exposer.def( 
+                "hasSameDimensions"
+                , hasSameDimensions_function_type( &::OutputData< double >::hasSameDimensions )
+                , ( bp::arg("right") ) );
+        
+        }
+        { //::OutputData< double >::hasSameShape
+        
+            typedef OutputData< double > exported_class_t;
+            typedef bool ( exported_class_t::*hasSameShape_function_type )( ::OutputData< double > const & ) const;
+            
+            ndimdata_t_exposer.def( 
+                "hasSameShape"
+                , hasSameShape_function_type( &::OutputData< double >::hasSameShape )
+                , ( bp::arg("right") ) );
+        
+        }
+        ndimdata_t_exposer.def( bp::self *= bp::self );
+        ndimdata_t_exposer.def( bp::self += bp::self );
+        ndimdata_t_exposer.def( bp::self -= bp::self );
+        ndimdata_t_exposer.def( bp::self /= bp::self );
+        { //::OutputData< double >::operator[]
+        
+            typedef OutputData< double > exported_class_t;
+            typedef double & ( exported_class_t::*__getitem___function_type )( ::size_t ) ;
+            
+            ndimdata_t_exposer.def( 
+                "__getitem__"
+                , __getitem___function_type( &::OutputData< double >::operator[] )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::copy_non_const_reference >() );
+        
+        }
+        { //::OutputData< double >::operator[]
+        
+            typedef OutputData< double > exported_class_t;
+            typedef double const & ( exported_class_t::*__getitem___function_type )( ::size_t ) const;
+            
+            ndimdata_t_exposer.def( 
+                "__getitem__"
+                , __getitem___function_type( &::OutputData< double >::operator[] )
+                , ( bp::arg("index") )
+                , bp::return_value_policy< bp::copy_const_reference >() );
+        
+        }
+        { //::OutputData< double >::removeAllMasks
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*removeAllMasks_function_type )(  ) ;
+            
+            ndimdata_t_exposer.def( 
+                "removeAllMasks"
+                , removeAllMasks_function_type( &::OutputData< double >::removeAllMasks ) );
+        
+        }
+        { //::OutputData< double >::scaleAll
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*scaleAll_function_type )( double const & ) ;
+            
+            ndimdata_t_exposer.def( 
+                "scaleAll"
+                , scaleAll_function_type( &::OutputData< double >::scaleAll )
+                , ( bp::arg("factor") ) );
+        
+        }
+        { //::OutputData< double >::setAllTo
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*setAllTo_function_type )( double const & ) ;
+            
+            ndimdata_t_exposer.def( 
+                "setAllTo"
+                , setAllTo_function_type( &::OutputData< double >::setAllTo )
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::OutputData< double >::setRawDataVector
+        
+            typedef OutputData< double > exported_class_t;
+            typedef void ( exported_class_t::*setRawDataVector_function_type )( ::std::vector< double > const & ) ;
+            
+            ndimdata_t_exposer.def( 
+                "setRawDataVector"
+                , setRawDataVector_function_type( &::OutputData< double >::setRawDataVector )
+                , ( bp::arg("data_vector") ) );
+        
+        }
+        { //::OutputData< double >::toCoordinate
+        
+            typedef OutputData< double > exported_class_t;
+            typedef int ( exported_class_t::*toCoordinate_function_type )( ::size_t,::size_t ) const;
+            
+            ndimdata_t_exposer.def( 
+                "toCoordinate"
+                , toCoordinate_function_type( &::OutputData< double >::toCoordinate )
+                , ( bp::arg("index"), bp::arg("i_selected_axis") ) );
+        
+        }
+        { //::OutputData< double >::toCoordinates
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::std::vector< int > ( exported_class_t::*toCoordinates_function_type )( ::size_t ) const;
+            
+            ndimdata_t_exposer.def( 
+                "toCoordinates"
+                , toCoordinates_function_type( &::OutputData< double >::toCoordinates )
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::OutputData< double >::toIndex
+        
+            typedef OutputData< double > exported_class_t;
+            typedef ::size_t ( exported_class_t::*toIndex_function_type )( ::std::vector< int > ) const;
+            
+            ndimdata_t_exposer.def( 
+                "toIndex"
+                , toIndex_function_type( &::OutputData< double >::toIndex )
+                , ( bp::arg("coordinates") ) );
+        
+        }
+        { //::OutputData< double >::totalSum
+        
+            typedef OutputData< double > exported_class_t;
+            typedef double ( exported_class_t::*totalSum_function_type )(  ) const;
+            
+            ndimdata_t_exposer.def( 
+                "totalSum"
+                , totalSum_function_type( &::OutputData< double >::totalSum ) );
+        
+        }
+        ndimdata_t_exposer.def("__setitem__", &pyplusplus_setitem<OutputData<double >,int,double> );
+    }
 
 }
diff --git a/Core/PythonAPI/src/vdouble1d_t.pypp.cpp b/Core/PythonAPI/src/vdouble1d_t.pypp.cpp
index 31026504f20fda5b026bcce19a2d7363b27b343b..a2fe9490d81b378a218b610b24c87ee39efd6bbb 100644
--- a/Core/PythonAPI/src/vdouble1d_t.pypp.cpp
+++ b/Core/PythonAPI/src/vdouble1d_t.pypp.cpp
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
@@ -7,76 +10,7 @@ GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "vdouble1d_t.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/PythonAPI/src/vector_DiffuseParticleInfoPtr_t.pypp.cpp b/Core/PythonAPI/src/vector_DiffuseParticleInfoPtr_t.pypp.cpp
deleted file mode 100644
index f4fcc91eb2012f45a287a080e69a5fff132f5477..0000000000000000000000000000000000000000
--- a/Core/PythonAPI/src/vector_DiffuseParticleInfoPtr_t.pypp.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
-#include "vector_DiffuseParticleInfoPtr_t.pypp.h"
-
-namespace bp = boost::python;
-
-void register_vector_DiffuseParticleInfoPtr_t_class(){
-
-    { //::std::vector< DiffuseParticleInfo* >
-        typedef bp::class_< std::vector< DiffuseParticleInfo* > > vector_DiffuseParticleInfoPtr_t_exposer_t;
-        vector_DiffuseParticleInfoPtr_t_exposer_t vector_DiffuseParticleInfoPtr_t_exposer = vector_DiffuseParticleInfoPtr_t_exposer_t( "vector_DiffuseParticleInfoPtr_t" );
-        bp::scope vector_DiffuseParticleInfoPtr_t_scope( vector_DiffuseParticleInfoPtr_t_exposer );
-        vector_DiffuseParticleInfoPtr_t_exposer.def( bp::vector_indexing_suite< ::std::vector< DiffuseParticleInfo* > >() );
-    }
-
-}
diff --git a/Core/PythonAPI/src/vector_IFormFactorPtr_t.pypp.cpp b/Core/PythonAPI/src/vector_IFormFactorPtr_t.pypp.cpp
index 4557dd48944749dbea0da0ae3c1b8fb8515d64d8..4cba78795a0b2f4af21f952f4d9e687991284aeb 100644
--- a/Core/PythonAPI/src/vector_IFormFactorPtr_t.pypp.cpp
+++ b/Core/PythonAPI/src/vector_IFormFactorPtr_t.pypp.cpp
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
@@ -7,76 +10,7 @@ GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "vector_IFormFactorPtr_t.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/PythonAPI/src/vector_integer_t.pypp.cpp b/Core/PythonAPI/src/vector_integer_t.pypp.cpp
index 6d798db783fae57cd26237dd77253a094003a4a6..faccf920ffe7ebf6fcd1d24b63a54fd9294f8588 100644
--- a/Core/PythonAPI/src/vector_integer_t.pypp.cpp
+++ b/Core/PythonAPI/src/vector_integer_t.pypp.cpp
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
@@ -7,76 +10,7 @@ GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "vector_integer_t.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/PythonAPI/src/vector_kvector_t.pypp.cpp b/Core/PythonAPI/src/vector_kvector_t.pypp.cpp
index fa5c397693ce7aa7da433b9f8d87f0a1156d9cb7..0db096bda718932aa726a2e3d85e042bca18c092 100644
--- a/Core/PythonAPI/src/vector_kvector_t.pypp.cpp
+++ b/Core/PythonAPI/src/vector_kvector_t.pypp.cpp
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
@@ -7,76 +10,7 @@ GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "vector_kvector_t.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/PythonAPI/src/vector_longinteger_t.pypp.cpp b/Core/PythonAPI/src/vector_longinteger_t.pypp.cpp
index 69514170d6e906ef7fdba86ebac7a96504d74a19..fe28212b09d781350e50b003e0131f32109ec1bf 100644
--- a/Core/PythonAPI/src/vector_longinteger_t.pypp.cpp
+++ b/Core/PythonAPI/src/vector_longinteger_t.pypp.cpp
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
@@ -7,76 +10,7 @@ GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "BasicVector3D.h"
-#include "Bin.h"
-#include "Crystal.h"
-#include "DiffuseParticleInfo.h"
-#include "FTDistributions.h"
-#include "FormFactorBox.h"
-#include "FormFactorCrystal.h"
-#include "FormFactorCylinder.h"
-#include "FormFactorDecoratorDebyeWaller.h"
-#include "FormFactorFullSphere.h"
-#include "FormFactorGauss.h"
-#include "FormFactorLorentz.h"
-#include "FormFactorParallelepiped.h"
-#include "FormFactorPrism3.h"
-#include "FormFactorPyramid.h"
-#include "FormFactorSphereGaussianRadius.h"
-#include "HomogeneousMaterial.h"
-#include "ICloneable.h"
-#include "IClusteredParticles.h"
-#include "ICompositeSample.h"
-#include "IDecoration.h"
-#include "IFormFactor.h"
-#include "IFormFactorBorn.h"
-#include "IFormFactorDecorator.h"
-#include "IInterferenceFunction.h"
-#include "IMaterial.h"
-#include "IParameterized.h"
-#include "ISample.h"
-#include "ISampleBuilder.h"
-#include "ISelectionRule.h"
-#include "ISingleton.h"
-#include "Instrument.h"
-#include "InterferenceFunction1DParaCrystal.h"
-#include "InterferenceFunction2DLattice.h"
-#include "InterferenceFunction2DParaCrystal.h"
-#include "InterferenceFunctionNone.h"
-#include "IResolutionFunction2D.h"
-#include "Lattice.h"
-#include "Lattice2DIFParameters.h"
-#include "LatticeBasis.h"
-#include "Layer.h"
-#include "LayerDecorator.h"
-#include "LayerRoughness.h"
-#include "Lattice2DIFParameters.h"
-#include "MaterialManager.h"
-#include "MesoCrystal.h"
-#include "MultiLayer.h"
-#include "OpticalFresnel.h"
-#include "ParameterPool.h"
-#include "Particle.h"
-#include "ParticleBuilder.h"
-#include "ParticleCoreShell.h"
-#include "ParticleDecoration.h"
-#include "OutputData.h"
-#include "OutputDataIOFactory.h"
-#include "ParticleInfo.h"
-#include "PositionParticleInfo.h"
-#include "PythonOutputData.h"
-#include "PythonPlusplusHelper.h"
-#include "RealParameterWrapper.h"
-#include "Simulation.h"
-#include "SimulationParameters.h"
-#include "IStochasticParameter.h"
-#include "ResolutionFunction2DSimple.h"
-#include "StochasticGaussian.h"
-#include "StochasticSampledParameter.h"
-#include "StochasticDoubleGate.h"
-#include "Transform3D.h"
-#include "Types.h"
-#include "Units.h"
+#include "PythonCoreList.h"
 #include "vector_longinteger_t.pypp.h"
 
 namespace bp = boost::python;
diff --git a/Core/Samples/inc/IDecoration.h b/Core/Samples/inc/IDecoration.h
index 46e16c19a5c7cf9b352d424d7d7e7fe6be8207f6..e077a352878be09e8f010e19d618b81c055a7e95 100644
--- a/Core/Samples/inc/IDecoration.h
+++ b/Core/Samples/inc/IDecoration.h
@@ -26,8 +26,6 @@ class IInterferenceFunction;
 
 //! Interface to equip a sample component with various properties.
 
-//! Currently (March 2013) the only child class is ParticleDecoration.
-
 class IDecoration : public ICompositeSample
 {
  public:
diff --git a/Core/Samples/inc/Layer.h b/Core/Samples/inc/Layer.h
index dbf75cf0208cd4d727a740acb50bbfa17672077f..a2f92dc2170a875d5092e1e7e5dd2ff4544239cd 100644
--- a/Core/Samples/inc/Layer.h
+++ b/Core/Samples/inc/Layer.h
@@ -45,6 +45,7 @@ class Layer : public ICompositeSample
     virtual ~Layer() {}
 
     virtual Layer *clone() const { return new Layer(*this); }
+    //virtual Layer *clone() const { return new Layer(mp_material, m_thickness); }
 
     //! Sets layer thickness in Angstrom.
     virtual void setThickness(double thickness);
@@ -76,7 +77,7 @@ class Layer : public ICompositeSample
     virtual LayerDWBASimulation *createDWBASimulation() const { return 0; }
 
  protected:
-    Layer(const Layer& other)
+    Layer(const Layer& other) : ICompositeSample()
     {
         mp_material = other.mp_material;
         m_thickness = other.m_thickness;
diff --git a/Core/python_module.pri b/Core/python_module.pri
index 65faaabe02041f86bfa35ce104e407b552ddd43d..642092941e6a992a64d59701c8089d594b6243e0 100644
--- a/Core/python_module.pri
+++ b/Core/python_module.pri
@@ -2,38 +2,45 @@ HEADERS +=  \
     PythonAPI/inc/PythonListConverter.h \ 
     PythonAPI/inc/PythonModule.h \ 
     PythonAPI/inc/PythonOutputData.h \ 
-    PythonAPI/inc/PythonPlusplusHelper.h \ 
+    PythonAPI/inc/PythonCoreExposer.h \ 
+    PythonAPI/inc/PythonCoreList.h \ 
+    PythonAPI/inc/Beam.pypp.h \
     PythonAPI/inc/Bin1D.pypp.h \
     PythonAPI/inc/Bin1DCVector.pypp.h \
     PythonAPI/inc/Crystal.pypp.h \
     PythonAPI/inc/cvector_t.pypp.h \
-    PythonAPI/inc/DiffuseDWBASimulation.pypp.h \
-    PythonAPI/inc/DiffuseParticleInfo.pypp.h \
+    PythonAPI/inc/Detector.pypp.h \
     PythonAPI/inc/FormFactorBox.pypp.h \
+    PythonAPI/inc/FormFactorCone.pypp.h \
     PythonAPI/inc/FormFactorCrystal.pypp.h \
     PythonAPI/inc/FormFactorCylinder.pypp.h \
     PythonAPI/inc/FormFactorDecoratorDebyeWaller.pypp.h \
+    PythonAPI/inc/FormFactorEllipsoid.pypp.h \
     PythonAPI/inc/FormFactorFullSphere.pypp.h \
+    PythonAPI/inc/FormFactorFullSpheroid.pypp.h \
     PythonAPI/inc/FormFactorGauss.pypp.h \
+    PythonAPI/inc/FormFactorHemiSpheroid.pypp.h \
     PythonAPI/inc/FormFactorLorentz.pypp.h \
     PythonAPI/inc/FormFactorParallelepiped.pypp.h \
     PythonAPI/inc/FormFactorPrism3.pypp.h \
+    PythonAPI/inc/FormFactorPrism6.pypp.h \
     PythonAPI/inc/FormFactorPyramid.pypp.h \
+    PythonAPI/inc/FormFactorSphere.pypp.h \
     PythonAPI/inc/FormFactorSphereGaussianRadius.pypp.h \
     PythonAPI/inc/FTDistribution2DCauchy.pypp.h \
     PythonAPI/inc/HomogeneousMaterial.pypp.h \
+    PythonAPI/inc/IAxis.pypp.h \
     PythonAPI/inc/ICloneable.pypp.h \
     PythonAPI/inc/IClusteredParticles.pypp.h \
     PythonAPI/inc/ICompositeSample.pypp.h \
     PythonAPI/inc/IDecoration.pypp.h \
+    PythonAPI/inc/IDetectorResolution.pypp.h \
     PythonAPI/inc/IFormFactor.pypp.h \
     PythonAPI/inc/IFormFactorBorn.pypp.h \
     PythonAPI/inc/IFormFactorDecorator.pypp.h \
-    PythonAPI/inc/IFTDistribution1D.pypp.h \
     PythonAPI/inc/IFTDistribution2D.pypp.h \
     PythonAPI/inc/IInterferenceFunction.pypp.h \
     PythonAPI/inc/IMaterial.pypp.h \
-    PythonAPI/inc/IndexVector3D.pypp.h \
     PythonAPI/inc/Instrument.pypp.h \
     PythonAPI/inc/InterferenceFunction1DParaCrystal.pypp.h \
     PythonAPI/inc/InterferenceFunction2DLattice.pypp.h \
@@ -44,24 +51,19 @@ HEADERS +=  \
     PythonAPI/inc/ISample.pypp.h \
     PythonAPI/inc/ISampleBuilder.pypp.h \
     PythonAPI/inc/ISelectionRule.pypp.h \
-    PythonAPI/inc/ISimulation.pypp.h \
-    PythonAPI/inc/IStochasticParameter.pypp.h \
+    PythonAPI/inc/ITransform3D.pypp.h \
     PythonAPI/inc/kvector_t.pypp.h \
     PythonAPI/inc/Lattice.pypp.h \
     PythonAPI/inc/Lattice2DIFParameters.pypp.h \
     PythonAPI/inc/LatticeBasis.pypp.h \
     PythonAPI/inc/Layer.pypp.h \
     PythonAPI/inc/LayerDecorator.pypp.h \
-    PythonAPI/inc/LayerDecoratorDWBASimulation.pypp.h \
-    PythonAPI/inc/LayerDWBASimulation.pypp.h \
+    PythonAPI/inc/LayerInterface.pypp.h \
     PythonAPI/inc/LayerRoughness.pypp.h \
     PythonAPI/inc/MaterialManager.pypp.h \
-    PythonAPI/inc/MaterialManagerSingleton_t.pypp.h \
     PythonAPI/inc/MesoCrystal.pypp.h \
     PythonAPI/inc/MultiLayer.pypp.h \
-    PythonAPI/inc/MultiLayerDWBASimulation.pypp.h \
     PythonAPI/inc/ndimdata_t.pypp.h \
-    PythonAPI/inc/OpticalFresnel.pypp.h \
     PythonAPI/inc/OutputDataIOFactory.pypp.h \
     PythonAPI/inc/ParameterPool.pypp.h \
     PythonAPI/inc/Particle.pypp.h \
@@ -74,10 +76,8 @@ HEADERS +=  \
     PythonAPI/inc/PythonInterface_global_variables.pypp.h \
     PythonAPI/inc/RealParameterWrapper.pypp.h \
     PythonAPI/inc/ResolutionFunction2DSimple.pypp.h \
-    PythonAPI/inc/Rotate3D.pypp.h \
-    PythonAPI/inc/RotateX3D.pypp.h \
-    PythonAPI/inc/RotateY3D.pypp.h \
-    PythonAPI/inc/RotateZ3D.pypp.h \
+    PythonAPI/inc/RotateY_3D.pypp.h \
+    PythonAPI/inc/RotateZ_3D.pypp.h \
     PythonAPI/inc/SimpleSelectionRule.pypp.h \
     PythonAPI/inc/Simulation.pypp.h \
     PythonAPI/inc/SimulationParameters.pypp.h \
@@ -85,9 +85,7 @@ HEADERS +=  \
     PythonAPI/inc/StochasticDoubleGaussian.pypp.h \
     PythonAPI/inc/StochasticParameter_t.pypp.h \
     PythonAPI/inc/StochasticSampledParameter.pypp.h \
-    PythonAPI/inc/Transform3D.pypp.h \
     PythonAPI/inc/vdouble1d_t.pypp.h \
-    PythonAPI/inc/vector_DiffuseParticleInfoPtr_t.pypp.h \
     PythonAPI/inc/vector_IFormFactorPtr_t.pypp.h \
     PythonAPI/inc/vector_integer_t.pypp.h \
     PythonAPI/inc/vector_kvector_t.pypp.h \
@@ -99,38 +97,44 @@ SOURCES +=  \
     PythonAPI/src/PythonModule.cpp \ 
     PythonAPI/src/PythonListConverter.cpp \ 
     PythonAPI/src/PythonOutputData.cpp \ 
-    PythonAPI/src/PythonPlusplusHelper.cpp \ 
+    PythonAPI/src/PythonCoreExposer.cpp \ 
+    PythonAPI/src/Beam.pypp.cpp \
     PythonAPI/src/Bin1D.pypp.cpp \
     PythonAPI/src/Bin1DCVector.pypp.cpp \
     PythonAPI/src/Crystal.pypp.cpp \
     PythonAPI/src/cvector_t.pypp.cpp \
-    PythonAPI/src/DiffuseDWBASimulation.pypp.cpp \
-    PythonAPI/src/DiffuseParticleInfo.pypp.cpp \
+    PythonAPI/src/Detector.pypp.cpp \
     PythonAPI/src/FormFactorBox.pypp.cpp \
+    PythonAPI/src/FormFactorCone.pypp.cpp \
     PythonAPI/src/FormFactorCrystal.pypp.cpp \
     PythonAPI/src/FormFactorCylinder.pypp.cpp \
     PythonAPI/src/FormFactorDecoratorDebyeWaller.pypp.cpp \
+    PythonAPI/src/FormFactorEllipsoid.pypp.cpp \
     PythonAPI/src/FormFactorFullSphere.pypp.cpp \
+    PythonAPI/src/FormFactorFullSpheroid.pypp.cpp \
     PythonAPI/src/FormFactorGauss.pypp.cpp \
+    PythonAPI/src/FormFactorHemiSpheroid.pypp.cpp \
     PythonAPI/src/FormFactorLorentz.pypp.cpp \
     PythonAPI/src/FormFactorParallelepiped.pypp.cpp \
     PythonAPI/src/FormFactorPrism3.pypp.cpp \
+    PythonAPI/src/FormFactorPrism6.pypp.cpp \
     PythonAPI/src/FormFactorPyramid.pypp.cpp \
+    PythonAPI/src/FormFactorSphere.pypp.cpp \
     PythonAPI/src/FormFactorSphereGaussianRadius.pypp.cpp \
     PythonAPI/src/FTDistribution2DCauchy.pypp.cpp \
     PythonAPI/src/HomogeneousMaterial.pypp.cpp \
+    PythonAPI/src/IAxis.pypp.cpp \
     PythonAPI/src/ICloneable.pypp.cpp \
     PythonAPI/src/IClusteredParticles.pypp.cpp \
     PythonAPI/src/ICompositeSample.pypp.cpp \
     PythonAPI/src/IDecoration.pypp.cpp \
+    PythonAPI/src/IDetectorResolution.pypp.cpp \
     PythonAPI/src/IFormFactor.pypp.cpp \
     PythonAPI/src/IFormFactorBorn.pypp.cpp \
     PythonAPI/src/IFormFactorDecorator.pypp.cpp \
-    PythonAPI/src/IFTDistribution1D.pypp.cpp \
     PythonAPI/src/IFTDistribution2D.pypp.cpp \
     PythonAPI/src/IInterferenceFunction.pypp.cpp \
     PythonAPI/src/IMaterial.pypp.cpp \
-    PythonAPI/src/IndexVector3D.pypp.cpp \
     PythonAPI/src/Instrument.pypp.cpp \
     PythonAPI/src/InterferenceFunction1DParaCrystal.pypp.cpp \
     PythonAPI/src/InterferenceFunction2DLattice.pypp.cpp \
@@ -141,24 +145,19 @@ SOURCES +=  \
     PythonAPI/src/ISample.pypp.cpp \
     PythonAPI/src/ISampleBuilder.pypp.cpp \
     PythonAPI/src/ISelectionRule.pypp.cpp \
-    PythonAPI/src/ISimulation.pypp.cpp \
-    PythonAPI/src/IStochasticParameter.pypp.cpp \
+    PythonAPI/src/ITransform3D.pypp.cpp \
     PythonAPI/src/kvector_t.pypp.cpp \
     PythonAPI/src/Lattice.pypp.cpp \
     PythonAPI/src/Lattice2DIFParameters.pypp.cpp \
     PythonAPI/src/LatticeBasis.pypp.cpp \
     PythonAPI/src/Layer.pypp.cpp \
     PythonAPI/src/LayerDecorator.pypp.cpp \
-    PythonAPI/src/LayerDecoratorDWBASimulation.pypp.cpp \
-    PythonAPI/src/LayerDWBASimulation.pypp.cpp \
+    PythonAPI/src/LayerInterface.pypp.cpp \
     PythonAPI/src/LayerRoughness.pypp.cpp \
     PythonAPI/src/MaterialManager.pypp.cpp \
-    PythonAPI/src/MaterialManagerSingleton_t.pypp.cpp \
     PythonAPI/src/MesoCrystal.pypp.cpp \
     PythonAPI/src/MultiLayer.pypp.cpp \
-    PythonAPI/src/MultiLayerDWBASimulation.pypp.cpp \
     PythonAPI/src/ndimdata_t.pypp.cpp \
-    PythonAPI/src/OpticalFresnel.pypp.cpp \
     PythonAPI/src/OutputDataIOFactory.pypp.cpp \
     PythonAPI/src/ParameterPool.pypp.cpp \
     PythonAPI/src/Particle.pypp.cpp \
@@ -171,10 +170,8 @@ SOURCES +=  \
     PythonAPI/src/PythonInterface_global_variables.pypp.cpp \
     PythonAPI/src/RealParameterWrapper.pypp.cpp \
     PythonAPI/src/ResolutionFunction2DSimple.pypp.cpp \
-    PythonAPI/src/Rotate3D.pypp.cpp \
-    PythonAPI/src/RotateX3D.pypp.cpp \
-    PythonAPI/src/RotateY3D.pypp.cpp \
-    PythonAPI/src/RotateZ3D.pypp.cpp \
+    PythonAPI/src/RotateY_3D.pypp.cpp \
+    PythonAPI/src/RotateZ_3D.pypp.cpp \
     PythonAPI/src/SimpleSelectionRule.pypp.cpp \
     PythonAPI/src/Simulation.pypp.cpp \
     PythonAPI/src/SimulationParameters.pypp.cpp \
@@ -182,9 +179,7 @@ SOURCES +=  \
     PythonAPI/src/StochasticDoubleGaussian.pypp.cpp \
     PythonAPI/src/StochasticParameter_t.pypp.cpp \
     PythonAPI/src/StochasticSampledParameter.pypp.cpp \
-    PythonAPI/src/Transform3D.pypp.cpp \
     PythonAPI/src/vdouble1d_t.pypp.cpp \
-    PythonAPI/src/vector_DiffuseParticleInfoPtr_t.pypp.cpp \
     PythonAPI/src/vector_IFormFactorPtr_t.pypp.cpp \
     PythonAPI/src/vector_integer_t.pypp.cpp \
     PythonAPI/src/vector_kvector_t.pypp.cpp \
diff --git a/Fit/PythonAPI/inc/AttLimits.pypp.h b/Fit/PythonAPI/inc/AttLimits.pypp.h
index 60a20bbe27ef368f403d273dd9d9c27191c8f257..53e95cfad4b93c69207a59113e5d4308aef27658 100644
--- a/Fit/PythonAPI/inc/AttLimits.pypp.h
+++ b/Fit/PythonAPI/inc/AttLimits.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef AttLimits_hpp__pyplusplus_wrapper
 #define AttLimits_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/ChiSquaredModule.pypp.h b/Fit/PythonAPI/inc/ChiSquaredModule.pypp.h
index 3924a7c3b78b44865d29d53da770d03adf77a481..1b1b596eea8e50009579bf549a08a95600a1a0ff 100644
--- a/Fit/PythonAPI/inc/ChiSquaredModule.pypp.h
+++ b/Fit/PythonAPI/inc/ChiSquaredModule.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ChiSquaredModule_hpp__pyplusplus_wrapper
 #define ChiSquaredModule_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/FitSuite.pypp.h b/Fit/PythonAPI/inc/FitSuite.pypp.h
index 11d9333df2169d2e2e174b44d2a16b5ed3b6608c..c690587bf082f902eff2eb5ddccf005c7aa7f647 100644
--- a/Fit/PythonAPI/inc/FitSuite.pypp.h
+++ b/Fit/PythonAPI/inc/FitSuite.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FitSuite_hpp__pyplusplus_wrapper
 #define FitSuite_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/FitSuiteParameters.pypp.h b/Fit/PythonAPI/inc/FitSuiteParameters.pypp.h
index 0cbc4c7700505c7f1d119e6bcdf57314a5de0cb2..fd05b9420954b138ed83b355e5090bdc1ffa32f5 100644
--- a/Fit/PythonAPI/inc/FitSuiteParameters.pypp.h
+++ b/Fit/PythonAPI/inc/FitSuiteParameters.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef FitSuiteParameters_hpp__pyplusplus_wrapper
 #define FitSuiteParameters_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/IChiSquaredModule.pypp.h b/Fit/PythonAPI/inc/IChiSquaredModule.pypp.h
index f1111284935ca134c49419a0e2c06a13a1384ddb..0d80efaacf118be998ae89cd3f361935f8e0208a 100644
--- a/Fit/PythonAPI/inc/IChiSquaredModule.pypp.h
+++ b/Fit/PythonAPI/inc/IChiSquaredModule.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IChiSquaredModule_hpp__pyplusplus_wrapper
 #define IChiSquaredModule_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/IMinimizer.pypp.h b/Fit/PythonAPI/inc/IMinimizer.pypp.h
index 066237be2d4f7c4d4bd6c850a1e004ed7cd9439c..bb0b5d3479cc4f3c01f8463c2f660ab67ffc168f 100644
--- a/Fit/PythonAPI/inc/IMinimizer.pypp.h
+++ b/Fit/PythonAPI/inc/IMinimizer.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IMinimizer_hpp__pyplusplus_wrapper
 #define IMinimizer_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/IOutputDataNormalizer.pypp.h b/Fit/PythonAPI/inc/IOutputDataNormalizer.pypp.h
index 031b271dd52eac136eabdf0b9d078a6e72c9c6fe..897ac9f10e43f2b2bcacb98e4b01be0f0ccce04a 100644
--- a/Fit/PythonAPI/inc/IOutputDataNormalizer.pypp.h
+++ b/Fit/PythonAPI/inc/IOutputDataNormalizer.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef IOutputDataNormalizer_hpp__pyplusplus_wrapper
 #define IOutputDataNormalizer_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/ISquaredFunction.pypp.h b/Fit/PythonAPI/inc/ISquaredFunction.pypp.h
index da9d91e883e8d2a98966e65386dfb00221aadc4d..3ebb75fe6d1ced9285d5b24b37fd5d2152a72105 100644
--- a/Fit/PythonAPI/inc/ISquaredFunction.pypp.h
+++ b/Fit/PythonAPI/inc/ISquaredFunction.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef ISquaredFunction_hpp__pyplusplus_wrapper
 #define ISquaredFunction_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/MinimizerFactory.pypp.h b/Fit/PythonAPI/inc/MinimizerFactory.pypp.h
index 657b4d43b7614109abf21a02dbe321f6045442d3..5064c65127803e3a14bfca5fef11cee9f426b162 100644
--- a/Fit/PythonAPI/inc/MinimizerFactory.pypp.h
+++ b/Fit/PythonAPI/inc/MinimizerFactory.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef MinimizerFactory_hpp__pyplusplus_wrapper
 #define MinimizerFactory_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/OutputDataNormalizer.pypp.h b/Fit/PythonAPI/inc/OutputDataNormalizer.pypp.h
index 6da897293fb34277bf61dc95fbb4d8e26de7e38d..6dc42593d7d3129e49c211ab672cafd574a7e562 100644
--- a/Fit/PythonAPI/inc/OutputDataNormalizer.pypp.h
+++ b/Fit/PythonAPI/inc/OutputDataNormalizer.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef OutputDataNormalizer_hpp__pyplusplus_wrapper
 #define OutputDataNormalizer_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/OutputDataSimpleNormalizer.pypp.h b/Fit/PythonAPI/inc/OutputDataSimpleNormalizer.pypp.h
index 8ea81066d4d2a082da40fef83bc71c5a87455a6a..62ac0226e6c1883f752ee53cd56d0a075272c506 100644
--- a/Fit/PythonAPI/inc/OutputDataSimpleNormalizer.pypp.h
+++ b/Fit/PythonAPI/inc/OutputDataSimpleNormalizer.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef OutputDataSimpleNormalizer_hpp__pyplusplus_wrapper
 #define OutputDataSimpleNormalizer_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/PythonFitExposer.h b/Fit/PythonAPI/inc/PythonFitExposer.h
new file mode 100644
index 0000000000000000000000000000000000000000..72716dd53e4d9d4c9b7b82f7d06bf948ebfec155
--- /dev/null
+++ b/Fit/PythonAPI/inc/PythonFitExposer.h
@@ -0,0 +1,23 @@
+#ifndef PYTHONFITEXPOSER_H
+#define PYTHONFITEXPOSER_H
+
+#include "Types.h"
+
+
+//! this is special namespace to help Py++ generate correct names
+namespace pyplusplus {
+    namespace aliases {
+    typedef std::vector<double > vdouble1d_t;
+    typedef std::vector<vdouble1d_t > vdouble2d_t;
+    typedef std::vector<complex_t > vcomplex1d_t;
+    }
+}
+
+
+//! functions to help Py++ with template instantiation
+namespace pyplusplus {
+    inline size_t pyplusplus_boost_vdouble1d() { return sizeof(pyplusplus::aliases::vdouble1d_t); }
+    inline size_t pyplusplus_boost_vcomplex1d() { return sizeof(pyplusplus::aliases::vcomplex1d_t); }
+}
+
+#endif // PYTHONFITEXPOSER_H
diff --git a/Fit/PythonAPI/inc/PythonFitList.h b/Fit/PythonAPI/inc/PythonFitList.h
new file mode 100644
index 0000000000000000000000000000000000000000..687ac7b6c9749f90fdca6c3c7f1bd8e5aa882ce0
--- /dev/null
+++ b/Fit/PythonAPI/inc/PythonFitList.h
@@ -0,0 +1,22 @@
+#ifndef PYTHONFITLIST_H
+#define PYTHONFITLIST_H
+
+//! list of files to process with Py++
+
+#include "AttLimits.h"
+#include "IChiSquaredModule.h"
+#include "IMinimizer.h"
+#include "ChiSquaredModule.h"
+#include "FitSuite.h"
+#include "FitParameter.h"
+#include "FitSuiteParameters.h"
+#include "MinimizerFactory.h"
+#include "MathFunctions.h"
+#include "ISquaredFunction.h"
+#include "IOutputDataNormalizer.h"
+
+//! file containig additional exposers
+#include "PythonFitExposer.h"
+
+
+#endif // PYTHONFITLIST_H
diff --git a/Fit/PythonAPI/inc/PythonInterface_enumerations.pypp.h b/Fit/PythonAPI/inc/PythonInterface_enumerations.pypp.h
deleted file mode 100644
index 6e018af0847a957a93bda749d8c7b7fbbb9c99b1..0000000000000000000000000000000000000000
--- a/Fit/PythonAPI/inc/PythonInterface_enumerations.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef PythonInterface_enumerations_hpp__pyplusplus_wrapper
-#define PythonInterface_enumerations_hpp__pyplusplus_wrapper
-
-void register_enumerations();
-
-#endif//PythonInterface_enumerations_hpp__pyplusplus_wrapper
diff --git a/Fit/PythonAPI/inc/PythonInterface_free_functions.pypp.h b/Fit/PythonAPI/inc/PythonInterface_free_functions.pypp.h
deleted file mode 100644
index 0600a558b716e773e0d47ed4785fe07b4c005951..0000000000000000000000000000000000000000
--- a/Fit/PythonAPI/inc/PythonInterface_free_functions.pypp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file has been generated by Py++.
-
-#ifndef PythonInterface_free_functions_hpp__pyplusplus_wrapper
-#define PythonInterface_free_functions_hpp__pyplusplus_wrapper
-
-void register_free_functions();
-
-#endif//PythonInterface_free_functions_hpp__pyplusplus_wrapper
diff --git a/Fit/PythonAPI/inc/PythonPlusplusFitHelper.h b/Fit/PythonAPI/inc/PythonPlusplusFitHelper.h
deleted file mode 100644
index 79317f5115968d99c5af1ac34cedc4d4a521bc71..0000000000000000000000000000000000000000
--- a/Fit/PythonAPI/inc/PythonPlusplusFitHelper.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef PYTHONFITPLUSPLUSHELPER_H
-#define PYTHONFITPLUSPLUSHELPER_H
-// ********************************************************************
-// * The BornAgain project                                            *
-// * Simulation of neutron and x-ray scattering at grazing incidence  *
-// *                                                                  *
-// * LICENSE AND DISCLAIMER                                           *
-// * Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Mauris *
-// * eget quam orci. Quisque  porta  varius  dui,  quis  posuere nibh *
-// * mollis quis. Mauris commodo rhoncus porttitor.                   *
-// ********************************************************************
-//! @file   PythonPlusplusHelper.h
-//! @brief  Contains additional helper classes for Py++ code generator
-//! @author Scientific Computing Group at FRM II
-//! @date   19.03.2013
-
-
-#include "OutputData.h"
-#include "Types.h"
-
-
-
-// this is special namespace to help Py++ generate correct names
-namespace pyplusplus {
-    namespace aliases {
-//    typedef OutputData<double > ndimdata_t;
-//    typedef OutputDataIterator<double, ndimdata_t > ndimiterator_t;
-    typedef std::vector<double > vdouble1d_t;
-    typedef std::vector<vdouble1d_t > vdouble2d_t;
-//    typedef std::vector<int > vint1d_t;
-//    typedef std::vector<size_t > vsizet_t;
-    typedef std::vector<complex_t > vcomplex1d_t;
-    }
-}
-
-
-// helper class to provide Py++ with explicit template instantiations
-class PythonPlusplusFitHelper
-{
- public:
-//    size_t pyplusplus_boost_outputdata() { return sizeof(pyplusplus::aliases::ndimdata_t); }
-//    size_t pyplusplus_boost_outputdata_iterator() { return sizeof(pyplusplus::aliases::ndimiterator_t); }
-    size_t pyplusplus_boost_vdouble1d() { return sizeof(pyplusplus::aliases::vdouble1d_t); }
-    size_t pyplusplus_boost_vcomplex1d() { return sizeof(pyplusplus::aliases::vcomplex1d_t); }
-};
-
-#endif // PYTHONFITPLUSPLUSHELPER_H
diff --git a/Fit/PythonAPI/inc/SquaredFunctionDefault.pypp.h b/Fit/PythonAPI/inc/SquaredFunctionDefault.pypp.h
index da775ae6412377c4617fa9c9047c1546a0e41293..9f3ffbe439af01bd6fb6c61107963da65082c892 100644
--- a/Fit/PythonAPI/inc/SquaredFunctionDefault.pypp.h
+++ b/Fit/PythonAPI/inc/SquaredFunctionDefault.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef SquaredFunctionDefault_hpp__pyplusplus_wrapper
 #define SquaredFunctionDefault_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/SquaredFunctionWhichOnlyWorks.pypp.h b/Fit/PythonAPI/inc/SquaredFunctionWhichOnlyWorks.pypp.h
index 22055647bf16ad3413149cf2694c8b2a36ac9260..2e6a5f25538b4a78c072c88a5a721990c2c9167a 100644
--- a/Fit/PythonAPI/inc/SquaredFunctionWhichOnlyWorks.pypp.h
+++ b/Fit/PythonAPI/inc/SquaredFunctionWhichOnlyWorks.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef SquaredFunctionWhichOnlyWorks_hpp__pyplusplus_wrapper
 #define SquaredFunctionWhichOnlyWorks_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/SquaredFunctionWithGaussianError.pypp.h b/Fit/PythonAPI/inc/SquaredFunctionWithGaussianError.pypp.h
index 05fa85f61f1d043bc4639a3106066eb3c688d60d..b9a043bb2dccc9d0b2bf0fc248841cf76ba30845 100644
--- a/Fit/PythonAPI/inc/SquaredFunctionWithGaussianError.pypp.h
+++ b/Fit/PythonAPI/inc/SquaredFunctionWithGaussianError.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef SquaredFunctionWithGaussianError_hpp__pyplusplus_wrapper
 #define SquaredFunctionWithGaussianError_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/inc/SquaredFunctionWithSystematicError.pypp.h b/Fit/PythonAPI/inc/SquaredFunctionWithSystematicError.pypp.h
index 81573c322a50d1fb9a57c2e75e8aec4d8b2c64bf..ba6d9cb2d9d331d4723ab673840ac8ba8212b009 100644
--- a/Fit/PythonAPI/inc/SquaredFunctionWithSystematicError.pypp.h
+++ b/Fit/PythonAPI/inc/SquaredFunctionWithSystematicError.pypp.h
@@ -1,5 +1,8 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #ifndef SquaredFunctionWithSystematicError_hpp__pyplusplus_wrapper
 #define SquaredFunctionWithSystematicError_hpp__pyplusplus_wrapper
 
diff --git a/Fit/PythonAPI/src/AttLimits.pypp.cpp b/Fit/PythonAPI/src/AttLimits.pypp.cpp
index bfc6f3e51f1c83ed256319333ffed26b1f02c3a2..e9ebeee424eb2c646fdbec7c49aea06ddc19540b 100644
--- a/Fit/PythonAPI/src/AttLimits.pypp.cpp
+++ b/Fit/PythonAPI/src/AttLimits.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "AttLimits.pypp.h"
 
 namespace bp = boost::python;
@@ -198,86 +190,210 @@ struct AttLimits_wrapper : AttLimits, bp::wrapper< AttLimits > {
 
 void register_AttLimits_class(){
 
-    bp::class_< AttLimits_wrapper >( "AttLimits", bp::init< >() )    
-        .def( 
-            "fixed"
-            , (::AttLimits (*)(  ))( &::AttLimits::fixed ) )    
-        .def( 
-            "getLowerLimit"
-            , (double ( ::AttLimits::* )(  ) const)(&::AttLimits::getLowerLimit)
-            , (double ( AttLimits_wrapper::* )(  ) const)(&AttLimits_wrapper::default_getLowerLimit) )    
-        .def( 
-            "getUpperLimit"
-            , (double ( ::AttLimits::* )(  ) const)(&::AttLimits::getUpperLimit)
-            , (double ( AttLimits_wrapper::* )(  ) const)(&AttLimits_wrapper::default_getUpperLimit) )    
-        .def( 
-            "hasLowerAndUpperLimits"
-            , (bool ( ::AttLimits::* )(  ) const)(&::AttLimits::hasLowerAndUpperLimits)
-            , (bool ( AttLimits_wrapper::* )(  ) const)(&AttLimits_wrapper::default_hasLowerAndUpperLimits) )    
-        .def( 
-            "hasLowerLimit"
-            , (bool ( ::AttLimits::* )(  ) const)(&::AttLimits::hasLowerLimit)
-            , (bool ( AttLimits_wrapper::* )(  ) const)(&AttLimits_wrapper::default_hasLowerLimit) )    
-        .def( 
-            "hasUpperLimit"
-            , (bool ( ::AttLimits::* )(  ) const)(&::AttLimits::hasUpperLimit)
-            , (bool ( AttLimits_wrapper::* )(  ) const)(&AttLimits_wrapper::default_hasUpperLimit) )    
-        .def( 
-            "isFixed"
-            , (bool ( ::AttLimits::* )(  ) const)(&::AttLimits::isFixed)
-            , (bool ( AttLimits_wrapper::* )(  ) const)(&AttLimits_wrapper::default_isFixed) )    
-        .def( 
-            "limited"
-            , (::AttLimits (*)( double,double ))( &::AttLimits::limited )
-            , ( bp::arg("left_bound_value"), bp::arg("right_bound_value") ) )    
-        .def( 
-            "limitless"
-            , (::AttLimits (*)(  ))( &::AttLimits::limitless ) )    
-        .def( 
-            "lowerLimited"
-            , (::AttLimits (*)( double ))( &::AttLimits::lowerLimited )
-            , ( bp::arg("bound_value") ) )    
-        .def( 
-            "removeLimits"
-            , (void ( ::AttLimits::* )(  ) )(&::AttLimits::removeLimits)
-            , (void ( AttLimits_wrapper::* )(  ) )(&AttLimits_wrapper::default_removeLimits) )    
-        .def( 
-            "removeLowerLimit"
-            , (void ( ::AttLimits::* )(  ) )(&::AttLimits::removeLowerLimit)
-            , (void ( AttLimits_wrapper::* )(  ) )(&AttLimits_wrapper::default_removeLowerLimit) )    
-        .def( 
-            "removeUpperLimit"
-            , (void ( ::AttLimits::* )(  ) )(&::AttLimits::removeUpperLimit)
-            , (void ( AttLimits_wrapper::* )(  ) )(&AttLimits_wrapper::default_removeUpperLimit) )    
-        .def( 
-            "setFixed"
-            , (void ( ::AttLimits::* )( bool ) )(&::AttLimits::setFixed)
-            , (void ( AttLimits_wrapper::* )( bool ) )(&AttLimits_wrapper::default_setFixed)
-            , ( bp::arg("is_fixed") ) )    
-        .def( 
-            "setLimits"
-            , (void ( ::AttLimits::* )( double,double ) )(&::AttLimits::setLimits)
-            , (void ( AttLimits_wrapper::* )( double,double ) )(&AttLimits_wrapper::default_setLimits)
-            , ( bp::arg("xmin"), bp::arg("xmax") ) )    
-        .def( 
-            "setLowerLimit"
-            , (void ( ::AttLimits::* )( double ) )(&::AttLimits::setLowerLimit)
-            , (void ( AttLimits_wrapper::* )( double ) )(&AttLimits_wrapper::default_setLowerLimit)
-            , ( bp::arg("value") ) )    
-        .def( 
-            "setUpperLimit"
-            , (void ( ::AttLimits::* )( double ) )(&::AttLimits::setUpperLimit)
-            , (void ( AttLimits_wrapper::* )( double ) )(&AttLimits_wrapper::default_setUpperLimit)
-            , ( bp::arg("value") ) )    
-        .def( 
-            "upperLimited"
-            , (::AttLimits (*)( double ))( &::AttLimits::upperLimited )
-            , ( bp::arg("bound_value") ) )    
-        .staticmethod( "fixed" )    
-        .staticmethod( "limited" )    
-        .staticmethod( "limitless" )    
-        .staticmethod( "lowerLimited" )    
-        .staticmethod( "upperLimited" )    
-        .def( bp::self_ns::str( bp::self ) );
+    { //::AttLimits
+        typedef bp::class_< AttLimits_wrapper > AttLimits_exposer_t;
+        AttLimits_exposer_t AttLimits_exposer = AttLimits_exposer_t( "AttLimits", bp::init< >() );
+        bp::scope AttLimits_scope( AttLimits_exposer );
+        { //::AttLimits::fixed
+        
+            typedef ::AttLimits ( *fixed_function_type )(  );
+            
+            AttLimits_exposer.def( 
+                "fixed"
+                , fixed_function_type( &::AttLimits::fixed ) );
+        
+        }
+        { //::AttLimits::getLowerLimit
+        
+            typedef double ( ::AttLimits::*getLowerLimit_function_type )(  ) const;
+            typedef double ( AttLimits_wrapper::*default_getLowerLimit_function_type )(  ) const;
+            
+            AttLimits_exposer.def( 
+                "getLowerLimit"
+                , getLowerLimit_function_type(&::AttLimits::getLowerLimit)
+                , default_getLowerLimit_function_type(&AttLimits_wrapper::default_getLowerLimit) );
+        
+        }
+        { //::AttLimits::getUpperLimit
+        
+            typedef double ( ::AttLimits::*getUpperLimit_function_type )(  ) const;
+            typedef double ( AttLimits_wrapper::*default_getUpperLimit_function_type )(  ) const;
+            
+            AttLimits_exposer.def( 
+                "getUpperLimit"
+                , getUpperLimit_function_type(&::AttLimits::getUpperLimit)
+                , default_getUpperLimit_function_type(&AttLimits_wrapper::default_getUpperLimit) );
+        
+        }
+        { //::AttLimits::hasLowerAndUpperLimits
+        
+            typedef bool ( ::AttLimits::*hasLowerAndUpperLimits_function_type )(  ) const;
+            typedef bool ( AttLimits_wrapper::*default_hasLowerAndUpperLimits_function_type )(  ) const;
+            
+            AttLimits_exposer.def( 
+                "hasLowerAndUpperLimits"
+                , hasLowerAndUpperLimits_function_type(&::AttLimits::hasLowerAndUpperLimits)
+                , default_hasLowerAndUpperLimits_function_type(&AttLimits_wrapper::default_hasLowerAndUpperLimits) );
+        
+        }
+        { //::AttLimits::hasLowerLimit
+        
+            typedef bool ( ::AttLimits::*hasLowerLimit_function_type )(  ) const;
+            typedef bool ( AttLimits_wrapper::*default_hasLowerLimit_function_type )(  ) const;
+            
+            AttLimits_exposer.def( 
+                "hasLowerLimit"
+                , hasLowerLimit_function_type(&::AttLimits::hasLowerLimit)
+                , default_hasLowerLimit_function_type(&AttLimits_wrapper::default_hasLowerLimit) );
+        
+        }
+        { //::AttLimits::hasUpperLimit
+        
+            typedef bool ( ::AttLimits::*hasUpperLimit_function_type )(  ) const;
+            typedef bool ( AttLimits_wrapper::*default_hasUpperLimit_function_type )(  ) const;
+            
+            AttLimits_exposer.def( 
+                "hasUpperLimit"
+                , hasUpperLimit_function_type(&::AttLimits::hasUpperLimit)
+                , default_hasUpperLimit_function_type(&AttLimits_wrapper::default_hasUpperLimit) );
+        
+        }
+        { //::AttLimits::isFixed
+        
+            typedef bool ( ::AttLimits::*isFixed_function_type )(  ) const;
+            typedef bool ( AttLimits_wrapper::*default_isFixed_function_type )(  ) const;
+            
+            AttLimits_exposer.def( 
+                "isFixed"
+                , isFixed_function_type(&::AttLimits::isFixed)
+                , default_isFixed_function_type(&AttLimits_wrapper::default_isFixed) );
+        
+        }
+        { //::AttLimits::limited
+        
+            typedef ::AttLimits ( *limited_function_type )( double,double );
+            
+            AttLimits_exposer.def( 
+                "limited"
+                , limited_function_type( &::AttLimits::limited )
+                , ( bp::arg("left_bound_value"), bp::arg("right_bound_value") ) );
+        
+        }
+        { //::AttLimits::limitless
+        
+            typedef ::AttLimits ( *limitless_function_type )(  );
+            
+            AttLimits_exposer.def( 
+                "limitless"
+                , limitless_function_type( &::AttLimits::limitless ) );
+        
+        }
+        { //::AttLimits::lowerLimited
+        
+            typedef ::AttLimits ( *lowerLimited_function_type )( double );
+            
+            AttLimits_exposer.def( 
+                "lowerLimited"
+                , lowerLimited_function_type( &::AttLimits::lowerLimited )
+                , ( bp::arg("bound_value") ) );
+        
+        }
+        { //::AttLimits::removeLimits
+        
+            typedef void ( ::AttLimits::*removeLimits_function_type )(  ) ;
+            typedef void ( AttLimits_wrapper::*default_removeLimits_function_type )(  ) ;
+            
+            AttLimits_exposer.def( 
+                "removeLimits"
+                , removeLimits_function_type(&::AttLimits::removeLimits)
+                , default_removeLimits_function_type(&AttLimits_wrapper::default_removeLimits) );
+        
+        }
+        { //::AttLimits::removeLowerLimit
+        
+            typedef void ( ::AttLimits::*removeLowerLimit_function_type )(  ) ;
+            typedef void ( AttLimits_wrapper::*default_removeLowerLimit_function_type )(  ) ;
+            
+            AttLimits_exposer.def( 
+                "removeLowerLimit"
+                , removeLowerLimit_function_type(&::AttLimits::removeLowerLimit)
+                , default_removeLowerLimit_function_type(&AttLimits_wrapper::default_removeLowerLimit) );
+        
+        }
+        { //::AttLimits::removeUpperLimit
+        
+            typedef void ( ::AttLimits::*removeUpperLimit_function_type )(  ) ;
+            typedef void ( AttLimits_wrapper::*default_removeUpperLimit_function_type )(  ) ;
+            
+            AttLimits_exposer.def( 
+                "removeUpperLimit"
+                , removeUpperLimit_function_type(&::AttLimits::removeUpperLimit)
+                , default_removeUpperLimit_function_type(&AttLimits_wrapper::default_removeUpperLimit) );
+        
+        }
+        { //::AttLimits::setFixed
+        
+            typedef void ( ::AttLimits::*setFixed_function_type )( bool ) ;
+            typedef void ( AttLimits_wrapper::*default_setFixed_function_type )( bool ) ;
+            
+            AttLimits_exposer.def( 
+                "setFixed"
+                , setFixed_function_type(&::AttLimits::setFixed)
+                , default_setFixed_function_type(&AttLimits_wrapper::default_setFixed)
+                , ( bp::arg("is_fixed") ) );
+        
+        }
+        { //::AttLimits::setLimits
+        
+            typedef void ( ::AttLimits::*setLimits_function_type )( double,double ) ;
+            typedef void ( AttLimits_wrapper::*default_setLimits_function_type )( double,double ) ;
+            
+            AttLimits_exposer.def( 
+                "setLimits"
+                , setLimits_function_type(&::AttLimits::setLimits)
+                , default_setLimits_function_type(&AttLimits_wrapper::default_setLimits)
+                , ( bp::arg("xmin"), bp::arg("xmax") ) );
+        
+        }
+        { //::AttLimits::setLowerLimit
+        
+            typedef void ( ::AttLimits::*setLowerLimit_function_type )( double ) ;
+            typedef void ( AttLimits_wrapper::*default_setLowerLimit_function_type )( double ) ;
+            
+            AttLimits_exposer.def( 
+                "setLowerLimit"
+                , setLowerLimit_function_type(&::AttLimits::setLowerLimit)
+                , default_setLowerLimit_function_type(&AttLimits_wrapper::default_setLowerLimit)
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::AttLimits::setUpperLimit
+        
+            typedef void ( ::AttLimits::*setUpperLimit_function_type )( double ) ;
+            typedef void ( AttLimits_wrapper::*default_setUpperLimit_function_type )( double ) ;
+            
+            AttLimits_exposer.def( 
+                "setUpperLimit"
+                , setUpperLimit_function_type(&::AttLimits::setUpperLimit)
+                , default_setUpperLimit_function_type(&AttLimits_wrapper::default_setUpperLimit)
+                , ( bp::arg("value") ) );
+        
+        }
+        { //::AttLimits::upperLimited
+        
+            typedef ::AttLimits ( *upperLimited_function_type )( double );
+            
+            AttLimits_exposer.def( 
+                "upperLimited"
+                , upperLimited_function_type( &::AttLimits::upperLimited )
+                , ( bp::arg("bound_value") ) );
+        
+        }
+        AttLimits_exposer.staticmethod( "fixed" );
+        AttLimits_exposer.staticmethod( "limited" );
+        AttLimits_exposer.staticmethod( "limitless" );
+        AttLimits_exposer.staticmethod( "lowerLimited" );
+        AttLimits_exposer.staticmethod( "upperLimited" );
+    }
 
 }
diff --git a/Fit/PythonAPI/src/ChiSquaredModule.pypp.cpp b/Fit/PythonAPI/src/ChiSquaredModule.pypp.cpp
index d50945b08c0bfacad13d1621303c203c07493769..a81c504cd79afbcf33fe98e052e349e741224dc9 100644
--- a/Fit/PythonAPI/src/ChiSquaredModule.pypp.cpp
+++ b/Fit/PythonAPI/src/ChiSquaredModule.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "ChiSquaredModule.pypp.h"
 
 namespace bp = boost::python;
@@ -98,16 +90,28 @@ struct ChiSquaredModule_wrapper : ChiSquaredModule, bp::wrapper< ChiSquaredModul
         return IChiSquaredModule::getFittingDataSelector( );
     }
 
-    virtual ::IIntensityFunction const * getIntensityFunction(  ) const  {
-        if( bp::override func_getIntensityFunction = this->get_override( "getIntensityFunction" ) )
-            return func_getIntensityFunction(  );
+    virtual bool getIntensityLog(  ) const  {
+        if( bp::override func_getIntensityLog = this->get_override( "getIntensityLog" ) )
+            return func_getIntensityLog(  );
+        else{
+            return this->IChiSquaredModule::getIntensityLog(  );
+        }
+    }
+    
+    bool default_getIntensityLog(  ) const  {
+        return IChiSquaredModule::getIntensityLog( );
+    }
+
+    virtual bool getIntensitySqrt(  ) const  {
+        if( bp::override func_getIntensitySqrt = this->get_override( "getIntensitySqrt" ) )
+            return func_getIntensitySqrt(  );
         else{
-            return this->IChiSquaredModule::getIntensityFunction(  );
+            return this->IChiSquaredModule::getIntensitySqrt(  );
         }
     }
     
-    ::IIntensityFunction const * default_getIntensityFunction(  ) const  {
-        return IChiSquaredModule::getIntensityFunction( );
+    bool default_getIntensitySqrt(  ) const  {
+        return IChiSquaredModule::getIntensitySqrt( );
     }
 
     virtual ::IOutputDataNormalizer const * getOutputDataNormalizer(  ) const  {
@@ -158,16 +162,28 @@ struct ChiSquaredModule_wrapper : ChiSquaredModule, bp::wrapper< ChiSquaredModul
         IChiSquaredModule::setFittingDataSelector( boost::ref(selector) );
     }
 
-    virtual void setIntensityFunction( ::IIntensityFunction const & intensity_function ) {
-        if( bp::override func_setIntensityFunction = this->get_override( "setIntensityFunction" ) )
-            func_setIntensityFunction( boost::ref(intensity_function) );
+    virtual void setIntensityLog( bool val ) {
+        if( bp::override func_setIntensityLog = this->get_override( "setIntensityLog" ) )
+            func_setIntensityLog( val );
         else{
-            this->IChiSquaredModule::setIntensityFunction( boost::ref(intensity_function) );
+            this->IChiSquaredModule::setIntensityLog( val );
         }
     }
     
-    void default_setIntensityFunction( ::IIntensityFunction const & intensity_function ) {
-        IChiSquaredModule::setIntensityFunction( boost::ref(intensity_function) );
+    void default_setIntensityLog( bool val ) {
+        IChiSquaredModule::setIntensityLog( val );
+    }
+
+    virtual void setIntensitySqrt( bool val ) {
+        if( bp::override func_setIntensitySqrt = this->get_override( "setIntensitySqrt" ) )
+            func_setIntensitySqrt( val );
+        else{
+            this->IChiSquaredModule::setIntensitySqrt( val );
+        }
+    }
+    
+    void default_setIntensitySqrt( bool val ) {
+        IChiSquaredModule::setIntensitySqrt( val );
     }
 
     virtual void setOutputDataNormalizer( ::IOutputDataNormalizer const & data_normalizer ) {
@@ -186,65 +202,175 @@ struct ChiSquaredModule_wrapper : ChiSquaredModule, bp::wrapper< ChiSquaredModul
 
 void register_ChiSquaredModule_class(){
 
-    bp::class_< ChiSquaredModule_wrapper, bp::bases< IChiSquaredModule > >( "ChiSquaredModule", bp::init< >() )    
-        .def( bp::init< ChiSquaredModule const & >(( bp::arg("other") )) )    
-        .def( 
-            "calculateChiSquared"
-            , (double ( ::ChiSquaredModule::* )(  ) )(&::ChiSquaredModule::calculateChiSquared)
-            , (double ( ChiSquaredModule_wrapper::* )(  ) )(&ChiSquaredModule_wrapper::default_calculateChiSquared) )    
-        .def( 
-            "clone"
-            , (::ChiSquaredModule * ( ::ChiSquaredModule::* )(  ) const)(&::ChiSquaredModule::clone)
-            , (::ChiSquaredModule * ( ChiSquaredModule_wrapper::* )(  ) const)(&ChiSquaredModule_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createChi2DifferenceMap"
-            , (::OutputData< double > * ( ::ChiSquaredModule::* )(  ) const)(&::ChiSquaredModule::createChi2DifferenceMap)
-            , (::OutputData< double > * ( ChiSquaredModule_wrapper::* )(  ) const)(&ChiSquaredModule_wrapper::default_createChi2DifferenceMap)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getResidualValue"
-            , (double ( ::ChiSquaredModule::* )( ::size_t ) const)(&::ChiSquaredModule::getResidualValue)
-            , (double ( ChiSquaredModule_wrapper::* )( ::size_t ) const)(&ChiSquaredModule_wrapper::default_getResidualValue)
-            , ( bp::arg("index") ) )    
-        .def( 
-            "getFittingDataSelector"
-            , (::IFittingDataSelector const * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getFittingDataSelector)
-            , (::IFittingDataSelector const * ( ChiSquaredModule_wrapper::* )(  ) const)(&ChiSquaredModule_wrapper::default_getFittingDataSelector)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getIntensityFunction"
-            , (::IIntensityFunction const * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getIntensityFunction)
-            , (::IIntensityFunction const * ( ChiSquaredModule_wrapper::* )(  ) const)(&ChiSquaredModule_wrapper::default_getIntensityFunction)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getOutputDataNormalizer"
-            , (::IOutputDataNormalizer const * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getOutputDataNormalizer)
-            , (::IOutputDataNormalizer const * ( ChiSquaredModule_wrapper::* )(  ) const)(&ChiSquaredModule_wrapper::default_getOutputDataNormalizer)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getOutputDataNormalizer"
-            , (::IOutputDataNormalizer * ( ::IChiSquaredModule::* )(  ) )(&::IChiSquaredModule::getOutputDataNormalizer)
-            , (::IOutputDataNormalizer * ( ChiSquaredModule_wrapper::* )(  ) )(&ChiSquaredModule_wrapper::default_getOutputDataNormalizer)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getValue"
-            , (double ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getValue)
-            , (double ( ChiSquaredModule_wrapper::* )(  ) const)(&ChiSquaredModule_wrapper::default_getValue) )    
-        .def( 
-            "setFittingDataSelector"
-            , (void ( ::IChiSquaredModule::* )( ::IFittingDataSelector const & ) )(&::IChiSquaredModule::setFittingDataSelector)
-            , (void ( ChiSquaredModule_wrapper::* )( ::IFittingDataSelector const & ) )(&ChiSquaredModule_wrapper::default_setFittingDataSelector)
-            , ( bp::arg("selector") ) )    
-        .def( 
-            "setIntensityFunction"
-            , (void ( ::IChiSquaredModule::* )( ::IIntensityFunction const & ) )(&::IChiSquaredModule::setIntensityFunction)
-            , (void ( ChiSquaredModule_wrapper::* )( ::IIntensityFunction const & ) )(&ChiSquaredModule_wrapper::default_setIntensityFunction)
-            , ( bp::arg("intensity_function") ) )    
-        .def( 
-            "setOutputDataNormalizer"
-            , (void ( ::IChiSquaredModule::* )( ::IOutputDataNormalizer const & ) )(&::IChiSquaredModule::setOutputDataNormalizer)
-            , (void ( ChiSquaredModule_wrapper::* )( ::IOutputDataNormalizer const & ) )(&ChiSquaredModule_wrapper::default_setOutputDataNormalizer)
-            , ( bp::arg("data_normalizer") ) );
+    { //::ChiSquaredModule
+        typedef bp::class_< ChiSquaredModule_wrapper, bp::bases< IChiSquaredModule > > ChiSquaredModule_exposer_t;
+        ChiSquaredModule_exposer_t ChiSquaredModule_exposer = ChiSquaredModule_exposer_t( "ChiSquaredModule", bp::init< >() );
+        bp::scope ChiSquaredModule_scope( ChiSquaredModule_exposer );
+        ChiSquaredModule_exposer.def( bp::init< ChiSquaredModule const & >(( bp::arg("other") )) );
+        { //::ChiSquaredModule::calculateChiSquared
+        
+            typedef double ( ::ChiSquaredModule::*calculateChiSquared_function_type )(  ) ;
+            typedef double ( ChiSquaredModule_wrapper::*default_calculateChiSquared_function_type )(  ) ;
+            
+            ChiSquaredModule_exposer.def( 
+                "calculateChiSquared"
+                , calculateChiSquared_function_type(&::ChiSquaredModule::calculateChiSquared)
+                , default_calculateChiSquared_function_type(&ChiSquaredModule_wrapper::default_calculateChiSquared) );
+        
+        }
+        { //::ChiSquaredModule::clone
+        
+            typedef ::ChiSquaredModule * ( ::ChiSquaredModule::*clone_function_type )(  ) const;
+            typedef ::ChiSquaredModule * ( ChiSquaredModule_wrapper::*default_clone_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "clone"
+                , clone_function_type(&::ChiSquaredModule::clone)
+                , default_clone_function_type(&ChiSquaredModule_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ChiSquaredModule::createChi2DifferenceMap
+        
+            typedef ::OutputData< double > * ( ::ChiSquaredModule::*createChi2DifferenceMap_function_type )(  ) const;
+            typedef ::OutputData< double > * ( ChiSquaredModule_wrapper::*default_createChi2DifferenceMap_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "createChi2DifferenceMap"
+                , createChi2DifferenceMap_function_type(&::ChiSquaredModule::createChi2DifferenceMap)
+                , default_createChi2DifferenceMap_function_type(&ChiSquaredModule_wrapper::default_createChi2DifferenceMap)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ChiSquaredModule::getResidualValue
+        
+            typedef double ( ::ChiSquaredModule::*getResidualValue_function_type )( ::size_t ) const;
+            typedef double ( ChiSquaredModule_wrapper::*default_getResidualValue_function_type )( ::size_t ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "getResidualValue"
+                , getResidualValue_function_type(&::ChiSquaredModule::getResidualValue)
+                , default_getResidualValue_function_type(&ChiSquaredModule_wrapper::default_getResidualValue)
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::IChiSquaredModule::getFittingDataSelector
+        
+            typedef ::IFittingDataSelector const * ( ::IChiSquaredModule::*getFittingDataSelector_function_type )(  ) const;
+            typedef ::IFittingDataSelector const * ( ChiSquaredModule_wrapper::*default_getFittingDataSelector_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "getFittingDataSelector"
+                , getFittingDataSelector_function_type(&::IChiSquaredModule::getFittingDataSelector)
+                , default_getFittingDataSelector_function_type(&ChiSquaredModule_wrapper::default_getFittingDataSelector)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getIntensityLog
+        
+            typedef bool ( ::IChiSquaredModule::*getIntensityLog_function_type )(  ) const;
+            typedef bool ( ChiSquaredModule_wrapper::*default_getIntensityLog_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "getIntensityLog"
+                , getIntensityLog_function_type(&::IChiSquaredModule::getIntensityLog)
+                , default_getIntensityLog_function_type(&ChiSquaredModule_wrapper::default_getIntensityLog) );
+        
+        }
+        { //::IChiSquaredModule::getIntensitySqrt
+        
+            typedef bool ( ::IChiSquaredModule::*getIntensitySqrt_function_type )(  ) const;
+            typedef bool ( ChiSquaredModule_wrapper::*default_getIntensitySqrt_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "getIntensitySqrt"
+                , getIntensitySqrt_function_type(&::IChiSquaredModule::getIntensitySqrt)
+                , default_getIntensitySqrt_function_type(&ChiSquaredModule_wrapper::default_getIntensitySqrt) );
+        
+        }
+        { //::IChiSquaredModule::getOutputDataNormalizer
+        
+            typedef ::IOutputDataNormalizer const * ( ::IChiSquaredModule::*getOutputDataNormalizer_function_type )(  ) const;
+            typedef ::IOutputDataNormalizer const * ( ChiSquaredModule_wrapper::*default_getOutputDataNormalizer_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "getOutputDataNormalizer"
+                , getOutputDataNormalizer_function_type(&::IChiSquaredModule::getOutputDataNormalizer)
+                , default_getOutputDataNormalizer_function_type(&ChiSquaredModule_wrapper::default_getOutputDataNormalizer)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getOutputDataNormalizer
+        
+            typedef ::IOutputDataNormalizer * ( ::IChiSquaredModule::*getOutputDataNormalizer_function_type )(  ) ;
+            typedef ::IOutputDataNormalizer * ( ChiSquaredModule_wrapper::*default_getOutputDataNormalizer_function_type )(  ) ;
+            
+            ChiSquaredModule_exposer.def( 
+                "getOutputDataNormalizer"
+                , getOutputDataNormalizer_function_type(&::IChiSquaredModule::getOutputDataNormalizer)
+                , default_getOutputDataNormalizer_function_type(&ChiSquaredModule_wrapper::default_getOutputDataNormalizer)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getValue
+        
+            typedef double ( ::IChiSquaredModule::*getValue_function_type )(  ) const;
+            typedef double ( ChiSquaredModule_wrapper::*default_getValue_function_type )(  ) const;
+            
+            ChiSquaredModule_exposer.def( 
+                "getValue"
+                , getValue_function_type(&::IChiSquaredModule::getValue)
+                , default_getValue_function_type(&ChiSquaredModule_wrapper::default_getValue) );
+        
+        }
+        { //::IChiSquaredModule::setFittingDataSelector
+        
+            typedef void ( ::IChiSquaredModule::*setFittingDataSelector_function_type )( ::IFittingDataSelector const & ) ;
+            typedef void ( ChiSquaredModule_wrapper::*default_setFittingDataSelector_function_type )( ::IFittingDataSelector const & ) ;
+            
+            ChiSquaredModule_exposer.def( 
+                "setFittingDataSelector"
+                , setFittingDataSelector_function_type(&::IChiSquaredModule::setFittingDataSelector)
+                , default_setFittingDataSelector_function_type(&ChiSquaredModule_wrapper::default_setFittingDataSelector)
+                , ( bp::arg("selector") ) );
+        
+        }
+        { //::IChiSquaredModule::setIntensityLog
+        
+            typedef void ( ::IChiSquaredModule::*setIntensityLog_function_type )( bool ) ;
+            typedef void ( ChiSquaredModule_wrapper::*default_setIntensityLog_function_type )( bool ) ;
+            
+            ChiSquaredModule_exposer.def( 
+                "setIntensityLog"
+                , setIntensityLog_function_type(&::IChiSquaredModule::setIntensityLog)
+                , default_setIntensityLog_function_type(&ChiSquaredModule_wrapper::default_setIntensityLog)
+                , ( bp::arg("val") ) );
+        
+        }
+        { //::IChiSquaredModule::setIntensitySqrt
+        
+            typedef void ( ::IChiSquaredModule::*setIntensitySqrt_function_type )( bool ) ;
+            typedef void ( ChiSquaredModule_wrapper::*default_setIntensitySqrt_function_type )( bool ) ;
+            
+            ChiSquaredModule_exposer.def( 
+                "setIntensitySqrt"
+                , setIntensitySqrt_function_type(&::IChiSquaredModule::setIntensitySqrt)
+                , default_setIntensitySqrt_function_type(&ChiSquaredModule_wrapper::default_setIntensitySqrt)
+                , ( bp::arg("val") ) );
+        
+        }
+        { //::IChiSquaredModule::setOutputDataNormalizer
+        
+            typedef void ( ::IChiSquaredModule::*setOutputDataNormalizer_function_type )( ::IOutputDataNormalizer const & ) ;
+            typedef void ( ChiSquaredModule_wrapper::*default_setOutputDataNormalizer_function_type )( ::IOutputDataNormalizer const & ) ;
+            
+            ChiSquaredModule_exposer.def( 
+                "setOutputDataNormalizer"
+                , setOutputDataNormalizer_function_type(&::IChiSquaredModule::setOutputDataNormalizer)
+                , default_setOutputDataNormalizer_function_type(&ChiSquaredModule_wrapper::default_setOutputDataNormalizer)
+                , ( bp::arg("data_normalizer") ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/FitSuite.pypp.cpp b/Fit/PythonAPI/src/FitSuite.pypp.cpp
index 49b1dc2d56f42094dbddfb7482c74d6be83bba16..d7d4ba051dfa20b45e02d8e546a232e2501d3c16 100644
--- a/Fit/PythonAPI/src/FitSuite.pypp.cpp
+++ b/Fit/PythonAPI/src/FitSuite.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "FitSuite.pypp.h"
 
 namespace bp = boost::python;
@@ -47,45 +39,110 @@ struct FitSuite_wrapper : FitSuite, bp::wrapper< FitSuite > {
 
 void register_FitSuite_class(){
 
-    bp::class_< FitSuite_wrapper, boost::noncopyable >( "FitSuite", bp::no_init )    
-        .def( bp::init< >() )    
-        .def( 
-            "addFitParameter"
-            , (void ( ::FitSuite::* )( ::std::string const &,double,double,::AttLimits const &,double ) )( &::FitSuite::addFitParameter )
-            , ( bp::arg("name"), bp::arg("value"), bp::arg("step"), bp::arg("attlim")=AttLimits::limitless( ), bp::arg("error")=0.0 ) )    
-        .def( 
-            "addFitParameter"
-            , (void ( ::FitSuite::* )( ::std::string const &,double,::AttLimits const &,double ) )( &::FitSuite::addFitParameter )
-            , ( bp::arg("name"), bp::arg("value"), bp::arg("attlim")=AttLimits::limitless( ), bp::arg("error")=0.0 ) )    
-        .def( 
-            "addSimulationAndRealData"
-            , (void ( ::FitSuite::* )( ::Simulation const &,::OutputData< double > const &,::IChiSquaredModule const & ) )( &::FitSuite::addSimulationAndRealData )
-            , ( bp::arg("simulation"), bp::arg("real_data"), bp::arg("chi2_module")=ChiSquaredModule() ) )    
-        .def( 
-            "getFitParameters"
-            , (::FitSuiteParameters * ( ::FitSuite::* )(  ) )( &::FitSuite::getFitParameters )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getMinimizer"
-            , (::IMinimizer * ( ::FitSuite::* )(  ) )( &::FitSuite::getMinimizer )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getNCalls"
-            , (::size_t ( ::FitSuite::* )(  ) const)( &::FitSuite::getNCalls ) )    
-        .def( 
-            "initPrint"
-            , (void ( ::FitSuite::* )( int ) )( &::FitSuite::initPrint )
-            , ( bp::arg("print_every_nth") ) )    
-        .def( 
-            "printResults"
-            , (void ( ::FitSuite::* )(  ) const)( &::FitSuite::printResults ) )    
-        .def( 
-            "runFit"
-            , (void ( ::FitSuite::* )(  ) )(&::FitSuite::runFit)
-            , (void ( FitSuite_wrapper::* )(  ) )(&FitSuite_wrapper::default_runFit) )    
-        .def( 
-            "setMinimizer"
-            , (void ( ::FitSuite::* )( ::IMinimizer * ) )( &::FitSuite::setMinimizer )
-            , ( bp::arg("minimizer") ) );
+    { //::FitSuite
+        typedef bp::class_< FitSuite_wrapper, boost::noncopyable > FitSuite_exposer_t;
+        FitSuite_exposer_t FitSuite_exposer = FitSuite_exposer_t( "FitSuite", bp::no_init );
+        bp::scope FitSuite_scope( FitSuite_exposer );
+        FitSuite_exposer.def( bp::init< >() );
+        { //::FitSuite::addFitParameter
+        
+            typedef void ( ::FitSuite::*addFitParameter_function_type )( ::std::string const &,double,double,::AttLimits const &,double ) ;
+            
+            FitSuite_exposer.def( 
+                "addFitParameter"
+                , addFitParameter_function_type( &::FitSuite::addFitParameter )
+                , ( bp::arg("name"), bp::arg("value"), bp::arg("step"), bp::arg("attlim")=AttLimits::limitless( ), bp::arg("error")=0.0 ) );
+        
+        }
+        { //::FitSuite::addFitParameter
+        
+            typedef void ( ::FitSuite::*addFitParameter_function_type )( ::std::string const &,double,::AttLimits const &,double ) ;
+            
+            FitSuite_exposer.def( 
+                "addFitParameter"
+                , addFitParameter_function_type( &::FitSuite::addFitParameter )
+                , ( bp::arg("name"), bp::arg("value"), bp::arg("attlim")=AttLimits::limitless( ), bp::arg("error")=0.0 ) );
+        
+        }
+        { //::FitSuite::addSimulationAndRealData
+        
+            typedef void ( ::FitSuite::*addSimulationAndRealData_function_type )( ::Simulation const &,::OutputData< double > const &,::IChiSquaredModule const & ) ;
+            
+            FitSuite_exposer.def( 
+                "addSimulationAndRealData"
+                , addSimulationAndRealData_function_type( &::FitSuite::addSimulationAndRealData )
+                , ( bp::arg("simulation"), bp::arg("real_data"), bp::arg("chi2_module")=ChiSquaredModule() ) );
+        
+        }
+        { //::FitSuite::getFitParameters
+        
+            typedef ::FitSuiteParameters * ( ::FitSuite::*getFitParameters_function_type )(  ) ;
+            
+            FitSuite_exposer.def( 
+                "getFitParameters"
+                , getFitParameters_function_type( &::FitSuite::getFitParameters )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::FitSuite::getMinimizer
+        
+            typedef ::IMinimizer * ( ::FitSuite::*getMinimizer_function_type )(  ) ;
+            
+            FitSuite_exposer.def( 
+                "getMinimizer"
+                , getMinimizer_function_type( &::FitSuite::getMinimizer )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::FitSuite::getNCalls
+        
+            typedef ::size_t ( ::FitSuite::*getNCalls_function_type )(  ) const;
+            
+            FitSuite_exposer.def( 
+                "getNCalls"
+                , getNCalls_function_type( &::FitSuite::getNCalls ) );
+        
+        }
+        { //::FitSuite::initPrint
+        
+            typedef void ( ::FitSuite::*initPrint_function_type )( int ) ;
+            
+            FitSuite_exposer.def( 
+                "initPrint"
+                , initPrint_function_type( &::FitSuite::initPrint )
+                , ( bp::arg("print_every_nth") ) );
+        
+        }
+        { //::FitSuite::printResults
+        
+            typedef void ( ::FitSuite::*printResults_function_type )(  ) const;
+            
+            FitSuite_exposer.def( 
+                "printResults"
+                , printResults_function_type( &::FitSuite::printResults ) );
+        
+        }
+        { //::FitSuite::runFit
+        
+            typedef void ( ::FitSuite::*runFit_function_type )(  ) ;
+            typedef void ( FitSuite_wrapper::*default_runFit_function_type )(  ) ;
+            
+            FitSuite_exposer.def( 
+                "runFit"
+                , runFit_function_type(&::FitSuite::runFit)
+                , default_runFit_function_type(&FitSuite_wrapper::default_runFit) );
+        
+        }
+        { //::FitSuite::setMinimizer
+        
+            typedef void ( ::FitSuite::*setMinimizer_function_type )( ::IMinimizer * ) ;
+            
+            FitSuite_exposer.def( 
+                "setMinimizer"
+                , setMinimizer_function_type( &::FitSuite::setMinimizer )
+                , ( bp::arg("minimizer") ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/FitSuiteParameters.pypp.cpp b/Fit/PythonAPI/src/FitSuiteParameters.pypp.cpp
index bb9d8cd9002e06df9790cf75ddc4a723a0383ecf..d891a46e14c5214f7572aa528095b008007e69b4 100644
--- a/Fit/PythonAPI/src/FitSuiteParameters.pypp.cpp
+++ b/Fit/PythonAPI/src/FitSuiteParameters.pypp.cpp
@@ -1,32 +1,34 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "FitSuiteParameters.pypp.h"
 
 namespace bp = boost::python;
 
 void register_FitSuiteParameters_class(){
 
-    bp::class_< FitSuiteParameters >( "FitSuiteParameters", bp::init< >() )    
-        .def( 
-            "getValues"
-            , (::std::vector< double > ( ::FitSuiteParameters::* )(  ) const)( &::FitSuiteParameters::getValues ) );
+    { //::FitSuiteParameters
+        typedef bp::class_< FitSuiteParameters > FitSuiteParameters_exposer_t;
+        FitSuiteParameters_exposer_t FitSuiteParameters_exposer = FitSuiteParameters_exposer_t( "FitSuiteParameters", bp::init< >() );
+        bp::scope FitSuiteParameters_scope( FitSuiteParameters_exposer );
+        { //::FitSuiteParameters::getValues
+        
+            typedef ::std::vector< double > ( ::FitSuiteParameters::*getValues_function_type )(  ) const;
+            
+            FitSuiteParameters_exposer.def( 
+                "getValues"
+                , getValues_function_type( &::FitSuiteParameters::getValues ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/IChiSquaredModule.pypp.cpp b/Fit/PythonAPI/src/IChiSquaredModule.pypp.cpp
index 60f604994c4b168f02b0ede26161d1ccf78bc2bf..869f3a2009c17491d190884d6d7f6e490c2976cc 100644
--- a/Fit/PythonAPI/src/IChiSquaredModule.pypp.cpp
+++ b/Fit/PythonAPI/src/IChiSquaredModule.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "IChiSquaredModule.pypp.h"
 
 namespace bp = boost::python;
@@ -58,16 +50,28 @@ struct IChiSquaredModule_wrapper : IChiSquaredModule, bp::wrapper< IChiSquaredMo
         return IChiSquaredModule::getFittingDataSelector( );
     }
 
-    virtual ::IIntensityFunction const * getIntensityFunction(  ) const  {
-        if( bp::override func_getIntensityFunction = this->get_override( "getIntensityFunction" ) )
-            return func_getIntensityFunction(  );
+    virtual bool getIntensityLog(  ) const  {
+        if( bp::override func_getIntensityLog = this->get_override( "getIntensityLog" ) )
+            return func_getIntensityLog(  );
         else{
-            return this->IChiSquaredModule::getIntensityFunction(  );
+            return this->IChiSquaredModule::getIntensityLog(  );
         }
     }
     
-    ::IIntensityFunction const * default_getIntensityFunction(  ) const  {
-        return IChiSquaredModule::getIntensityFunction( );
+    bool default_getIntensityLog(  ) const  {
+        return IChiSquaredModule::getIntensityLog( );
+    }
+
+    virtual bool getIntensitySqrt(  ) const  {
+        if( bp::override func_getIntensitySqrt = this->get_override( "getIntensitySqrt" ) )
+            return func_getIntensitySqrt(  );
+        else{
+            return this->IChiSquaredModule::getIntensitySqrt(  );
+        }
+    }
+    
+    bool default_getIntensitySqrt(  ) const  {
+        return IChiSquaredModule::getIntensitySqrt( );
     }
 
     virtual ::IOutputDataNormalizer const * getOutputDataNormalizer(  ) const  {
@@ -130,16 +134,28 @@ struct IChiSquaredModule_wrapper : IChiSquaredModule, bp::wrapper< IChiSquaredMo
         IChiSquaredModule::setFittingDataSelector( boost::ref(selector) );
     }
 
-    virtual void setIntensityFunction( ::IIntensityFunction const & intensity_function ) {
-        if( bp::override func_setIntensityFunction = this->get_override( "setIntensityFunction" ) )
-            func_setIntensityFunction( boost::ref(intensity_function) );
+    virtual void setIntensityLog( bool val ) {
+        if( bp::override func_setIntensityLog = this->get_override( "setIntensityLog" ) )
+            func_setIntensityLog( val );
         else{
-            this->IChiSquaredModule::setIntensityFunction( boost::ref(intensity_function) );
+            this->IChiSquaredModule::setIntensityLog( val );
         }
     }
     
-    void default_setIntensityFunction( ::IIntensityFunction const & intensity_function ) {
-        IChiSquaredModule::setIntensityFunction( boost::ref(intensity_function) );
+    void default_setIntensityLog( bool val ) {
+        IChiSquaredModule::setIntensityLog( val );
+    }
+
+    virtual void setIntensitySqrt( bool val ) {
+        if( bp::override func_setIntensitySqrt = this->get_override( "setIntensitySqrt" ) )
+            func_setIntensitySqrt( val );
+        else{
+            this->IChiSquaredModule::setIntensitySqrt( val );
+        }
+    }
+    
+    void default_setIntensitySqrt( bool val ) {
+        IChiSquaredModule::setIntensitySqrt( val );
     }
 
     virtual void setOutputDataNormalizer( ::IOutputDataNormalizer const & data_normalizer ) {
@@ -158,85 +174,228 @@ struct IChiSquaredModule_wrapper : IChiSquaredModule, bp::wrapper< IChiSquaredMo
 
 void register_IChiSquaredModule_class(){
 
-    bp::class_< IChiSquaredModule_wrapper, boost::noncopyable >( "IChiSquaredModule", bp::init< >() )    
-        .def( 
-            "calculateChiSquared"
-            , bp::pure_virtual( (double ( ::IChiSquaredModule::* )(  ) )(&::IChiSquaredModule::calculateChiSquared) ) )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IChiSquaredModule * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createChi2DifferenceMap"
-            , bp::pure_virtual( (::OutputData< double > * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::createChi2DifferenceMap) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "getFittingDataSelector"
-            , (::IFittingDataSelector const * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getFittingDataSelector)
-            , (::IFittingDataSelector const * ( IChiSquaredModule_wrapper::* )(  ) const)(&IChiSquaredModule_wrapper::default_getFittingDataSelector)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getIntensityFunction"
-            , (::IIntensityFunction const * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getIntensityFunction)
-            , (::IIntensityFunction const * ( IChiSquaredModule_wrapper::* )(  ) const)(&IChiSquaredModule_wrapper::default_getIntensityFunction)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getOutputDataNormalizer"
-            , (::IOutputDataNormalizer const * ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getOutputDataNormalizer)
-            , (::IOutputDataNormalizer const * ( IChiSquaredModule_wrapper::* )(  ) const)(&IChiSquaredModule_wrapper::default_getOutputDataNormalizer)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getOutputDataNormalizer"
-            , (::IOutputDataNormalizer * ( ::IChiSquaredModule::* )(  ) )(&::IChiSquaredModule::getOutputDataNormalizer)
-            , (::IOutputDataNormalizer * ( IChiSquaredModule_wrapper::* )(  ) )(&IChiSquaredModule_wrapper::default_getOutputDataNormalizer)
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getRealData"
-            , (::OutputData< double > const * ( ::IChiSquaredModule::* )(  ) const)( &::IChiSquaredModule::getRealData )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getResidualValue"
-            , (double ( ::IChiSquaredModule::* )( ::size_t ) const)(&::IChiSquaredModule::getResidualValue)
-            , (double ( IChiSquaredModule_wrapper::* )( ::size_t ) const)(&IChiSquaredModule_wrapper::default_getResidualValue)
-            , ( bp::arg("arg0") ) )    
-        .def( 
-            "getSimulationData"
-            , (::OutputData< double > const * ( ::IChiSquaredModule::* )(  ) const)( &::IChiSquaredModule::getSimulationData )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getSquaredFunction"
-            , (::ISquaredFunction const * ( ::IChiSquaredModule::* )(  ) const)( &::IChiSquaredModule::getSquaredFunction )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "getValue"
-            , (double ( ::IChiSquaredModule::* )(  ) const)(&::IChiSquaredModule::getValue)
-            , (double ( IChiSquaredModule_wrapper::* )(  ) const)(&IChiSquaredModule_wrapper::default_getValue) )    
-        .def( 
-            "setChiSquaredFunction"
-            , (void ( ::IChiSquaredModule::* )( ::ISquaredFunction const & ) )( &::IChiSquaredModule::setChiSquaredFunction )
-            , ( bp::arg("squared_function") ) )    
-        .def( 
-            "setFittingDataSelector"
-            , (void ( ::IChiSquaredModule::* )( ::IFittingDataSelector const & ) )(&::IChiSquaredModule::setFittingDataSelector)
-            , (void ( IChiSquaredModule_wrapper::* )( ::IFittingDataSelector const & ) )(&IChiSquaredModule_wrapper::default_setFittingDataSelector)
-            , ( bp::arg("selector") ) )    
-        .def( 
-            "setIntensityFunction"
-            , (void ( ::IChiSquaredModule::* )( ::IIntensityFunction const & ) )(&::IChiSquaredModule::setIntensityFunction)
-            , (void ( IChiSquaredModule_wrapper::* )( ::IIntensityFunction const & ) )(&IChiSquaredModule_wrapper::default_setIntensityFunction)
-            , ( bp::arg("intensity_function") ) )    
-        .def( 
-            "setNdegreeOfFreedom"
-            , (void ( ::IChiSquaredModule::* )( int ) )( &::IChiSquaredModule::setNdegreeOfFreedom )
-            , ( bp::arg("ndegree_of_freedom") ) )    
-        .def( 
-            "setOutputDataNormalizer"
-            , (void ( ::IChiSquaredModule::* )( ::IOutputDataNormalizer const & ) )(&::IChiSquaredModule::setOutputDataNormalizer)
-            , (void ( IChiSquaredModule_wrapper::* )( ::IOutputDataNormalizer const & ) )(&IChiSquaredModule_wrapper::default_setOutputDataNormalizer)
-            , ( bp::arg("data_normalizer") ) )    
-        .def( 
-            "setRealAndSimulatedData"
-            , (void ( ::IChiSquaredModule::* )( ::OutputData< double > const &,::OutputData< double > const & ) )( &::IChiSquaredModule::setRealAndSimulatedData )
-            , ( bp::arg("real_data"), bp::arg("simulation_data") ) );
+    { //::IChiSquaredModule
+        typedef bp::class_< IChiSquaredModule_wrapper, boost::noncopyable > IChiSquaredModule_exposer_t;
+        IChiSquaredModule_exposer_t IChiSquaredModule_exposer = IChiSquaredModule_exposer_t( "IChiSquaredModule", bp::init< >() );
+        bp::scope IChiSquaredModule_scope( IChiSquaredModule_exposer );
+        { //::IChiSquaredModule::calculateChiSquared
+        
+            typedef double ( ::IChiSquaredModule::*calculateChiSquared_function_type )(  ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "calculateChiSquared"
+                , bp::pure_virtual( calculateChiSquared_function_type(&::IChiSquaredModule::calculateChiSquared) ) );
+        
+        }
+        { //::IChiSquaredModule::clone
+        
+            typedef ::IChiSquaredModule * ( ::IChiSquaredModule::*clone_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IChiSquaredModule::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IChiSquaredModule::createChi2DifferenceMap
+        
+            typedef ::OutputData<double> * ( ::IChiSquaredModule::*createChi2DifferenceMap_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "createChi2DifferenceMap"
+                , bp::pure_virtual( createChi2DifferenceMap_function_type(&::IChiSquaredModule::createChi2DifferenceMap) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IChiSquaredModule::getFittingDataSelector
+        
+            typedef ::IFittingDataSelector const * ( ::IChiSquaredModule::*getFittingDataSelector_function_type )(  ) const;
+            typedef ::IFittingDataSelector const * ( IChiSquaredModule_wrapper::*default_getFittingDataSelector_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getFittingDataSelector"
+                , getFittingDataSelector_function_type(&::IChiSquaredModule::getFittingDataSelector)
+                , default_getFittingDataSelector_function_type(&IChiSquaredModule_wrapper::default_getFittingDataSelector)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getIntensityLog
+        
+            typedef bool ( ::IChiSquaredModule::*getIntensityLog_function_type )(  ) const;
+            typedef bool ( IChiSquaredModule_wrapper::*default_getIntensityLog_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getIntensityLog"
+                , getIntensityLog_function_type(&::IChiSquaredModule::getIntensityLog)
+                , default_getIntensityLog_function_type(&IChiSquaredModule_wrapper::default_getIntensityLog) );
+        
+        }
+        { //::IChiSquaredModule::getIntensitySqrt
+        
+            typedef bool ( ::IChiSquaredModule::*getIntensitySqrt_function_type )(  ) const;
+            typedef bool ( IChiSquaredModule_wrapper::*default_getIntensitySqrt_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getIntensitySqrt"
+                , getIntensitySqrt_function_type(&::IChiSquaredModule::getIntensitySqrt)
+                , default_getIntensitySqrt_function_type(&IChiSquaredModule_wrapper::default_getIntensitySqrt) );
+        
+        }
+        { //::IChiSquaredModule::getOutputDataNormalizer
+        
+            typedef ::IOutputDataNormalizer const * ( ::IChiSquaredModule::*getOutputDataNormalizer_function_type )(  ) const;
+            typedef ::IOutputDataNormalizer const * ( IChiSquaredModule_wrapper::*default_getOutputDataNormalizer_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getOutputDataNormalizer"
+                , getOutputDataNormalizer_function_type(&::IChiSquaredModule::getOutputDataNormalizer)
+                , default_getOutputDataNormalizer_function_type(&IChiSquaredModule_wrapper::default_getOutputDataNormalizer)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getOutputDataNormalizer
+        
+            typedef ::IOutputDataNormalizer * ( ::IChiSquaredModule::*getOutputDataNormalizer_function_type )(  ) ;
+            typedef ::IOutputDataNormalizer * ( IChiSquaredModule_wrapper::*default_getOutputDataNormalizer_function_type )(  ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "getOutputDataNormalizer"
+                , getOutputDataNormalizer_function_type(&::IChiSquaredModule::getOutputDataNormalizer)
+                , default_getOutputDataNormalizer_function_type(&IChiSquaredModule_wrapper::default_getOutputDataNormalizer)
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getRealData
+        
+            typedef ::OutputData< double > const * ( ::IChiSquaredModule::*getRealData_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getRealData"
+                , getRealData_function_type( &::IChiSquaredModule::getRealData )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getResidualValue
+        
+            typedef double ( ::IChiSquaredModule::*getResidualValue_function_type )( ::size_t ) const;
+            typedef double ( IChiSquaredModule_wrapper::*default_getResidualValue_function_type )( ::size_t ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getResidualValue"
+                , getResidualValue_function_type(&::IChiSquaredModule::getResidualValue)
+                , default_getResidualValue_function_type(&IChiSquaredModule_wrapper::default_getResidualValue)
+                , ( bp::arg("arg0") ) );
+        
+        }
+        { //::IChiSquaredModule::getSimulationData
+        
+            typedef ::OutputData< double > const * ( ::IChiSquaredModule::*getSimulationData_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getSimulationData"
+                , getSimulationData_function_type( &::IChiSquaredModule::getSimulationData )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getSquaredFunction
+        
+            typedef ::ISquaredFunction const * ( ::IChiSquaredModule::*getSquaredFunction_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getSquaredFunction"
+                , getSquaredFunction_function_type( &::IChiSquaredModule::getSquaredFunction )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::IChiSquaredModule::getValue
+        
+            typedef double ( ::IChiSquaredModule::*getValue_function_type )(  ) const;
+            typedef double ( IChiSquaredModule_wrapper::*default_getValue_function_type )(  ) const;
+            
+            IChiSquaredModule_exposer.def( 
+                "getValue"
+                , getValue_function_type(&::IChiSquaredModule::getValue)
+                , default_getValue_function_type(&IChiSquaredModule_wrapper::default_getValue) );
+        
+        }
+        { //::IChiSquaredModule::setChiSquaredFunction
+        
+            typedef void ( ::IChiSquaredModule::*setChiSquaredFunction_function_type )( ::ISquaredFunction const & ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setChiSquaredFunction"
+                , setChiSquaredFunction_function_type( &::IChiSquaredModule::setChiSquaredFunction )
+                , ( bp::arg("squared_function") ) );
+        
+        }
+        { //::IChiSquaredModule::setFittingDataSelector
+        
+            typedef void ( ::IChiSquaredModule::*setFittingDataSelector_function_type )( ::IFittingDataSelector const & ) ;
+            typedef void ( IChiSquaredModule_wrapper::*default_setFittingDataSelector_function_type )( ::IFittingDataSelector const & ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setFittingDataSelector"
+                , setFittingDataSelector_function_type(&::IChiSquaredModule::setFittingDataSelector)
+                , default_setFittingDataSelector_function_type(&IChiSquaredModule_wrapper::default_setFittingDataSelector)
+                , ( bp::arg("selector") ) );
+        
+        }
+        { //::IChiSquaredModule::setIntensityLog
+        
+            typedef void ( ::IChiSquaredModule::*setIntensityLog_function_type )( bool ) ;
+            typedef void ( IChiSquaredModule_wrapper::*default_setIntensityLog_function_type )( bool ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setIntensityLog"
+                , setIntensityLog_function_type(&::IChiSquaredModule::setIntensityLog)
+                , default_setIntensityLog_function_type(&IChiSquaredModule_wrapper::default_setIntensityLog)
+                , ( bp::arg("val") ) );
+        
+        }
+        { //::IChiSquaredModule::setIntensitySqrt
+        
+            typedef void ( ::IChiSquaredModule::*setIntensitySqrt_function_type )( bool ) ;
+            typedef void ( IChiSquaredModule_wrapper::*default_setIntensitySqrt_function_type )( bool ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setIntensitySqrt"
+                , setIntensitySqrt_function_type(&::IChiSquaredModule::setIntensitySqrt)
+                , default_setIntensitySqrt_function_type(&IChiSquaredModule_wrapper::default_setIntensitySqrt)
+                , ( bp::arg("val") ) );
+        
+        }
+        { //::IChiSquaredModule::setNdegreeOfFreedom
+        
+            typedef void ( ::IChiSquaredModule::*setNdegreeOfFreedom_function_type )( int ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setNdegreeOfFreedom"
+                , setNdegreeOfFreedom_function_type( &::IChiSquaredModule::setNdegreeOfFreedom )
+                , ( bp::arg("ndegree_of_freedom") ) );
+        
+        }
+        { //::IChiSquaredModule::setOutputDataNormalizer
+        
+            typedef void ( ::IChiSquaredModule::*setOutputDataNormalizer_function_type )( ::IOutputDataNormalizer const & ) ;
+            typedef void ( IChiSquaredModule_wrapper::*default_setOutputDataNormalizer_function_type )( ::IOutputDataNormalizer const & ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setOutputDataNormalizer"
+                , setOutputDataNormalizer_function_type(&::IChiSquaredModule::setOutputDataNormalizer)
+                , default_setOutputDataNormalizer_function_type(&IChiSquaredModule_wrapper::default_setOutputDataNormalizer)
+                , ( bp::arg("data_normalizer") ) );
+        
+        }
+        { //::IChiSquaredModule::setRealAndSimulatedData
+        
+            typedef void ( ::IChiSquaredModule::*setRealAndSimulatedData_function_type )( ::OutputData< double > const &,::OutputData< double > const & ) ;
+            
+            IChiSquaredModule_exposer.def( 
+                "setRealAndSimulatedData"
+                , setRealAndSimulatedData_function_type( &::IChiSquaredModule::setRealAndSimulatedData )
+                , ( bp::arg("real_data"), bp::arg("simulation_data") ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/IMinimizer.pypp.cpp b/Fit/PythonAPI/src/IMinimizer.pypp.cpp
index 4e2d7c69af6ac49a62ff5f3102641231fd85938d..d93ae8bf65b4706aed797efc8586dd2d7f9e1ee1 100644
--- a/Fit/PythonAPI/src/IMinimizer.pypp.cpp
+++ b/Fit/PythonAPI/src/IMinimizer.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "IMinimizer.pypp.h"
 
 namespace bp = boost::python;
@@ -160,53 +152,133 @@ struct IMinimizer_wrapper : IMinimizer, bp::wrapper< IMinimizer > {
 
 void register_IMinimizer_class(){
 
-    bp::class_< IMinimizer_wrapper, boost::noncopyable >( "IMinimizer", bp::init< >() )    
-        .def( 
-            "clear"
-            , (void ( ::IMinimizer::* )(  ) )(&::IMinimizer::clear)
-            , (void ( IMinimizer_wrapper::* )(  ) )(&IMinimizer_wrapper::default_clear) )    
-        .def( 
-            "getErrorOfVariable"
-            , (double ( ::IMinimizer::* )( ::size_t ) const)(&::IMinimizer::getErrorOfVariable)
-            , (double ( IMinimizer_wrapper::* )( ::size_t ) const)(&IMinimizer_wrapper::default_getErrorOfVariable)
-            , ( bp::arg("index") ) )    
-        .def( 
-            "getMinValue"
-            , (double ( ::IMinimizer::* )(  ) const)(&::IMinimizer::getMinValue)
-            , (double ( IMinimizer_wrapper::* )(  ) const)(&IMinimizer_wrapper::default_getMinValue) )    
-        .def( 
-            "getNCalls"
-            , (::size_t ( ::IMinimizer::* )(  ) const)(&::IMinimizer::getNCalls)
-            , (::size_t ( IMinimizer_wrapper::* )(  ) const)(&IMinimizer_wrapper::default_getNCalls) )    
-        .def( 
-            "getNumberOfVariables"
-            , (::size_t ( ::IMinimizer::* )(  ) const)(&::IMinimizer::getNumberOfVariables)
-            , (::size_t ( IMinimizer_wrapper::* )(  ) const)(&IMinimizer_wrapper::default_getNumberOfVariables) )    
-        .def( 
-            "getValueOfVariableAtMinimum"
-            , (double ( ::IMinimizer::* )( ::size_t ) const)(&::IMinimizer::getValueOfVariableAtMinimum)
-            , (double ( IMinimizer_wrapper::* )( ::size_t ) const)(&IMinimizer_wrapper::default_getValueOfVariableAtMinimum)
-            , ( bp::arg("index") ) )    
-        .def( 
-            "getValueOfVariablesAtMinimum"
-            , (::std::vector< double > ( ::IMinimizer::* )(  ) const)(&::IMinimizer::getValueOfVariablesAtMinimum)
-            , (::std::vector< double > ( IMinimizer_wrapper::* )(  ) const)(&IMinimizer_wrapper::default_getValueOfVariablesAtMinimum) )    
-        .def( 
-            "minimize"
-            , bp::pure_virtual( (void ( ::IMinimizer::* )(  ) )(&::IMinimizer::minimize) ) )    
-        .def( 
-            "printResults"
-            , (void ( ::IMinimizer::* )(  ) const)(&::IMinimizer::printResults)
-            , (void ( IMinimizer_wrapper::* )(  ) const)(&IMinimizer_wrapper::default_printResults) )    
-        .def( 
-            "setOptions"
-            , (void ( ::IMinimizer::* )( ::std::string const & ) )(&::IMinimizer::setOptions)
-            , (void ( IMinimizer_wrapper::* )( ::std::string const & ) )(&IMinimizer_wrapper::default_setOptions)
-            , ( bp::arg("options") ) )    
-        .def( 
-            "setParameters"
-            , (void ( ::IMinimizer::* )( ::FitSuiteParameters const & ) )(&::IMinimizer::setParameters)
-            , (void ( IMinimizer_wrapper::* )( ::FitSuiteParameters const & ) )(&IMinimizer_wrapper::default_setParameters)
-            , ( bp::arg("parameters") ) );
+    { //::IMinimizer
+        typedef bp::class_< IMinimizer_wrapper, boost::noncopyable > IMinimizer_exposer_t;
+        IMinimizer_exposer_t IMinimizer_exposer = IMinimizer_exposer_t( "IMinimizer", bp::init< >() );
+        bp::scope IMinimizer_scope( IMinimizer_exposer );
+        { //::IMinimizer::clear
+        
+            typedef void ( ::IMinimizer::*clear_function_type )(  ) ;
+            typedef void ( IMinimizer_wrapper::*default_clear_function_type )(  ) ;
+            
+            IMinimizer_exposer.def( 
+                "clear"
+                , clear_function_type(&::IMinimizer::clear)
+                , default_clear_function_type(&IMinimizer_wrapper::default_clear) );
+        
+        }
+        { //::IMinimizer::getErrorOfVariable
+        
+            typedef double ( ::IMinimizer::*getErrorOfVariable_function_type )( ::size_t ) const;
+            typedef double ( IMinimizer_wrapper::*default_getErrorOfVariable_function_type )( ::size_t ) const;
+            
+            IMinimizer_exposer.def( 
+                "getErrorOfVariable"
+                , getErrorOfVariable_function_type(&::IMinimizer::getErrorOfVariable)
+                , default_getErrorOfVariable_function_type(&IMinimizer_wrapper::default_getErrorOfVariable)
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::IMinimizer::getMinValue
+        
+            typedef double ( ::IMinimizer::*getMinValue_function_type )(  ) const;
+            typedef double ( IMinimizer_wrapper::*default_getMinValue_function_type )(  ) const;
+            
+            IMinimizer_exposer.def( 
+                "getMinValue"
+                , getMinValue_function_type(&::IMinimizer::getMinValue)
+                , default_getMinValue_function_type(&IMinimizer_wrapper::default_getMinValue) );
+        
+        }
+        { //::IMinimizer::getNCalls
+        
+            typedef ::size_t ( ::IMinimizer::*getNCalls_function_type )(  ) const;
+            typedef ::size_t ( IMinimizer_wrapper::*default_getNCalls_function_type )(  ) const;
+            
+            IMinimizer_exposer.def( 
+                "getNCalls"
+                , getNCalls_function_type(&::IMinimizer::getNCalls)
+                , default_getNCalls_function_type(&IMinimizer_wrapper::default_getNCalls) );
+        
+        }
+        { //::IMinimizer::getNumberOfVariables
+        
+            typedef ::size_t ( ::IMinimizer::*getNumberOfVariables_function_type )(  ) const;
+            typedef ::size_t ( IMinimizer_wrapper::*default_getNumberOfVariables_function_type )(  ) const;
+            
+            IMinimizer_exposer.def( 
+                "getNumberOfVariables"
+                , getNumberOfVariables_function_type(&::IMinimizer::getNumberOfVariables)
+                , default_getNumberOfVariables_function_type(&IMinimizer_wrapper::default_getNumberOfVariables) );
+        
+        }
+        { //::IMinimizer::getValueOfVariableAtMinimum
+        
+            typedef double ( ::IMinimizer::*getValueOfVariableAtMinimum_function_type )( ::size_t ) const;
+            typedef double ( IMinimizer_wrapper::*default_getValueOfVariableAtMinimum_function_type )( ::size_t ) const;
+            
+            IMinimizer_exposer.def( 
+                "getValueOfVariableAtMinimum"
+                , getValueOfVariableAtMinimum_function_type(&::IMinimizer::getValueOfVariableAtMinimum)
+                , default_getValueOfVariableAtMinimum_function_type(&IMinimizer_wrapper::default_getValueOfVariableAtMinimum)
+                , ( bp::arg("index") ) );
+        
+        }
+        { //::IMinimizer::getValueOfVariablesAtMinimum
+        
+            typedef ::std::vector< double > ( ::IMinimizer::*getValueOfVariablesAtMinimum_function_type )(  ) const;
+            typedef ::std::vector< double > ( IMinimizer_wrapper::*default_getValueOfVariablesAtMinimum_function_type )(  ) const;
+            
+            IMinimizer_exposer.def( 
+                "getValueOfVariablesAtMinimum"
+                , getValueOfVariablesAtMinimum_function_type(&::IMinimizer::getValueOfVariablesAtMinimum)
+                , default_getValueOfVariablesAtMinimum_function_type(&IMinimizer_wrapper::default_getValueOfVariablesAtMinimum) );
+        
+        }
+        { //::IMinimizer::minimize
+        
+            typedef void ( ::IMinimizer::*minimize_function_type )(  ) ;
+            
+            IMinimizer_exposer.def( 
+                "minimize"
+                , bp::pure_virtual( minimize_function_type(&::IMinimizer::minimize) ) );
+        
+        }
+        { //::IMinimizer::printResults
+        
+            typedef void ( ::IMinimizer::*printResults_function_type )(  ) const;
+            typedef void ( IMinimizer_wrapper::*default_printResults_function_type )(  ) const;
+            
+            IMinimizer_exposer.def( 
+                "printResults"
+                , printResults_function_type(&::IMinimizer::printResults)
+                , default_printResults_function_type(&IMinimizer_wrapper::default_printResults) );
+        
+        }
+        { //::IMinimizer::setOptions
+        
+            typedef void ( ::IMinimizer::*setOptions_function_type )( ::std::string const & ) ;
+            typedef void ( IMinimizer_wrapper::*default_setOptions_function_type )( ::std::string const & ) ;
+            
+            IMinimizer_exposer.def( 
+                "setOptions"
+                , setOptions_function_type(&::IMinimizer::setOptions)
+                , default_setOptions_function_type(&IMinimizer_wrapper::default_setOptions)
+                , ( bp::arg("options") ) );
+        
+        }
+        { //::IMinimizer::setParameters
+        
+            typedef void ( ::IMinimizer::*setParameters_function_type )( ::FitSuiteParameters const & ) ;
+            typedef void ( IMinimizer_wrapper::*default_setParameters_function_type )( ::FitSuiteParameters const & ) ;
+            
+            IMinimizer_exposer.def( 
+                "setParameters"
+                , setParameters_function_type(&::IMinimizer::setParameters)
+                , default_setParameters_function_type(&IMinimizer_wrapper::default_setParameters)
+                , ( bp::arg("parameters") ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/IOutputDataNormalizer.pypp.cpp b/Fit/PythonAPI/src/IOutputDataNormalizer.pypp.cpp
index 33ea7378bfb478fcf1473e63087d32ee67f60bfe..08eab7fc5ed010cf2b51712ba76f915be379cc89 100644
--- a/Fit/PythonAPI/src/IOutputDataNormalizer.pypp.cpp
+++ b/Fit/PythonAPI/src/IOutputDataNormalizer.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "IOutputDataNormalizer.pypp.h"
 
 namespace bp = boost::python;
@@ -50,19 +42,41 @@ struct IOutputDataNormalizer_wrapper : IOutputDataNormalizer, bp::wrapper< IOutp
 
 void register_IOutputDataNormalizer_class(){
 
-    bp::class_< IOutputDataNormalizer_wrapper, boost::noncopyable >( "IOutputDataNormalizer" )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::IOutputDataNormalizer * ( ::IOutputDataNormalizer::* )(  ) const)(&::IOutputDataNormalizer::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createNormalizedData"
-            , bp::pure_virtual( (::OutputData< double > * ( ::IOutputDataNormalizer::* )( ::OutputData< double > const & ) const)(&::IOutputDataNormalizer::createNormalizedData) )
-            , ( bp::arg("data") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "setMaximumIntensity"
-            , bp::pure_virtual( (void ( ::IOutputDataNormalizer::* )( double ) )(&::IOutputDataNormalizer::setMaximumIntensity) )
-            , ( bp::arg("arg0") ) );
+    { //::IOutputDataNormalizer
+        typedef bp::class_< IOutputDataNormalizer_wrapper, boost::noncopyable > IOutputDataNormalizer_exposer_t;
+        IOutputDataNormalizer_exposer_t IOutputDataNormalizer_exposer = IOutputDataNormalizer_exposer_t( "IOutputDataNormalizer" );
+        bp::scope IOutputDataNormalizer_scope( IOutputDataNormalizer_exposer );
+        { //::IOutputDataNormalizer::clone
+        
+            typedef ::IOutputDataNormalizer * ( ::IOutputDataNormalizer::*clone_function_type )(  ) const;
+            
+            IOutputDataNormalizer_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::IOutputDataNormalizer::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IOutputDataNormalizer::createNormalizedData
+        
+            typedef ::OutputData<double> * ( ::IOutputDataNormalizer::*createNormalizedData_function_type )( ::OutputData<double> const & ) const;
+            
+            IOutputDataNormalizer_exposer.def( 
+                "createNormalizedData"
+                , bp::pure_virtual( createNormalizedData_function_type(&::IOutputDataNormalizer::createNormalizedData) )
+                , ( bp::arg("data") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::IOutputDataNormalizer::setMaximumIntensity
+        
+            typedef void ( ::IOutputDataNormalizer::*setMaximumIntensity_function_type )( double ) ;
+            
+            IOutputDataNormalizer_exposer.def( 
+                "setMaximumIntensity"
+                , bp::pure_virtual( setMaximumIntensity_function_type(&::IOutputDataNormalizer::setMaximumIntensity) )
+                , ( bp::arg("arg0") ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/ISquaredFunction.pypp.cpp b/Fit/PythonAPI/src/ISquaredFunction.pypp.cpp
index 9a2ed8d781588f1806c489c37fcb1a73bd68f6df..d3102be1a4b8578ccb595113353c8de045bf2187 100644
--- a/Fit/PythonAPI/src/ISquaredFunction.pypp.cpp
+++ b/Fit/PythonAPI/src/ISquaredFunction.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "ISquaredFunction.pypp.h"
 
 namespace bp = boost::python;
@@ -57,19 +49,42 @@ struct ISquaredFunction_wrapper : ISquaredFunction, bp::wrapper< ISquaredFunctio
 
 void register_ISquaredFunction_class(){
 
-    bp::class_< ISquaredFunction_wrapper, boost::noncopyable >( "ISquaredFunction" )    
-        .def( 
-            "calculateSquaredDifference"
-            , bp::pure_virtual( (double ( ::ISquaredFunction::* )( double,double ) const)(&::ISquaredFunction::calculateSquaredDifference) )
-            , ( bp::arg("real_value"), bp::arg("simulated_value") ) )    
-        .def( 
-            "calculateSquaredError"
-            , (double ( ::ISquaredFunction::* )( double,double ) const)(&::ISquaredFunction::calculateSquaredError)
-            , (double ( ISquaredFunction_wrapper::* )( double,double ) const)(&ISquaredFunction_wrapper::default_calculateSquaredError)
-            , ( bp::arg("real_value"), bp::arg("simulated_value")=0.0 ) )    
-        .def( 
-            "clone"
-            , bp::pure_virtual( (::ISquaredFunction * ( ::ISquaredFunction::* )(  ) const)(&::ISquaredFunction::clone) )
-            , bp::return_value_policy< bp::manage_new_object >() );
+    { //::ISquaredFunction
+        typedef bp::class_< ISquaredFunction_wrapper, boost::noncopyable > ISquaredFunction_exposer_t;
+        ISquaredFunction_exposer_t ISquaredFunction_exposer = ISquaredFunction_exposer_t( "ISquaredFunction" );
+        bp::scope ISquaredFunction_scope( ISquaredFunction_exposer );
+        { //::ISquaredFunction::calculateSquaredDifference
+        
+            typedef double ( ::ISquaredFunction::*calculateSquaredDifference_function_type )( double,double ) const;
+            
+            ISquaredFunction_exposer.def( 
+                "calculateSquaredDifference"
+                , bp::pure_virtual( calculateSquaredDifference_function_type(&::ISquaredFunction::calculateSquaredDifference) )
+                , ( bp::arg("real_value"), bp::arg("simulated_value") ) );
+        
+        }
+        { //::ISquaredFunction::calculateSquaredError
+        
+            typedef double ( ::ISquaredFunction::*calculateSquaredError_function_type )( double,double ) const;
+            typedef double ( ISquaredFunction_wrapper::*default_calculateSquaredError_function_type )( double,double ) const;
+            
+            ISquaredFunction_exposer.def( 
+                "calculateSquaredError"
+                , calculateSquaredError_function_type(&::ISquaredFunction::calculateSquaredError)
+                , default_calculateSquaredError_function_type(&ISquaredFunction_wrapper::default_calculateSquaredError)
+                , ( bp::arg("real_value"), bp::arg("simulated_value")=0.0 ) );
+        
+        }
+        { //::ISquaredFunction::clone
+        
+            typedef ::ISquaredFunction * ( ::ISquaredFunction::*clone_function_type )(  ) const;
+            
+            ISquaredFunction_exposer.def( 
+                "clone"
+                , bp::pure_virtual( clone_function_type(&::ISquaredFunction::clone) )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/MinimizerFactory.pypp.cpp b/Fit/PythonAPI/src/MinimizerFactory.pypp.cpp
index 274d6b509b7a3ad3f452a047722ca64d9f8c5c35..b868b189d1feb5a2d43f6ae8533a9a5c164587d2 100644
--- a/Fit/PythonAPI/src/MinimizerFactory.pypp.cpp
+++ b/Fit/PythonAPI/src/MinimizerFactory.pypp.cpp
@@ -1,39 +1,47 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "MinimizerFactory.pypp.h"
 
 namespace bp = boost::python;
 
 void register_MinimizerFactory_class(){
 
-    bp::class_< MinimizerFactory >( "MinimizerFactory" )    
-        .def( 
-            "createMinimizer"
-            , (::IMinimizer * (*)( ::std::string const &,::std::string const &,::std::string const & ))( &::MinimizerFactory::createMinimizer )
-            , ( bp::arg("minimizer"), bp::arg("algorithm")=std::basic_string<char, std::char_traits<char>, std::allocator<char> >(), bp::arg("options")=std::basic_string<char, std::char_traits<char>, std::allocator<char> >() )
-            , bp::return_value_policy< bp::reference_existing_object >() )    
-        .def( 
-            "print_catalogue"
-            , (void (*)(  ))( &::MinimizerFactory::print_catalogue ) )    
-        .staticmethod( "createMinimizer" )    
-        .staticmethod( "print_catalogue" );
+    { //::MinimizerFactory
+        typedef bp::class_< MinimizerFactory > MinimizerFactory_exposer_t;
+        MinimizerFactory_exposer_t MinimizerFactory_exposer = MinimizerFactory_exposer_t( "MinimizerFactory" );
+        bp::scope MinimizerFactory_scope( MinimizerFactory_exposer );
+        { //::MinimizerFactory::createMinimizer
+        
+            typedef ::IMinimizer * ( *createMinimizer_function_type )( ::std::string const &,::std::string const &,::std::string const & );
+            
+            MinimizerFactory_exposer.def( 
+                "createMinimizer"
+                , createMinimizer_function_type( &::MinimizerFactory::createMinimizer )
+                , ( bp::arg("minimizer"), bp::arg("algorithm")=std::basic_string<char, std::char_traits<char>, std::allocator<char> >(), bp::arg("options")=std::basic_string<char, std::char_traits<char>, std::allocator<char> >() )
+                , bp::return_value_policy< bp::reference_existing_object >() );
+        
+        }
+        { //::MinimizerFactory::print_catalogue
+        
+            typedef void ( *print_catalogue_function_type )(  );
+            
+            MinimizerFactory_exposer.def( 
+                "print_catalogue"
+                , print_catalogue_function_type( &::MinimizerFactory::print_catalogue ) );
+        
+        }
+        MinimizerFactory_exposer.staticmethod( "createMinimizer" );
+        MinimizerFactory_exposer.staticmethod( "print_catalogue" );
+    }
 
 }
diff --git a/Fit/PythonAPI/src/OutputDataNormalizer.pypp.cpp b/Fit/PythonAPI/src/OutputDataNormalizer.pypp.cpp
index 9282a5f164f7161b94e0e37f79d8ed73ced65f2b..1f174b834df98ba7427c89851fdabb962ea652c5 100644
--- a/Fit/PythonAPI/src/OutputDataNormalizer.pypp.cpp
+++ b/Fit/PythonAPI/src/OutputDataNormalizer.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "OutputDataNormalizer.pypp.h"
 
 namespace bp = boost::python;
@@ -78,22 +70,47 @@ struct OutputDataNormalizer_wrapper : OutputDataNormalizer, bp::wrapper< OutputD
 
 void register_OutputDataNormalizer_class(){
 
-    bp::class_< OutputDataNormalizer_wrapper, bp::bases< IOutputDataNormalizer > >( "OutputDataNormalizer", bp::init< bp::optional< double, double > >(( bp::arg("scale")=1.0e+0, bp::arg("shift")=0.0 )) )    
-        .def( 
-            "clone"
-            , (::OutputDataNormalizer * ( ::OutputDataNormalizer::* )(  ) const)(&::OutputDataNormalizer::clone)
-            , (::OutputDataNormalizer * ( OutputDataNormalizer_wrapper::* )(  ) const)(&OutputDataNormalizer_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "createNormalizedData"
-            , (::OutputData< double > * ( ::OutputDataNormalizer::* )( ::OutputData< double > const & ) const)(&::OutputDataNormalizer::createNormalizedData)
-            , (::OutputData< double > * ( OutputDataNormalizer_wrapper::* )( ::OutputData< double > const & ) const)(&OutputDataNormalizer_wrapper::default_createNormalizedData)
-            , ( bp::arg("data") )
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "setMaximumIntensity"
-            , (void ( ::OutputDataNormalizer::* )( double ) )(&::OutputDataNormalizer::setMaximumIntensity)
-            , (void ( OutputDataNormalizer_wrapper::* )( double ) )(&OutputDataNormalizer_wrapper::default_setMaximumIntensity)
-            , ( bp::arg("max_intensity") ) );
+    { //::OutputDataNormalizer
+        typedef bp::class_< OutputDataNormalizer_wrapper, bp::bases< IOutputDataNormalizer > > OutputDataNormalizer_exposer_t;
+        OutputDataNormalizer_exposer_t OutputDataNormalizer_exposer = OutputDataNormalizer_exposer_t( "OutputDataNormalizer", bp::init< bp::optional< double, double > >(( bp::arg("scale")=1.0e+0, bp::arg("shift")=0.0 )) );
+        bp::scope OutputDataNormalizer_scope( OutputDataNormalizer_exposer );
+        { //::OutputDataNormalizer::clone
+        
+            typedef ::OutputDataNormalizer * ( ::OutputDataNormalizer::*clone_function_type )(  ) const;
+            typedef ::OutputDataNormalizer * ( OutputDataNormalizer_wrapper::*default_clone_function_type )(  ) const;
+            
+            OutputDataNormalizer_exposer.def( 
+                "clone"
+                , clone_function_type(&::OutputDataNormalizer::clone)
+                , default_clone_function_type(&OutputDataNormalizer_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::OutputDataNormalizer::createNormalizedData
+        
+            typedef ::OutputData< double > * ( ::OutputDataNormalizer::*createNormalizedData_function_type )( ::OutputData< double > const & ) const;
+            typedef ::OutputData< double > * ( OutputDataNormalizer_wrapper::*default_createNormalizedData_function_type )( ::OutputData< double > const & ) const;
+            
+            OutputDataNormalizer_exposer.def( 
+                "createNormalizedData"
+                , createNormalizedData_function_type(&::OutputDataNormalizer::createNormalizedData)
+                , default_createNormalizedData_function_type(&OutputDataNormalizer_wrapper::default_createNormalizedData)
+                , ( bp::arg("data") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::OutputDataNormalizer::setMaximumIntensity
+        
+            typedef void ( ::OutputDataNormalizer::*setMaximumIntensity_function_type )( double ) ;
+            typedef void ( OutputDataNormalizer_wrapper::*default_setMaximumIntensity_function_type )( double ) ;
+            
+            OutputDataNormalizer_exposer.def( 
+                "setMaximumIntensity"
+                , setMaximumIntensity_function_type(&::OutputDataNormalizer::setMaximumIntensity)
+                , default_setMaximumIntensity_function_type(&OutputDataNormalizer_wrapper::default_setMaximumIntensity)
+                , ( bp::arg("max_intensity") ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/OutputDataSimpleNormalizer.pypp.cpp b/Fit/PythonAPI/src/OutputDataSimpleNormalizer.pypp.cpp
index 65e719b3c98571ac13d2a023419ceb53209f0d16..70b59588290d8d49c637096863ec5648dc3965f9 100644
--- a/Fit/PythonAPI/src/OutputDataSimpleNormalizer.pypp.cpp
+++ b/Fit/PythonAPI/src/OutputDataSimpleNormalizer.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "OutputDataSimpleNormalizer.pypp.h"
 
 namespace bp = boost::python;
@@ -78,22 +70,47 @@ struct OutputDataSimpleNormalizer_wrapper : OutputDataSimpleNormalizer, bp::wrap
 
 void register_OutputDataSimpleNormalizer_class(){
 
-    bp::class_< OutputDataSimpleNormalizer_wrapper, bp::bases< OutputDataNormalizer > >( "OutputDataSimpleNormalizer", bp::init< bp::optional< double, double > >(( bp::arg("scale")=1.0e+0, bp::arg("shift")=0.0 )) )    
-        .def( 
-            "clone"
-            , (::OutputDataSimpleNormalizer * ( ::OutputDataSimpleNormalizer::* )(  ) const)(&::OutputDataSimpleNormalizer::clone)
-            , (::OutputDataSimpleNormalizer * ( OutputDataSimpleNormalizer_wrapper::* )(  ) const)(&OutputDataSimpleNormalizer_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "setMaximumIntensity"
-            , (void ( ::OutputDataSimpleNormalizer::* )( double ) )(&::OutputDataSimpleNormalizer::setMaximumIntensity)
-            , (void ( OutputDataSimpleNormalizer_wrapper::* )( double ) )(&OutputDataSimpleNormalizer_wrapper::default_setMaximumIntensity)
-            , ( bp::arg("max_intensity") ) )    
-        .def( 
-            "createNormalizedData"
-            , (::OutputData< double > * ( ::OutputDataNormalizer::* )( ::OutputData< double > const & ) const)(&::OutputDataNormalizer::createNormalizedData)
-            , (::OutputData< double > * ( OutputDataSimpleNormalizer_wrapper::* )( ::OutputData< double > const & ) const)(&OutputDataSimpleNormalizer_wrapper::default_createNormalizedData)
-            , ( bp::arg("data") )
-            , bp::return_value_policy< bp::manage_new_object >() );
+    { //::OutputDataSimpleNormalizer
+        typedef bp::class_< OutputDataSimpleNormalizer_wrapper, bp::bases< OutputDataNormalizer > > OutputDataSimpleNormalizer_exposer_t;
+        OutputDataSimpleNormalizer_exposer_t OutputDataSimpleNormalizer_exposer = OutputDataSimpleNormalizer_exposer_t( "OutputDataSimpleNormalizer", bp::init< bp::optional< double, double > >(( bp::arg("scale")=1.0e+0, bp::arg("shift")=0.0 )) );
+        bp::scope OutputDataSimpleNormalizer_scope( OutputDataSimpleNormalizer_exposer );
+        { //::OutputDataSimpleNormalizer::clone
+        
+            typedef ::OutputDataSimpleNormalizer * ( ::OutputDataSimpleNormalizer::*clone_function_type )(  ) const;
+            typedef ::OutputDataSimpleNormalizer * ( OutputDataSimpleNormalizer_wrapper::*default_clone_function_type )(  ) const;
+            
+            OutputDataSimpleNormalizer_exposer.def( 
+                "clone"
+                , clone_function_type(&::OutputDataSimpleNormalizer::clone)
+                , default_clone_function_type(&OutputDataSimpleNormalizer_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::OutputDataSimpleNormalizer::setMaximumIntensity
+        
+            typedef void ( ::OutputDataSimpleNormalizer::*setMaximumIntensity_function_type )( double ) ;
+            typedef void ( OutputDataSimpleNormalizer_wrapper::*default_setMaximumIntensity_function_type )( double ) ;
+            
+            OutputDataSimpleNormalizer_exposer.def( 
+                "setMaximumIntensity"
+                , setMaximumIntensity_function_type(&::OutputDataSimpleNormalizer::setMaximumIntensity)
+                , default_setMaximumIntensity_function_type(&OutputDataSimpleNormalizer_wrapper::default_setMaximumIntensity)
+                , ( bp::arg("max_intensity") ) );
+        
+        }
+        { //::OutputDataNormalizer::createNormalizedData
+        
+            typedef ::OutputData< double > * ( ::OutputDataNormalizer::*createNormalizedData_function_type )( ::OutputData< double > const & ) const;
+            typedef ::OutputData< double > * ( OutputDataSimpleNormalizer_wrapper::*default_createNormalizedData_function_type )( ::OutputData< double > const & ) const;
+            
+            OutputDataSimpleNormalizer_exposer.def( 
+                "createNormalizedData"
+                , createNormalizedData_function_type(&::OutputDataNormalizer::createNormalizedData)
+                , default_createNormalizedData_function_type(&OutputDataSimpleNormalizer_wrapper::default_createNormalizedData)
+                , ( bp::arg("data") )
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/PythonInterface_enumerations.pypp.cpp b/Fit/PythonAPI/src/PythonInterface_enumerations.pypp.cpp
deleted file mode 100644
index bb67ac2e7f76cfcb2fe57ff04e88529df379e416..0000000000000000000000000000000000000000
--- a/Fit/PythonAPI/src/PythonInterface_enumerations.pypp.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
-#include "PythonInterface_enumerations.pypp.h"
-
-namespace bp = boost::python;
-
-void register_enumerations(){
-
-    bp::enum_< MathFunctions::TransformCase>("TransformCase")
-        .value("ForwardFFT", MathFunctions::ForwardFFT)
-        .value("BackwardFFT", MathFunctions::BackwardFFT)
-        .export_values()
-        ;
-
-}
diff --git a/Fit/PythonAPI/src/PythonInterface_free_functions.pypp.cpp b/Fit/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
deleted file mode 100644
index 5d46a2e109da8b08070f640e08e258504fa475c3..0000000000000000000000000000000000000000
--- a/Fit/PythonAPI/src/PythonInterface_free_functions.pypp.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
-#include "PythonInterface_free_functions.pypp.h"
-
-namespace bp = boost::python;
-
-void register_free_functions(){
-
-    { //::MathFunctions::Bessel_C1
-    
-        typedef double ( *Bessel_C1_function_type )( double );
-        
-        bp::def( 
-            "Bessel_C1"
-            , Bessel_C1_function_type( &::MathFunctions::Bessel_C1 )
-            , ( bp::arg("value") ) );
-    
-    }
-
-    { //::MathFunctions::Bessel_J1
-    
-        typedef double ( *Bessel_J1_function_type )( double );
-        
-        bp::def( 
-            "Bessel_J1"
-            , Bessel_J1_function_type( &::MathFunctions::Bessel_J1 )
-            , ( bp::arg("value") ) );
-    
-    }
-
-    { //::MathFunctions::ConvolveFFT
-    
-        typedef ::std::vector< std::complex<double> > ( *ConvolveFFT_function_type )( ::std::vector< double > const &,::std::vector< double > const & );
-        
-        bp::def( 
-            "ConvolveFFT"
-            , ConvolveFFT_function_type( &::MathFunctions::ConvolveFFT )
-            , ( bp::arg("signal"), bp::arg("resfunc") ) );
-    
-    }
-
-    { //::MathFunctions::FastCos
-    
-        typedef ::complex_t ( *FastCos_function_type )( ::complex_t const & );
-        
-        bp::def( 
-            "FastCos"
-            , FastCos_function_type( &::MathFunctions::FastCos )
-            , ( bp::arg("x") ) );
-    
-    }
-
-    { //::MathFunctions::FastCos
-    
-        typedef double ( *FastCos_function_type )( double const & );
-        
-        bp::def( 
-            "FastCos"
-            , FastCos_function_type( &::MathFunctions::FastCos )
-            , ( bp::arg("x") ) );
-    
-    }
-
-    { //::MathFunctions::FastFourierTransform
-    
-        typedef ::std::vector< std::complex<double> > ( *FastFourierTransform_function_type )( ::std::vector< double > const &,::MathFunctions::TransformCase );
-        
-        bp::def( 
-            "FastFourierTransform"
-            , FastFourierTransform_function_type( &::MathFunctions::FastFourierTransform )
-            , ( bp::arg("data"), bp::arg("tcase") ) );
-    
-    }
-
-    { //::MathFunctions::FastFourierTransform
-    
-        typedef ::std::vector< std::complex<double> > ( *FastFourierTransform_function_type )( ::std::vector< std::complex<double> > const &,::MathFunctions::TransformCase );
-        
-        bp::def( 
-            "FastFourierTransform"
-            , FastFourierTransform_function_type( &::MathFunctions::FastFourierTransform )
-            , ( bp::arg("data"), bp::arg("tcase") ) );
-    
-    }
-
-    { //::MathFunctions::FastSin
-    
-        typedef ::complex_t ( *FastSin_function_type )( ::complex_t const & );
-        
-        bp::def( 
-            "FastSin"
-            , FastSin_function_type( &::MathFunctions::FastSin )
-            , ( bp::arg("x") ) );
-    
-    }
-
-    { //::MathFunctions::FastSin
-    
-        typedef double ( *FastSin_function_type )( double const & );
-        
-        bp::def( 
-            "FastSin"
-            , FastSin_function_type( &::MathFunctions::FastSin )
-            , ( bp::arg("x") ) );
-    
-    }
-
-    { //::MathFunctions::FastSinCos
-    
-        typedef void ( *FastSinCos_function_type )( ::complex_t const &,::complex_t &,::complex_t & );
-        
-        bp::def( 
-            "FastSinCos"
-            , FastSinCos_function_type( &::MathFunctions::FastSinCos )
-            , ( bp::arg("x"), bp::arg("xsin"), bp::arg("xcos") ) );
-    
-    }
-
-    { //::MathFunctions::Gaussian
-    
-        typedef double ( *Gaussian_function_type )( double,double,double );
-        
-        bp::def( 
-            "Gaussian"
-            , Gaussian_function_type( &::MathFunctions::Gaussian )
-            , ( bp::arg("value"), bp::arg("average"), bp::arg("std_dev") ) );
-    
-    }
-
-    { //::MathFunctions::GenerateNormalRandom
-    
-        typedef double ( *GenerateNormalRandom_function_type )( double,double );
-        
-        bp::def( 
-            "GenerateNormalRandom"
-            , GenerateNormalRandom_function_type( &::MathFunctions::GenerateNormalRandom )
-            , ( bp::arg("average"), bp::arg("std_dev") ) );
-    
-    }
-
-    { //::MathFunctions::GenerateStandardNormalRandom
-    
-        typedef double ( *GenerateStandardNormalRandom_function_type )(  );
-        
-        bp::def( 
-            "GenerateStandardNormalRandom"
-            , GenerateStandardNormalRandom_function_type( &::MathFunctions::GenerateStandardNormalRandom ) );
-    
-    }
-
-    { //::MathFunctions::GenerateUniformRandom
-    
-        typedef double ( *GenerateUniformRandom_function_type )(  );
-        
-        bp::def( 
-            "GenerateUniformRandom"
-            , GenerateUniformRandom_function_type( &::MathFunctions::GenerateUniformRandom ) );
-    
-    }
-
-    { //::MathFunctions::IntegratedGaussian
-    
-        typedef double ( *IntegratedGaussian_function_type )( double,double,double );
-        
-        bp::def( 
-            "IntegratedGaussian"
-            , IntegratedGaussian_function_type( &::MathFunctions::IntegratedGaussian )
-            , ( bp::arg("value"), bp::arg("average"), bp::arg("std_dev") ) );
-    
-    }
-
-    { //::MathFunctions::Laue
-    
-        typedef ::complex_t ( *Laue_function_type )( ::complex_t const &,::size_t );
-        
-        bp::def( 
-            "Laue"
-            , Laue_function_type( &::MathFunctions::Laue )
-            , ( bp::arg("value"), bp::arg("N") ) );
-    
-    }
-
-    { //::MathFunctions::Si
-    
-        typedef double ( *Si_function_type )( double );
-        
-        bp::def( 
-            "Si"
-            , Si_function_type( &::MathFunctions::Si )
-            , ( bp::arg("value") ) );
-    
-    }
-
-    { //::MathFunctions::Sinc
-    
-        typedef ::complex_t ( *Sinc_function_type )( ::complex_t const & );
-        
-        bp::def( 
-            "Sinc"
-            , Sinc_function_type( &::MathFunctions::Sinc )
-            , ( bp::arg("value") ) );
-    
-    }
-
-    { //::MathFunctions::Sinc
-    
-        typedef double ( *Sinc_function_type )( double );
-        
-        bp::def( 
-            "Sinc"
-            , Sinc_function_type( &::MathFunctions::Sinc )
-            , ( bp::arg("value") ) );
-    
-    }
-
-    { //::MathFunctions::StandardNormal
-    
-        typedef double ( *StandardNormal_function_type )( double );
-        
-        bp::def( 
-            "StandardNormal"
-            , StandardNormal_function_type( &::MathFunctions::StandardNormal )
-            , ( bp::arg("value") ) );
-    
-    }
-
-}
diff --git a/Fit/PythonAPI/src/PythonModule.cpp b/Fit/PythonAPI/src/PythonModule.cpp
index 6fa5e70d73bf5bcb57efc5441e61061b2b9c263f..c07346ae29958b52dfa4432a5d92272c21403dcc 100644
--- a/Fit/PythonAPI/src/PythonModule.cpp
+++ b/Fit/PythonAPI/src/PythonModule.cpp
@@ -3,7 +3,6 @@
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
 
@@ -18,8 +17,6 @@ GCC_DIAG_ON(missing-field-initializers);
 #include "MinimizerFactory.pypp.h" 
 #include "OutputDataNormalizer.pypp.h" 
 #include "OutputDataSimpleNormalizer.pypp.h" 
-#include "PythonInterface_enumerations.pypp.h" 
-#include "PythonInterface_free_functions.pypp.h" 
 #include "SquaredFunctionDefault.pypp.h" 
 #include "SquaredFunctionWhichOnlyWorks.pypp.h" 
 #include "SquaredFunctionWithGaussianError.pypp.h" 
@@ -27,7 +24,6 @@ GCC_DIAG_ON(missing-field-initializers);
 
 BOOST_PYTHON_MODULE(libBornAgainFit){
 
-    register_enumerations();
     register_AttLimits_class();
     register_IChiSquaredModule_class();
     register_ChiSquaredModule_class();
@@ -43,5 +39,4 @@ BOOST_PYTHON_MODULE(libBornAgainFit){
     register_SquaredFunctionWhichOnlyWorks_class();
     register_SquaredFunctionWithGaussianError_class();
     register_SquaredFunctionWithSystematicError_class();
-    register_free_functions();
 }
diff --git a/Fit/PythonAPI/src/SquaredFunctionDefault.pypp.cpp b/Fit/PythonAPI/src/SquaredFunctionDefault.pypp.cpp
index e6129765aefb8088fe53c9e7a6b34db813016d23..24c1031d440dfb73a3a0f7df006e34d0ea02bb61 100644
--- a/Fit/PythonAPI/src/SquaredFunctionDefault.pypp.cpp
+++ b/Fit/PythonAPI/src/SquaredFunctionDefault.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "SquaredFunctionDefault.pypp.h"
 
 namespace bp = boost::python;
@@ -78,21 +70,46 @@ struct SquaredFunctionDefault_wrapper : SquaredFunctionDefault, bp::wrapper< Squ
 
 void register_SquaredFunctionDefault_class(){
 
-    bp::class_< SquaredFunctionDefault_wrapper, bp::bases< ISquaredFunction > >( "SquaredFunctionDefault", bp::init< >() )    
-        .def( 
-            "calculateSquaredDifference"
-            , (double ( ::SquaredFunctionDefault::* )( double,double ) const)(&::SquaredFunctionDefault::calculateSquaredDifference)
-            , (double ( SquaredFunctionDefault_wrapper::* )( double,double ) const)(&SquaredFunctionDefault_wrapper::default_calculateSquaredDifference)
-            , ( bp::arg("real_value"), bp::arg("simulated_value") ) )    
-        .def( 
-            "calculateSquaredError"
-            , (double ( ::SquaredFunctionDefault::* )( double,double ) const)(&::SquaredFunctionDefault::calculateSquaredError)
-            , (double ( SquaredFunctionDefault_wrapper::* )( double,double ) const)(&SquaredFunctionDefault_wrapper::default_calculateSquaredError)
-            , ( bp::arg("real_value"), bp::arg("arg1") ) )    
-        .def( 
-            "clone"
-            , (::SquaredFunctionDefault * ( ::SquaredFunctionDefault::* )(  ) const)(&::SquaredFunctionDefault::clone)
-            , (::SquaredFunctionDefault * ( SquaredFunctionDefault_wrapper::* )(  ) const)(&SquaredFunctionDefault_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() );
+    { //::SquaredFunctionDefault
+        typedef bp::class_< SquaredFunctionDefault_wrapper, bp::bases< ISquaredFunction > > SquaredFunctionDefault_exposer_t;
+        SquaredFunctionDefault_exposer_t SquaredFunctionDefault_exposer = SquaredFunctionDefault_exposer_t( "SquaredFunctionDefault", bp::init< >() );
+        bp::scope SquaredFunctionDefault_scope( SquaredFunctionDefault_exposer );
+        { //::SquaredFunctionDefault::calculateSquaredDifference
+        
+            typedef double ( ::SquaredFunctionDefault::*calculateSquaredDifference_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionDefault_wrapper::*default_calculateSquaredDifference_function_type )( double,double ) const;
+            
+            SquaredFunctionDefault_exposer.def( 
+                "calculateSquaredDifference"
+                , calculateSquaredDifference_function_type(&::SquaredFunctionDefault::calculateSquaredDifference)
+                , default_calculateSquaredDifference_function_type(&SquaredFunctionDefault_wrapper::default_calculateSquaredDifference)
+                , ( bp::arg("real_value"), bp::arg("simulated_value") ) );
+        
+        }
+        { //::SquaredFunctionDefault::calculateSquaredError
+        
+            typedef double ( ::SquaredFunctionDefault::*calculateSquaredError_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionDefault_wrapper::*default_calculateSquaredError_function_type )( double,double ) const;
+            
+            SquaredFunctionDefault_exposer.def( 
+                "calculateSquaredError"
+                , calculateSquaredError_function_type(&::SquaredFunctionDefault::calculateSquaredError)
+                , default_calculateSquaredError_function_type(&SquaredFunctionDefault_wrapper::default_calculateSquaredError)
+                , ( bp::arg("real_value"), bp::arg("arg1") ) );
+        
+        }
+        { //::SquaredFunctionDefault::clone
+        
+            typedef ::SquaredFunctionDefault * ( ::SquaredFunctionDefault::*clone_function_type )(  ) const;
+            typedef ::SquaredFunctionDefault * ( SquaredFunctionDefault_wrapper::*default_clone_function_type )(  ) const;
+            
+            SquaredFunctionDefault_exposer.def( 
+                "clone"
+                , clone_function_type(&::SquaredFunctionDefault::clone)
+                , default_clone_function_type(&SquaredFunctionDefault_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/SquaredFunctionWhichOnlyWorks.pypp.cpp b/Fit/PythonAPI/src/SquaredFunctionWhichOnlyWorks.pypp.cpp
index aa93efc9d4e3f704884267bea7936bf9b2abc427..bbb302b394a39e8dbddda31cd8b59120bf12a96c 100644
--- a/Fit/PythonAPI/src/SquaredFunctionWhichOnlyWorks.pypp.cpp
+++ b/Fit/PythonAPI/src/SquaredFunctionWhichOnlyWorks.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "SquaredFunctionWhichOnlyWorks.pypp.h"
 
 namespace bp = boost::python;
@@ -78,21 +70,46 @@ struct SquaredFunctionWhichOnlyWorks_wrapper : SquaredFunctionWhichOnlyWorks, bp
 
 void register_SquaredFunctionWhichOnlyWorks_class(){
 
-    bp::class_< SquaredFunctionWhichOnlyWorks_wrapper, bp::bases< ISquaredFunction > >( "SquaredFunctionWhichOnlyWorks", bp::init< >() )    
-        .def( 
-            "calculateSquaredDifference"
-            , (double ( ::SquaredFunctionWhichOnlyWorks::* )( double,double ) const)(&::SquaredFunctionWhichOnlyWorks::calculateSquaredDifference)
-            , (double ( SquaredFunctionWhichOnlyWorks_wrapper::* )( double,double ) const)(&SquaredFunctionWhichOnlyWorks_wrapper::default_calculateSquaredDifference)
-            , ( bp::arg("real_value"), bp::arg("simulated_value") ) )    
-        .def( 
-            "clone"
-            , (::SquaredFunctionWhichOnlyWorks * ( ::SquaredFunctionWhichOnlyWorks::* )(  ) const)(&::SquaredFunctionWhichOnlyWorks::clone)
-            , (::SquaredFunctionWhichOnlyWorks * ( SquaredFunctionWhichOnlyWorks_wrapper::* )(  ) const)(&SquaredFunctionWhichOnlyWorks_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() )    
-        .def( 
-            "calculateSquaredError"
-            , (double ( ::ISquaredFunction::* )( double,double ) const)(&::ISquaredFunction::calculateSquaredError)
-            , (double ( SquaredFunctionWhichOnlyWorks_wrapper::* )( double,double ) const)(&SquaredFunctionWhichOnlyWorks_wrapper::default_calculateSquaredError)
-            , ( bp::arg("real_value"), bp::arg("simulated_value")=0.0 ) );
+    { //::SquaredFunctionWhichOnlyWorks
+        typedef bp::class_< SquaredFunctionWhichOnlyWorks_wrapper, bp::bases< ISquaredFunction > > SquaredFunctionWhichOnlyWorks_exposer_t;
+        SquaredFunctionWhichOnlyWorks_exposer_t SquaredFunctionWhichOnlyWorks_exposer = SquaredFunctionWhichOnlyWorks_exposer_t( "SquaredFunctionWhichOnlyWorks", bp::init< >() );
+        bp::scope SquaredFunctionWhichOnlyWorks_scope( SquaredFunctionWhichOnlyWorks_exposer );
+        { //::SquaredFunctionWhichOnlyWorks::calculateSquaredDifference
+        
+            typedef double ( ::SquaredFunctionWhichOnlyWorks::*calculateSquaredDifference_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionWhichOnlyWorks_wrapper::*default_calculateSquaredDifference_function_type )( double,double ) const;
+            
+            SquaredFunctionWhichOnlyWorks_exposer.def( 
+                "calculateSquaredDifference"
+                , calculateSquaredDifference_function_type(&::SquaredFunctionWhichOnlyWorks::calculateSquaredDifference)
+                , default_calculateSquaredDifference_function_type(&SquaredFunctionWhichOnlyWorks_wrapper::default_calculateSquaredDifference)
+                , ( bp::arg("real_value"), bp::arg("simulated_value") ) );
+        
+        }
+        { //::SquaredFunctionWhichOnlyWorks::clone
+        
+            typedef ::SquaredFunctionWhichOnlyWorks * ( ::SquaredFunctionWhichOnlyWorks::*clone_function_type )(  ) const;
+            typedef ::SquaredFunctionWhichOnlyWorks * ( SquaredFunctionWhichOnlyWorks_wrapper::*default_clone_function_type )(  ) const;
+            
+            SquaredFunctionWhichOnlyWorks_exposer.def( 
+                "clone"
+                , clone_function_type(&::SquaredFunctionWhichOnlyWorks::clone)
+                , default_clone_function_type(&SquaredFunctionWhichOnlyWorks_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+        { //::ISquaredFunction::calculateSquaredError
+        
+            typedef double ( ::ISquaredFunction::*calculateSquaredError_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionWhichOnlyWorks_wrapper::*default_calculateSquaredError_function_type )( double,double ) const;
+            
+            SquaredFunctionWhichOnlyWorks_exposer.def( 
+                "calculateSquaredError"
+                , calculateSquaredError_function_type(&::ISquaredFunction::calculateSquaredError)
+                , default_calculateSquaredError_function_type(&SquaredFunctionWhichOnlyWorks_wrapper::default_calculateSquaredError)
+                , ( bp::arg("real_value"), bp::arg("simulated_value")=0.0 ) );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/SquaredFunctionWithGaussianError.pypp.cpp b/Fit/PythonAPI/src/SquaredFunctionWithGaussianError.pypp.cpp
index 207f37428915fdcd2d1acf4d5ec60fa96a2e31fc..87abc082ddab8fe0715b108485d9918c947bae3c 100644
--- a/Fit/PythonAPI/src/SquaredFunctionWithGaussianError.pypp.cpp
+++ b/Fit/PythonAPI/src/SquaredFunctionWithGaussianError.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "SquaredFunctionWithGaussianError.pypp.h"
 
 namespace bp = boost::python;
@@ -78,21 +70,46 @@ struct SquaredFunctionWithGaussianError_wrapper : SquaredFunctionWithGaussianErr
 
 void register_SquaredFunctionWithGaussianError_class(){
 
-    bp::class_< SquaredFunctionWithGaussianError_wrapper, bp::bases< ISquaredFunction > >( "SquaredFunctionWithGaussianError", bp::init< bp::optional< double > >(( bp::arg("sigma")=1.00000000000000002081668171172168513294309377670288085938e-2 )) )    
-        .def( 
-            "calculateSquaredDifference"
-            , (double ( ::SquaredFunctionWithGaussianError::* )( double,double ) const)(&::SquaredFunctionWithGaussianError::calculateSquaredDifference)
-            , (double ( SquaredFunctionWithGaussianError_wrapper::* )( double,double ) const)(&SquaredFunctionWithGaussianError_wrapper::default_calculateSquaredDifference)
-            , ( bp::arg("real_value"), bp::arg("simulated_value") ) )    
-        .def( 
-            "calculateSquaredError"
-            , (double ( ::SquaredFunctionWithGaussianError::* )( double,double ) const)(&::SquaredFunctionWithGaussianError::calculateSquaredError)
-            , (double ( SquaredFunctionWithGaussianError_wrapper::* )( double,double ) const)(&SquaredFunctionWithGaussianError_wrapper::default_calculateSquaredError)
-            , ( bp::arg("arg0"), bp::arg("arg1") ) )    
-        .def( 
-            "clone"
-            , (::SquaredFunctionWithGaussianError * ( ::SquaredFunctionWithGaussianError::* )(  ) const)(&::SquaredFunctionWithGaussianError::clone)
-            , (::SquaredFunctionWithGaussianError * ( SquaredFunctionWithGaussianError_wrapper::* )(  ) const)(&SquaredFunctionWithGaussianError_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() );
+    { //::SquaredFunctionWithGaussianError
+        typedef bp::class_< SquaredFunctionWithGaussianError_wrapper, bp::bases< ISquaredFunction > > SquaredFunctionWithGaussianError_exposer_t;
+        SquaredFunctionWithGaussianError_exposer_t SquaredFunctionWithGaussianError_exposer = SquaredFunctionWithGaussianError_exposer_t( "SquaredFunctionWithGaussianError", bp::init< bp::optional< double > >(( bp::arg("sigma")=1.00000000000000002081668171172168513294309377670288085938e-2 )) );
+        bp::scope SquaredFunctionWithGaussianError_scope( SquaredFunctionWithGaussianError_exposer );
+        { //::SquaredFunctionWithGaussianError::calculateSquaredDifference
+        
+            typedef double ( ::SquaredFunctionWithGaussianError::*calculateSquaredDifference_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionWithGaussianError_wrapper::*default_calculateSquaredDifference_function_type )( double,double ) const;
+            
+            SquaredFunctionWithGaussianError_exposer.def( 
+                "calculateSquaredDifference"
+                , calculateSquaredDifference_function_type(&::SquaredFunctionWithGaussianError::calculateSquaredDifference)
+                , default_calculateSquaredDifference_function_type(&SquaredFunctionWithGaussianError_wrapper::default_calculateSquaredDifference)
+                , ( bp::arg("real_value"), bp::arg("simulated_value") ) );
+        
+        }
+        { //::SquaredFunctionWithGaussianError::calculateSquaredError
+        
+            typedef double ( ::SquaredFunctionWithGaussianError::*calculateSquaredError_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionWithGaussianError_wrapper::*default_calculateSquaredError_function_type )( double,double ) const;
+            
+            SquaredFunctionWithGaussianError_exposer.def( 
+                "calculateSquaredError"
+                , calculateSquaredError_function_type(&::SquaredFunctionWithGaussianError::calculateSquaredError)
+                , default_calculateSquaredError_function_type(&SquaredFunctionWithGaussianError_wrapper::default_calculateSquaredError)
+                , ( bp::arg("arg0"), bp::arg("arg1") ) );
+        
+        }
+        { //::SquaredFunctionWithGaussianError::clone
+        
+            typedef ::SquaredFunctionWithGaussianError * ( ::SquaredFunctionWithGaussianError::*clone_function_type )(  ) const;
+            typedef ::SquaredFunctionWithGaussianError * ( SquaredFunctionWithGaussianError_wrapper::*default_clone_function_type )(  ) const;
+            
+            SquaredFunctionWithGaussianError_exposer.def( 
+                "clone"
+                , clone_function_type(&::SquaredFunctionWithGaussianError::clone)
+                , default_clone_function_type(&SquaredFunctionWithGaussianError_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/SquaredFunctionWithSystematicError.pypp.cpp b/Fit/PythonAPI/src/SquaredFunctionWithSystematicError.pypp.cpp
index c6644f2cc43f772e767602d87473a0434890b804..1129f605a5790a1f9349c749d78ddce6dd9e3e5d 100644
--- a/Fit/PythonAPI/src/SquaredFunctionWithSystematicError.pypp.cpp
+++ b/Fit/PythonAPI/src/SquaredFunctionWithSystematicError.pypp.cpp
@@ -1,23 +1,15 @@
 // This file has been generated by Py++.
 
+// BornAgain: simulate and fit scattering at grazing incidence 
+//! @brief automatically generated boost::python code for PythonCoreAPI  
+
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
 #include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
 GCC_DIAG_ON(unused-parameter);
 GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "FitSuiteParameters.h"
-#include "MinimizerFactory.h"
-#include "PythonPlusplusFitHelper.h"
-#include "MathFunctions.h"
-#include "ISquaredFunction.h"
-#include "IOutputDataNormalizer.h"
+#include "PythonFitList.h"
 #include "SquaredFunctionWithSystematicError.pypp.h"
 
 namespace bp = boost::python;
@@ -78,21 +70,46 @@ struct SquaredFunctionWithSystematicError_wrapper : SquaredFunctionWithSystemati
 
 void register_SquaredFunctionWithSystematicError_class(){
 
-    bp::class_< SquaredFunctionWithSystematicError_wrapper, bp::bases< ISquaredFunction > >( "SquaredFunctionWithSystematicError", bp::init< bp::optional< double > >(( bp::arg("epsilon")=8.000000000000000166533453693773481063544750213623046875e-2 )) )    
-        .def( 
-            "calculateSquaredDifference"
-            , (double ( ::SquaredFunctionWithSystematicError::* )( double,double ) const)(&::SquaredFunctionWithSystematicError::calculateSquaredDifference)
-            , (double ( SquaredFunctionWithSystematicError_wrapper::* )( double,double ) const)(&SquaredFunctionWithSystematicError_wrapper::default_calculateSquaredDifference)
-            , ( bp::arg("real_value"), bp::arg("simulated_value") ) )    
-        .def( 
-            "calculateSquaredError"
-            , (double ( ::SquaredFunctionWithSystematicError::* )( double,double ) const)(&::SquaredFunctionWithSystematicError::calculateSquaredError)
-            , (double ( SquaredFunctionWithSystematicError_wrapper::* )( double,double ) const)(&SquaredFunctionWithSystematicError_wrapper::default_calculateSquaredError)
-            , ( bp::arg("real_value"), bp::arg("simulated_value")=0.0 ) )    
-        .def( 
-            "clone"
-            , (::SquaredFunctionWithSystematicError * ( ::SquaredFunctionWithSystematicError::* )(  ) const)(&::SquaredFunctionWithSystematicError::clone)
-            , (::SquaredFunctionWithSystematicError * ( SquaredFunctionWithSystematicError_wrapper::* )(  ) const)(&SquaredFunctionWithSystematicError_wrapper::default_clone)
-            , bp::return_value_policy< bp::manage_new_object >() );
+    { //::SquaredFunctionWithSystematicError
+        typedef bp::class_< SquaredFunctionWithSystematicError_wrapper, bp::bases< ISquaredFunction > > SquaredFunctionWithSystematicError_exposer_t;
+        SquaredFunctionWithSystematicError_exposer_t SquaredFunctionWithSystematicError_exposer = SquaredFunctionWithSystematicError_exposer_t( "SquaredFunctionWithSystematicError", bp::init< bp::optional< double > >(( bp::arg("epsilon")=8.000000000000000166533453693773481063544750213623046875e-2 )) );
+        bp::scope SquaredFunctionWithSystematicError_scope( SquaredFunctionWithSystematicError_exposer );
+        { //::SquaredFunctionWithSystematicError::calculateSquaredDifference
+        
+            typedef double ( ::SquaredFunctionWithSystematicError::*calculateSquaredDifference_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionWithSystematicError_wrapper::*default_calculateSquaredDifference_function_type )( double,double ) const;
+            
+            SquaredFunctionWithSystematicError_exposer.def( 
+                "calculateSquaredDifference"
+                , calculateSquaredDifference_function_type(&::SquaredFunctionWithSystematicError::calculateSquaredDifference)
+                , default_calculateSquaredDifference_function_type(&SquaredFunctionWithSystematicError_wrapper::default_calculateSquaredDifference)
+                , ( bp::arg("real_value"), bp::arg("simulated_value") ) );
+        
+        }
+        { //::SquaredFunctionWithSystematicError::calculateSquaredError
+        
+            typedef double ( ::SquaredFunctionWithSystematicError::*calculateSquaredError_function_type )( double,double ) const;
+            typedef double ( SquaredFunctionWithSystematicError_wrapper::*default_calculateSquaredError_function_type )( double,double ) const;
+            
+            SquaredFunctionWithSystematicError_exposer.def( 
+                "calculateSquaredError"
+                , calculateSquaredError_function_type(&::SquaredFunctionWithSystematicError::calculateSquaredError)
+                , default_calculateSquaredError_function_type(&SquaredFunctionWithSystematicError_wrapper::default_calculateSquaredError)
+                , ( bp::arg("real_value"), bp::arg("simulated_value")=0.0 ) );
+        
+        }
+        { //::SquaredFunctionWithSystematicError::clone
+        
+            typedef ::SquaredFunctionWithSystematicError * ( ::SquaredFunctionWithSystematicError::*clone_function_type )(  ) const;
+            typedef ::SquaredFunctionWithSystematicError * ( SquaredFunctionWithSystematicError_wrapper::*default_clone_function_type )(  ) const;
+            
+            SquaredFunctionWithSystematicError_exposer.def( 
+                "clone"
+                , clone_function_type(&::SquaredFunctionWithSystematicError::clone)
+                , default_clone_function_type(&SquaredFunctionWithSystematicError_wrapper::default_clone)
+                , bp::return_value_policy< bp::manage_new_object >() );
+        
+        }
+    }
 
 }
diff --git a/Fit/PythonAPI/src/ndimdata_t.pypp.cpp b/Fit/PythonAPI/src/ndimdata_t.pypp.cpp
deleted file mode 100644
index 59106742fd9aa1a10dd86f6eeca8ba543f6759bc..0000000000000000000000000000000000000000
--- a/Fit/PythonAPI/src/ndimdata_t.pypp.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// This file has been generated by Py++.
-
-#include "Macros.h"
-GCC_DIAG_OFF(unused-parameter);
-GCC_DIAG_OFF(missing-field-initializers);
-#include "boost/python.hpp"
-#include "boost/python/suite/indexing/vector_indexing_suite.hpp"
-GCC_DIAG_ON(unused-parameter);
-GCC_DIAG_ON(missing-field-initializers);
-#include "AttLimits.h"
-#include "IChiSquaredModule.h"
-#include "IMinimizer.h"
-#include "ChiSquaredModule.h"
-#include "FitSuite.h"
-#include "MinimizerFactory.h"
-#include "OutputData.h"
-#include "PythonPlusplusFitHelper.h"
-#include "ndimdata_t.pypp.h"
-
-namespace bp = boost::python;
-
-void register_ndimdata_t_class(){
-
-    bp::class_< OutputData< double >, boost::noncopyable >( "ndimdata_t", bp::init< >() )    
-        .def( bp::self *= bp::self )    
-        .def( bp::self += bp::self )    
-        .def( bp::self -= bp::self )    
-        .def( bp::self /= bp::self )    
-        .def( 
-            "__getitem__"
-            , (double&  ( ::OutputData<double>::* )( ::size_t ) )(& ::OutputData< double >::operator[] )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::copy_non_const_reference >() )    
-        .def( 
-            "__getitem__"
-            , (double const&  ( ::OutputData<double>::* )( ::size_t ) const)(& ::OutputData< double >::operator[] )
-            , ( bp::arg("index") )
-            , bp::return_value_policy< bp::copy_const_reference >() )    
-        .def( 
-            "totalSum"
-            , (double ( ::OutputData<double>::* )(  ) const)(& ::OutputData< double >::totalSum ) );
-
-}
diff --git a/Fit/python_module.pri b/Fit/python_module.pri
index 05383d53f7caa58ece10f87e6a0c35fa40408ad8..c12606a3c3329b794180f574274794b23b94bf55 100644
--- a/Fit/python_module.pri
+++ b/Fit/python_module.pri
@@ -1,5 +1,6 @@
 HEADERS +=  \ 
-    PythonAPI/inc/PythonPlusplusFitHelper.h \ 
+    PythonAPI/inc/PythonFitExposer.h \ 
+    PythonAPI/inc/PythonFitList.h \ 
     PythonAPI/inc/AttLimits.pypp.h \
     PythonAPI/inc/ChiSquaredModule.pypp.h \
     PythonAPI/inc/FitSuite.pypp.h \
@@ -11,8 +12,6 @@ HEADERS +=  \
     PythonAPI/inc/MinimizerFactory.pypp.h \
     PythonAPI/inc/OutputDataNormalizer.pypp.h \
     PythonAPI/inc/OutputDataSimpleNormalizer.pypp.h \
-    PythonAPI/inc/PythonInterface_enumerations.pypp.h \
-    PythonAPI/inc/PythonInterface_free_functions.pypp.h \
     PythonAPI/inc/SquaredFunctionDefault.pypp.h \
     PythonAPI/inc/SquaredFunctionWhichOnlyWorks.pypp.h \
     PythonAPI/inc/SquaredFunctionWithGaussianError.pypp.h \
@@ -31,13 +30,10 @@ SOURCES +=  \
     PythonAPI/src/MinimizerFactory.pypp.cpp \
     PythonAPI/src/OutputDataNormalizer.pypp.cpp \
     PythonAPI/src/OutputDataSimpleNormalizer.pypp.cpp \
-    PythonAPI/src/PythonInterface_enumerations.pypp.cpp \
-    PythonAPI/src/PythonInterface_free_functions.pypp.cpp \
     PythonAPI/src/SquaredFunctionDefault.pypp.cpp \
     PythonAPI/src/SquaredFunctionWhichOnlyWorks.pypp.cpp \
     PythonAPI/src/SquaredFunctionWithGaussianError.pypp.cpp \
     PythonAPI/src/SquaredFunctionWithSystematicError.pypp.cpp 
 
-INCLUDEPATH += $$PWD/PythonAPI/inc 
-DEPENDPATH  += $$PWD/PythonAPI/inc 
-
+INCLUDEPATH += ./PythonAPI/inc 
+DEPENDPATH  += ./PythonAPI/inc 
diff --git a/Macros/BoostPythonGenerator/InstallPyCore.py b/Macros/BoostPythonGenerator/InstallPyCore.py
deleted file mode 100644
index 50687d0a1614bd2832819afb28beea66e2298e17..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/InstallPyCore.py
+++ /dev/null
@@ -1,196 +0,0 @@
-# see codegenerator.py
-
-import os
-import sys
-import glob
-
-
-#-------------------------------------------------------------
-# generating python_module.pri for qt-creator
-#-------------------------------------------------------------
-def GenerateProjectFile(OutputTempDir, files_inc, files_src):
-  python_pri_file = OutputTempDir+"/python_module.pri"
-  fout = open(python_pri_file, 'w')
-  fout.write("HEADERS +=  \\ \n")
-  # existing files (written by human being)
-  fout.write("    PythonAPI/inc/PythonListConverter.h \\ \n")
-  fout.write("    PythonAPI/inc/PythonModule.h \\ \n")
-  fout.write("    PythonAPI/inc/PythonOutputData.h \\ \n")
-  fout.write("    PythonAPI/inc/PythonPlusplusHelper.h \\ \n")
-  # automatically generated files
-  for i_file in range(0,len(files_inc)):
-    delim = " \\"
-    if i_file == len(files_inc)-1:
-      delim = " "
-    ff = files_inc[i_file]
-    ff = ff.replace(OutputTempDir,"PythonAPI/inc")
-    fout.write("    "+ff+delim+"\n")
-  fout.write("\n")
-  fout.write("SOURCES +=  \\ \n")
-  # existing files (written by human being)
-  fout.write("    PythonAPI/src/PythonModule.cpp \\ \n")
-  fout.write("    PythonAPI/src/PythonListConverter.cpp \\ \n")
-  fout.write("    PythonAPI/src/PythonOutputData.cpp \\ \n")
-  fout.write("    PythonAPI/src/PythonPlusplusHelper.cpp \\ \n")
-  # automatically generated files
-  for i_file in range(0,len(files_src)):
-    delim = " \\"
-    if i_file == len(files_src)-1:
-      delim = " "
-    ff = files_src[i_file]
-    ff = ff.replace(OutputTempDir,"PythonAPI/src")
-    fout.write("    "+ff+delim+"\n")
-  fout.write("\n")
-
-  fout.write("INCLUDEPATH += ./PythonAPI/inc \n")
-  fout.write("DEPENDPATH  += ./PythonAPI/inc \n")
-  fout.close()
-  return python_pri_file
-
-
-#-------------------------------------------------------------
-# generating python module main cpp file
-#-------------------------------------------------------------
-def GenerateModuleFile(OutputTempDir, files_inc, files_src):
-  # generating own PythonModule.cpp
-  python_module_file = OutputTempDir+"/PythonModule.cpp"
-  fout = open(python_module_file, 'w')
-  fout.write("#include \"Python.h\"\n")
-  fout.write("#define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY \n")
-  fout.write("#include \"numpy/arrayobject.h\"\n")
-  fout.write("// the order of 3 guys above is important\n")
-  fout.write("\n")
-  #fout.write("#include \"PythonModule.h\"\n")
-  for ff in files_inc:
-      ff = ff.replace(OutputTempDir+"/","")
-      fout.write("#include \""+ff+"\" \n")
-  fout.write("\n")
-  fout.write("#include \"PythonListConverter.h\"\n")
-  fout.write("\n")
-  fout.write("BOOST_PYTHON_MODULE(libBornAgainCore){\n")
-  fout.write("\n")
-  # adding register lines
-  #for ff in files_inc:
-    #fout2 = open(ff,'r')
-    #for line in fout2:
-      #if "register_" in line:
-        #line = line.replace("void ","    ")
-        #fout.write(line)
-
-  # copying register lines from automaticaly generated module file to our manually generated
-  old_python_module_file = OutputTempDir+"/PythonInterface.main.cpp"
-  fin = open(old_python_module_file,'r')
-  for line in fin:
-      if "register_" in line:
-          fout.write(line)
-  fin.close()
-
-  fout.write("\n")
-  fout.write("    register_python2cpp_converters();\n")
-  fout.write("\n")
-  fout.write("    import_array();\n")
-  fout.write("    /* IMPORTANT\n")
-  fout.write("    this is initialisation function from C-API of python-numpy package. It has to be called once in the\n")
-  fout.write("    initialisation section of the module (i.e. here), when module is going to use any of python numpy C-API.\n")
-  fout.write("    Additional rule: when initialisation of the module, and functions that use python-numpy C-API are located in\n")
-  fout.write("    different files (different compilation units) - and this is exactly our case - additional defines has\n")
-  fout.write("    to be inserted before #include \"numpy/arrayobject.h\". See explanations\n")
-  fout.write("    http://docs.scipy.org/doc/numpy/reference/c-api.array.html#import_array\n")
-  fout.write("    */\n")
-  fout.write("}\n")
-
-  fout.close()
-  return python_module_file
-
-
-#-------------------------------------------------------------
-# patching generated files to get rid warnings from boost
-#-------------------------------------------------------------
-def PatchFiles(files):
-  for ff in files:
-    print ff
-    fin = file(ff,"r")
-    fout = file("tmp.tmp","w")
-    for line in fin:
-      if "boost/python.hpp" in line:
-        fout.write("#include \"Macros.h\"\n")
-        fout.write("GCC_DIAG_OFF(unused-parameter);\n")
-        fout.write("GCC_DIAG_OFF(missing-field-initializers);\n")
-        fout.write("#include \"boost/python.hpp\"\n")
-        fout.write("#include \"boost/python/suite/indexing/vector_indexing_suite.hpp\"\n")
-        fout.write("GCC_DIAG_ON(unused-parameter);\n")
-        fout.write("GCC_DIAG_ON(missing-field-initializers);\n")
-      elif "vector_indexing_suite.hpp" in line:
-        continue
-      else:
-        fout.write(line)
-    fout.close()
-    fin.close()
-    os.system("mv tmp.tmp "+ff)
-
-
-#-------------------------------------------------------------
-# copying files to the project directory
-#-------------------------------------------------------------
-def CopyFiles(files, InstallDir):
-  copycommand='cp '
-  # copying files
-  overwriteAnswer=''
-  for f in files:
-    fileName = os.path.basename(f)
-
-    # different output directory for source and headers
-    outputName=''
-    if '.cpp' in fileName:
-      outputName=InstallDir+"/src/"+fileName
-    elif '.h' in fileName:
-      outputName=InstallDir+"/inc/"+fileName
-    elif '.pri' in fileName:
-      outputName=InstallDir+"/../"+fileName
-    #print "XXX",f, outputName
-
-    # check file existance
-    if os.path.exists(outputName) and overwriteAnswer != 'a':
-      prompt="File '"+outputName+"' exists, Overwrite? [y/a/n] "
-      overwriteAnswer=raw_input(prompt)
-
-    if (overwriteAnswer == 'y' or overwriteAnswer=='a') or not os.path.exists(outputName):
-      command = copycommand + f + " " + outputName
-      print command
-      os.system(command)
-
-    else:
-      continue
-
-
-#-------------------------------------------------------------
-# InstallCode()
-#-------------------------------------------------------------
-def InstallCode(OutputTempDir, InstallDir):
-  if not os.path.exists(OutputTempDir): exit("No output directory '" + OutputTempDir+"'")
-  if not os.path.exists(InstallDir): exit("No install directory '" + InstallDir+"'")
-  
-  files_inc =glob.glob(OutputTempDir+"/*.pypp.h");
-  files_inc+= glob.glob(OutputTempDir+"/__call_policies.pypp.hpp");
-  files_inc+= glob.glob(OutputTempDir+"/__convenience.pypp.hpp");
-  files_src = glob.glob(OutputTempDir+"/*.pypp.cpp");
-  files = files_inc+files_src
-
-  python_pri_file = GenerateProjectFile(OutputTempDir, files_inc, files_src)
-  files.append(python_pri_file)
-
-  python_module_file = GenerateModuleFile(OutputTempDir, files_inc, files_src)
-  files.append(python_module_file)
-
-  PatchFiles(files)
-
-  CopyFiles(files, InstallDir)
-
-
-#-------------------------------------------------------------
-# main()
-#-------------------------------------------------------------
-if __name__ == '__main__':
-  InstallCode("output/PyCore","../../Core/PythonAPI")
-
-
diff --git a/Macros/BoostPythonGenerator/InstallPyFit.py b/Macros/BoostPythonGenerator/InstallPyFit.py
deleted file mode 100644
index a60e230aedf486c80b85b7b3870368137772ff3c..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/InstallPyFit.py
+++ /dev/null
@@ -1,186 +0,0 @@
-# see codegenerator.py
-
-import os
-import sys
-import glob
-
-
-#-------------------------------------------------------------
-# generating python_module.pri for qt-creator
-#-------------------------------------------------------------
-def GenerateProjectFile(OutputTempDir, files_inc, files_src):
-  python_pri_file = OutputTempDir+"/python_module.pri"
-  fout = open(python_pri_file, 'w')
-  fout.write("HEADERS +=  \\ \n")
-  # existing files (written by human being)
-  fout.write("    PythonAPI/inc/PythonPlusplusFitHelper.h \\ \n")
-  # automatically generated files
-  for i_file in range(0,len(files_inc)):
-    delim = " \\"
-    if i_file == len(files_inc)-1:
-      delim = " "
-    ff = files_inc[i_file]
-    ff = ff.replace(OutputTempDir,"PythonAPI/inc")
-    fout.write("    "+ff+delim+"\n")
-  fout.write("\n")
-  fout.write("SOURCES +=  \\ \n")
-  # existing files (written by human being)
-  fout.write("    PythonAPI/src/PythonModule.cpp \\ \n")
-  # automatically generated files
-  for i_file in range(0,len(files_src)):
-    delim = " \\"
-    if i_file == len(files_src)-1:
-      delim = " "
-    ff = files_src[i_file]
-    ff = ff.replace(OutputTempDir,"PythonAPI/src")
-    fout.write("    "+ff+delim+"\n")
-  fout.write("\n")
-
-  fout.write("INCLUDEPATH += $$PWD/PythonAPI/inc \n")
-  fout.write("DEPENDPATH  += $$PWD/PythonAPI/inc \n")
-  fout.write("\n")
-  fout.close()
-  return python_pri_file
-
-
-#-------------------------------------------------------------
-# generating python module main cpp file
-#-------------------------------------------------------------
-def GenerateModuleFile(OutputTempDir, files_inc, files_src, PatternsToExclude):
-  # generating own PythonModule.cpp
-  python_module_file = OutputTempDir+"/PythonModule.cpp"
-  fout = open(python_module_file, 'w')
-  fout.write("#include \"Python.h\"\n")
-  fout.write("#include \"boost/python.hpp\"\n")
-  fout.write("\n")
-  for ff in files_inc:
-      ff = ff.replace(OutputTempDir+"/","")
-      fout.write("#include \""+ff+"\" \n")
-  fout.write("\n")
-  fout.write("BOOST_PYTHON_MODULE(libBornAgainFit){\n")
-  fout.write("\n")
-
-  # copying register lines from automaticaly generated module file to our manually generated
-  old_python_module_file = OutputTempDir+"/PythonInterface.main.cpp"
-  fin = open(old_python_module_file,'r')
-  for line in fin:
-      skip_this = False
-      for pattern in PatternsToExclude:
-        if pattern in line:
-          skip_this = True
-          break
-      if skip_this: continue
-      if "register_" in line:
-          fout.write(line)
-  fin.close()
-
-  fout.write("}\n")
-
-  fout.close()
-  return python_module_file
-
-
-#-------------------------------------------------------------
-# patching generated files to get rid warnings from boost
-#-------------------------------------------------------------
-def PatchFiles(files):
-  for ff in files:
-    print ff
-    fin = file(ff,"r")
-    fout = file("tmp.tmp","w")
-    for line in fin:
-      if "boost/python.hpp" in line:
-        fout.write("#include \"Macros.h\"\n")
-        fout.write("GCC_DIAG_OFF(unused-parameter);\n")
-        fout.write("GCC_DIAG_OFF(missing-field-initializers);\n")
-        fout.write("#include \"boost/python.hpp\"\n")
-        fout.write("#include \"boost/python/suite/indexing/vector_indexing_suite.hpp\"\n")
-        fout.write("GCC_DIAG_ON(unused-parameter);\n")
-        fout.write("GCC_DIAG_ON(missing-field-initializers);\n")
-      elif "vector_indexing_suite.hpp" in line:
-        continue
-      else:
-        fout.write(line)
-    fout.close()
-    fin.close()
-    os.system("mv tmp.tmp "+ff)
-
-
-#-------------------------------------------------------------
-# copying files to the project directory
-#-------------------------------------------------------------
-def CopyFiles(files, InstallDir):
-  copycommand='cp '
-  # copying files
-  overwriteAnswer=''
-  for f in files:
-    fileName = os.path.basename(f)
-
-    # different output directory for source and headers
-    outputName=''
-    if '.cpp' in fileName:
-      outputName=InstallDir+"/src/"+fileName
-    elif '.h' in fileName:
-      outputName=InstallDir+"/inc/"+fileName
-    elif '.pri' in fileName:
-      outputName=InstallDir+"/../"+fileName
-    #print "XXX",f, outputName
-
-    # check file existance
-    if os.path.exists(outputName) and overwriteAnswer != 'a':
-      prompt="File '"+outputName+"' exists, Overwrite? [y/a/n] "
-      overwriteAnswer=raw_input(prompt)
-
-    if (overwriteAnswer == 'y' or overwriteAnswer=='a') or not os.path.exists(outputName):
-      command = copycommand + f + " " + outputName
-      print command
-      os.system(command)
-
-    else:
-      continue
-
-
-#-------------------------------------------------------------
-# InstallCode()
-#-------------------------------------------------------------
-def InstallCode(OutputTempDir, InstallDir):
-  if not os.path.exists(OutputTempDir): exit("No output directory '" + OutputTempDir+"'")
-  if not os.path.exists(InstallDir): exit("No install directory '" + InstallDir+"'")
-
-  # special list of files which has to be excluded, since they are exposed already in libBornAgainCore
-  #FilesToExclude=["vdouble1d_t"]
-  #for fname in FilesToExclude:
-    #files_inc = filter(lambda x: not fname in x, files_inc)
-    #files_src = filter(lambda x: not fname in x, files_src)
-  PatternsToExclude = ["vdouble1d_t", "vcomplex1d_t"]
-  for pattern in PatternsToExclude:
-    files2remove = glob.glob(OutputTempDir+"/"+pattern+".*")
-    for ff in files2remove:
-        print "...removing unnecessary ",ff
-        os.remove(ff)
-
-  files_inc =glob.glob(OutputTempDir+"/*.pypp.h");
-  files_inc+= glob.glob(OutputTempDir+"/__call_policies.pypp.hpp");
-  files_src = glob.glob(OutputTempDir+"/*.pypp.cpp");
-
-  files = files_inc+files_src
-
-  python_pri_file = GenerateProjectFile(OutputTempDir, files_inc, files_src)
-  files.append(python_pri_file)
-
-  python_module_file = GenerateModuleFile(OutputTempDir, files_inc, files_src, PatternsToExclude)
-  files.append(python_module_file)
-
-  PatchFiles(files)
-
-  CopyFiles(files, InstallDir)
-
-
-#-------------------------------------------------------------
-# main()
-#-------------------------------------------------------------
-if __name__ == '__main__':
-  InstallCode("output/PyFit","../../Fit/PythonAPI")
-
-
-
diff --git a/Macros/BoostPythonGenerator/MakePyCore.py b/Macros/BoostPythonGenerator/MakePyCore.py
deleted file mode 100644
index 039eb26cb8cc080f3f88d76270ecd7080c9a5978..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/MakePyCore.py
+++ /dev/null
@@ -1,599 +0,0 @@
-# generate python API wrappers for Core library
-# used by codegenerator.py
-
-import os
-import sys
-import glob
-import subprocess
-from pyplusplus import module_builder
-from pyplusplus.module_builder import call_policies
-from pyplusplus import messages
-from pyplusplus import file_writers
-from pygccxml.declarations.matchers import access_type_matcher_t
-from pygccxml.declarations.matchers import virtuality_type_matcher_t
-from pygccxml import declarations
-from pyplusplus import function_transformers as FT
-
-from pyplusplus.function_transformers import transformers
-
-ModuleName = 'PythonInterface'
-
-
-# --------------------------------------------------------------------------
-# This is patched version of pyplusplus.function_transformers classes to
-# pass address of ctype(double) into C++. The pointer is passed now in the 
-# form of long unsigned, which correspond to 64 bit (before it was unsigned int)
-# --------------------------------------------------------------------------
-class from_address_custom_t(transformers.type_modifier_t):
-    def __init__(self, function, arg_ref):
-        modifier = lambda type_: declarations.FUNDAMENTAL_TYPES[ 'long unsigned int' ]
-        print modifier
-        transformers.type_modifier_t.__init__( self, function, arg_ref, modifier )
-        if not transformers.is_ptr_or_array( self.arg.type ):
-            raise ValueError( '%s\nin order to use "from_address_t" transformation, argument %s type must be a pointer or a array (got %s).' ) \
-                  % ( function, self.arg_ref.name, arg.type)
-    def __str__(self):
-        return "from_address(%s)"%(self.arg.name)
-
-def from_address_custom( *args, **keywd ):
-    def creator( function ):
-        return from_address_custom_t( function, *args, **keywd )
-    return creator
-
-
-# list of files to analyse and corresponding functions with rules for analysis
-myFiles=[
-  'BasicVector3D.h',
-  'Bin.h',
-  'Crystal.h',
-  'DiffuseParticleInfo.h',
-  'FTDistributions.h',
-  'FormFactorBox.h',
-  'FormFactorCrystal.h',
-  'FormFactorCylinder.h',
-  'FormFactorDecoratorDebyeWaller.h',
-  'FormFactorFullSphere.h',
-  'FormFactorGauss.h',
-  'FormFactorLorentz.h',
-  'FormFactorParallelepiped.h',
-  'FormFactorPrism3.h',
-  'FormFactorPyramid.h',
-  'FormFactorSphereGaussianRadius.h',
-  'HomogeneousMaterial.h',
-  'ICloneable.h',
-  'IClusteredParticles.h',
-  'ICompositeSample.h',
-  'IDecoration.h',
-  'IFormFactor.h',
-  'IFormFactorBorn.h',
-  'IFormFactorDecorator.h',
-  'IInterferenceFunction.h',
-  'IMaterial.h',
-  'IParameterized.h',
-  'ISample.h',
-  'ISampleBuilder.h',
-  'ISelectionRule.h',
-  'ISingleton.h',
-  'Instrument.h',
-  'InterferenceFunction1DParaCrystal.h',
-  'InterferenceFunction2DLattice.h',
-  'InterferenceFunction2DParaCrystal.h',
-  'InterferenceFunctionNone.h',
-  'IResolutionFunction2D.h',
-  'Lattice.h',
-  'Lattice2DIFParameters.h',
-  'LatticeBasis.h',
-  'Layer.h',
-  'LayerDecorator.h',
-  'LayerRoughness.h',
-  'Lattice2DIFParameters.h',
-  'MaterialManager.h',
-  'MesoCrystal.h',
-  'MultiLayer.h',
-  'OpticalFresnel.h',
-  'ParameterPool.h',
-  'Particle.h',
-  'ParticleBuilder.h',
-  'ParticleCoreShell.h',
-  'ParticleDecoration.h',
-  'OutputData.h',
-  'OutputDataIOFactory.h',
-  'ParticleInfo.h',
-  'PositionParticleInfo.h',
-  'PythonOutputData.h',
-  'PythonPlusplusHelper.h',
-  'RealParameterWrapper.h',
-  'Simulation.h',
-  'SimulationParameters.h',
-  'IStochasticParameter.h',
-  'ResolutionFunction2DSimple.h',
-  'StochasticGaussian.h',
-  'StochasticSampledParameter.h',
-  'StochasticDoubleGate.h',
-  'Transform3D.h',
-  'Types.h',
-  'Units.h',
-]
-
-# list of include directories
-myIncludes = ['../../Core/Samples/inc','../../Core/FormFactors/inc','../../Core/Algorithms/inc','../../Core/Tools/inc','../../Core/PythonAPI/inc','../../Core/Geometry/inc']
-
-
-# -------------------------------------------------------------------
-# AdditionalRules
-# -------------------------------------------------------------------
-def AdditionalRules(mb):
-
-  # --- BasicVector3D.h -----------------------------------------------
-  if "BasicVector3D.h" in myFiles:
-    ##cl = mb.class_("BasicVector3D<std::complex<double> >")
-    #mb.classes(lambda decl: 'Geometry::BasicVector3D<std::complex<double> >' in decl.decl_string ).exclude()
-    #mb.free_operators( lambda decl: 'Geometry::BasicVector3D<std::complex<double> >' in decl.decl_string ).exclude()
-    #mb.free_functions( lambda decl: 'Geometry::BasicVector3D<std::complex<double> >' in decl.decl_string ).exclude()
-    #mb.classes(lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude()
-    #mb.free_operators( lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude()
-    #mb.free_functions( lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude()
-    classes = mb.classes()
-    # here we have to exclude all templated methods which are not defined complex<double>, otherwise py++ will try to generate wrappers
-    MethodsWhichAreNotSuitable=[
-        "phi", "theta", "cosTheta", "getPhi", "getTheta", "setPhi", "setTheta", "setR",
-        "setMag", "perp", "perp2", "setPerp", "angle", "unit", "orthogonal",
-        "rotate","rotateX","rotateY","rotateZ"
-    ]
-    for cl in classes:
-      if "BasicVector3D<std::complex<double> >" in cl.decl_string or "BasicVector3D<double>" in cl.decl_string or "BasicVector3D<int>" in cl.decl_string:
-        for fun in cl.member_functions(allow_empty=True):
-          MethodIsBad = False
-          for x in MethodsWhichAreNotSuitable:
-            if fun.name == x:
-              MethodIsBad = True
-          if MethodIsBad:
-            fun.exclude()
-
-
-    MethodsWhichAreNotUsed=["dot","mag","mag2","cross","magxy","magxy2","transform"]
-    for cl in classes:
-      if "BasicVector3D<int>" in cl.decl_string:
-        for fun in cl.member_functions(allow_empty=True):
-          MethodIsBad = False
-          for x in MethodsWhichAreNotUsed:
-            if fun.name == x:
-              MethodIsBad = True
-          if MethodIsBad:
-            fun.exclude()
-
-    # 28.04.2013 To get back kvector algebra
-    cl = mb.class_("BasicVector3D<double>")
-    cl.add_code("def( bp::self - bp::self )")
-    cl.add_code("def( bp::self + bp::self )")
-    cl.add_code("def( bp::other< double >() * bp::self )")
-    cl.add_code("def( bp::self * bp::other< double >() )")
-    cl.add_code("def( +bp::self )")
-    cl.add_code("def( -bp::self )")
-    cl.add_code("def( bp::self / bp::other< double >() )")
-    cl.add_code("def( bp::self_ns::str( bp::self ) )")
-    #cl.add_code("def( bp::self * bp::self )")
-    #cl.add_code("def( bp::self != bp::self )")
-    #cl.add_code("def( bp::self == bp::self )  ")  
-
-
-  #if "FTDistributions.h" in myFiles:
-      #cl = mb.class_("IFTDistribution2D")
-      #cl = mb.class_("FTDistribution2DCauchy")
-      #cl.member_function("transformToStarBasis").exclude()
-
-  # --- FormFactorCylinder.h ------------------------------------------
-  if "FormFactorCrystal.h" in myFiles:
-    cl = mb.class_( "FormFactorCrystal" )
-    cl.member_function("evaluate").exclude()
-    cl.member_function("evaluate_for_q").exclude()
-
-
-  # --- FormFactorCylinder.h ------------------------------------------
-  #if "FormFactorCylinder.h" in myFiles:
-    #cl = mb.class_( "FormFactorCylinder" )
-
-  # --- FormFactorDecoratorDebyeWaller.h ------------------------------
-  #if "FormFactorDecoratorDebyeWaller" in myFiles:
-    #cl = mb.class_( "FormFactorDecoratorDebyeWaller" )
-
-  # --- FormFactorFullSphere.h ----------------------------------------
-  #if "FormFactorFullSphere.h" in myFiles:
-    #cl = mb.class_( "FormFactorFullSphere" )
-
-  # --- FormFactorPyramid.h -------------------------------------------
-  #if "FormFactorPyramid.h" in myFiles:
-    #cl = mb.class_( "FormFactorPyramid" )
-
-  # --- FormFactorSphereGaussianRadius.h ------------------------------
-  if "FormFactorSphereGaussianRadius.h" in myFiles:
-    cl = mb.class_( "FormFactorSphereGaussianRadius" )
-    cl.member_functions("createDistributedFormFactors").exclude()
-
-
-  # --- HomogeneousMaterial.h -----------------------------------------
-  #if "HomogeneousMaterial.h" in myFiles:
-    #cl = mb.class_( "HomogeneousMaterial" )
-
-  # --- IClusteredParticles.h -----------------------------------------
-  #if "IClusteredParticles.h" in myFiles:
-    #cl.constructors( lambda decl: bool( decl.arguments ) ).exclude() # exclude non-default constructors
-    #cl.member_function("createTotalFormFactor").call_policies = call_policies.return_value_policy(call_policies.manage_new_object )
-
-  # --- ICompositeSample.h --------------------------------------------
-  if "ICompositeSample.h" in myFiles:
-    cl = mb.class_( "ICompositeSample" )
-    #cl.constructors( lambda decl: bool( decl.arguments ) ).exclude() # exclude non-default constructors
-    #cl.member_functions().exclude()
-    cl.member_function( "createIterator" ).exclude()
-
-  # --- IFormFactor.h -------------------------------------------------
-  #if "IFormFactor.h" in myFiles:
-    #cl = mb.class_( "IFormFactor" )
-
-  # --- IFormFactorBorn.h ---------------------------------------------
-  #if "IFormFactorBorn.h" in myFiles:
-    #cl = mb.class_( "IFormFactorBorn" )
-
-  # --- IFormFactorBornSeparable.h ------------------------------------
-  #if "IFormFactorBornSeparable.h" in myFiles:
-    #cl = mb.class_( "IFormFactorBornSeparable" )
-
-  # --- IFormFactorDecorator.h ----------------------------------------
-  #if "IFormFactorDecorator.h" in myFiles:
-    #cl = mb.class_( "IFormFactorDecorator" )
-
-  # --- IInterferenceFunction.h ---------------------------------------
-  #if "IInterferenceFunction.h" in myFiles:
-    #cl = mb.class_( "IInterferenceFunction" )
-
-  # --- InterferenceFunctionNone.h ------------------------------------
-  #if "InterferenceFunctionNone.h" in myFiles:
-    #cl = mb.class_( "InterferenceFunctionNone" )
-
-  # --- InterferenceFunction1DParaCrystal.h ---------------------------
-  #if "InterferenceFunction1DParaCrystal.h" in myFiles:
-    #cl = mb.class_( "InterferenceFunction1DParaCrystal" )
-
-  # --- IMaterial.h ---------------------------------------------------
-  #if "IMaterial.h" in myFiles:
-    #cl = mb.class_( "IMaterial" )
-
-  # --- IParameterized.h ----------------------------------------------
-  if "IParameterized.h" in myFiles:
-    cl = mb.class_( "IParameterized" )
-    cl.member_function("registerParameter").include()
-    cl.member_function("registerParameter").add_transformation( from_address_custom( 1 ) )
-
-    #cl = mb.class_( "IParameterized" )
-    #cl.member_functions().exclude()
-    #cl.member_function( "createParameterTree" ).include()
-    #cl.member_function( "addParametersToExternalPool" ).include()
-
-  # --- ISingleton.h --------------------------------------------------
-  #if "ISingleton.h" in myFiles:
-    #cl = mb.class_( "ISingleton" )
-
-  # --- ISample.h -----------------------------------------------------
-  if "ISample.h" in myFiles:
-    cl = mb.class_( "ISample" )
-    cl.member_functions().exclude()
-    cl.member_function( "clone" ).include()
-    cl.member_function("print_structure").include()
-
-  # --- ISampleBuilder.h ----------------------------------------------
-  if "ISampleBuilder.h" in myFiles:
-    cl = mb.class_( "ISampleBuilder" )
-    cl.member_functions().exclude()
-    cl.member_function( "buildSample" ).include()
-    cl.member_function( "buildSample" ).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
-
-  # --- Lattice.h -----------------------------------------------------
-  if "Lattice.h" in myFiles:
-    cl = mb.class_( "Lattice" )
-    cl.member_functions().exclude()
-    cl.member_function("getBasisVectorA").include()
-    cl.member_function("getBasisVectorB").include()
-    cl.member_function("getBasisVectorC").include()
-    cl.member_function("createTrigonalLattice").include()
-    cl.member_function("createTrigonalLattice").call_policies = call_policies.return_value_policy(call_policies.return_by_value )
-    cl.member_function("setSelectionRule").include()
-
-  # --- LatticeBasis.h ------------------------------------------------
-  if "LatticeBasis.h" in myFiles:
-    cl = mb.class_( "LatticeBasis" )
-    cl.constructors( lambda decl: bool( decl.arguments ) ).exclude() # exclude non-default constructors
-    cl.member_functions().exclude()
-    cl.member_function("addParticle").include()
-
-  # --- Layer.h -------------------------------------------------------
-  if "Layer.h" in myFiles:
-    cl = mb.class_( "Layer" )
-    cl.member_function( "createDWBASimulation" ).exclude()
-    # we need to include back setMaterial methods since they have pointers in argument list (and our default policy is to exclude them)
-    for fun in cl.member_functions():
-      if fun.name == "setMaterial":
-        fun.include()
-    # including back constructors with pointers (general policy is to exclude them)
-    cl.constructors().include()
-
-  # --- LayerDecorator.h ----------------------------------------------
-  if "LayerDecorator.h" in myFiles:
-    cl = mb.class_( "LayerDecorator" )
-    cl.member_functions().exclude()
-    #cl.member_function( "createDiffuseDWBASimulation").exclude()
-    #cl.member_function( "createDWBASimulation").exclude()
-    #cl.member_function( "createStrategy").exclude()
-
-  # --- LayerRoughness.h ----------------------------------------------
-  if "LayerRoughness.h" in myFiles:
-    cl = mb.class_( "LayerRoughness" )
-    cl.member_function( "getSpectralFun" ).exclude()
-    cl.member_function( "getCorrFun" ).exclude()
-
-  # --- MaterialManager.h ---------------------------------------------
-  if "MaterialManager.h" in myFiles:
-    cl = mb.class_( "MaterialManager" )
-    cl.constructors().exclude()
-
-  # --- MesoCrystal.h -------------------------------------------------
-  if "MesoCrystal.h" in myFiles:
-    cl = mb.class_( "MesoCrystal" )
-    cl.member_functions( ).exclude() # excluding all member functions, leaving only constructors
-
-  # --- MultiLayer.h --------------------------------------------------
-  if "MultiLayer.h" in myFiles:
-    cl = mb.class_( "MultiLayer" )
-    cl.member_functions( ).exclude()
-    cl.member_function( "addLayer" ).include()
-    cl.member_function( "addLayer" ).include()
-    cl.member_function( "addLayerWithTopRoughness" ).include()
-
-  # --- OutputData.h ----------------------------------------------------
-  if "OutputData.h" in myFiles:
-    cl = mb.class_("OutputData<double>")
-    cl.add_code('def("__setitem__", &pyplusplus_setitem<OutputData<double >,int,double> )')
-    MethodsToExclude=["begin","end"]
-    for fun in cl.member_functions(allow_empty=True):
-      isToExclude = False
-      for x in MethodsToExclude:
-        if fun.name == x:
-          isToExclude = True
-      if isToExclude:
-        fun.exclude()
-
-  # --- Particle.h ----------------------------------------------------
-  if "Particle.h" in myFiles:
-    cl = mb.class_( "Particle" )
-    cl.member_function( "createDiffuseParticleInfo" ).exclude()
-    cl.member_function( "createDistributedParticles" ).exclude()
-
-  # --- Crystal.h -----------------------------------------------------
-  #if "Crystal.h" in myFiles:
-    #cl = mb.class_( "Crystal" )
-
-  # --- ParticleDecoration.h ------------------------------------------
-  if "ParticleDecoration.h" in myFiles:
-    cl = mb.class_( "ParticleDecoration" )
-    cl.constructors( lambda decl: bool( decl.arguments ) ).exclude() # exclude non-default constructors
-    #cl.member_function("createStrategy").exclude()
-
-  #if "ParticleInfo.h" in myFiles:
-    #cl = mb.class_( "ParticleInfo" )
-
-
-
-  # --- OpticalFresnel.h ----------------------------------------------
-  #if "OpticalFresnel.h" in myFiles:
-    #cl = mb.class_( "OpticalFresnel" )
-
-  # --- Point3D.h -----------------------------------------------------
-  #if "Point3D.h" in myFiles:
-    #cl = mb.class_( "Point3D<double>" )
-
-  # --- ParameterPool.h -----------------------------------------------
-  if "ParameterPool.h" in myFiles:
-    cl = mb.class_( "ParameterPool" )
-    #print "XXX",from_address_custom( 1 )
-    cl.member_function("registerParameter").add_transformation( from_address_custom( 1 ) )
-    cl.member_function("getMatchedParameters").exclude()
-
-  # --- ParticleCoreShell.h -----------------------------------------------
-  if "ParticleCoreShell.h" in myFiles:
-    cl = mb.class_( "ParticleCoreShell" )
-    cl.member_functions().exclude()
-
-  # --- PythonOutputData.h --------------------------------------------
-  if "PythonOutputData.h" in myFiles:
-    # these functions returns PyObject, the empty custom policy is the only way I know
-    mb.free_function('GetOutputData').call_policies = call_policies.custom_call_policies("")
-    mb.free_function('GetOutputDataAxis').call_policies = call_policies.custom_call_policies("")
-
-  # --- PythonPlusplusHelper.h ----------------------------------------
-  if "PythonPlusplusHelper.h" in myFiles:
-    cl = mb.class_( "PythonPlusplusHelper" )
-    cl.exclude() # given class is only to teach pyplusplus to templates, but we do not need class itself to be visible in python, excluding it...
-
-  # --- RealParameterWrapper.h ----------------------------------------
-  if "RealParameterWrapper.h" in myFiles:
-    cl = mb.class_('RealParameterWrapper') # given class is only to teach pyplusplus to templates, but we do not need class itself to be visible in python, excluding it...
-    cl.member_functions().exclude()
-    cl.member_function("setValue").include()
-    cl.member_function("getValue").include()
-    cl.member_function("isNull").include()
-
-  if "Simulation.h" in myFiles:
-    mb.class_('DWBASimulation').exclude()
-    cl = mb.class_("Simulation")
-    cl.member_function("setSampleBuilder").include()
-
-  # --- Transform3D.h -------------------------------------------------
-  #if "Transform3D.h" in myFiles:
-    # removing mentioning of Point3D from constructors and member_functions
-    #mb.class_( "Point3D<double>").exclude()
-    #TransformClasses={"Transform3D","Reflect3D","Translate3D", "Scale3D", "Rotate3D"}
-    #for clname in TransformClasses:
-      #cl = mb.class_(clname)
-      #cl.constructors(lambda decl: 'Point3D' in decl.decl_string, allow_empty=True ).exclude()
-      #cl.member_functions(lambda decl: 'Point3D' in decl.decl_string, allow_empty=True ).exclude()
-
-  # --- Types.h -------------------------------------------------------
-  if "Types.h" in myFiles:
-    cl = mb.class_("KVectorContainer")
-    cl.exclude()
-
-
-def MakePythonAPI(OutputTempDir):
-  from pyplusplus.file_writers.balanced_files import balanced_files_t
-  balanced_files_t.HEADER_EXT='.h'
-  balanced_files_t.SOURCE_EXT='.cpp'
-  from pyplusplus.file_writers.multiple_files import multiple_files_t
-  multiple_files_t.HEADER_EXT='.pypp.h'
-  multiple_files_t.SOURCE_EXT='.pypp.cpp'
-
-  #GCCXML_COMPILER="/opt/local/bin/g++"
-  #GCCXML_CXXFLAGS=""
-  
-  #myIncludes.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7')
-  #myIncludes.append('/opt/local/include/')
-
-  #---------------------------------------------------------------
-  # getting paths
-  #---------------------------------------------------------------
-  myIncludes.append(sys.prefix +"/include/python"+ sys.version[:3])
-  # looking for general headers
-  proc = subprocess.Popen(["which g++"], stdout=subprocess.PIPE, shell=True)
-  (out, err) = proc.communicate()
-  path = out.strip()
-  if path.endswith("bin/g++"):
-    myIncludes.append(path[:-7]+"include")
-  else:
-    exit("Can't find g++")
-  # looking for gccxml
-  proc = subprocess.Popen(["which gccxml"], stdout=subprocess.PIPE, shell=True)
-  (out, err) = proc.communicate()
-  path = out.strip()
-  if path.endswith("/gccxml"):
-    mygccxml = path[:-7]
-  else:
-    exit("No gccxml!")
-  
-  print myIncludes
-  print mygccxml
-  
-  mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path=mygccxml, cflags="-m64")
-  #mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin', cflags="-m64")
-  #mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin')
-
-  # ---------------------------------------------------------
-  # common properties
-  # ---------------------------------------------------------
-  mb.always_expose_using_scope = True
-
-  # Generated code containing errors will not compile on
-  mem_funs = mb.calldefs ()
-  mem_funs.create_with_signature = True
-
-  # Exclude protected and private that are not pure virtual (we still have to expose pure virtual functions to have them overriden in the wrapper)
-  query = declarations.access_type_matcher_t( 'private' ) & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
-  mb.global_ns.calldefs( query, allow_empty=True ).exclude()
-  query = declarations.access_type_matcher_t( 'protected' ) & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
-  mb.global_ns.calldefs( query, allow_empty=True ).exclude()
-
-  # excluding generation of methods for implicit conversion
-  mb.constructors().allow_implicit_conversion = False
-
-  # return policy for singletons, clone and create methods
-  classes = mb.classes();
-  for cl in classes:
-    cl.member_functions('instance', allow_empty=True).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object )
-    cl.member_functions('clone', allow_empty=True).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
-    cl.member_functions( lambda x: x.name.startswith('create'), allow_empty=True ).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
-
-  # excluding constructors which have pointers in argument list
-  for cl in classes:
-    for ctor in cl.constructors(allow_empty=True):
-      for arg in ctor.arguments:
-        if declarations.type_traits.is_pointer(arg.type):
-          ctor.exclude()
-
-  # excluding member functions if they have pointers in argument list
-  for cl in classes:
-    for fun in cl.member_functions(allow_empty=True):
-      has_pointers = False
-      for arg in fun.arguments:
-        if declarations.type_traits.is_pointer(arg.type):
-          has_pointers = True
-      if has_pointers:
-          fun.exclude();
-
-  # ---------------------------------------------------------
-  # calling class individual parsing properties
-  # ---------------------------------------------------------
-  AdditionalRules(mb)
-
-  # set the default return policies (for references/pointers) on classes if it wasn't already been done for
-  mem_funs = mb.calldefs()
-  for mem_fun in mem_funs:
-    if mem_fun.call_policies:
-      continue
-    if not mem_fun.call_policies and (declarations.is_reference(mem_fun.return_type) or declarations.is_pointer(mem_fun.return_type) ):
-      mem_fun.call_policies = call_policies.return_value_policy(call_policies.reference_existing_object )
-
-  # exluding classes which are dublicated in libBornAgainCore
-  DublicatesToExclude=[ 
-    "vector_integer_t",
-    "vector_longinteger_t",
-  ]
-
-  for cl in mb.classes():
-    for name in DublicatesToExclude:
-      if name in cl.name or name in cl.alias:
-        cl.exclude()
-
-
-  # disabling some warnings
-  messages.disable(
-        messages.W1020  # Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X
-      , messages.W1021
-      , messages.W1022
-      , messages.W1023
-      , messages.W1024
-      , messages.W1025
-      , messages.W1026
-      , messages.W1027
-      , messages.W1028
-      , messages.W1029
-      , messages.W1030
-      , messages.W1031
-      #, messages.W1035
-      #, messages.W1040
-      #, messages.W1038
-      #, messages.W1041
-      #, messages.W1036 # pointer to Python immutable member
-      #, messages.W1033 # unnamed variables
-      #, messages.W1018 # expose unnamed classes
-      #, messages.W1049 # returns reference to local variable
-      #, messages.W1014 # unsupported '=' operator
-       )
-
-  # ---------------------------------------------------------
-  # generating output
-  # ---------------------------------------------------------
-  mb.build_code_creator( module_name=ModuleName)
-  mb.code_creator.user_defined_directories.append( os.path.abspath('./') )
-  mb.split_module( OutputTempDir)
-  #nOutputFiles = 8 # generated code for classes will be splitted in this number of files
-  #if nOutputFiles > 0:
-    #mb.split_module( OutputTempDir)
-    #mb.balanced_split_module( OutputTempDir, nOutputFiles)
-  #else:
-    #mb.write_module( "tmp.cpp")
-
-#-------------------------------------------------------------
-# main()
-#-------------------------------------------------------------
-if __name__ == '__main__':
-  PyCoreTempDir='output/PyCore'
-  if not os.path.exists(PyCoreTempDir): os.makedirs(PyCoreTempDir)
-  MakePythonAPI(PyCoreTempDir)
diff --git a/Macros/BoostPythonGenerator/MakePyFit.py b/Macros/BoostPythonGenerator/MakePyFit.py
deleted file mode 100644
index 853f47e3308a1ad2a406a8707fad8e429b18dd63..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/MakePyFit.py
+++ /dev/null
@@ -1,256 +0,0 @@
-# generate python API wrappers for Fit library, see codegenerator.py
-
-import os
-import sys
-import glob
-import subprocess
-from pyplusplus import module_builder
-from pyplusplus.module_builder import call_policies
-from pyplusplus import messages
-from pyplusplus import file_writers
-from pygccxml.declarations.matchers import access_type_matcher_t
-from pygccxml.declarations.matchers import virtuality_type_matcher_t
-from pygccxml import declarations
-from pyplusplus import function_transformers as FT
-
-ModuleName = 'PythonInterface'
-
-# list of files to analyse and corresponding functions with rules for analysis
-myFiles=[
-  'AttLimits.h',
-  'IChiSquaredModule.h',
-  'IMinimizer.h',
-  'ChiSquaredModule.h',
-  'FitSuite.h',
-  #'FitParameter.h',
-  'FitSuiteParameters.h',
-  'MinimizerFactory.h',
-  'PythonPlusplusFitHelper.h',
-  'MathFunctions.h',
-  'ISquaredFunction.h',
-  'IOutputDataNormalizer.h'
-]
-
-
-# list of include directories
-myIncludes = [
-    '../../Core/Samples/inc',
-    '../../Core/Algorithms/inc',
-    '../../Core/Tools/inc',
-    '../../Core/Geometry/inc',
-    '../../Core/Fitting/inc',
-    '../../Fit/Factory/inc',
-    '../../Fit/PythonAPI/inc'
-]
-
-
-# -------------------------------------------------------------------
-# AdditionalRules
-# -------------------------------------------------------------------
-def AdditionalRules(mb):
-
-  if "IChiSquaredModule.h" in myFiles:
-    cl = mb.class_("IChiSquaredModule")
-    #cl.member_functions().exclude()
-
-  if "IMinimizer.h" in myFiles:
-    cl = mb.class_("IMinimizer")
-    cl.member_function("setChiSquaredFunction").exclude()
-    cl.member_function("setGradientFunction").exclude()
-
-  if "ChiSquaredModule.h" in myFiles:
-    cl = mb.class_("ChiSquaredModule")
-    #cl.member_functions().exclude()
-
-  if "FitSuite.h" in myFiles:
-    cl = mb.class_("FitSuite")
-    cl.member_functions().exclude()
-    for fun in cl.member_functions(allow_empty=True):
-      if "addFitParameter" in fun.name:
-          fun.include()
-    cl.member_function("getMinimizer").include()
-    cl.member_function("setMinimizer").include()
-    cl.member_function("addSimulationAndRealData").include()
-    cl.member_function("runFit").include()
-    cl.member_function("printResults").include()
-    cl.member_function("getNCalls").include()
-    cl.member_function("initPrint").include()
-    cl.member_function("getFitParameters").include()
-
-  if "FitSuiteParameters.h" in myFiles:
-    cl = mb.class_("FitSuiteParameters")
-    cl.member_functions().exclude()
-    #cl.member_operator("[]").exclude()
-    cl.member_function("getValues").include()
-    for fun in cl.member_operators():
-      if "operator[]" in fun.name:
-        fun.exclude()
-
-
-  if "MinimizerFactory.h" in myFiles:
-    cl = mb.class_("MinimizerFactory")
-    #cl.member_function( "createMinimizer" ).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
-    cl.member_function( "createMinimizer" ).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object )
-
-  if "OutputData.h" in myFiles:
-    cl = mb.class_("OutputData<double>")
-    #cl.member_functions().exclude()
-    #cl.member_function("totalSum").include()
-
-  # --- PythonPlusplusHelper.h ----------------------------------------
-  if "PythonPlusplusFitHelper.h" in myFiles:
-    cl = mb.class_( "PythonPlusplusFitHelper" )
-    cl.exclude() # given class is only to teach pyplusplus to templates, but we do not need class itself to be visible in python, excluding it...
-
-
-
-def MakePythonAPI(OutputTempDir):
-  from pyplusplus.file_writers.balanced_files import balanced_files_t
-  balanced_files_t.HEADER_EXT='.h'
-  balanced_files_t.SOURCE_EXT='.cpp'
-  from pyplusplus.file_writers.multiple_files import multiple_files_t
-  multiple_files_t.HEADER_EXT='.pypp.h'
-  multiple_files_t.SOURCE_EXT='.pypp.cpp'
-
-
-  #---------------------------------------------------------------
-  # getting paths
-  #---------------------------------------------------------------
-  myIncludes.append(sys.prefix +"/include/python"+ sys.version[:3])
-  # looking for general headers
-  proc = subprocess.Popen(["which g++"], stdout=subprocess.PIPE, shell=True)
-  (out, err) = proc.communicate()
-  path = out.strip()
-  if path.endswith("bin/g++"):
-    myIncludes.append(path[:-7]+"include")
-  else:
-    exit("Can't find g++")
-  # looking for gccxml
-  proc = subprocess.Popen(["which gccxml"], stdout=subprocess.PIPE, shell=True)
-  (out, err) = proc.communicate()
-  path = out.strip()
-  if path.endswith("/gccxml"):
-    mygccxml = path[:-7]
-  else:
-    exit("No gccxml!")
-  
-  print myIncludes
-  print mygccxml
-  
-  mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path=mygccxml, cflags="-m64")
-
-
-  #myIncludes.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7')
-  #myIncludes.append('/opt/local/include/')
-  #mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin', cflags="-m64")
-  #mb = module_builder.module_builder_t(files=myFiles, include_paths=myIncludes, gccxml_path='/opt/local/bin')
-
-  # ---------------------------------------------------------
-  # common properties
-  # ---------------------------------------------------------
-  mb.always_expose_using_scope = True
-
-  # Generated code containing errors will not compile on
-  mem_funs = mb.calldefs ()
-  mem_funs.create_with_signature = True
-
-  # Exclude protected and private that are not pure virtual (we still have to expose pure virtual functions to have them overriden in the wrapper)
-  query = declarations.access_type_matcher_t( 'private' ) & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
-  mb.global_ns.calldefs( query, allow_empty=True ).exclude()
-  query = declarations.access_type_matcher_t( 'protected' ) & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
-  mb.global_ns.calldefs( query, allow_empty=True ).exclude()
-
-  # excluding generation of methods for implicit conversion
-  mb.constructors().allow_implicit_conversion = False
-
-  # return policy for singletons, clone and create methods
-  classes = mb.classes();
-  for cl in classes:
-    cl.member_functions('instance', allow_empty=True).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object )
-    cl.member_functions('clone', allow_empty=True).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
-    cl.member_functions( lambda x: x.name.startswith('create'), allow_empty=True ).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
-
-  # excluding constructors which have pointers in argument list
-  for cl in classes:
-    for ctor in cl.constructors(allow_empty=True):
-      for arg in ctor.arguments:
-        if declarations.type_traits.is_pointer(arg.type):
-          ctor.exclude()
-
-  # excluding member functions if they have pointers in argument list
-  for cl in classes:
-    for fun in cl.member_functions(allow_empty=True):
-      has_pointers = False
-      for arg in fun.arguments:
-        if declarations.type_traits.is_pointer(arg.type):
-          has_pointers = True
-      if has_pointers:
-          fun.exclude();
-
-
-  # ---------------------------------------------------------
-  # calling class individual parsing properties
-  # ---------------------------------------------------------
-  AdditionalRules(mb)
-
-  # set the default return policies (for references/pointers) on classes if it wasn't already been done for
-  mem_funs = mb.calldefs()
-  for mem_fun in mem_funs:
-    if mem_fun.call_policies:
-      continue
-    if not mem_fun.call_policies and (declarations.is_reference(mem_fun.return_type) or declarations.is_pointer(mem_fun.return_type) ):
-      mem_fun.call_policies = call_policies.return_value_policy(call_policies.reference_existing_object )
-
-  # exluding classes which are dublicated in libBornAgainCore
-  DublicatesToExclude=[ 
-    "std::vector<unsigned long, std::allocator<unsigned long> >", 
-    "std::vector<double, std::allocator<double> >",
-    "std::vector<int, std::allocator<int> >",
-    "std::vector<std::vector<double, std::allocator<double> >",
-    "vdouble2d_t",
-    "vdouble1d_t",
-    "cvector_t",
-    "kvector_t",
-    "complex_t",
-    "std::vector<double>",
-    "vcomplex1d_t",
-  ]
-
-  for cl in mb.classes():
-    for name in DublicatesToExclude:
-      if name in cl.name or name in cl.alias:
-        cl.exclude()
-
-
-  # disabling some warnings
-  messages.disable(
-        messages.W1020  # Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X
-      , messages.W1021
-      , messages.W1022
-      , messages.W1023
-      , messages.W1024
-      , messages.W1025
-      , messages.W1026
-      , messages.W1027
-      , messages.W1028
-      , messages.W1029
-      , messages.W1030
-      , messages.W1031
-       )
-
-  # ---------------------------------------------------------
-  # generating output
-  # ---------------------------------------------------------
-  mb.build_code_creator( module_name=ModuleName)
-  mb.code_creator.user_defined_directories.append( os.path.abspath('./') )
-  mb.split_module( OutputTempDir)
-
-
-#-------------------------------------------------------------
-# main()
-#-------------------------------------------------------------
-if __name__ == '__main__':
-  PyFitTempDir='output/PyFit'
-  if not os.path.exists(PyFitTempDir): os.makedirs(PyFitTempDir)
-  MakePythonAPI(PyFitTempDir)
-
diff --git a/Macros/BoostPythonGenerator/Makefile.am b/Macros/BoostPythonGenerator/Makefile.am
deleted file mode 100644
index e6757e1cb790be59d1d9cf6cc758045052599bb0..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-# generate aditional code for GISASFW Python API
-
-default: build
-
-build:
-	python codegenerator.py make
-
-install:
-	python codegenerator.py install
-
-
-
-.PHONY: clean
-
-clean:
-	rm -r -f output
-	rm -f *~
-	rm -f named_tuple.py
-	rm -f *.pyc
-	rm -f exposed_decl.pypp.txt
diff --git a/Macros/BoostPythonGenerator/README b/Macros/BoostPythonGenerator/README
deleted file mode 100644
index 96739370a1dac338d81abc322d921a084326329f..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/README
+++ /dev/null
@@ -1,10 +0,0 @@
-C++ wrappers generator for accessing libBornAgainCore, libBornAgainFit from python
-
-Usage:
-'make'  - to generate python-boost C++ wrappers
-'make install'  - to copy files into BornAgain/Core/PythonAPI, BornAgain/Fit/PythonAPI
-
-requires boost, python27, py27-pyplusplus-devel, py-pygccxml-devel, gccxml-devel
-
-
-
diff --git a/Macros/BoostPythonGenerator/codegenerator.py b/Macros/BoostPythonGenerator/codegenerator.py
deleted file mode 100644
index c6d8c0cb80f50fed06761a4a72112a0c94023aa9..0000000000000000000000000000000000000000
--- a/Macros/BoostPythonGenerator/codegenerator.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# c++ wrapper generator for exposing libScattCore to python
-#
-# Usage: 'python codegenerator.py make'  - to generate python-boost C++ wrappers
-# Usage: 'python codegenerator.py install'  - to copy files into GISASFW/Core/PythonAPI directory
-#
-# requires boost, python27, py27-pyplusplus-devel, py-pygccxml-devel, gccxml-devel
-#
-
-import os
-import sys
-import glob
-
-import MakePyCore
-import MakePyFit
-import InstallPyCore
-import InstallPyFit
-
-
-PyCoreTempDir='output/PyCore'
-PyCoreInstallDir = '../../Core/PythonAPI'
-
-PyFitTempDir='output/PyFit'
-PyFitInstallDir = '../../Fit/PythonAPI'
-
-#-------------------------------------------------------------
-# main()
-#-------------------------------------------------------------
-def main():
-  if len(sys.argv)!=2:
-    print "Usage: 'python codegenerator.py make' - generates python boost wrapping code in ./output subdirectory"
-    print "Usage: 'python codegenerator.py install' - installs generated code to BornAgain/PythonAPI"
-    print " "
-
-  else:
-    if not os.path.exists(PyCoreTempDir): os.makedirs(PyCoreTempDir)
-    if not os.path.exists(PyFitTempDir): os.makedirs(PyFitTempDir)
-
-    if sys.argv[1] == 'make':
-      MakePyCore.MakePythonAPI(PyCoreTempDir)
-      MakePyFit.MakePythonAPI(PyFitTempDir)
-    elif sys.argv[1] == 'install':
-      InstallPyCore.InstallCode(PyCoreTempDir, PyCoreInstallDir)
-      InstallPyFit.InstallCode(PyFitTempDir, PyFitInstallDir)
-    else:
-      print "Nothing to do, run 'python codegenerator.py' to get help"
-
-
-#-------------------------------------------------------------
-# main()
-#-------------------------------------------------------------
-if __name__ == '__main__':
-  main()
-
diff --git a/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.cpp b/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.cpp
index 57dd0b9d20dcc56d6c5f9bc812d8c0bad295928a..b1847fb505c990db577a59053e9c6b60a5a0a845 100644
--- a/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.cpp
+++ b/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.cpp
@@ -53,8 +53,10 @@ void FunctionalTests::IsGISAXS02::run()
     double sigma1 = radius1*0.2;
     double sigma2 = radius2*0.02;
     int nfwhm(3); // to have xmin=average-nfwhm*FWHM, xmax=average+nfwhm*FWHM (nfwhm = xR/2, where xR is what is defined in isgisaxs *.inp file)
-    StochasticSampledParameter par1(StochasticDoubleGaussian(radius1, sigma1), nbins, nfwhm);
-    StochasticSampledParameter par2(StochasticDoubleGaussian(radius2, sigma2), nbins, nfwhm);
+    StochasticDoubleGaussian sg1(radius1, sigma1);
+    StochasticDoubleGaussian sg2(radius2, sigma2);
+    StochasticSampledParameter par1(sg1, nbins, nfwhm);
+    StochasticSampledParameter par2(sg2, nbins, nfwhm);
 
     // building nano particles
     ParticleBuilder builder;
diff --git a/Tests/FunctionalTests/TestCore/IsGISAXS03/IsGISAXS03.cpp b/Tests/FunctionalTests/TestCore/IsGISAXS03/IsGISAXS03.cpp
index 176899bb58530766801370ab2a5edd635bc6616e..a92e0fd2303c990169f92cafc5607bd492b3dd13 100644
--- a/Tests/FunctionalTests/TestCore/IsGISAXS03/IsGISAXS03.cpp
+++ b/Tests/FunctionalTests/TestCore/IsGISAXS03/IsGISAXS03.cpp
@@ -111,7 +111,8 @@ void FunctionalTests::IsGISAXS03::runBA_Size()
     Particle nano_particle(n_particle, p_ff_cylinder);
     // radius of nanoparticles will be sampled with gaussian probability
     int nbins(100), nfwhm(2);
-    StochasticSampledParameter par(StochasticDoubleGaussian(radius, sigma), nbins, nfwhm);
+    StochasticDoubleGaussian double_gaussian(radius, sigma);
+    StochasticSampledParameter par(double_gaussian, nbins, nfwhm);
     ParticleBuilder builder;
     builder.setPrototype(nano_particle,"/Particle/FormFactorCylinder/radius", par);
     builder.plantParticles(particle_decoration);
diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs07.py b/Tests/FunctionalTests/TestPyCore/isgisaxs07.py
index 4b422834270ec2488658d5284b151be22fbb13f6..2b40d3e705875a3cb423fb7dfe6baadcaa75397a 100644
--- a/Tests/FunctionalTests/TestPyCore/isgisaxs07.py
+++ b/Tests/FunctionalTests/TestPyCore/isgisaxs07.py
@@ -33,72 +33,82 @@ def RunSimulation():
     #add particle number 2:
     ff2 = FormFactorBox(1.0*nanometer, 2.0*nanometer,1.0*nanometer)
     pos2 = kvector_t(5.0*nanometer, 5.0*nanometer, 0.0)
-    rotate3d2 = RotateZ3D(10*degree)
-    p_rot2 = Transform3D(rotate3d2)
+    #rotate3d2 = RotateZ_3D(10*degree)
+    #p_rot2 = ITransform3D(rotate3d2)
+    p_rot2 = RotateZ_3D(10*degree)
+    
     particle2 = Particle(n_particle, ff2)   
     particle_info2 = PositionParticleInfo(particle2, p_rot2, pos2, 0.5)
     particle_decoration.addParticleInfo(particle_info2)
     #add particle number 3:
     ff3 = FormFactorBox(1.0*nanometer, 3.0*nanometer,1.0*nanometer)
     pos3 = kvector_t(-5.0*nanometer, -5.0*nanometer, 0.0)
-    rotate3d3 = RotateZ3D(20*degree)
-    p_rot3 = Transform3D(rotate3d3)   
+    #rotate3d3 = RotateZ_3D(20*degree)
+    #p_rot3 = ITransform3D(rotate3d3)   
+    p_rot3 = RotateZ_3D(20*degree)
     particle3 = Particle(n_particle, ff3)
     particle_info3 = PositionParticleInfo(particle3, p_rot3, pos3, 0.5)
     particle_decoration.addParticleInfo(particle_info3)
     #add particle number 4:
     ff4 = FormFactorBox(1.0*nanometer, 4.0*nanometer,1.0*nanometer)
     pos4 = kvector_t(5.0*nanometer, -5.0*nanometer, 0.0)
-    rotate3d4 = RotateZ3D(30*degree)
-    p_rot4 = Transform3D(rotate3d4)   
+    #rotate3d4 = RotateZ_3D(30*degree)
+    #p_rot4 = ITransform3D(rotate3d4)   
+    p_rot4 = RotateZ_3D(30*degree)
     particle4 = Particle(n_particle, ff4)   
     particle_info4 = PositionParticleInfo(particle4, p_rot4, pos4, 0.5)
     particle_decoration.addParticleInfo(particle_info4)
     #add particle number 5:
     ff5 = FormFactorBox(1.0*nanometer, 5.0*nanometer,1.0*nanometer)
     pos5 = kvector_t(-5.0*nanometer, 5.0*nanometer, 0.0)
-    rotate3d5 = RotateZ3D(40*degree)
-    p_rot5 = Transform3D(rotate3d5)   
+    #rotate3d5 = RotateZ_3D(40*degree)
+    #p_rot5 = ITransform3D(rotate3d5)   
+    p_rot5 = RotateZ_3D(40*degree)
     particle5 = Particle(n_particle, ff5)   
     particle_info5 =  PositionParticleInfo(particle5, p_rot5, pos5, 0.5)
     particle_decoration.addParticleInfo(particle_info5)
     #add particle number 6:
     ff6 = FormFactorBox(1.0*nanometer, 1.0*nanometer,1.0*nanometer)
     pos6 = kvector_t(0.0*nanometer, 0.0*nanometer, 0.0)
-    rotate3d6 = RotateZ3D(50*degree)
-    p_rot6 = Transform3D(rotate3d6)
+    #rotate3d6 = RotateZ_3D(50*degree)
+    #p_rot6 = ITransform3D(rotate3d6)
+    p_rot6 = RotateZ_3D(50*degree)
     particle6 = Particle(n_particle, ff6)   
     particle_info6 = PositionParticleInfo(particle6, p_rot6, pos6, 0.5)
     particle_decoration.addParticleInfo(particle_info6)
     #add particle number 7:
     ff7 = FormFactorBox(1.0*nanometer, 2.0*nanometer,1.0*nanometer)
     pos7 = kvector_t(5.0*nanometer, 5.0*nanometer, 0.0)
-    rotate3d7 = RotateZ3D(60*degree)
-    p_rot7 = Transform3D(rotate3d7)
+    #rotate3d7 = RotateZ_3D(60*degree)
+    #p_rot7 = ITransform3D(rotate3d7)
+    p_rot7 = RotateZ_3D(60*degree)
     particle7 = Particle(n_particle, ff7)
     particle_info7 = PositionParticleInfo(particle7, p_rot7, pos7, 0.5)
     particle_decoration.addParticleInfo(particle_info7)
     #add particle number 8:
     ff8 = FormFactorBox(1.0*nanometer, 3.0*nanometer,1.0*nanometer)
     pos8 = kvector_t(-5.0*nanometer, -5.0*nanometer, 0.0)
-    rotate3d8 = RotateZ3D(70*degree)
-    p_rot8 = Transform3D(rotate3d8)
+    #rotate3d8 = RotateZ_3D(70*degree)
+    #p_rot8 = ITransform3D(rotate3d8)
+    p_rot8 = RotateZ_3D(70*degree)
     particle8 = Particle(n_particle, ff8)    
     particle_info8 = PositionParticleInfo(particle8 , p_rot8, pos8, 0.5)
     particle_decoration.addParticleInfo(particle_info8)
     #add particle number 9:
     ff9 = FormFactorBox(1.0*nanometer, 4.0*nanometer,1.0*nanometer)
     pos9 = kvector_t(5.0*nanometer, -5.0*nanometer, 0.0)
-    rotate3d9 = RotateZ3D(80*degree)
-    p_rot9 = Transform3D(rotate3d9)
+    #rotate3d9 = RotateZ_3D(80*degree)
+    #p_rot9 = ITransform3D(rotate3d9)
+    p_rot9 = RotateZ_3D(80*degree)
     particle9 = Particle(n_particle, ff9)     
     particle_info9 = PositionParticleInfo(particle9, p_rot9, pos9, 0.5)
     particle_decoration.addParticleInfo(particle_info9)
     #add particle number 10:
     ff10 = FormFactorBox(1.0*nanometer, 5.0*nanometer,1.0*nanometer)
     pos10 = kvector_t(-5.0*nanometer, 5.0*nanometer, 0.0)
-    rotate3d10 = RotateZ3D(90*degree)
-    p_rot10 = Transform3D(rotate3d10)
+    #rotate3d10 = RotateZ_3D(90*degree)
+    #p_rot10 = ITransform3D(rotate3d10)
+    p_rot10 = RotateZ_3D(90*degree)
     particle10 = Particle(n_particle, ff10)
     particle_info10 = PositionParticleInfo(particle10, p_rot10, pos10, 0.5)
     particle_decoration.addParticleInfo(particle_info10)
diff --git a/Tests/FunctionalTests/TestPyCore/isgisaxs09.py b/Tests/FunctionalTests/TestPyCore/isgisaxs09.py
index 28ca82cd20acfef3754f3e52cada92554da967a2..0ead0094cce00bd386507b30a9f6047b91df32c6 100644
--- a/Tests/FunctionalTests/TestPyCore/isgisaxs09.py
+++ b/Tests/FunctionalTests/TestPyCore/isgisaxs09.py
@@ -56,8 +56,9 @@ def RunSimulation2():
     pyramid = Particle(n_particle, pyramid_ff)
     interference = InterferenceFunctionNone()
     angle_around_z = 45.*degree
-    rotatez3d = RotateZ3D(angle_around_z)
-    transform = Transform3D(rotatez3d)
+    #rotatez3d = RotateZ3D(angle_around_z)
+    #transform = Transform3D(rotatez3d)
+    transform = RotateZ_3D(angle_around_z)
     particle_decoration = ParticleDecoration()
     particle_decoration.addParticle(pyramid, transform)
     
diff --git a/Tests/FunctionalTests/TestPyCore/mesocrystal1.py b/Tests/FunctionalTests/TestPyCore/mesocrystal1.py
index 43f66600c9fa1744f2f94e018c996268fb29f9f4..3cd397ac6f43ec9c4dcb7326a2986784b59e1092 100644
--- a/Tests/FunctionalTests/TestPyCore/mesocrystal1.py
+++ b/Tests/FunctionalTests/TestPyCore/mesocrystal1.py
@@ -84,9 +84,9 @@ class MySampleBuilder(ISampleBuilder):
         for i in range(0, n_max_phi_rotation_steps):
             for j in range(0, n_alpha_rotation_steps):
 
-                transform1 = RotateZ3D(phi_start + i*phi_step)
+                #transform1 = RotateZ3D(phi_start + i*phi_step)
                 #transform2 = RotateY3D(alpha_start + j*alpha_step);
-                p_total_transform = Transform3D(transform1)
+                p_total_transform = RotateZ_3D(phi_start + i*phi_step)
                 meso = self.createMesoCrystal(self.lattice_length_a.value, self.lattice_length_c.value, n_particle_adapted, ff_meso)
                 particle_decoration.addParticle(meso, p_total_transform, self.meso_height.value)
 
diff --git a/dev-tools/log/perf_history.txt b/dev-tools/log/perf_history.txt
index 7b84034e926c9d8ad7cdf4c1b28279f0013691cb..6bb4a8d76396b23d52373a60d5fe87e0cb058cc7 100644
--- a/dev-tools/log/perf_history.txt
+++ b/dev-tools/log/perf_history.txt
@@ -233,3 +233,8 @@
 2013-03-30 11:59:21 | h4         | linuxx8664gcc, 2832 MHz | 186916  | 8.3682  | 8.26446 | 2.5974  | 
 2013-03-30 12:00:05 | h4         | linuxx8664gcc, 2832 MHz | 188679  | 8.3682  | 8.29875 | 2.5974  | 
 2013-03-30 12:00:53 | h4         | linuxx8664gcc, 2832 MHz | 186916  | 8.29875 | 8.23045 | 2.5974  | 
+
+# after multiple chnages (i.e. shared_ptr in transformation)
+# # (and ./App --mesocrystal2 gives  24.69 (4 threads), 50.38 (1 thread))
+2013-04-04 11:39:49 | jcnsopc73  | macosx64, 2800 MHz      | 294118  | 22.4719 | 22.4719 | 6.06061 | 
+2013-04-04 11:40:34 | jcnsopc73  | macosx64, 2800 MHz      | 294118  | 22.9885 | 21.7391 | 6.06061 | 
diff --git a/dev-tools/python-bindings/InstallPyCore.py b/dev-tools/python-bindings/InstallPyCore.py
new file mode 100644
index 0000000000000000000000000000000000000000..a277fc767fd7e724f55a70f92cd15924447e0517
--- /dev/null
+++ b/dev-tools/python-bindings/InstallPyCore.py
@@ -0,0 +1,136 @@
+# see codegenerator.py
+
+import os
+import sys
+import glob
+import difflib
+import subprocess
+
+import install_utils
+
+#-------------------------------------------------------------
+# generating python_module.pri for qt-creator
+#-------------------------------------------------------------
+def GenerateProjectFile(OutputTempDir, files_inc, files_src):
+    python_pri_file = OutputTempDir+"/python_module.pri"
+    fout = open(python_pri_file, 'w')
+    fout.write("HEADERS +=  \\ \n")
+    # existing files (written by human being)
+    fout.write("    PythonAPI/inc/PythonListConverter.h \\ \n")
+    fout.write("    PythonAPI/inc/PythonModule.h \\ \n")
+    fout.write("    PythonAPI/inc/PythonOutputData.h \\ \n")
+    fout.write("    PythonAPI/inc/PythonCoreExposer.h \\ \n")
+    fout.write("    PythonAPI/inc/PythonCoreList.h \\ \n")
+    # automatically generated files
+    for i_file in range(0,len(files_inc)):
+        delim = " \\"
+        if i_file == len(files_inc)-1:
+            delim = " "
+        ff = files_inc[i_file]
+        ff = ff.replace(OutputTempDir,"PythonAPI/inc")
+        fout.write("    "+ff+delim+"\n")
+    fout.write("\n")
+    fout.write("SOURCES +=  \\ \n")
+    # existing files (written by human being)
+    fout.write("    PythonAPI/src/PythonModule.cpp \\ \n")
+    fout.write("    PythonAPI/src/PythonListConverter.cpp \\ \n")
+    fout.write("    PythonAPI/src/PythonOutputData.cpp \\ \n")
+    fout.write("    PythonAPI/src/PythonCoreExposer.cpp \\ \n")
+    # automatically generated files
+    for i_file in range(0,len(files_src)):
+        delim = " \\"
+        if i_file == len(files_src)-1:
+            delim = " "
+        ff = files_src[i_file]
+        ff = ff.replace(OutputTempDir,"PythonAPI/src")
+        fout.write("    "+ff+delim+"\n")
+    fout.write("\n")
+
+    fout.write("INCLUDEPATH += ./PythonAPI/inc \n")
+    fout.write("DEPENDPATH  += ./PythonAPI/inc \n")
+    fout.close()
+    return python_pri_file
+
+
+#-------------------------------------------------------------
+# generating python module main cpp file
+#-------------------------------------------------------------
+def GenerateModuleFile(OutputTempDir, files_inc, files_src):
+    # generating own PythonModule.cpp
+    python_module_file = OutputTempDir+"/PythonModule.cpp"
+    fout = open(python_module_file, 'w')
+    fout.write("#include \"Python.h\"\n")
+    fout.write("#define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY \n")
+    fout.write("#include \"numpy/arrayobject.h\"\n")
+    fout.write("// the order of 3 guys above is important\n")
+    fout.write("\n")
+    #fout.write("#include \"PythonModule.h\"\n")
+    for ff in files_inc:
+        ff = ff.replace(OutputTempDir+"/","")
+        fout.write("#include \""+ff+"\" \n")
+    fout.write("\n")
+    fout.write("#include \"PythonListConverter.h\"\n")
+    fout.write("\n")
+    fout.write("BOOST_PYTHON_MODULE(libBornAgainCore){\n")
+    fout.write("\n")
+
+    # copying register lines from automaticaly generated module file to our manually generated
+    old_python_module_file = OutputTempDir+"/PythonInterface.main.cpp"
+    fin = open(old_python_module_file,'r')
+    for line in fin:
+        if "register_" in line:
+            fout.write(line)
+    fin.close()
+
+    fout.write("\n")
+    fout.write("    register_python2cpp_converters();\n")
+    fout.write("\n")
+    fout.write("    import_array();\n")
+    fout.write("    /* IMPORTANT\n")
+    fout.write("    this is initialisation function from C-API of python-numpy package. It has to be called once in the\n")
+    fout.write("    initialisation section of the module (i.e. here), when module is going to use any of python numpy C-API.\n")
+    fout.write("    Additional rule: when initialisation of the module, and functions that use python-numpy C-API are located in\n")
+    fout.write("    different files (different compilation units) - and this is exactly our case - additional defines has\n")
+    fout.write("    to be inserted before #include \"numpy/arrayobject.h\". See explanations\n")
+    fout.write("    http://docs.scipy.org/doc/numpy/reference/c-api.array.html#import_array\n")
+    fout.write("    */\n")
+    fout.write("}\n")
+
+    fout.close()
+    return python_module_file
+
+#------------------------------------------------------------------------------
+# InstallCode()
+#------------------------------------------------------------------------------
+def InstallCode(OutputTempDir, InstallDir):
+    print "Installing generated PythonFitAPI into ", InstallDir
+    if not os.path.exists(OutputTempDir): exit("No output directory '" + OutputTempDir+"'")
+    if not os.path.exists(InstallDir): exit("No install directory '" + InstallDir+"'")
+
+    files_inc =glob.glob(OutputTempDir+"/*.pypp.h");
+    files_inc+= glob.glob(OutputTempDir+"/__call_policies.pypp.hpp");
+    files_inc+= glob.glob(OutputTempDir+"/__convenience.pypp.hpp");
+    files_src = glob.glob(OutputTempDir+"/*.pypp.cpp");
+    files = files_inc+files_src
+
+    python_pri_file = GenerateProjectFile(OutputTempDir, files_inc, files_src)
+    files.append(python_pri_file)
+
+    python_module_file = GenerateModuleFile(OutputTempDir, files_inc, files_src)
+    files.append(python_module_file)
+
+    install_utils.PatchFiles(files)
+
+    install_utils.CopyFiles(files, InstallDir)
+
+    install_utils.ClearPythonAPI(files, InstallDir)
+    print "Done"
+
+
+#------------------------------------------------------------------------------
+# main()
+#------------------------------------------------------------------------------
+if __name__ == '__main__':
+    InstallCode("output/PyCore","../../Core/PythonAPI")
+
+
diff --git a/dev-tools/python-bindings/InstallPyFit.py b/dev-tools/python-bindings/InstallPyFit.py
new file mode 100644
index 0000000000000000000000000000000000000000..0b156becb0c3573f7b213c00e4c630237ffddd0b
--- /dev/null
+++ b/dev-tools/python-bindings/InstallPyFit.py
@@ -0,0 +1,124 @@
+# see codegenerator.py
+
+import os
+import sys
+import glob
+import difflib
+import subprocess
+
+import install_utils
+
+#-------------------------------------------------------------
+# generating python_module.pri for qt-creator
+#-------------------------------------------------------------
+def GenerateProjectFile(OutputTempDir, files_inc, files_src):
+    python_pri_file = OutputTempDir+"/python_module.pri"
+    fout = open(python_pri_file, 'w')
+    fout.write("HEADERS +=  \\ \n")
+    # existing files (written by human being)
+    fout.write("    PythonAPI/inc/PythonFitExposer.h \\ \n")
+    fout.write("    PythonAPI/inc/PythonFitList.h \\ \n")
+    # automatically generated files
+    for i_file in range(0,len(files_inc)):
+        delim = " \\"
+        if i_file == len(files_inc)-1:
+            delim = " "
+        ff = files_inc[i_file]
+        ff = ff.replace(OutputTempDir,"PythonAPI/inc")
+        fout.write("    "+ff+delim+"\n")
+    fout.write("\n")
+    fout.write("SOURCES +=  \\ \n")
+    # existing files (written by human being)
+    fout.write("    PythonAPI/src/PythonModule.cpp \\ \n")
+    # automatically generated files
+    for i_file in range(0,len(files_src)):
+        delim = " \\"
+        if i_file == len(files_src)-1:
+            delim = " "
+        ff = files_src[i_file]
+        ff = ff.replace(OutputTempDir,"PythonAPI/src")
+        fout.write("    "+ff+delim+"\n")
+    fout.write("\n")
+
+    fout.write("INCLUDEPATH += ./PythonAPI/inc \n")
+    fout.write("DEPENDPATH  += ./PythonAPI/inc \n")
+    fout.close()
+    return python_pri_file
+
+
+#-------------------------------------------------------------
+# generating python module main cpp file
+#-------------------------------------------------------------
+def GenerateModuleFile(OutputTempDir, files_inc, files_src, PatternsToExclude):
+    # generating own PythonModule.cpp
+    python_module_file = OutputTempDir+"/PythonModule.cpp"
+    fout = open(python_module_file, 'w')
+    fout.write("#include \"Python.h\"\n")
+    fout.write("#include \"boost/python.hpp\"\n")
+    fout.write("\n")
+    #fout.write("#include \"PythonModule.h\"\n")
+    for ff in files_inc:
+        ff = ff.replace(OutputTempDir+"/","")
+        fout.write("#include \""+ff+"\" \n")
+    fout.write("\n")
+    fout.write("BOOST_PYTHON_MODULE(libBornAgainFit){\n")
+    fout.write("\n")
+
+    # copying register lines from automaticaly generated module file to our manually generated
+    old_python_module_file = OutputTempDir+"/PythonInterface.main.cpp"
+    fin = open(old_python_module_file,'r')
+    for line in fin:
+        skip_this = False
+        for pattern in PatternsToExclude:
+          if pattern in line: 
+            skip_this = True
+            break
+        if skip_this: continue
+        if "register_" in line: fout.write(line)
+    fin.close()
+    fout.write("}\n")
+    fout.close()
+    return python_module_file
+
+#------------------------------------------------------------------------------
+# InstallCode()
+#------------------------------------------------------------------------------
+def InstallCode(OutputTempDir, InstallDir):
+    print "Installing generated PythonCoreAPI into ", InstallDir
+    if not os.path.exists(OutputTempDir): exit("No output directory '" + OutputTempDir+"'")
+    if not os.path.exists(InstallDir): exit("No install directory '" + InstallDir+"'")
+
+    # skipping files which are already included into Core library
+    PatternsToExclude = ["vdouble1d_t", "vcomplex1d_t"]
+    for pattern in PatternsToExclude:
+      files2remove = glob.glob(OutputTempDir+"/"+pattern+".*")
+      for ff in files2remove:
+          print "...removing dublicated ",ff
+          os.remove(ff)
+
+    files_inc =glob.glob(OutputTempDir+"/*.pypp.h");
+    files_inc+= glob.glob(OutputTempDir+"/__call_policies.pypp.hpp");
+    files_src = glob.glob(OutputTempDir+"/*.pypp.cpp");
+    files = files_inc+files_src
+
+    python_pri_file = GenerateProjectFile(OutputTempDir, files_inc, files_src)
+    files.append(python_pri_file)
+
+    python_module_file = GenerateModuleFile(OutputTempDir, files_inc, files_src, PatternsToExclude)
+    files.append(python_module_file)
+
+    install_utils.PatchFiles(files)
+
+    install_utils.CopyFiles(files, InstallDir)
+
+    install_utils.ClearPythonAPI(files, InstallDir)
+    print "Done"
+
+
+#------------------------------------------------------------------------------
+# main()
+#------------------------------------------------------------------------------
+if __name__ == '__main__':
+    InstallCode("output/PyFit","../../Fit/PythonAPI")
+
+
diff --git a/dev-tools/python-bindings/MakePyCore.py b/dev-tools/python-bindings/MakePyCore.py
new file mode 100644
index 0000000000000000000000000000000000000000..21d3b018562acf8e8ed090e57c567d8887f97347
--- /dev/null
+++ b/dev-tools/python-bindings/MakePyCore.py
@@ -0,0 +1,327 @@
+# generate python API wrappers for Core library
+# used by codegenerator.py
+
+import os
+import sys
+import glob
+import subprocess
+import time
+from pyplusplus import module_builder
+from pyplusplus.module_builder import call_policies
+from pyplusplus import messages
+from pyplusplus import file_writers
+from pygccxml.declarations.matchers import access_type_matcher_t
+from pygccxml.declarations.matchers import virtuality_type_matcher_t
+from pygccxml import declarations
+from pyplusplus import function_transformers as FT
+from pygccxml import parser
+
+
+import builder_utils
+
+
+include_dirs = [
+    '../../Core/Samples/inc',
+    '../../Core/FormFactors/inc',
+    '../../Core/Algorithms/inc',
+    '../../Core/Tools/inc',
+    '../../Core/PythonAPI/inc',
+    '../../Core/Geometry/inc'
+]
+
+include_classes = [
+"BasicVector3D<double>",
+"BasicVector3D<std::complex<double> >",
+"Beam",
+"Bin1D",
+"Bin1DCVector",
+"Crystal",
+"Detector",
+"FTDistribution2DCauchy",
+"FormFactorBox",
+"FormFactorCone",
+"FormFactorCylinder",
+"FormFactorCrystal",
+"FormFactorDecoratorDebyeWaller",
+"FormFactorEllipsoid",
+"FormFactorFullSphere",
+"FormFactorFullSpheroid",
+"FormFactorGauss",
+"FormFactorHemiSpheroid",
+"FormFactorLorentz",
+"FormFactorParallelepiped",
+"FormFactorPrism3",
+"FormFactorPrism6",
+"FormFactorPyramid",
+"FormFactorSphere",
+"FormFactorSphereGaussianRadius",
+"HomogeneousMaterial",
+"IAxis",
+"ICloneable",
+"IClusteredParticles",
+"ICompositeSample",
+"IDecoration",
+"IDetectorResolution",
+"IFTDistribution2D",
+"IFormFactor",
+"IFormFactorBorn",
+"IFormFactorDecorator",
+"IInterferenceFunction",
+"IMaterial",
+"IParameterized",
+"IResolutionFunction2D",
+"ISample",
+"ISampleBuilder",
+"ISelectionRule",
+"ITransform3D",
+"Instrument",
+"InterferenceFunction1DParaCrystal",
+"InterferenceFunction2DLattice",
+"InterferenceFunction2DParaCrystal",
+"InterferenceFunctionNone",
+"Lattice",
+"Lattice2DIFParameters",
+"LatticeBasis",
+"Layer",
+"LayerDecorator",
+"LayerInterface",
+"LayerRoughness",
+"MaterialManager",
+"MesoCrystal",
+"MultiLayer",
+"OutputData<double>",
+"OutputDataIOFactory",
+"ParameterPool",
+"Particle",
+"ParticleCoreShell",
+"ParticleBuilder",
+"ParticleDecoration",
+"ParticleInfo",
+"PositionParticleInfo",
+"RealParameterWrapper",
+"ResolutionFunction2DSimple",
+"RotateY_3D",
+"RotateZ_3D",
+"Simulation",
+"SimulationParameters",
+"SimpleSelectionRule",
+"StochasticDoubleGate",
+"StochasticDoubleGaussian",
+"StochasticParameter<double>",
+"StochasticSampledParameter",
+"cvector_t",
+"kvector_t",
+]
+
+
+# -----------------------------------------------------------------------------
+# AdditionalRules
+# -----------------------------------------------------------------------------
+def ManualClassTunings(mb):
+    mb.class_("Detector").member_functions("addAxis").exclude()
+    #
+    shared_ptrs = mb.decls( lambda decl: decl.name.startswith( 'shared_ptr<' ) )
+    shared_ptrs.disable_warnings( messages.W1040 )
+    # BasicVector3D
+    methods_to_exclude=[
+        "phi", "theta", "cosTheta", "getPhi", "getTheta", "setPhi", "setTheta", "setR",
+        "setMag", "perp", "perp2", "setPerp", "angle", "unit", "orthogonal",
+        "rotated","rotatedX","rotatedY","rotatedZ"
+    ]
+    classes_to_exclude = ["BasicVector3D<std::complex<double> >","BasicVector3D<double>","BasicVector3D<int>"]
+    builder_utils.ExcludeMemberFunctionsForClasses(mb, methods_to_exclude, classes_to_exclude)
+    # Pure virtual should always be included
+    mb.class_("IDetectorResolution").member_function("applyDetectorResolution").include()
+    #
+    cl = mb.class_( "Lattice" )
+    cl.member_functions().exclude()
+    cl.member_function("getBasisVectorA").include()
+    cl.member_function("getBasisVectorB").include()
+    cl.member_function("getBasisVectorC").include()
+    cl.member_function("createTrigonalLattice").include()
+    cl.member_function("createTrigonalLattice").call_policies = call_policies.return_value_policy(call_policies.return_by_value )
+    cl.member_function("setSelectionRule").include()
+    #
+    cl = mb.class_("LatticeBasis")
+    cl.constructors( lambda decl: bool( decl.arguments ) ).exclude() # exclude non-default constructors
+    cl.member_functions().exclude()
+    cl.member_function("addParticle").include()
+    #
+    cl = mb.class_('RealParameterWrapper') # given class is only to teach pyplusplus to templates, but we do not need class itself to be visible in python, excluding it...
+    cl.member_functions().exclude()
+    cl.member_function("setValue").include()
+    cl.member_function("getValue").include()
+    cl.member_function("isNull").include()
+    # 
+    mb.free_function("GetOutputDataNdimensions").include()
+    mb.free_function("GetOutputData").include()
+    mb.free_function("GetOutputDataAxis").include()
+    mb.free_function('GetOutputData').call_policies = call_policies.custom_call_policies("")
+    mb.free_function('GetOutputDataAxis').call_policies = call_policies.custom_call_policies("")
+    #
+    cl = mb.class_("BasicVector3D<double>")
+    cl.add_code("def( bp::self - bp::self )")
+    cl.add_code("def( bp::self + bp::self )")
+    cl.add_code("def( bp::other< double >() * bp::self )")
+    cl.add_code("def( bp::self * bp::other< double >() )")
+    cl.add_code("def( +bp::self )")
+    cl.add_code("def( -bp::self )")
+    cl.add_code("def( bp::self / bp::other< double >() )")
+    cl.add_code("def( bp::self_ns::str( bp::self ) )")
+    #
+    cl = mb.class_( "IParameterized" )
+    cl.member_function("registerParameter").include()
+    cl.member_function("registerParameter").add_transformation( builder_utils.from_address_custom( 1 ) )
+    #
+    cl = mb.class_( "ISampleBuilder" )
+    cl.member_functions().exclude()
+    cl.member_function( "buildSample" ).include()
+    cl.member_function( "buildSample" ).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
+    #
+    cl = mb.class_( "MaterialManager" )
+    cl.constructors().exclude()
+    #
+    cl = mb.class_("OutputData<double>")
+    cl.add_code('def("__setitem__", &pyplusplus_setitem<OutputData<double >,int,double> )') # [] operator for OutputData
+    #
+    cl = mb.class_( "Particle" )
+    cl.member_function( "createDiffuseParticleInfo" ).exclude()
+    cl.member_function( "createDistributedParticles" ).exclude()
+    #
+    cl = mb.class_( "ParticleDecoration" )
+    cl.constructors( lambda decl: bool( decl.arguments ) ).exclude() # exclude non-default constructors
+    #
+    cl = mb.class_( "ParameterPool" )
+    cl.member_function("registerParameter").add_transformation( builder_utils.from_address_custom( 1 ) )
+    cl.member_function("getMatchedParameters").exclude()
+    #
+    mb.namespace( "Units" ).include()
+    #
+    cl = mb.class_( "Layer" )
+    # including back methods which have been excluded by our pointer policy
+    for fun in cl.member_functions():
+        if fun.name == "setMaterial":fun.include()
+    cl.constructors().include() # including back constructors with pointers
+    #
+    cl = mb.class_("Simulation")
+    cl.member_function("setSampleBuilder").include()
+    #
+    cl = mb.class_( "ParticleCoreShell" )
+    cl.member_functions().exclude()
+    #
+    cl = mb.class_( "MesoCrystal" )
+    cl.member_functions( ).exclude()
+    #
+    mb.namespace( "MathFunctions" ).free_function("GenerateNormalRandom").include()
+
+
+# excluding specific member functions
+def ManualExcludeMemberFunctions(mb):
+    # with given name in function name
+    to_exclude=['Iterator','iterator','DWBASimulation']
+    to_exclude_exact=['createDiffuseParticleInfo','createDistributedParticles',
+    'inverse','transformed','getNearestLatticeVectorCoordinates','getNearestReciprocalLatticeVectorCoordinates',
+    'collectBraggAngles','getKVectorContainer',
+    'begin','end','getBinOfAxis','addMask','getMask','setMask',
+    ]
+    for f in mb.member_functions():
+        for x in to_exclude:
+            if x in f.name: f.exclude()
+        for x in to_exclude_exact:
+            if x == f.name: f.exclude()
+    pass
+
+
+#------------------------------------------------------------------------------
+# produces boost python code
+#------------------------------------------------------------------------------
+def MakePythonAPI(OutputTempDir):
+    print "Generating PythonAPI for libBornAgainCore."
+    # getting paths
+    include_dirs.append( builder_utils.get_python_path() )
+    include_dirs.append( builder_utils.get_gcc_path() )
+    mygccxml = builder_utils.get_gccxml_path()
+
+    #If the cache file cache_core.xml doesn't exist it gets created, otherwise it just gets loaded
+    print "NOTE: If you update the source library code you need to manually delete the cache_core.xml file, or run 'python codegenerator.py clean'"
+    xml_cached_fc = parser.create_cached_source_fc( "PythonCoreList.h", "cache_core.xml" )
+    #xml_cached_fc = parser.create_cached_source_fc( ["PythonCoreList.h","PythonCoreExposer.h"], "cache_core.xml" )
+    mb = module_builder.module_builder_t( [xml_cached_fc], include_paths=include_dirs, gccxml_path=mygccxml, cflags="-m64")
+
+    # -----------------
+    # general rules
+    # -----------------
+
+    builder_utils.IncludeClasses(mb, include_classes)
+
+    builder_utils.DefineGeneralRules(mb)
+
+    builder_utils.ExcludeConstructorsArgPtr(mb)
+
+    builder_utils.ExcludeMemberFunctionsArgPtr(mb)
+
+    builder_utils.ManageNewReturnPolicy(mb)
+
+    # -----------------
+    # manual tuning
+    # -----------------
+
+    ManualExcludeMemberFunctions(mb)
+
+    ManualClassTunings(mb) 
+
+    # -----------------
+    # default policies for what remained unchainged
+    # -----------------
+
+    #builder_utils.IncludePureVirtualMethods(mb, include_classes)
+
+    builder_utils.DefaultReturnPolicy(mb)
+
+    # disabling some warnings
+    messages.disable(
+        messages.W1020  # Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X
+      , messages.W1021
+      , messages.W1022
+      , messages.W1023
+      , messages.W1024
+      , messages.W1025
+      , messages.W1026
+      , messages.W1027
+      , messages.W1028
+      , messages.W1029
+      , messages.W1030
+      , messages.W1031
+      #, messages.W1035
+      #, messages.W1040
+      #, messages.W1038
+      #, messages.W1041
+      , messages.W1036 # pointer to Python immutable member
+      #, messages.W1033 # unnamed variables
+      #, messages.W1018 # expose unnamed classes
+      #, messages.W1049 # returns reference to local variable
+      #, messages.W1014 # unsupported '=' operator
+       )
+
+    # ---------------------------------------------------------
+    # generating output
+    # ---------------------------------------------------------
+    mb.build_code_creator( module_name=builder_utils.ModuleName)
+    mb.code_creator.license = builder_utils.license
+    
+    mb.code_creator.user_defined_directories.append( os.path.abspath('./') )
+    mb.split_module(OutputTempDir)
+
+
+#------------------------------------------------------------------------------
+# main()
+#------------------------------------------------------------------------------
+if __name__ == '__main__':
+    tempDir='output/PyCore'
+    if not os.path.exists(tempDir): os.makedirs(tempDir)
+    start_time = time.clock()
+    MakePythonAPI(tempDir)
+    print '\nPythonCoreAPI source code was generated ( %f seconds ).' % (  ( time.clock() - start_time ) )
+    print 'Run InstallPyCore.py to install generated code into BornAgain source tree'
+    print 'Done'
+
diff --git a/dev-tools/python-bindings/MakePyFit.py b/dev-tools/python-bindings/MakePyFit.py
new file mode 100644
index 0000000000000000000000000000000000000000..3329d9da21799d7fe830ec3f9cfc9ca08b4e4090
--- /dev/null
+++ b/dev-tools/python-bindings/MakePyFit.py
@@ -0,0 +1,181 @@
+# generate python API wrappers for Fit library
+# used by codegenerator.py
+
+import os
+import sys
+import glob
+import subprocess
+import time
+from pyplusplus import module_builder
+from pyplusplus.module_builder import call_policies
+from pyplusplus import messages
+from pyplusplus import file_writers
+from pygccxml.declarations.matchers import access_type_matcher_t
+from pygccxml.declarations.matchers import virtuality_type_matcher_t
+from pygccxml import declarations
+from pyplusplus import function_transformers as FT
+from pygccxml import parser
+
+
+import builder_utils
+
+
+include_dirs = [
+'../../Core/Samples/inc',
+'../../Core/Algorithms/inc',
+'../../Core/Tools/inc',
+'../../Core/Geometry/inc',
+'../../Core/Fitting/inc',
+'../../Fit/Factory/inc',
+'../../Fit/PythonAPI/inc'
+]
+
+include_classes = [
+"AttLimits",
+"ChiSquaredModule",
+"FitSuite",
+"FitSuiteParameters",
+"IChiSquaredModule",
+"IMinimizer",
+"IOutputDataNormalizer",
+"ISquaredFunction",
+"MinimizerFactory",
+"OutputDataNormalizer",
+"OutputDataSimpleNormalizer",
+"SquaredFunctionDefault",
+"SquaredFunctionWhichOnlyWorks",
+"SquaredFunctionWithGaussianError",
+"SquaredFunctionWithSystematicError",
+]
+
+
+# -----------------------------------------------------------------------------
+# AdditionalRules
+# -----------------------------------------------------------------------------
+def ManualClassTunings(mb):
+    cl = mb.class_("IMinimizer")
+    cl.member_function("setChiSquaredFunction").exclude()
+    cl.member_function("setGradientFunction").exclude()
+    #
+    cl = mb.class_("FitSuite")
+    cl.member_functions().exclude()
+    for fun in cl.member_functions(allow_empty=True):
+      if "addFitParameter" in fun.name:
+          fun.include()
+    cl.member_function("getMinimizer").include()
+    cl.member_function("setMinimizer").include()
+    cl.member_function("addSimulationAndRealData").include()
+    cl.member_function("runFit").include()
+    cl.member_function("printResults").include()
+    cl.member_function("getNCalls").include()
+    cl.member_function("initPrint").include()
+    cl.member_function("getFitParameters").include()
+    #
+    cl = mb.class_("FitSuiteParameters")
+    cl.member_functions().exclude()
+    cl.member_function("getValues").include()
+    for fun in cl.member_operators():
+        if "operator[]" in fun.name:
+            fun.exclude()
+    #
+    cl = mb.class_("MinimizerFactory")
+    cl.member_function( "createMinimizer" ).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object )
+
+
+# excluding specific member functions
+def ManualExcludeMemberFunctions(mb):
+    pass
+
+
+#------------------------------------------------------------------------------
+# produces boost python code
+#------------------------------------------------------------------------------
+def MakePythonAPI(OutputTempDir):
+    print "Generating PythonAPI for libBornAgainFit."
+    # getting paths
+    include_dirs.append( builder_utils.get_python_path() )
+    include_dirs.append( builder_utils.get_gcc_path() )
+    mygccxml = builder_utils.get_gccxml_path()
+
+    #If the cache file cache_core.xml doesn't exist it gets created, otherwise it just gets loaded
+    print "NOTE: If you update the source library code you need to manually delete the cache_fit.xml file, or run 'python codegenerator.py clean'"
+    xml_cached_fc = parser.create_cached_source_fc( "PythonFitList.h", "cache_fit.xml" )
+    mb = module_builder.module_builder_t( [xml_cached_fc], include_paths=include_dirs, gccxml_path=mygccxml, cflags="-m64")
+
+    # -----------------
+    # general rules
+    # -----------------
+
+    builder_utils.IncludeClasses(mb, include_classes)
+
+    builder_utils.DefineGeneralRules(mb)
+
+    builder_utils.ExcludeConstructorsArgPtr(mb)
+
+    builder_utils.ExcludeMemberFunctionsArgPtr(mb)
+
+    builder_utils.ManageNewReturnPolicy(mb)
+
+    # -----------------
+    # manual tuning
+    # -----------------
+
+    ManualExcludeMemberFunctions(mb)
+
+    ManualClassTunings(mb) 
+
+    # -----------------
+    # default policies for what remained unchainged
+    # -----------------
+
+    #builder_utils.IncludePureVirtualMethods(mb, include_classes)
+
+    builder_utils.DefaultReturnPolicy(mb)
+
+    # disabling some warnings
+    messages.disable(
+        messages.W1020  # Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X
+      , messages.W1021
+      , messages.W1022
+      , messages.W1023
+      , messages.W1024
+      , messages.W1025
+      , messages.W1026
+      , messages.W1027
+      , messages.W1028
+      , messages.W1029
+      , messages.W1030
+      , messages.W1031
+      #, messages.W1035
+      #, messages.W1040
+      #, messages.W1038
+      #, messages.W1041
+      , messages.W1036 # pointer to Python immutable member
+      #, messages.W1033 # unnamed variables
+      #, messages.W1018 # expose unnamed classes
+      #, messages.W1049 # returns reference to local variable
+      #, messages.W1014 # unsupported '=' operator
+       )
+
+    # ---------------------------------------------------------
+    # generating output
+    # ---------------------------------------------------------
+    mb.build_code_creator( module_name=builder_utils.ModuleName)
+    mb.code_creator.license = builder_utils.license
+    
+    mb.code_creator.user_defined_directories.append( os.path.abspath('./') )
+    mb.split_module(OutputTempDir)
+
+
+#------------------------------------------------------------------------------
+# main()
+#------------------------------------------------------------------------------
+if __name__ == '__main__':
+    tempDir='output/PyFit'
+    if not os.path.exists(tempDir): os.makedirs(tempDir)
+    start_time = time.clock()
+    MakePythonAPI(tempDir)
+    print '\nPythonFitAPI source code was generated ( %f seconds ).' % (  ( time.clock() - start_time ) )
+    print 'Run InstallPyFit.py to install generated code into BornAgain source tree'
+    print 'Done'
+
diff --git a/dev-tools/python-bindings/README b/dev-tools/python-bindings/README
new file mode 100644
index 0000000000000000000000000000000000000000..5aa12a90756bd32011e91b534835463ef45dc1a5
--- /dev/null
+++ b/dev-tools/python-bindings/README
@@ -0,0 +1,12 @@
+C++ boost::python code generator for accessing libBornAgainCore, libBornAgainFit from python
+
+Usage:
+'python codegenerator.py make'  - to generate python-boost C++ wrappers
+'python codegenerator.py install'  - to install files into BornAgain/Core/PythonAPI, BornAgain/Fit/PythonAPI
+'python codegenerator.py clean'  - to clean local directory
+
+requires boost, python27, pyplusplus, pygccxml, gccxml
+
+
+
+
diff --git a/dev-tools/python-bindings/builder_utils.py b/dev-tools/python-bindings/builder_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..8e1509f44aee5572081d181f76cf73214c5ce8cd
--- /dev/null
+++ b/dev-tools/python-bindings/builder_utils.py
@@ -0,0 +1,208 @@
+# common rules and utilities for boost python code generation
+import os
+import sys
+import glob
+import subprocess
+from pyplusplus import module_builder
+from pyplusplus.module_builder import call_policies
+from pyplusplus import messages
+from pyplusplus import file_writers
+from pygccxml.declarations.matchers import access_type_matcher_t
+from pygccxml.declarations.matchers import virtuality_type_matcher_t
+from pygccxml import declarations
+from pyplusplus import function_transformers as FT
+from pygccxml import parser
+from pyplusplus.function_transformers import transformers
+from pyplusplus.file_writers.balanced_files import balanced_files_t
+from pyplusplus.file_writers.multiple_files import multiple_files_t
+
+
+license =  "// BornAgain: simulate and fit scattering at grazing incidence \n" \
+           "//! @brief automatically generated boost::python code for PythonCoreAPI  \n"
+
+ModuleName = 'PythonInterface'
+
+balanced_files_t.HEADER_EXT='.h'
+balanced_files_t.SOURCE_EXT='.cpp'
+multiple_files_t.HEADER_EXT='.pypp.h'
+multiple_files_t.SOURCE_EXT='.pypp.cpp'
+
+
+#------------------------------------------------------------------------------
+# excluding constructors which have pointers in argument list
+#------------------------------------------------------------------------------
+def ExcludeConstructorsArgPtr(mb):
+    for cl in mb.classes():
+        for ctor in cl.constructors(allow_empty=True):
+            for arg in ctor.arguments:
+                if declarations.type_traits.is_pointer(arg.type): ctor.exclude()
+
+
+#------------------------------------------------------------------------------
+# excluding member functions if they have pointers in argument list
+#------------------------------------------------------------------------------
+def ExcludeMemberFunctionsArgPtr(mb):
+    for cl in mb.classes():
+        for fun in cl.member_functions(allow_empty=True):
+            has_pointers = False
+            for arg in fun.arguments:
+                if declarations.type_traits.is_pointer(arg.type): has_pointers = True
+            if has_pointers: 
+                #print "XXX",cl.name, fun.name
+                fun.exclude();
+        #query = declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
+        #fun = cl.member_functions( query, allow_empty=True )
+        #for x in fun:
+            #print "ZZZ",x.name
+
+
+#------------------------------------------------------------------------------
+# excluding member functions if they have pointers in argument list
+#------------------------------------------------------------------------------
+def IncludePureVirtualMethods(mb, include_classes):
+    for cl in mb.classes():
+        itsOurClass = False
+        for name in include_classes:
+            if name == cl.name or name == cl.alias: itsOurClass=True
+        if not itsOurClass: continue
+        query = declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
+        fun = cl.member_functions( query, allow_empty=True )
+        for f in fun:
+            f.include()
+
+
+#------------------------------------------------------------------------------
+# include list of defined classes
+#------------------------------------------------------------------------------
+def IncludeClasses(mb, include_classes):
+    # check if classes defined in list are presented in module builder
+    not_found_classes=[]
+    for name in include_classes:
+        isFound = False
+        for cl in mb.classes():
+            if name == cl.name or name == cl.alias: isFound = True
+        if not isFound: not_found_classes.append(name)
+    if len(not_found_classes): 
+        print "Error! Can't find classes with requested names ", not_found_classes
+        exit()
+    mb.classes( lambda cls: cls.name in include_classes ).include()
+
+
+#------------------------------------------------------------------------------
+# for classes with names from 'class_names' exclude methods from 'method_names'
+#------------------------------------------------------------------------------
+def ExcludeMemberFunctionsForClasses(mb, method_names, class_names):
+    # if class decl_string is present in class_names
+    def ClassInList(cl):
+        for name in class_names:
+            if name in cl.decl_string: return True
+        return False
+    # method name is present in method_names
+    def MethodInList(method):
+        for name in method_names:
+            if method.name == name: return True
+        return False
+    #
+    for cl in mb.classes():
+        if ClassInList(cl):
+            #print "class in list",cl.decl_string, class_names
+            for fun in cl.member_functions(allow_empty=True):
+                if MethodInList(fun):
+                    #print "method in list",fun.name, method_names
+                    fun.exclude()
+
+
+##------------------------------------------------------------------------------
+# general rules
+#------------------------------------------------------------------------------
+def DefineGeneralRules(mb):
+    mb.classes().always_expose_using_scope = True
+    #mb.always_expose_using_scope = True
+    # Generated code containing errors will not compile on
+    mem_funs = mb.calldefs ()
+    mem_funs.create_with_signature = True
+    # Exclude protected and private that are not pure virtual (we still have to expose pure virtual functions to have them overriden in the wrapper)
+    query = declarations.access_type_matcher_t( 'private' ) & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
+    mb.global_ns.calldefs( query, allow_empty=True ).exclude()
+    query = declarations.access_type_matcher_t( 'protected' ) & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL )
+    mb.global_ns.calldefs( query, allow_empty=True ).exclude()
+    # excluding generation of methods for implicit conversion
+    mb.constructors().allow_implicit_conversion = False
+
+
+#------------------------------------------------------------------------------
+# return policy for singletons, clone and create methods
+#------------------------------------------------------------------------------
+def ManageNewReturnPolicy(mb):
+    for cl in mb.classes():
+        cl.member_functions('instance', allow_empty=True).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object )
+        cl.member_functions('clone', allow_empty=True).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
+        cl.member_functions( lambda x: x.name.startswith('create'), allow_empty=True ).call_policies = call_policies.return_value_policy( call_policies.manage_new_object )
+
+
+#------------------------------------------------------------------------------
+# set the default return policies (for references/pointers) on classes 
+# if it wasn't already been done for. Should be called last
+#------------------------------------------------------------------------------
+def DefaultReturnPolicy(mb):
+    mem_funs = mb.calldefs()
+    for mem_fun in mem_funs:
+        if mem_fun.call_policies:
+            continue
+        if not mem_fun.call_policies and (declarations.is_reference(mem_fun.return_type) or declarations.is_pointer(mem_fun.return_type) ):
+            mem_fun.call_policies = call_policies.return_value_policy(call_policies.reference_existing_object )
+
+
+# --------------------------------------------------------------------------
+# This is patched version of pyplusplus.function_transformers classes to
+# pass address of ctype(double) into C++. The pointer is passed now in the 
+# form of long unsigned, which correspond to 64 bit (before it was unsigned int)
+# --------------------------------------------------------------------------
+class from_address_custom_t(transformers.type_modifier_t):
+    def __init__(self, function, arg_ref):
+        modifier = lambda type_: declarations.FUNDAMENTAL_TYPES[ 'long unsigned int' ]
+        transformers.type_modifier_t.__init__( self, function, arg_ref, modifier )
+        if not transformers.is_ptr_or_array( self.arg.type ):
+            raise ValueError( '%s\nin order to use "from_address_t" transformation, argument %s type must be a pointer or a array (got %s).' ) \
+                  % ( function, self.arg_ref.name, arg.type)
+    def __str__(self):
+        return "from_address(%s)"%(self.arg.name)
+
+def from_address_custom( *args, **keywd ):
+    def creator( function ):
+        return from_address_custom_t( function, *args, **keywd )
+    return creator
+
+
+# --------------------------------------------------------------------------
+# returns python include directory
+# --------------------------------------------------------------------------
+def get_python_path():
+    return sys.prefix +"/include/python"+ sys.version[:3]
+
+
+# --------------------------------------------------------------------------
+# returns g++ include directory
+# --------------------------------------------------------------------------
+def get_gcc_path():
+    proc = subprocess.Popen(["which g++"], stdout=subprocess.PIPE, shell=True)
+    (out, err) = proc.communicate()
+    path = out.strip()
+    if path.endswith("bin/g++"):
+        return path[:-7]+"include"
+    else:
+        exit("Can't find g++")
+    # looking for gccxml
+
+
+# --------------------------------------------------------------------------
+# returns gccxml path
+# --------------------------------------------------------------------------
+def get_gccxml_path():
+    proc = subprocess.Popen(["which gccxml"], stdout=subprocess.PIPE, shell=True)
+    (out, err) = proc.communicate()
+    path = out.strip()
+    if path.endswith("/gccxml"):
+        return path[:-7]
+    else:
+        exit("No gccxml!")
diff --git a/dev-tools/python-bindings/codegenerator.py b/dev-tools/python-bindings/codegenerator.py
new file mode 100644
index 0000000000000000000000000000000000000000..ab3b160c5d321c63ed032c8b56282cc9ec4026df
--- /dev/null
+++ b/dev-tools/python-bindings/codegenerator.py
@@ -0,0 +1,53 @@
+# c++ wrapper generator for exposing libBornAgainCore and libBornAgainFit libraries to python
+#
+# Usage: 'python codegenerator.py make'  - to generate python-boost C++ wrappers
+# Usage: 'python codegenerator.py install'  - to copy files into BornAgain/Core/PythonAPI directory
+# Usage: 'python codegenerator.py clean'  - to clean local directory
+#
+# requires boost, python27, py27-pyplusplus-devel, py-pygccxml-devel, gccxml-devel
+#
+
+import os
+import sys
+import glob
+
+import MakePyCore
+import MakePyFit
+import InstallPyCore
+import InstallPyFit
+
+
+PyCoreTempDir='output/PyCore'
+PyCoreInstallDir = '../../Core/PythonAPI'
+
+PyFitTempDir='output/PyFit'
+PyFitInstallDir = '../../Fit/PythonAPI'
+
+
+def main():
+    if len(sys.argv)!=2:
+        print "Usage: 'python codegenerator.py make' - generates python boost wrapping code in ./output subdirectory"
+        print "Usage: 'python codegenerator.py install' - installs generated code to BornAgain/PythonAPI"
+        print "Usage: 'python codegenerator.py clean' - clean local directory"
+        print " "
+
+    else:
+        if not os.path.exists(PyCoreTempDir): os.makedirs(PyCoreTempDir)
+        if not os.path.exists(PyFitTempDir): os.makedirs(PyFitTempDir)
+
+        if sys.argv[1] == 'make':
+            MakePyCore.MakePythonAPI(PyCoreTempDir)
+            MakePyFit.MakePythonAPI(PyFitTempDir)
+        elif sys.argv[1] == 'install':
+            InstallPyCore.InstallCode(PyCoreTempDir, PyCoreInstallDir)
+            InstallPyFit.InstallCode(PyFitTempDir, PyFitInstallDir)
+        elif sys.argv[1] == 'clean':
+            clean = ["output", "cache_*.xml", "*~","named_tuple.py","*.pyc","exposed_decl.pypp.txt","tmp.pypp.cpp"]
+            for x in clean: os.system("rm -r -f "+x)
+        else:
+            print "Nothing to do, run 'python codegenerator.py' to get help"
+
+
+if __name__ == '__main__':
+    main()
+
diff --git a/dev-tools/python-bindings/install_utils.py b/dev-tools/python-bindings/install_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..3f3a84a540d57b6606c59360d7aafe2bc968e83f
--- /dev/null
+++ b/dev-tools/python-bindings/install_utils.py
@@ -0,0 +1,128 @@
+# common rules and utilities for PythonAPI installatin
+
+import os
+import sys
+import glob
+import difflib
+import subprocess
+
+# returns True if files are different or absent
+def FilesAreDifferent(file1, file2):
+    if not os.path.exists(file1) or not os.path.exists(file2):
+        return True
+    proc = subprocess.Popen(["diff "+file1+" "+file2], stdout=subprocess.PIPE, shell=True)
+    (out, err) = proc.communicate()
+    if len(out) or err!=None:
+        return True
+    return False
+
+
+# return True if file contains given line
+def FileContainsLine(file_name, myline):
+    lines = open(file_name, 'r').readlines()
+    for line in lines:
+        if line == myline:
+            return True
+    return False
+
+
+# return True if file contains given string
+def FileContainsString(file_name, mystr):
+    lines = open(file_name, 'r').readlines()
+    for line in lines:
+        if mystr in line:
+            return True
+    return False
+
+
+#------------------------------------------------------------------------------
+# patching generated files to get rid from boost compilation warnings
+#------------------------------------------------------------------------------
+def PatchFiles(files):
+    n_patched_files = 0
+    for ff in files:
+        # check if file needs to be patched
+        if FileContainsLine(ff, "#include \"Macros.h\"\n" ):
+            # file was already patched
+            continue
+
+        has_boost_hpp = False
+        has_boost_suite_hpp = False
+
+        if FileContainsString(ff, "boost/python.hpp"): has_boost_hpp = True
+        if FileContainsString(ff, "vector_indexing_suite.hpp"): has_boost_suite_hpp = True
+        if not (has_boost_hpp or has_boost_suite_hpp): 
+            continue
+
+        # patch is required
+        fin = file(ff,"r")
+        fout = file("tmp.tmp","w")
+
+        for line in fin:
+            if "boost/python.hpp" in line:
+                fout.write("#include \"Macros.h\"\n")
+                fout.write("GCC_DIAG_OFF(unused-parameter);\n")
+                fout.write("GCC_DIAG_OFF(missing-field-initializers);\n")
+                fout.write("#include \"boost/python.hpp\"\n")
+                if has_boost_suite_hpp: fout.write("#include \"boost/python/suite/indexing/vector_indexing_suite.hpp\"\n")
+                fout.write("GCC_DIAG_ON(unused-parameter);\n")
+                fout.write("GCC_DIAG_ON(missing-field-initializers);\n")
+            elif "vector_indexing_suite.hpp" in line:
+                continue
+            else:
+                fout.write(line)
+        fout.close()
+        fin.close()
+        os.system("mv tmp.tmp "+ff)
+        n_patched_files += 1
+    print "PatchFiles()     :",n_patched_files, "files have been patched to get rid from compilation warnings"
+
+
+#------------------------------------------------------------------------------
+# copying modified files to the project directory
+#------------------------------------------------------------------------------
+def CopyFiles(files, InstallDir):
+    copycommand='cp '
+    # copying files
+    n_copied_files = 0
+    for f in files:
+        fileName = os.path.basename(f)
+
+        # different output directory for source and headers
+        outputName=''
+        if '.cpp' in fileName:
+            outputName=InstallDir+"/src/"+fileName
+        elif '.h' in fileName:
+            outputName=InstallDir+"/inc/"+fileName
+        elif '.pri' in fileName:
+            outputName=InstallDir+"/../"+fileName
+
+        filesAreDifferentOrAbsent = FilesAreDifferent(outputName,f)
+        if filesAreDifferentOrAbsent:
+            command = copycommand + f + " " + outputName
+            #print command
+            n_copied_files += 1
+            os.system(command)
+
+    print "CopyFiles()      :",n_copied_files,"files out of",len(files),"have been replaced in ",InstallDir
+
+
+#------------------------------------------------------------------------------
+# clear PythonCoreAPI from files remained from previous installation
+#------------------------------------------------------------------------------
+def ClearPythonAPI(files, InstallDir):
+    old_files = glob.glob(InstallDir+"/inc/*.pypp.h")
+    old_files += glob.glob(InstallDir+"/src/*.pypp.cpp")
+    list_to_erase = []
+    for oldf in old_files:
+        old_base = os.path.basename(oldf)
+        oldIsObsolete = True
+        for newf in files:
+            new_base = os.path.basename(newf)
+            if old_base == new_base: oldIsObsolete = False
+        if oldIsObsolete:
+            list_to_erase.append(oldf)
+    print "ClearPythonAPI() : erasing obsolete files in BornAgain source tree ", list_to_erase
+    for x in list_to_erase:
+        os.system("rm "+x)
+
diff --git a/shared.pri b/shared.pri
index 76dd192252cab5ca57847241d552d06b40e4def2..1c206d34abb74130f4de1b119ce5f8d80e5f88e6 100644
--- a/shared.pri
+++ b/shared.pri
@@ -175,9 +175,8 @@ CONFIG(BORNAGAIN_ROOT) {
 # -----------------------------------------------------------------------------
 # add python API support
 # -----------------------------------------------------------------------------
-# CONFIG  += BORNAGAIN_PYTHON
+CONFIG  += BORNAGAIN_PYTHON
 CONFIG(BORNAGAIN_PYTHON) {
-  # TODO - implement check for existance of numpy/arrayobject.h
   # user wants to compile python module
   WhichPython=$$system(which python)
   isEmpty(WhichPython) {
@@ -200,6 +199,7 @@ CONFIG(BORNAGAIN_PYTHON) {
 
     # we need to know the location of numpy
     pythonnumpy=$$system("python -c 'import sys; import numpy; sys.stdout.write(numpy.get_include())'")
+    !exists($$pythonnumpy/numpy/arrayobject.h): error("Can't find numpy/arrayobject.h in $$pythonnumpy, you have to install python-numpy-devel")
     INCLUDEPATH += $$pythonnumpy
   }
 }