Index: sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -86,5 +86,5 @@
         
         // Initialize parameter dictionary
-        PyDict_SetItemString(self->params,"vol_frac_ls",Py_BuildValue("d",0.200000));
+        PyDict_SetItemString(self->params,"vol_frac_ls",Py_BuildValue("d",0.100000));
         PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
         PyDict_SetItemString(self->params,"vol_frac_ss",Py_BuildValue("d",0.200000));
@@ -93,5 +93,5 @@
         PyDict_SetItemString(self->params,"ss_sld",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"s_radius",Py_BuildValue("d",25.000000));
-        PyDict_SetItemString(self->params,"l_radius",Py_BuildValue("d",160.000000));
+        PyDict_SetItemString(self->params,"l_radius",Py_BuildValue("d",100.000000));
         // Initialize dispersion / averaging parameter dict
         DispersionVisitor* visitor = new DispersionVisitor();
@@ -170,41 +170,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( BinaryHSModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
Index: sansmodels/src/sans/models/c_models/CCoreShellSpheroidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellSpheroidModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
+++ sansmodels/src/sans/models/c_models/CCoreShellSpheroidModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -0,0 +1,597 @@
+/**
+	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
+ */
+
+/** CCoreShellSpheroidModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY spheroid.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include "spheroid.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreShellSpheroidModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreShellSpheroidModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreShellSpheroidModel;
+
+
+static void
+CCoreShellSpheroidModel_dealloc(CCoreShellSpheroidModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreShellSpheroidModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreShellSpheroidModel *self;
+    
+    self = (CCoreShellSpheroidModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreShellSpheroidModel_init(CCoreShellSpheroidModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new CoreShellSpheroidModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"polar_shell",Py_BuildValue("d",30.000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"equat_shell",Py_BuildValue("d",250.000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"equat_core",Py_BuildValue("d",200.000000));
+        PyDict_SetItemString(self->params,"polar_core",Py_BuildValue("d",20.000000));
+        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000001));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->equat_core.dispersion->accept_as_source(visitor, self->model->equat_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "equat_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->polar_core.dispersion->accept_as_source(visitor, self->model->polar_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "polar_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->equat_shell.dispersion->accept_as_source(visitor, self->model->equat_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "equat_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->polar_shell.dispersion->accept_as_source(visitor, self->model->polar_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "polar_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef CCoreShellSpheroidModel_members[] = {
+    {"params", T_OBJECT, offsetof(CCoreShellSpheroidModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(CCoreShellSpheroidModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(CCoreShellSpheroidModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreShellSpheroidModel_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 numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreShellSpheroidModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), 
+										  PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreShellSpheroidModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int i,j, x_len, y_len, dims[2];
+    //check validity of input vectors
+    if (x->nd != 2 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 2 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[1] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[1]= y->dimensions[1];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(2,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+        for ( i=0; i< x_len; i++) {
+            for ( j=0; j< y_len; j++) {
+                double x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+      			double *result_value = (double *)(result->data +
+      			      i*result->strides[0] + j*result->strides[1]);
+      			*result_value = (*model)(x_value, y_value);
+            }           
+        }
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreShellSpheroidModelError, 
+                   "CCoreShellSpheroidModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreShellSpheroidModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellSpheroidModelError, 
+	    	"CCoreShellSpheroidModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreShellSpheroidModelError, 
+                   "CCoreShellSpheroidModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreShellSpheroidModelError, 
+	    		"CCoreShellSpheroidModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreShellSpheroidModelError, 
+                   "CCoreShellSpheroidModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}else{
+	    PyErr_SetString(CCoreShellSpheroidModelError, 
+                   "CCoreShellSpheroidModel.evalDistribution couln't be run.");
+	    return NULL;
+	}
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreShellSpheroidModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellSpheroidModelError, 
+	    	"CCoreShellSpheroidModel.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(CCoreShellSpheroidModelError, 
+	    		"CCoreShellSpheroidModel.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 = CCoreShellSpheroidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreShellSpheroidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreShellSpheroidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreShellSpheroidModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellSpheroidModelError, 
+	    	"CCoreShellSpheroidModel.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(CCoreShellSpheroidModelError, 
+	    		"CCoreShellSpheroidModel.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 = CCoreShellSpheroidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreShellSpheroidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreShellSpheroidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreShellSpheroidModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreShellSpheroidModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreShellSpheroidModelError,
+	    	"CCoreShellSpheroidModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "equat_core")) {
+        self->model->equat_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "polar_core")) {
+        self->model->polar_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "equat_shell")) {
+        self->model->equat_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "polar_shell")) {
+        self->model->polar_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreShellSpheroidModelError,
+	    	"CCoreShellSpheroidModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreShellSpheroidModel_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"},
+      
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreShellSpheroidModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreShellSpheroidModel",             /*tp_name*/
+    sizeof(CCoreShellSpheroidModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreShellSpheroidModel_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*/
+    "CCoreShellSpheroidModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreShellSpheroidModel_methods,             /* tp_methods */
+    CCoreShellSpheroidModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreShellSpheroidModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreShellSpheroidModel_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 addCCoreShellSpheroidModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreShellSpheroidModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreShellSpheroidModelType);
+    PyModule_AddObject(module, "CCoreShellSpheroidModel", (PyObject *)&CCoreShellSpheroidModelType);
+    
+    d = PyModule_GetDict(module);
+    CCoreShellSpheroidModelError = PyErr_NewException("CCoreShellSpheroidModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "CCoreShellSpheroidModelError", CCoreShellSpheroidModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/CCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -175,41 +175,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( CylinderModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
Index: sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -175,41 +175,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( EllipsoidModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
Index: sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -183,41 +183,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( EllipticalCylinderModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
Index: sansmodels/src/sans/models/c_models/CLamellarModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -86,12 +86,15 @@
         
         // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"sld_sol",Py_BuildValue("d",0.000006));
         PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"sigma",Py_BuildValue("d",0.150000));
+        PyDict_SetItemString(self->params,"bi_thick",Py_BuildValue("d",50.000000));
         PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000));
-        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000005));
-        PyDict_SetItemString(self->params,"delta",Py_BuildValue("d",50.000000));
+        PyDict_SetItemString(self->params,"sld_bi",Py_BuildValue("d",0.000001));
         // Initialize dispersion / averaging parameter dict
         DispersionVisitor* visitor = new DispersionVisitor();
         PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->bi_thick.dispersion->accept_as_source(visitor, self->model->bi_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "bi_thick", disp_dict);
 
 
@@ -161,41 +164,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( LamellarModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
@@ -260,12 +227,14 @@
 	
 	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
     self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
-    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
-    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
     // Read in dispersion parameters
     PyObject* disp_dict;
     DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
 
 	
@@ -330,12 +299,14 @@
 	
 	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
     self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
-    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
-    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
     // Read in dispersion parameters
     PyObject* disp_dict;
     DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
 
 	
@@ -389,12 +360,14 @@
 	
 	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
     self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
-    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
-    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
     // Read in dispersion parameters
     PyObject* disp_dict;
     DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
 
 	
@@ -452,5 +425,7 @@
 	// Ugliness necessary to go from python to C
 	    // TODO: refactor this
- {
+    if (!strcmp(par_name, "bi_thick")) {
+        self->model->bi_thick.dispersion = dispersion;
+    } else {
 	    PyErr_SetString(CLamellarModelError,
 	    	"CLamellarModel.set_dispersion expects a valid parameter name.");
Index: sansmodels/src/sans/models/c_models/COblateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -178,41 +178,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( OblateModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
Index: sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -88,7 +88,8 @@
         PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
         PyDict_SetItemString(self->params,"longer_edgeB",Py_BuildValue("d",75.000000));
+        PyDict_SetItemString(self->params,"parallel_psi",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"longuest_edgeC",Py_BuildValue("d",400.000000));
-        PyDict_SetItemString(self->params,"parallel_phi",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"parallel_theta",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"parallel_phi",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"parallel_theta",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"short_edgeA",Py_BuildValue("d",35.000000));
@@ -109,4 +110,7 @@
         self->model->parallel_phi.dispersion->accept_as_source(visitor, self->model->parallel_phi.dispersion, disp_dict);
         PyDict_SetItemString(self->dispersion, "parallel_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_psi.dispersion->accept_as_source(visitor, self->model->parallel_psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_psi", disp_dict);
         disp_dict = PyDict_New();
         self->model->parallel_theta.dispersion->accept_as_source(visitor, self->model->parallel_theta.dispersion, disp_dict);
@@ -179,41 +183,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( ParallelepipedModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
@@ -280,4 +248,5 @@
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
     self->model->longer_edgeB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longer_edgeB") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
     self->model->longuest_edgeC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longuest_edgeC") );
     self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
@@ -297,4 +266,6 @@
     disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
     self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
     disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
     self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
@@ -363,4 +334,5 @@
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
     self->model->longer_edgeB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longer_edgeB") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
     self->model->longuest_edgeC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longuest_edgeC") );
     self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
@@ -380,4 +352,6 @@
     disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
     self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
     disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
     self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
@@ -435,4 +409,5 @@
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
     self->model->longer_edgeB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longer_edgeB") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
     self->model->longuest_edgeC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longuest_edgeC") );
     self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
@@ -452,4 +427,6 @@
     disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
     self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
     disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
     self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
@@ -517,4 +494,6 @@
     } else    if (!strcmp(par_name, "parallel_phi")) {
         self->model->parallel_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_psi")) {
+        self->model->parallel_psi.dispersion = dispersion;
     } else    if (!strcmp(par_name, "parallel_theta")) {
         self->model->parallel_theta.dispersion = dispersion;
Index: sansmodels/src/sans/models/c_models/CSphereModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -163,41 +163,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( SphereModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
Index: sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -86,22 +86,25 @@
         
         // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000004));
+        PyDict_SetItemString(self->params,"core_thick",Py_BuildValue("d",10.000000));
+        PyDict_SetItemString(self->params,"layer_thick",Py_BuildValue("d",15.000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"layer_sld",Py_BuildValue("d",-0.000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000005));
         PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",0.010000));
-        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"spacing",Py_BuildValue("d",0.000000));
-        PyDict_SetItemString(self->params,"nlayers",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"layer_sld",Py_BuildValue("d",-0.000000));
-        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000005));
-        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",15.000000));
-        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",10.000000));
-        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000004));
         PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",3000.000000));
         PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"sigma_d",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"n_stacking",Py_BuildValue("d",1.000000));
         // Initialize dispersion / averaging parameter dict
         DispersionVisitor* visitor = new DispersionVisitor();
         PyObject * disp_dict;
         disp_dict = PyDict_New();
-        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
-        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        self->model->core_thick.dispersion->accept_as_source(visitor, self->model->core_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "core_thick", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->layer_thick.dispersion->accept_as_source(visitor, self->model->layer_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "layer_thick", disp_dict);
         disp_dict = PyDict_New();
         self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
@@ -180,41 +183,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( StackedDisksModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
@@ -279,21 +246,23 @@
 	
 	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
-    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
-    self->model->nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nlayers") );
-    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
-    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
-    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
-    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
-    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
-    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
     self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
     self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
     // Read in dispersion parameters
     PyObject* disp_dict;
     DispersionVisitor* visitor = new DispersionVisitor();
-    disp_dict = PyDict_GetItemString(self->dispersion, "length");
-    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
     disp_dict = PyDict_GetItemString(self->dispersion, "radius");
     self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
@@ -364,21 +333,23 @@
 	
 	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
-    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
-    self->model->nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nlayers") );
-    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
-    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
-    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
-    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
-    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
-    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
     self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
     self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
     // Read in dispersion parameters
     PyObject* disp_dict;
     DispersionVisitor* visitor = new DispersionVisitor();
-    disp_dict = PyDict_GetItemString(self->dispersion, "length");
-    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
     disp_dict = PyDict_GetItemString(self->dispersion, "radius");
     self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
@@ -438,21 +409,23 @@
 	
 	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
-    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
-    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
-    self->model->nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nlayers") );
-    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
-    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
-    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
-    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
-    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
-    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
     self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
     self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
     // Read in dispersion parameters
     PyObject* disp_dict;
     DispersionVisitor* visitor = new DispersionVisitor();
-    disp_dict = PyDict_GetItemString(self->dispersion, "length");
-    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
     disp_dict = PyDict_GetItemString(self->dispersion, "radius");
     self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
@@ -516,6 +489,8 @@
 	// Ugliness necessary to go from python to C
 	    // TODO: refactor this
-    if (!strcmp(par_name, "length")) {
-        self->model->length.dispersion = dispersion;
+    if (!strcmp(par_name, "core_thick")) {
+        self->model->core_thick.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "layer_thick")) {
+        self->model->layer_thick.dispersion = dispersion;
     } else    if (!strcmp(par_name, "radius")) {
         self->model->radius.dispersion = dispersion;
Index: sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 9bd69098b443a3cbda08a1efa070cd1e2ead30ce)
+++ sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -87,9 +87,10 @@
         // Initialize parameter dictionary
         PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
-        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"axis_psi",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"semi_axisA",Py_BuildValue("d",100.000000));
         PyDict_SetItemString(self->params,"semi_axisB",Py_BuildValue("d",35.000000));
         PyDict_SetItemString(self->params,"semi_axisC",Py_BuildValue("d",400.000000));
-        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000));
         PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000005));
@@ -103,4 +104,7 @@
         self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
         PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_psi.dispersion->accept_as_source(visitor, self->model->axis_psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_psi", disp_dict);
 
 
@@ -170,41 +174,5 @@
     return PyArray_Return(result); 
  }
-/**
- * Function to call to evaluate model
- * @param args: input numpy array  [q[],phi[]]
- * @return: numpy array object 
- */
-static PyObject * evaluateTwoDim( TriaxialEllipsoidModel* model, 
-                              PyArrayObject *q, PyArrayObject *phi)
- {
-    PyArrayObject *result;
-    //check validity of input vectors
-    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE
-        || phi->nd != 1 || phi->descr->type_num != PyArray_DOUBLE
-        || phi->dimensions[0] != q->dimensions[0]){
-     
-        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
-        PyErr_SetString(PyExc_ValueError ,"wrong input"); 
-        return NULL;
-    }
-	result= (PyArrayObject *)PyArray_FromDims(q->nd,(int*)(q->dimensions), PyArray_DOUBLE);
-
-	if (result == NULL){
-	    const char * message= "Could not create result ";
-        PyErr_SetString(PyExc_RuntimeError , message);
-	    return NULL;
-	}
-	
-    for (int i = 0; i < q->dimensions[0]; i++) {
-      double q_value = *(double *)(q->data + i*q->strides[0]);
-      double phi_value = *(double *)(phi->data + i*phi->strides[0]);
-      double *result_value = (double *)(result->data + i*result->strides[0]);
-      if (q_value == 0)
-          *result_value = 0.0;
-      else
-          *result_value = model->evaluate_rphi(q_value, phi_value);
-    }
-    return PyArray_Return(result); 
- }
+
  /**
  * Function to call to evaluate model
@@ -270,4 +238,5 @@
 	    // Reader parameter dictionary
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
     self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
     self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
@@ -284,4 +253,6 @@
     disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
     self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
 
 	
@@ -347,4 +318,5 @@
 	    // Reader parameter dictionary
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
     self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
     self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
@@ -361,4 +333,6 @@
     disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
     self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
 
 	
@@ -413,4 +387,5 @@
 	    // Reader parameter dictionary
     self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
     self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
     self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
@@ -427,4 +402,6 @@
     disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
     self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
 
 	
@@ -486,4 +463,6 @@
     } else    if (!strcmp(par_name, "axis_phi")) {
         self->model->axis_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_psi")) {
+        self->model->axis_psi.dispersion = dispersion;
     } else {
 	    PyErr_SetString(CTriaxialEllipsoidModelError,
Index: sansmodels/src/sans/models/c_models/c_models.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/c_models.cpp	(revision eba988511d86410985b5a1c35ce70dd3968132a8)
+++ sansmodels/src/sans/models/c_models/c_models.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -30,4 +30,5 @@
 void addCLamellarPSModel(PyObject *module);
 void addCLamellarPSHGModel(PyObject *module);
+void addCCoreShellSpheroidModel(PyObject *module);
 void addCOblateModel(PyObject *module);
 void addCProlateModel(PyObject *module);
@@ -225,4 +226,5 @@
 	addCLamellarPSModel(m);
 	addCLamellarPSHGModel(m);
+	addCCoreShellSpheroidModel(m);
 	addCOblateModel(m);
 	addCProlateModel(m);
Index: sansmodels/src/sans/models/c_models/lamellar.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/lamellar.cpp	(revision 42f193aa18a9b086b81b4861e33abca433f0ba94)
+++ sansmodels/src/sans/models/c_models/lamellar.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -34,9 +34,8 @@
 LamellarModel :: LamellarModel() {
 	scale      = Parameter(1.0);
-	delta     = Parameter(50.0);
-	delta.set_min(0.0);
-	sigma    = Parameter(0.15);
-	sigma.set_min(0.0);
-	contrast   = Parameter(5.3e-6);
+	bi_thick     = Parameter(50.0, true);
+	bi_thick.set_min(0.0);
+	sld_bi    = Parameter(1.0e-6);
+	sld_sol    = Parameter(6.3e-6);
 	background = Parameter(0.0);
 
@@ -55,10 +54,26 @@
 	// Add the background after averaging
 	dp[0] = scale();
-	dp[1] = delta();
-	dp[2] = sigma();
-	dp[3] = contrast();
-	dp[4] = background();
+	dp[1] = bi_thick();
+	dp[2] = sld_bi();
+	dp[3] = sld_sol();
+	dp[4] = 0.0;
 
-	return LamellarFF(dp, q);
+	// Get the dispersion points for the bi_thick
+	vector<WeightPoint> weights_bi_thick;
+	bi_thick.get_weights(weights_bi_thick);
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over short_edgeA weight points
+	for(int i=0; i< (int)weights_bi_thick.size(); i++) {
+		dp[1] = weights_bi_thick[i].value;
+
+		sum += weights_bi_thick[i].weight * lamellar_kernel(dp, q);
+		norm += weights_bi_thick[i].weight;
+
+	}
+
+	return sum/norm + background();
 }
 
Index: sansmodels/src/sans/models/c_models/models.hh
===================================================================
--- sansmodels/src/sans/models/c_models/models.hh	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/c_models/models.hh	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -46,5 +46,5 @@
 class ParallelepipedModel{
 public:
-	// TODO: add 2D 
+	// TODO: add 2D
 	// Model parameters
 	Parameter scale;
@@ -56,4 +56,5 @@
 	Parameter parallel_theta;
 	Parameter parallel_phi;
+	Parameter parallel_psi;
 
 	// Constructor
@@ -277,5 +278,6 @@
 	Parameter axis_theta;
 	Parameter axis_phi;
-	
+	Parameter axis_psi;
+
 	// Constructor
 	TriaxialEllipsoidModel();
@@ -298,5 +300,5 @@
 	Parameter axis_theta;
 	Parameter axis_phi;
-	
+
 	// Constructor
 	FlexibleCylinderModel();
@@ -312,16 +314,16 @@
 	// Model parameters
 	Parameter scale;
-	Parameter length;
-	Parameter radius;
-	Parameter thickness;
+	Parameter core_thick;
+	Parameter radius;
+	Parameter layer_thick;
 	Parameter core_sld;
 	Parameter layer_sld;
 	Parameter solvent_sld;
-	Parameter nlayers;
-	Parameter spacing;
-	Parameter background;
-	Parameter axis_theta;
-	Parameter axis_phi;
-	
+	Parameter n_stacking;
+	Parameter sigma_d;
+	Parameter background;
+	Parameter axis_theta;
+	Parameter axis_phi;
+
 	// Constructor
 	StackedDisksModel();
@@ -337,9 +339,9 @@
 	// Model parameters
 	Parameter scale;
-	Parameter delta;
-	Parameter sigma;
-	Parameter contrast;
-	Parameter background;
-	
+	Parameter bi_thick;
+	Parameter sld_bi;
+	Parameter sld_sol;
+	Parameter background;
+
 	// Constructor
 	LamellarModel();
@@ -362,5 +364,5 @@
 	Parameter sld_solvent;
 	Parameter background;
-	
+
 	// Constructor
 	LamellarFFHGModel();
@@ -386,5 +388,5 @@
 	Parameter caille;
 	Parameter background;
-	
+
 	// Constructor
 	LamellarPSModel();
@@ -409,7 +411,30 @@
 	Parameter caille;
 	Parameter background;
-	
+
 	// Constructor
 	LamellarPSHGModel();
+
+	// Operators to get I(Q)
+	double operator()(double q);
+	double operator()(double qx, double qy);
+	double evaluate_rphi(double q, double phi);
+};
+
+class CoreShellSpheroidModel{
+public:
+	// Model parameters
+	Parameter scale;
+	Parameter equat_core;
+	Parameter polar_core;
+	Parameter equat_shell;
+	Parameter polar_shell;
+	Parameter contrast;
+	Parameter sld_solvent;
+	Parameter background;
+	Parameter axis_theta;
+	Parameter axis_phi;
+
+	// Constructor
+	CoreShellSpheroidModel();
 
 	// Operators to get I(Q)
@@ -432,5 +457,5 @@
 	Parameter axis_theta;
 	Parameter axis_phi;
-	
+
 	// Constructor
 	OblateModel();
@@ -454,5 +479,5 @@
 	Parameter axis_theta;
 	Parameter axis_phi;
-	
+
 	// Constructor
 	ProlateModel();
@@ -474,8 +499,8 @@
 	Parameter axis_theta;
 	Parameter axis_phi;
-	
+
 	//Constructor
 	HollowCylinderModel();
-	
+
 	//Operators to get I(Q)
 	double operator()(double q);
@@ -495,8 +520,8 @@
 	Parameter n_pairs;
 	Parameter background;
-	
+
 	//Constructor
 	MultiShellModel();
-	
+
 	//Operators to get I(Q)
 	double operator()(double q);
@@ -514,8 +539,8 @@
 	Parameter shell_sld;
 	Parameter background;
-	
+
 	//Constructor
 	VesicleModel();
-	
+
 	//Operators to get I(Q)
 	double operator()(double q);
@@ -535,8 +560,8 @@
 	Parameter solvent_sld;
 	Parameter background;
-	
+
 	//Constructor
 	BinaryHSModel();
-	
+
 	//Operators to get I(Q)
 	double operator()(double q);
@@ -556,8 +581,8 @@
 	Parameter solvent_sld;
 	Parameter background;
-	
+
 	//Constructor
 	BinaryHSPSF11Model();
-	
+
 	//Operators to get I(Q)
 	double operator()(double q);
Index: sansmodels/src/sans/models/c_models/oblate.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/oblate.cpp	(revision 96b593847bbd8eb6072269e750a93261a4f743b3)
+++ sansmodels/src/sans/models/c_models/oblate.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -121,5 +121,5 @@
  * @return: function value
  */
-
+/*
 double OblateModel :: operator()(double qx, double qy) {
 	double q = sqrt(qx*qx + qy*qy);
@@ -127,5 +127,5 @@
 	return (*this).operator()(q);
 }
-
+*/
 
 /**
@@ -140,6 +140,6 @@
 }
 
-/* disable below for now
-double OblateShellModel :: operator()(double qx, double qy) {
+
+double OblateModel :: operator()(double qx, double qy) {
 	OblateParameters dp;
 	// Fill parameter array
@@ -233,3 +233,3 @@
 	return sum/norm + background();
 }
-*///
+
Index: sansmodels/src/sans/models/c_models/parallelepiped.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/parallelepiped.cpp	(revision 8a487138bf42fe6104144ee6073b5989aa12bcd6)
+++ sansmodels/src/sans/models/c_models/parallelepiped.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -45,4 +45,5 @@
 	parallel_theta  = Parameter(0.0, true);
 	parallel_phi    = Parameter(0.0, true);
+	parallel_psi    = Parameter(0.0, true);
 }
 
@@ -54,5 +55,5 @@
  */
 double ParallelepipedModel :: operator()(double q) {
-	double dp[5];
+	double dp[6];
 
 	// Fill parameter array for IGOR library
@@ -63,5 +64,4 @@
 	dp[3] = longuest_edgeC();
 	dp[4] = contrast();
-	//dp[5] = background();
 	dp[5] = 0.0;
 
@@ -69,5 +69,5 @@
 	vector<WeightPoint> weights_short_edgeA;
 	short_edgeA.get_weights(weights_short_edgeA);
-	
+
 	// Get the dispersion points for the longer_edgeB
 	vector<WeightPoint> weights_longer_edgeB;
@@ -83,5 +83,5 @@
 	double sum = 0.0;
 	double norm = 0.0;
-	
+
 	// Loop over short_edgeA weight points
 	for(int i=0; i< (int)weights_short_edgeA.size(); i++) {
@@ -96,5 +96,5 @@
 				dp[3] = weights_longuest_edgeC[j].value;
 
-				sum += weights_short_edgeA[i].weight * weights_longer_edgeB[j].weight 
+				sum += weights_short_edgeA[i].weight * weights_longer_edgeB[j].weight
 					* weights_longuest_edgeC[k].weight * Parallelepiped(dp, q);
 
@@ -124,5 +124,6 @@
 	dp.parallel_theta  = parallel_theta();
 	dp.parallel_phi    = parallel_phi();
-	
+	dp.parallel_psi    = parallel_psi();
+
 
 	// Get the dispersion points for the short_edgeA
@@ -146,4 +147,7 @@
 	parallel_phi.get_weights(weights_parallel_phi);
 
+	// Get angular averaging for psi
+	vector<WeightPoint> weights_parallel_psi;
+	parallel_psi.get_weights(weights_parallel_psi);
 
 	// Perform the computation, with all weight points
@@ -171,20 +175,27 @@
 						dp.parallel_phi = weights_parallel_phi[m].value;
 
-						double _ptvalue = weights_short_edgeA[i].weight
-							* weights_longer_edgeB[j].weight
-							* weights_longuest_edgeC[k].weight
-							* weights_parallel_theta[l].weight
-							* weights_parallel_phi[m].weight
-							* parallelepiped_analytical_2DXY(&dp, qx, qy);
-						if (weights_parallel_theta.size()>1) {
-							_ptvalue *= sin(weights_parallel_theta[l].value);
+						// Average over phi distribution
+						for(int n=0; n< (int)weights_parallel_psi.size(); n++) {
+							dp.parallel_psi = weights_parallel_psi[n].value;
+
+							double _ptvalue = weights_short_edgeA[i].weight
+								* weights_longer_edgeB[j].weight
+								* weights_longuest_edgeC[k].weight
+								* weights_parallel_theta[l].weight
+								* weights_parallel_phi[m].weight
+								* weights_parallel_psi[n].weight
+								* parallelepiped_analytical_2DXY(&dp, qx, qy);
+							if (weights_parallel_theta.size()>1) {
+								_ptvalue *= sin(weights_parallel_theta[l].value);
+							}
+							sum += _ptvalue;
+
+							norm += weights_short_edgeA[i].weight
+								* weights_longer_edgeB[j].weight
+								* weights_longuest_edgeC[k].weight
+								* weights_parallel_theta[l].weight
+								* weights_parallel_phi[m].weight
+								* weights_parallel_psi[n].weight;
 						}
-						sum += _ptvalue;
-
-						norm += weights_short_edgeA[i].weight
-							* weights_longer_edgeB[j].weight
-							* weights_longuest_edgeC[k].weight
-							* weights_parallel_theta[l].weight
-							* weights_parallel_phi[m].weight;
 					}
 
Index: sansmodels/src/sans/models/c_models/spheroid.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/spheroid.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
+++ sansmodels/src/sans/models/c_models/spheroid.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -0,0 +1,238 @@
+/**
+	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
+ */
+
+/**
+ * Scattering model classes
+ * The classes use the IGOR library found in
+ *   sansmodels/src/libigor
+ *
+ *	TODO: refactor so that we pull in the old sansmodels.c_extensions
+ */
+
+#include <math.h>
+#include "models.hh"
+#include "parameters.hh"
+#include <stdio.h>
+using namespace std;
+
+extern "C" {
+	#include "libCylinder.h"
+	#include "spheroid.h"
+}
+
+CoreShellSpheroidModel :: CoreShellSpheroidModel() {
+	scale      = Parameter(1.0);
+	equat_core     = Parameter(200.0, true);
+	equat_core.set_min(0.0);
+	polar_core     = Parameter(20.0, true);
+	polar_core.set_min(0.0);
+	equat_shell   = Parameter(250.0, true);
+	equat_shell.set_min(0.0);
+	polar_shell    = Parameter(30.0, true);
+	polar_shell.set_min(0.0);
+	contrast   = Parameter(1e-6);
+	sld_solvent = Parameter(6.3e-6);
+	background = Parameter(0.0);
+	axis_theta  = Parameter(0.0, true);
+	axis_phi    = Parameter(0.0, true);
+
+}
+
+/**
+ * Function to evaluate 1D scattering function
+ * The NIST IGOR library is used for the actual calculation.
+ * @param q: q-value
+ * @return: function value
+ */
+double CoreShellSpheroidModel :: operator()(double q) {
+	double dp[8];
+
+	// Fill parameter array for IGOR library
+	// Add the background after averaging
+	dp[0] = scale();
+	dp[1] = equat_core();
+	dp[2] = polar_core();
+	dp[3] = equat_shell();
+	dp[4] = polar_shell();
+	dp[5] = contrast();
+	dp[6] = sld_solvent();
+	dp[7] = 0.0;
+
+	// Get the dispersion points for the major core
+	vector<WeightPoint> weights_equat_core;
+	equat_core.get_weights(weights_equat_core);
+
+	// Get the dispersion points for the minor core
+	vector<WeightPoint> weights_polar_core;
+	polar_core.get_weights(weights_polar_core);
+
+	// Get the dispersion points for the major shell
+	vector<WeightPoint> weights_equat_shell;
+	equat_shell.get_weights(weights_equat_shell);
+
+	// Get the dispersion points for the minor_shell
+	vector<WeightPoint> weights_polar_shell;
+	polar_shell.get_weights(weights_polar_shell);
+
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over major core weight points
+	for(int i=0; i<(int)weights_equat_core.size(); i++) {
+		dp[1] = weights_equat_core[i].value;
+
+		// Loop over minor core weight points
+		for(int j=0; j<(int)weights_polar_core.size(); j++) {
+			dp[2] = weights_polar_core[j].value;
+
+			// Loop over major shell weight points
+			for(int k=0; k<(int)weights_equat_shell.size(); k++) {
+				dp[3] = weights_equat_shell[k].value;
+
+				// Loop over minor shell weight points
+				for(int l=0; l<(int)weights_polar_shell.size(); l++) {
+					dp[4] = weights_polar_shell[l].value;
+
+					sum += weights_equat_core[i].weight* weights_polar_core[j].weight * weights_equat_shell[k].weight
+						* weights_polar_shell[l].weight * OblateForm(dp, q);
+					norm += weights_equat_core[i].weight* weights_polar_core[j].weight * weights_equat_shell[k].weight
+							* weights_polar_shell[l].weight;
+				}
+			}
+		}
+	}
+	return sum/norm + background();
+}
+
+/**
+ * Function to evaluate 2D scattering function
+ * @param q_x: value of Q along x
+ * @param q_y: value of Q along y
+ * @return: function value
+ */
+/*
+double OblateModel :: operator()(double qx, double qy) {
+	double q = sqrt(qx*qx + qy*qy);
+
+	return (*this).operator()(q);
+}
+*/
+
+/**
+ * Function to evaluate 2D scattering function
+ * @param pars: parameters of the oblate
+ * @param q: q-value
+ * @param phi: angle phi
+ * @return: function value
+ */
+double CoreShellSpheroidModel :: evaluate_rphi(double q, double phi) {
+	return (*this).operator()(q);
+}
+
+
+double CoreShellSpheroidModel :: operator()(double qx, double qy) {
+	SpheroidParameters dp;
+	// Fill parameter array
+	dp.scale      = scale();
+	dp.equat_core = equat_core();
+	dp.polar_core = polar_core();
+	dp.equat_shell = equat_shell();
+	dp.polar_shell = polar_shell();
+	dp.contrast = contrast();
+	dp.sld_solvent = sld_solvent();
+	dp.background = background();
+	dp.axis_theta = axis_theta();
+	dp.axis_phi = axis_phi();
+
+	// Get the dispersion points for the major core
+	vector<WeightPoint> weights_equat_core;
+	equat_core.get_weights(weights_equat_core);
+
+	// Get the dispersion points for the minor core
+	vector<WeightPoint> weights_polar_core;
+	polar_core.get_weights(weights_polar_core);
+
+	// Get the dispersion points for the major shell
+	vector<WeightPoint> weights_equat_shell;
+	equat_shell.get_weights(weights_equat_shell);
+
+	// Get the dispersion points for the minor shell
+	vector<WeightPoint> weights_polar_shell;
+	polar_shell.get_weights(weights_polar_shell);
+
+
+	// Get angular averaging for theta
+	vector<WeightPoint> weights_theta;
+	axis_theta.get_weights(weights_theta);
+
+	// Get angular averaging for phi
+	vector<WeightPoint> weights_phi;
+	axis_phi.get_weights(weights_phi);
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over major core weight points
+	for(int i=0; i< (int)weights_equat_core.size(); i++) {
+		dp.equat_core = weights_equat_core[i].value;
+
+		// Loop over minor core weight points
+		for(int j=0; j< (int)weights_polar_core.size(); j++) {
+			dp.polar_core = weights_polar_core[j].value;
+
+			// Loop over major shell weight points
+			for(int k=0; k< (int)weights_equat_shell.size(); k++) {
+				dp.equat_shell = weights_equat_shell[i].value;
+
+				// Loop over minor shell weight points
+				for(int l=0; l< (int)weights_polar_shell.size(); l++) {
+					dp.polar_shell = weights_polar_shell[l].value;
+
+					// Average over theta distribution
+					for(int m=0; m< (int)weights_theta.size(); m++) {
+						dp.axis_theta = weights_theta[m].value;
+
+						// Average over phi distribution
+						for(int n=0; n< (int)weights_phi.size(); n++) {
+							dp.axis_phi = weights_phi[n].value;
+
+							double _ptvalue = weights_equat_core[i].weight *weights_polar_core[j].weight
+								* weights_equat_shell[k].weight * weights_polar_shell[l].weight
+								* weights_theta[m].weight
+								* weights_phi[n].weight
+								* spheroid_analytical_2DXY(&dp, qx, qy);
+							if (weights_theta.size()>1) {
+								_ptvalue *= sin(weights_theta[m].value);
+							}
+							sum += _ptvalue;
+
+							norm += weights_equat_core[i].weight *weights_polar_core[j].weight
+								* weights_equat_shell[k].weight * weights_polar_shell[l].weight
+								* weights_theta[m].weight * weights_phi[n].weight;
+						}
+					}
+				}
+			}
+		}
+	}
+	// Averaging in theta needs an extra normalization
+	// factor to account for the sin(theta) term in the
+	// integration (see documentation).
+	if (weights_theta.size()>1) norm = norm / asin(1.0);
+	return sum/norm + background();
+}
+
Index: sansmodels/src/sans/models/c_models/stackeddisks.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/stackeddisks.cpp	(revision 9188cc14902588c2800a2821590f8bac1dd436e7)
+++ sansmodels/src/sans/models/c_models/stackeddisks.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -37,13 +37,13 @@
 	radius     = Parameter(3000.0, true);
 	radius.set_min(0.0);
-	length     = Parameter(10.0, true);
-	length.set_min(0.0);
-	thickness     = Parameter(15.0);
-	thickness.set_min(0.0);
+	core_thick  = Parameter(10.0, true);
+	core_thick.set_min(0.0);
+	layer_thick     = Parameter(15.0);
+	layer_thick.set_min(0.0);
 	core_sld = Parameter(4.0e-6);
 	layer_sld  = Parameter(-4.0e-7);
 	solvent_sld  = Parameter(5.0e-6);
-	nlayers   = Parameter(1);
-	spacing   = Parameter(0);
+	n_stacking   = Parameter(1);
+	sigma_d   = Parameter(0);
 	background = Parameter(0.001);
 	axis_theta  = Parameter(0.0, true);
@@ -64,16 +64,12 @@
 	dp[0] = scale();
 	dp[1] = radius();
-	dp[2] = length();
-	dp[3] = thickness();
+	dp[2] = core_thick();
+	dp[3] = layer_thick();
 	dp[4] = core_sld();
 	dp[5] = layer_sld();
 	dp[6] = solvent_sld();
-	dp[7] = nlayers();
-	dp[8] = spacing();
+	dp[7] = n_stacking();
+	dp[8] = sigma_d();
 	dp[9] = 0.0;
-
-	// Get the dispersion points for the length
-	vector<WeightPoint> weights_length;
-	length.get_weights(weights_length);
 
 	// Get the dispersion points for the radius
@@ -81,7 +77,11 @@
 	radius.get_weights(weights_radius);
 
-	// Get the dispersion points for the thickness
-	vector<WeightPoint> weights_thickness;
-	thickness.get_weights(weights_thickness);
+	// Get the dispersion points for the core_thick
+	vector<WeightPoint> weights_core_thick;
+	core_thick.get_weights(weights_core_thick);
+
+	// Get the dispersion points for the layer_thick
+	vector<WeightPoint> weights_layer_thick;
+	layer_thick.get_weights(weights_layer_thick);
 
 	// Perform the computation, with all weight points
@@ -90,19 +90,19 @@
 
 	// Loop over length weight points
-	for(int i=0; i< (int)weights_length.size(); i++) {
-		dp[1] = weights_length[i].value;
+	for(int i=0; i< (int)weights_radius.size(); i++) {
+		dp[1] = weights_radius[i].value;
 
 		// Loop over radius weight points
-		for(int j=0; j< (int)weights_radius.size(); j++) {
-			dp[2] = weights_radius[j].value;
+		for(int j=0; j< (int)weights_core_thick.size(); j++) {
+			dp[2] = weights_core_thick[j].value;
 
 			// Loop over thickness weight points
-			for(int k=0; k< (int)weights_radius.size(); k++) {
-				dp[3] = weights_radius[k].value;
-
-				sum += weights_length[i].weight
-					* weights_radius[j].weight * weights_thickness[k].weight* StackedDiscs(dp, q);
-				norm += weights_length[i].weight
-					* weights_radius[j].weight* weights_thickness[k].weight;
+			for(int k=0; k< (int)weights_layer_thick.size(); k++) {
+				dp[3] = weights_layer_thick[k].value;
+
+				sum += weights_radius[i].weight
+					* weights_core_thick[j].weight * weights_layer_thick[k].weight* StackedDiscs(dp, q);
+				norm += weights_radius[i].weight
+					* weights_core_thick[j].weight* weights_layer_thick[k].weight;
 			}
 		}
@@ -121,12 +121,12 @@
 	// Fill parameter array
 	dp.scale      = scale();
-	dp.length     = length();
+	dp.core_thick    = core_thick();
 	dp.radius	  = radius();
-	dp.thickness  = thickness();
+	dp.core_thick  = core_thick();
 	dp.core_sld   = core_sld();
 	dp.layer_sld  = layer_sld();
 	dp.solvent_sld= solvent_sld();
-	dp.nlayers	  = nlayers();
-	dp.spacing    = spacing();
+	dp.n_stacking	  = n_stacking();
+	dp.sigma_d   = sigma_d();
 	dp.background = 0.0;
 	dp.axis_theta = axis_theta();
@@ -134,6 +134,6 @@
 
 	// Get the dispersion points for the length
-	vector<WeightPoint> weights_length;
-	length.get_weights(weights_length);
+	vector<WeightPoint> weights_core_thick;
+	core_thick.get_weights(weights_core_thick);
 
 	// Get the dispersion points for the radius
@@ -142,6 +142,6 @@
 
 	// Get the dispersion points for the thickness
-	vector<WeightPoint> weights_thickness;
-	thickness.get_weights(weights_thickness);
+	vector<WeightPoint> weights_layer_thick;
+	layer_thick.get_weights(weights_layer_thick);
 
 	// Get angular averaging for theta
@@ -158,6 +158,6 @@
 
 	// Loop over length weight points
-	for(int i=0; i< (int)weights_length.size(); i++) {
-		dp.length = weights_length[i].value;
+	for(int i=0; i< (int)weights_core_thick.size(); i++) {
+		dp.core_thick = weights_core_thick[i].value;
 
 		// Loop over radius weight points
@@ -166,6 +166,6 @@
 
 				// Loop over thickness weight points
-				for(int k=0; k< (int)weights_thickness.size(); k++) {
-				dp.thickness = weights_thickness[k].value;
+				for(int k=0; k< (int)weights_layer_thick.size(); k++) {
+				dp.layer_thick = weights_layer_thick[k].value;
 
 					for(int l=0; l< (int)weights_theta.size(); l++) {
@@ -176,7 +176,7 @@
 							dp.axis_phi = weights_phi[m].value;
 
-							double _ptvalue = weights_length[i].weight
+							double _ptvalue = weights_core_thick[i].weight
 								* weights_radius[j].weight
-								* weights_thickness[k].weight
+								* weights_layer_thick[k].weight
 								* weights_theta[l].weight
 								* weights_phi[m].weight
@@ -187,7 +187,7 @@
 							sum += _ptvalue;
 
-							norm += weights_length[i].weight
+							norm += weights_core_thick[i].weight
 								* weights_radius[j].weight
-								* weights_thickness[k].weight
+								* weights_layer_thick[k].weight
 								* weights_theta[l].weight
 								* weights_phi[m].weight;
Index: sansmodels/src/sans/models/c_models/triaxialellipsoid.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/triaxialellipsoid.cpp	(revision 9188cc14902588c2800a2821590f8bac1dd436e7)
+++ sansmodels/src/sans/models/c_models/triaxialellipsoid.cpp	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
@@ -44,4 +44,5 @@
 	axis_theta  = Parameter(0.0, true);
 	axis_phi    = Parameter(0.0, true);
+	axis_psi    = Parameter(0.0, true);
 }
 
@@ -53,5 +54,5 @@
  */
 double TriaxialEllipsoidModel :: operator()(double q) {
-	double dp[5];
+	double dp[6];
 
 	// Fill parameter array for IGOR library
@@ -119,4 +120,5 @@
 	dp.axis_theta  = axis_theta();
 	dp.axis_phi    = axis_phi();
+	dp.axis_psi    = axis_psi();
 
 	// Get the dispersion points for the semi_axis A
@@ -140,4 +142,8 @@
 	axis_phi.get_weights(weights_phi);
 
+	// Get angular averaging for psi
+	vector<WeightPoint> weights_psi;
+	axis_psi.get_weights(weights_psi);
+
 	// Perform the computation, with all weight points
 	double sum = 0.0;
@@ -163,21 +169,27 @@
 					for(int m=0; m <(int)weights_phi.size(); m++) {
 						dp.axis_phi = weights_phi[m].value;
-
-						double _ptvalue = weights_semi_axisA[i].weight
-							* weights_semi_axisB[j].weight
-							* weights_semi_axisC[k].weight
-							* weights_theta[l].weight
-							* weights_phi[m].weight
-							* triaxial_ellipsoid_analytical_2DXY(&dp, qx, qy);
-						if (weights_theta.size()>1) {
-							_ptvalue *= sin(weights_theta[k].value);
+						// Average over psi distribution
+						for(int n=0; n <(int)weights_psi.size(); n++) {
+							dp.axis_psi = weights_psi[n].value;
+
+							double _ptvalue = weights_semi_axisA[i].weight
+								* weights_semi_axisB[j].weight
+								* weights_semi_axisC[k].weight
+								* weights_theta[l].weight
+								* weights_phi[m].weight
+								* weights_psi[n].weight
+								* triaxial_ellipsoid_analytical_2DXY(&dp, qx, qy);
+							if (weights_theta.size()>1) {
+								_ptvalue *= sin(weights_theta[k].value);
+							}
+							sum += _ptvalue;
+
+							norm += weights_semi_axisA[i].weight
+								* weights_semi_axisB[j].weight
+								* weights_semi_axisC[k].weight
+								* weights_theta[l].weight
+								* weights_phi[m].weight
+								* weights_psi[m].weight;
 						}
-						sum += _ptvalue;
-
-						norm += weights_semi_axisA[i].weight
-							* weights_semi_axisB[j].weight
-							* weights_semi_axisC[k].weight
-							* weights_theta[l].weight
-							* weights_phi[m].weight;
 					}
 
