Index: sansmodels/src/c_extensions/CSchulz.c
===================================================================
--- sansmodels/src/c_extensions/CSchulz.c	(revision 67424cdc019bde2f4cbc089828ff660e6f914c2c)
+++ 	(revision )
@@ -1,290 +1,0 @@
-/** CSchulz
- *
- * C extension 
- *
- * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY schulz.h
- *          AND RE-RUN THE GENERATOR SCRIPT
- *
- * @author   M.Doucet / UTK
- */
- 
-#include <Python.h>
-#include "structmember.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-
-#include "schulz.h"
-
-/// Error object for raised exceptions
-static PyObject * CSchulzError = NULL;
-
-
-// Class definition
-typedef struct {
-    PyObject_HEAD
-    /// Parameters
-    PyObject * params;
-    /// Log for unit testing
-    PyObject * log;
-    /// Model parameters
-	SchulzParameters model_pars;
-} CSchulz;
-
-
-static void
-CSchulz_dealloc(CSchulz* self)
-{
-    self->ob_type->tp_free((PyObject*)self);
-    
-
-}
-
-static PyObject *
-CSchulz_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
-    CSchulz *self;
-    
-    self = (CSchulz *)type->tp_alloc(type, 0);
-   
-    return (PyObject *)self;
-}
-
-static int
-CSchulz_init(CSchulz *self, PyObject *args, PyObject *kwds)
-{
-    if (self != NULL) {
-    	
-    	// Create parameters
-        self->params = PyDict_New();
-        
-        // Initialize parameter dictionary
-        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"sigma",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"center",Py_BuildValue("d",0.000000));
-
-         
-        // Create empty log
-        self->log = PyDict_New();
-        
-        
-
-    }
-    return 0;
-}
-
-static PyMemberDef CSchulz_members[] = {
-    {"params", T_OBJECT, offsetof(CSchulz, params), 0,
-     "Parameters"},
-    {"log", T_OBJECT, offsetof(CSchulz, log), 0,
-     "Log"},
-    {NULL}  /* Sentinel */
-};
-
-/** Read double from PyObject
-    @param p PyObject
-    @return double
-*/
-double CSchulz_readDouble(PyObject *p) {
-    if (PyFloat_Check(p)==1) {
-        return (double)(((PyFloatObject *)(p))->ob_fval);
-    } else if (PyInt_Check(p)==1) {
-        return (double)(((PyIntObject *)(p))->ob_ival);
-    } else if (PyLong_Check(p)==1) {
-        return (double)PyLong_AsLong(p);
-    } else {
-        return 0.0;
-    }
-}
-
-
-/**
- * Function to call to evaluate model
- * @param args: input q or [q,phi]
- * @return: function value
- */
-static PyObject * run(CSchulz *self, PyObject *args) {
-	double q_value, phi_value;
-	PyObject* pars;
-	int npars;
-	
-	// Get parameters
-	
-	// Reader parameter dictionary
-    self->model_pars.scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model_pars.sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
-    self->model_pars.center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
-
-	
-	// Get input and determine whether we have to supply a 1D or 2D return value.
-	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
-	    PyErr_SetString(CSchulzError, 
-	    	"CSchulz.run expects a q value.");
-		return NULL;
-	}
-	  
-	// Check params
-	if( PyList_Check(pars)==1) {
-		
-		// Length of list should be 2 for I(q,phi)
-	    npars = PyList_GET_SIZE(pars); 
-	    if(npars!=2) {
-	    	PyErr_SetString(CSchulzError, 
-	    		"CSchulz.run expects a double or a list of dimension 2.");
-	    	return NULL;
-	    }
-	    // We have a vector q, get the q and phi values at which
-	    // to evaluate I(q,phi)
-	    q_value = CSchulz_readDouble(PyList_GET_ITEM(pars,0));
-	    phi_value = CSchulz_readDouble(PyList_GET_ITEM(pars,1));
-	    // Skip zero
-	    if (q_value==0) {
-	    	return Py_BuildValue("d",0.0);
-	    }
-		return Py_BuildValue("d",schulz_analytical_2D(&(self->model_pars),q_value,phi_value));
-
-	} else {
-
-		// We have a scalar q, we will evaluate I(q)
-		q_value = CSchulz_readDouble(pars);		
-		
-		return Py_BuildValue("d",schulz_analytical_1D(&(self->model_pars),q_value));
-	}	
-}
-
-/**
- * Function to call to evaluate model in cartesian coordinates
- * @param args: input q or [qx, qy]]
- * @return: function value
- */
-static PyObject * runXY(CSchulz *self, PyObject *args) {
-	double qx_value, qy_value;
-	PyObject* pars;
-	int npars;
-	
-	// Get parameters
-	
-	// Reader parameter dictionary
-    self->model_pars.scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model_pars.sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
-    self->model_pars.center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
-
-	
-	// Get input and determine whether we have to supply a 1D or 2D return value.
-	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
-	    PyErr_SetString(CSchulzError, 
-	    	"CSchulz.run expects a q value.");
-		return NULL;
-	}
-	  
-	// Check params
-	if( PyList_Check(pars)==1) {
-		
-		// Length of list should be 2 for I(qx, qy))
-	    npars = PyList_GET_SIZE(pars); 
-	    if(npars!=2) {
-	    	PyErr_SetString(CSchulzError, 
-	    		"CSchulz.run expects a double or a list of dimension 2.");
-	    	return NULL;
-	    }
-	    // We have a vector q, get the qx and qy values at which
-	    // to evaluate I(qx,qy)
-	    qx_value = CSchulz_readDouble(PyList_GET_ITEM(pars,0));
-	    qy_value = CSchulz_readDouble(PyList_GET_ITEM(pars,1));
-		return Py_BuildValue("d",schulz_analytical_2DXY(&(self->model_pars),qx_value,qy_value));
-
-	} else {
-
-		// We have a scalar q, we will evaluate I(q)
-		qx_value = CSchulz_readDouble(pars);		
-		
-		return Py_BuildValue("d",schulz_analytical_1D(&(self->model_pars),qx_value));
-	}	
-}
-
-static PyObject * reset(CSchulz *self, PyObject *args) {
-    
-
-    return Py_BuildValue("d",0.0);
-}
-
-
-static PyMethodDef CSchulz_methods[] = {
-    {"run",      (PyCFunction)run     , METH_VARARGS,
-      "Evaluate the model at a given Q or Q, phi"},
-    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
-      "Evaluate the model at a given Q or Qx, Qy"},
-    {"reset",    (PyCFunction)reset   , METH_VARARGS,
-      "Reset pair correlation"},
-    //{"numerical_1D",      (PyCFunction)numerical_1D     , METH_VARARGS,
-    //  "Evaluate the 1D model at a given Q"},
-   {NULL}
-};
-
-static PyTypeObject CSchulzType = {
-    PyObject_HEAD_INIT(NULL)
-    0,                         /*ob_size*/
-    "CSchulz",             /*tp_name*/
-    sizeof(CSchulz),             /*tp_basicsize*/
-    0,                         /*tp_itemsize*/
-    (destructor)CSchulz_dealloc, /*tp_dealloc*/
-    0,                         /*tp_print*/
-    0,                         /*tp_getattr*/
-    0,                         /*tp_setattr*/
-    0,                         /*tp_compare*/
-    0,                         /*tp_repr*/
-    0,                         /*tp_as_number*/
-    0,                         /*tp_as_sequence*/
-    0,                         /*tp_as_mapping*/
-    0,                         /*tp_hash */
-    0,                         /*tp_call*/
-    0,                         /*tp_str*/
-    0,                         /*tp_getattro*/
-    0,                         /*tp_setattro*/
-    0,                         /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-    "CSchulz objects",           /* tp_doc */
-    0,		               /* tp_traverse */
-    0,		               /* tp_clear */
-    0,		               /* tp_richcompare */
-    0,		               /* tp_weaklistoffset */
-    0,		               /* tp_iter */
-    0,		               /* tp_iternext */
-    CSchulz_methods,             /* tp_methods */
-    CSchulz_members,             /* tp_members */
-    0,                         /* tp_getset */
-    0,                         /* tp_base */
-    0,                         /* tp_dict */
-    0,                         /* tp_descr_get */
-    0,                         /* tp_descr_set */
-    0,                         /* tp_dictoffset */
-    (initproc)CSchulz_init,      /* tp_init */
-    0,                         /* tp_alloc */
-    CSchulz_new,                 /* tp_new */
-};
-
-
-//static PyMethodDef module_methods[] = {
-//    {NULL}
-//};
-
-/**
- * Function used to add the model class to a module
- * @param module: module to add the class to
- */ 
-void addCSchulz(PyObject *module) {
-	PyObject *d;
-	
-    if (PyType_Ready(&CSchulzType) < 0)
-        return;
-
-    Py_INCREF(&CSchulzType);
-    PyModule_AddObject(module, "CSchulz", (PyObject *)&CSchulzType);
-    
-    d = PyModule_GetDict(module);
-    CSchulzError = PyErr_NewException("CSchulz.error", NULL, NULL);
-    PyDict_SetItemString(d, "CSchulzError", CSchulzError);
-}
-
Index: sansmodels/src/c_extensions/local.def
===================================================================
--- sansmodels/src/c_extensions/local.def	(revision 67424cdc019bde2f4cbc089828ff660e6f914c2c)
+++ 	(revision )
@@ -1,32 +1,0 @@
-# -*- Makefile -*-
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#                               Michael A.G. Aivazis
-#                        California Institute of Technology
-#                        (C) 1998-2004  All Rights Reserved
-#
-# <LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-#
-# Local (project) definitions
-#
-
-# C++
-
-
-    PROJ_CXX_FLAGS += $(CXX_SOFLAGS)
-    PROJ_LCXX_FLAGS += $(LCXX_SARFLAGS)
-
-PROJ_CC_INCLUDES += $(BLD_INCDIR)/sans
-
-#PROJ_CXX_DEFINES += DEEPDEBUG
-#PROJ_CXX_DEFINES += DEBUG
-
-# version
-# $Id: local.def 1280 2007-06-25 07:01:00Z linjiao $
-
-# End of file
Index: sansmodels/src/c_extensions/schulz.c
===================================================================
--- sansmodels/src/c_extensions/schulz.c	(revision 67424cdc019bde2f4cbc089828ff660e6f914c2c)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/**
- * Schulz function
- */
-
-#include "schulz.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(_MSC_VER)
-#include "gamma_win.h"
-#endif
-
-/**
- * Function to evaluate 1D Schulz function.
- * The function is normalized to the 'scale' parameter.
- *
- * f(x)=scale * math.pow(z+1, z+1)*math.pow((R), z)*
- *					math.exp(-R*(z+1))/(center*gamma(z+1)
- *		z= math.pow[(1/(sigma/center),2]-1
- *		R= x/center
- * @param pars: parameters of the schulz
- * @param x: x-value
- * @return: function value
- */
-double schulz_analytical_1D(SchulzParameters *pars, double x) {
-	double z = pow(pars->center/ pars->sigma, 2)-1;
-	double R= x/pars->center;
-	double zz= z+1;
-	double expo;
-	expo = log(pars->scale)+zz*log(zz)+z*log(R)-R*zz-log(pars->center)-lgamma(zz);
-
-	return exp(expo);//pars->scale * pow(zz,zz) * pow(R,z) * exp(-1*R*zz)/((pars->center) * tgamma(zz)) ;
-}
-
-/**
- * Function to evaluate 2D schulz function
- * The function is normalized to the 'scale' parameter.
- *
- * f(x,y) = Schulz(x) * Schulz(y)
- *
- * where both Shulzs share the same parameters.
- *
- * @param pars: parameters of the schulz
- * @param x: x-value
- * @param y: y-value
- * @return: function value
- */
-double schulz_analytical_2DXY(SchulzParameters *pars, double x, double y) {
-    return schulz_analytical_1D(pars, x) * schulz_analytical_1D(pars, y);
-}
-
-/**
- * Function to evaluate 2D Schulz  function
- * The function is normalized to the 'scale' parameter.
- *
- * f(x,y) = Schulz(x) * Schulz(y)
- *
- * where both Gaussians share the same parameters.
- *
- * @param pars: parameters of the gaussian
- * @param length: length of the (x,y) vector
- * @param phi: angle relative to x
- * @return: function value
- */
-double schulz_analytical_2D(SchulzParameters *pars, double length, double phi) {
-    return schulz_analytical_2DXY(pars, length*cos(phi), length*sin(phi));
-}
Index: sansmodels/src/c_extensions/schulz.h
===================================================================
--- sansmodels/src/c_extensions/schulz.h	(revision 67424cdc019bde2f4cbc089828ff660e6f914c2c)
+++ sansmodels/src/c_extensions/schulz.h	(revision 20d91bdc03a63d1b22cd368c66c0e2cf68e28444)
@@ -1,4 +1,5 @@
 #if !defined(schulz_h)
 #define schulz_h
+#include "parameters.hh"
 
 /** Structure definition for Schulz parameters.
@@ -16,22 +17,26 @@
  					R= x/center</text>
  */
-typedef struct {
-    /// Scale factor 
-    //  [DEFAULT]=scale=1.0
-    double scale;
-    /// Standard deviation
-    //  [DEFAULT]=sigma=1 
-    double sigma;
-    /// Center of the Schulz distribution
-    //  [DEFAULT]=center=0.0 
-    double center;
-} SchulzParameters;
 
-/// 1D scattering function
-double schulz_analytical_1D(SchulzParameters *pars, double x);
+class Schulz{
+public:
+  /// Scale factor
+  //  [DEFAULT]=scale=1.0
+  Parameter scale;
+  /// Standard deviation
+  //  [DEFAULT]=sigma=1
+  Parameter sigma;
+  /// Center of the Schulz distribution
+  //  [DEFAULT]=center=0.0
+  Parameter center;
 
-/// 2D scattering function
-double schulz_analytical_2D(SchulzParameters *pars, double x, double phi);
-double schulz_analytical_2DXY(SchulzParameters *pars, double x, double y);
+  // Constructor
+  Schulz();
+
+  // Operators to get I(Q)
+  double operator()(double q);
+  double operator()(double qx, double qy);
+  double calculate_ER();
+  double evaluate_rphi(double q, double phi);
+};
 
 #endif
Index: sansmodels/src/c_models/c_models.cpp
===================================================================
--- sansmodels/src/c_models/c_models.cpp	(revision 82c11d354f0cffa7741bd2e74e0641e042eeb034)
+++ sansmodels/src/c_models/c_models.cpp	(revision 20d91bdc03a63d1b22cd368c66c0e2cf68e28444)
@@ -69,7 +69,7 @@
 	void addCGaussian(PyObject *module);
 	void addCLogNormal(PyObject *module);
-	void addCSchulz(PyObject *module);
 }
 void addCLorentzian(PyObject *module);
+void addCSchulz(PyObject *module);
 
 /**
Index: sansmodels/src/c_models/schulz.cpp
===================================================================
--- sansmodels/src/c_models/schulz.cpp	(revision 20d91bdc03a63d1b22cd368c66c0e2cf68e28444)
+++ sansmodels/src/c_models/schulz.cpp	(revision 20d91bdc03a63d1b22cd368c66c0e2cf68e28444)
@@ -0,0 +1,90 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+#include <math.h>
+#include "parameters.hh"
+#include <stdio.h>
+using namespace std;
+#include "schulz.h"
+
+Schulz :: Schulz() {
+  scale  = Parameter(1.0, true);
+  sigma  = Parameter(1.0, true);
+  center = Parameter(0.0, true);
+}
+
+/**
+ * Function to evaluate 1D scattering function
+/**
+ * Function to evaluate 1D Schulz function.
+ * The function is normalized to the 'scale' parameter.
+ *
+ * f(x)=scale * math.pow(z+1, z+1)*math.pow((R), z)*
+ *          math.exp(-R*(z+1))/(center*gamma(z+1)
+ *    z= math.pow[(1/(sigma/center),2]-1
+ *    R= x/center
+ *
+ * @param q: q-value
+ * @return: function value
+ */
+double Schulz :: operator()(double q) {
+  double z = pow(center()/ sigma(), 2)-1;
+  double R= q/center();
+  double zz= z+1;
+  double expo;
+  expo = log(scale())+zz*log(zz)+z*log(R)-R*zz-log(center())-lgamma(zz);
+
+  return exp(expo);//scale * pow(zz,zz) * pow(R,z) * exp(-1*R*zz)/((center) * tgamma(zz)) ;
+}
+
+/**
+ * Function to evaluate 2D schulz function
+ * The function is normalized to the 'scale' parameter.
+ *
+ * f(x,y) = Schulz(x) * Schulz(y)
+ *
+ * where both Shulzs share the same parameters.
+ * @param q_x: value of Q along x
+ * @param q_y: value of Q along y
+ * @return: function value
+ */
+double Schulz :: operator()(double qx, double qy) {
+  return (*this).operator()(qx) * (*this).operator()(qy);
+}
+
+/**
+ * Function to evaluate 2D schulz function
+ * The function is normalized to the 'scale' parameter.
+ *
+ * f(x,y) = Schulz(x) * Schulz(y)
+ *
+ * where both Shulzs share the same parameters.
+ * @param pars: parameters of the cylinder
+ * @param q: q-value
+ * @param phi: angle phi
+ * @return: function value
+ */
+double Schulz :: evaluate_rphi(double q, double phi) {
+  double qx = q*cos(phi);
+  double qy = q*sin(phi);
+  return (*this).operator()(qx, qy);
+}
+/**
+ * Function to calculate effective radius
+ * @return: effective radius value
+ */
+double Schulz :: calculate_ER() {
+  //NOT implemented yet!!!
+  return 0.0;
+}
