Index: sansmodels/src/libigor/libCylinder.c
===================================================================
--- sansmodels/src/libigor/libCylinder.c	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/libigor/libCylinder.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -881,5 +881,5 @@
 	contr = dp[3];
 	bkg = dp[4];
-	
+	qval = q;
 	
 	Pq = 2.0*contr*contr/qval/qval*(1.0-cos(qval*del)*exp(-0.5*qval*qval*sig*sig));
Index: sansmodels/src/sans/models/LamellarFFHGModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarFFHGModel.py	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/LamellarFFHGModel.py	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+"""
+	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
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\lamellarFF_HG.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CLamellarFFHGModel
+import copy    
+    
+class LamellarFFHGModel(CLamellarFFHGModel, BaseComponent):
+    """ Class that evaluates a LamellarFFHGModel model. 
+    	This file was auto-generated from ..\c_extensions\lamellarFF_HG.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         t_length        = 15.0 [A]
+         h_thickness     = 10.0 [A]
+         sld_tail        = 4e-007 [1/A²]
+         sld_head        = 3e-006 [1/A²]
+         sld_solvent     = 6e-006 [1/A²]
+         background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CLamellarFFHGModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "LamellarFFHGModel"
+        ## Model description
+        self.description ="""
+		NOTE: The total bilayer thickness = 2(h_thickness + t_length)
+		The meaning of the multiplicative scale factor is not well-defined, but should be on the
+		order of the volume fraction of solution occupied by the lamellar crystallites. Please see
+		the original references for clarification."""
+       
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['t_length'] = ['[A]', None, None]
+        self.details['h_thickness'] = ['[A]', None, None]
+        self.details['sld_tail'] = ['[1/A²]', None, None]
+        self.details['sld_head'] = ['[1/A²]', None, None]
+        self.details['sld_solvent'] = ['[1/A²]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['t_length.width', 'h_thickness.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarFFHGModel())   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return CLamellarFFHGModel.run(self, x)
+   
+    def runXY(self, x = 0.0):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q, or [qx, qy]
+            @return: scattering function P(q)
+        """
+        
+        return CLamellarFFHGModel.runXY(self, x)
+        
+    def set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CLamellarFFHGModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/LamellarModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarModel.py	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/LamellarModel.py	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+"""
+	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
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\lamellar.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CLamellarModel
+import copy    
+    
+class LamellarModel(CLamellarModel, BaseComponent):
+    """ Class that evaluates a LamellarModel model. 
+    	This file was auto-generated from ..\c_extensions\lamellar.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         delta           = 50.0 [A]
+         sigma           = 0.15 
+         contrast        = 5.3e-006 [1/A²]
+         background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CLamellarModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "LamellarModel"
+        ## Model description
+        self.description =""" I(q)= 2*pi*P(q)/(delta *q^(2))
+		where:
+		P(q)=2*(contrast/q)^(2)*(1-cos(q*delta)*e^(1/2*(q*sigma)^(2))"""
+       
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['delta'] = ['[A]', None, None]
+        self.details['sigma'] = ['', None, None]
+        self.details['contrast'] = ['[1/A²]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['delta.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarModel())   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return CLamellarModel.run(self, x)
+   
+    def runXY(self, x = 0.0):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q, or [qx, qy]
+            @return: scattering function P(q)
+        """
+        
+        return CLamellarModel.runXY(self, x)
+        
+    def set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CLamellarModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/c_extensions/c_models.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/c_models.c	(revision 27a0771a6ddbafb74959fa451e80b17dcd5ca5ed)
+++ sansmodels/src/sans/models/c_extensions/c_models.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -46,4 +46,6 @@
 	addCProlateModel(m);
 	addCOblateModel(m);
+	addCLamellarModel(m);
+	addCLamellarFFHGModel(m);
 	addDisperser(m);
 	addCGaussian(m);
Index: sansmodels/src/sans/models/c_extensions/lamellar.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellar.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_extensions/lamellar.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,43 @@
+/**
+ * Scattering model for lamellar
+ * @author: Gervaise B. Alina / UTK
+ */
+
+#include "lamellar.h"
+#include <math.h>
+#include "libCylinder.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/**
+ * Function to evaluate 1D scattering function
+ * @param pars: parameters of the lamellar
+ * @param q: q-value
+ * @return: function value
+ */
+double lamellar_analytical_1D(LamellarParameters *pars, double q) {
+	double dp[5];
+	
+	// Fill paramater array
+	dp[0] = pars->scale;
+	dp[1] = pars->delta;
+	dp[2] = pars->sigma;
+	dp[3] = pars->contrast;
+	dp[4] = pars->background;
+	
+	
+	// Call library function to evaluate model
+	return LamellarFF(dp, q);	
+}
+
+double lamellar_analytical_2D(LamellarParameters *pars, double q, double phi){
+	return 1.0;
+}
+double lamellar_analytical_2DXY(LamellarParameters *pars, double qx, double qy){
+	return 1.0;
+}
+double lamellar_analytical_2D_scaled(LamellarParameters *pars, double q, double q_x, double q_y){
+	return 1.0;
+}
+
Index: sansmodels/src/sans/models/c_extensions/lamellar.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellar.h	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_extensions/lamellar.h	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,43 @@
+#if !defined(lamellar_h)
+#define lamellar_h
+/** Structure definition for lamellar parameters
+ * [PYTHONCLASS] = LamellarModel
+ * [DISP_PARAMS] =  delta
+   [DESCRIPTION] = <text> I(q)= 2*pi*P(q)/(delta *q^(2))
+						where:
+						P(q)=2*(contrast/q)^(2)*(1-cos(q*delta)*e^(1/2*(q*sigma)^(2))
+				   </text>
+	[FIXED]= delta.width 
+	[ORIENTATION_PARAMS]= 
+ **/
+typedef struct {
+    /// Scale factor
+    //  [DEFAULT]=scale=1.0
+    double scale;
+    /// delta bilayer thickness [A]
+    //  [DEFAULT]=delta=50.0 [A]
+    double delta;
+    /// variation in bilayer thickness 
+    //  [DEFAULT]=sigma=0.15
+    double sigma;
+    /// Contrast [1/A²]
+    //  [DEFAULT]=contrast=5.3e-6 [1/A²]
+    double contrast;
+	/// Incoherent Background [1/cm] 0.00
+	//  [DEFAULT]=background=0.0 [1/cm]
+	double background;
+   
+
+} LamellarParameters;
+
+
+
+/// 1D scattering function
+double lamellar_analytical_1D(LamellarParameters *pars, double q);
+
+/// 2D scattering function
+double lamellar_analytical_2D(LamellarParameters *pars, double q, double phi);
+double lamellar_analytical_2DXY(LamellarParameters *pars, double qx, double qy);
+double lamellar_analytical_2D_scaled(LamellarParameters *pars, double q, double q_x, double q_y);
+
+#endif
Index: sansmodels/src/sans/models/c_extensions/lamellarFF_HG.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellarFF_HG.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_extensions/lamellarFF_HG.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,44 @@
+/**
+ * Scattering model for the form factor from a lyotropic lamellar phase
+ * @author: Gervaise B. Alina / UTK
+ */
+
+#include "lamellarFF_HG.h"
+#include <math.h>
+#include "libCylinder.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/**
+ * Function to evaluate 1D scattering function
+ * @param pars: parameters of the form factor from a lyotropic lamellar phase
+ * @param q: q-value
+ * @return: function value
+ */
+double lamellarFF_HG_analytical_1D(LamellarFF_HGParameters *pars, double q) {
+	double dp[7];
+	
+	// Fill paramater array
+	dp[0] = pars->scale;
+	dp[1] = pars->t_length;
+	dp[2] = pars->h_thickness;
+	dp[3] = pars->sld_tail;
+	dp[4] = pars->sld_head;
+	dp[5] = pars->sld_solvent;
+	dp[6] = pars->background;
+	
+	// Call library function to evaluate model
+	return LamellarFF_HG(dp, q);	
+}
+
+double lamellarFF_HG_analytical_2D(LamellarFF_HGParameters *pars, double q, double phi){
+	return 1.0;
+}
+double lamellarFF_HG_analytical_2DXY(LamellarFF_HGParameters *pars, double qx, double qy){
+	return 1.0;
+}
+double lamellarFF_HG_analytical_2D_scaled(LamellarFF_HGParameters *pars, double q, double q_x, double q_y){
+	return 1.0;
+}
+
Index: sansmodels/src/sans/models/c_extensions/lamellarFF_HG.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellarFF_HG.h	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_extensions/lamellarFF_HG.h	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,50 @@
+#if !defined(lamellarFF_HG_h)
+#define lamellarFF_HG_h
+/** Structure definition for lamellar parameters
+ * [PYTHONCLASS] = LamellarFFHGModel
+ * [DISP_PARAMS] =  t_length, h_thickness
+   [DESCRIPTION] = <text> 
+					NOTE: The total bilayer thickness = 2(h_thickness + t_length)
+					The meaning of the multiplicative scale factor is not well-defined, but should be on the
+					order of the volume fraction of solution occupied by the lamellar crystallites. Please see
+					the original references for clarification.
+				   </text>
+	[FIXED]= t_length.width, h_thickness.width
+	[ORIENTATION_PARAMS]= 
+ **/
+typedef struct {
+    /// Scale factor
+    //  [DEFAULT]=scale=1.0
+    double scale;
+    /// tail length [A]
+    //  [DEFAULT]=t_length=15.0 [A]
+    double t_length;
+    /// head thickness 
+    //  [DEFAULT]=h_thickness=10.0 [A]
+    double h_thickness;
+	/// tail scrattering density length[1/A²]
+    //  [DEFAULT]=sld_tail=4e-7 [1/A²]
+    double sld_tail;
+    /// head group scrattering density length[1/A²]
+    //  [DEFAULT]=sld_head=3e-6 [1/A²]
+    double sld_head;
+	 /// solvent scrattering density length[1/A²]
+    //  [DEFAULT]=sld_solvent=6e-6 [1/A²]
+    double sld_solvent;
+	/// Incoherent Background [1/cm] 0.00
+	//  [DEFAULT]=background=0.0 [1/cm]
+	double background;
+   
+} LamellarFF_HGParameters;
+
+
+
+/// 1D scattering function
+double lamellarFF_HG_analytical_1D(LamellarFF_HGParameters *pars, double q);
+
+/// 2D scattering function
+double lamellarFF_HG_analytical_2D(LamellarFF_HGParameters *pars, double q, double phi);
+double lamellarFF_HG_analytical_2DXY(LamellarFF_HGParameters *pars, double qx, double qy);
+double lamellarFF_HG_analytical_2D_scaled(LamellarFF_HGParameters *pars, double q, double q_x, double q_y);
+
+#endif
Index: sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.c	(revision 50686972861f70ebff2c64a50118cfb6b905253a)
+++ sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.c	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -18,5 +18,5 @@
  */
 double triaxial_ellipsoid_analytical_1D(TriaxialEllipsoidParameters *pars, double q) {
-	double dp[5];
+	double dp[6];
 	
 	// Fill paramater array
Index: sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,381 @@
+/**
+	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
+ */
+
+/** CLamellarFFHGModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY lamellarFF_HG.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+ 
+extern "C" {
+#include <Python.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include "lamellarFF_HG.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarFFHGModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarFFHGModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarFFHGModel;
+
+
+static void
+CLamellarFFHGModel_dealloc(CLamellarFFHGModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarFFHGModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarFFHGModel *self;
+    
+    self = (CLamellarFFHGModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarFFHGModel_init(CLamellarFFHGModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new LamellarFFHGModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"h_thickness",Py_BuildValue("d",10.000000));
+        PyDict_SetItemString(self->params,"sld_tail",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"t_length",Py_BuildValue("d",15.000000));
+        PyDict_SetItemString(self->params,"sld_head",Py_BuildValue("d",0.000003));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->t_length.dispersion->accept_as_source(visitor, self->model->t_length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "t_length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->h_thickness.dispersion->accept_as_source(visitor, self->model->h_thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "h_thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef CLamellarFFHGModel_members[] = {
+    {"params", T_OBJECT, offsetof(CLamellarFFHGModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(CLamellarFFHGModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(CLamellarFFHGModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarFFHGModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarFFHGModel *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->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.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(CLamellarFFHGModelError, 
+	    	"CLamellarFFHGModel.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(CLamellarFFHGModelError, 
+	    		"CLamellarFFHGModel.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 = CLamellarFFHGModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarFFHGModel_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 = CLamellarFFHGModel_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(CLamellarFFHGModel *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->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.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(CLamellarFFHGModelError, 
+	    	"CLamellarFFHGModel.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(CLamellarFFHGModelError, 
+	    		"CLamellarFFHGModel.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 = CLamellarFFHGModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarFFHGModel_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 = CLamellarFFHGModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarFFHGModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarFFHGModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarFFHGModelError,
+	    	"CLamellarFFHGModel.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, "t_length")) {
+        self->model->t_length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "h_thickness")) {
+        self->model->h_thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarFFHGModelError,
+	    	"CLamellarFFHGModel.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 CLamellarFFHGModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarFFHGModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarFFHGModel",             /*tp_name*/
+    sizeof(CLamellarFFHGModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarFFHGModel_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*/
+    "CLamellarFFHGModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarFFHGModel_methods,             /* tp_methods */
+    CLamellarFFHGModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarFFHGModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarFFHGModel_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 addCLamellarFFHGModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarFFHGModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarFFHGModelType);
+    PyModule_AddObject(module, "CLamellarFFHGModel", (PyObject *)&CLamellarFFHGModelType);
+    
+    d = PyModule_GetDict(module);
+    CLamellarFFHGModelError = PyErr_NewException("CLamellarFFHGModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarFFHGModelError", CLamellarFFHGModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/CLamellarModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,366 @@
+/**
+	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
+ */
+
+/** CLamellarModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY lamellar.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+ 
+extern "C" {
+#include <Python.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include "lamellar.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarModel;
+
+
+static void
+CLamellarModel_dealloc(CLamellarModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarModel *self;
+    
+    self = (CLamellarModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarModel_init(CLamellarModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new LamellarModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"sigma",Py_BuildValue("d",0.150000));
+        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));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->delta.dispersion->accept_as_source(visitor, self->model->delta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "delta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef CLamellarModel_members[] = {
+    {"params", T_OBJECT, offsetof(CLamellarModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(CLamellarModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(CLamellarModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarModel *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->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    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") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.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(CLamellarModelError, 
+	    	"CLamellarModel.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(CLamellarModelError, 
+	    		"CLamellarModel.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 = CLamellarModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarModel_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 = CLamellarModel_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(CLamellarModel *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->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    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") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.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(CLamellarModelError, 
+	    	"CLamellarModel.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(CLamellarModelError, 
+	    		"CLamellarModel.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 = CLamellarModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarModel_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 = CLamellarModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarModelError,
+	    	"CLamellarModel.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, "delta")) {
+        self->model->delta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarModelError,
+	    	"CLamellarModel.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 CLamellarModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarModel",             /*tp_name*/
+    sizeof(CLamellarModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarModel_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*/
+    "CLamellarModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarModel_methods,             /* tp_methods */
+    CLamellarModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarModel_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 addCLamellarModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarModelType);
+    PyModule_AddObject(module, "CLamellarModel", (PyObject *)&CLamellarModelType);
+    
+    d = PyModule_GetDict(module);
+    CLamellarModelError = PyErr_NewException("CLamellarModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarModelError", CLamellarModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/c_models.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/c_models.cpp	(revision 27a0771a6ddbafb74959fa451e80b17dcd5ca5ed)
+++ sansmodels/src/sans/models/c_models/c_models.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -29,4 +29,6 @@
 void addCOblateModel(PyObject *module);
 void addCProlateModel(PyObject *module);
+void addCLamellarModel(PyObject *module);
+void addCLamellarFFHGModel(PyObject *module);
 
 
@@ -177,5 +179,6 @@
 	addCOblateModel(m);
 	addCProlateModel(m);
-
+	addCLamellarModel(m);
+	addCLamellarFFHGModel(m);
 	addDisperser(m);
 	addCGaussian(m);
Index: sansmodels/src/sans/models/c_models/lamellar.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/lamellar.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_models/lamellar.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,128 @@
+/**
+	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 "lamellar.h"
+}
+
+LamellarModel :: LamellarModel() {
+	scale      = Parameter(1.0);
+	delta     = Parameter(50.0, true);
+	delta.set_min(0.0);
+	sigma    = Parameter(0.15, true);
+	contrast   = Parameter(5.3e-6);
+	background = Parameter(0.0);
+
+}
+
+/**
+ * Function to evaluate 1D scattering function
+ * The NIST IGOR library is used for the actual calculation.
+ * @param q: q-value
+ * @return: function value
+ */
+double LamellarModel :: operator()(double q) {
+	double dp[5];
+
+	// Fill parameter array for IGOR library
+	// Add the background after averaging
+	dp[0] = scale();
+	dp[1] = delta();
+	dp[2] = sigma();
+	dp[3] = contrast();
+	dp[4] = background();
+
+
+	// Get the dispersion points for the bilayer thickness(delta)
+	vector<WeightPoint> weights_delta;
+	delta.get_weights(weights_delta);
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over semi axis A weight points
+	for(int i=0; i< (int)weights_delta.size(); i++) {
+		dp[1] = weights_delta[i].value;
+		sum += weights_delta[i].weight* LamellarFF(dp, q);
+		norm += weights_delta[i].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 LamellarModel :: operator()(double qx, double qy) {
+	LamellarParameters dp;
+
+	// Fill parameter array for IGOR library
+	// Add the background after averaging
+	dp.scale = scale();
+	dp.delta = delta();
+	dp.sigma = sigma();
+	dp.contrast = contrast();
+	dp.background = background();
+
+
+	// Get the dispersion points for the bilayer thickness(delta)
+	vector<WeightPoint> weights_delta;
+	delta.get_weights(weights_delta);
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over detla  weight points
+	for(int i=0; i< (int)weights_delta.size(); i++) {
+		dp.delta = weights_delta[i].value;
+		sum += weights_delta[i].weight* lamellar_analytical_2DXY(&dp, qx, qy);
+		norm += weights_delta[i].weight;
+				
+	}
+	return sum/norm + background();
+}
+
+/**
+ * Function to evaluate 2D scattering function
+ * @param pars: parameters of the lamellar
+ * @param q: q-value
+ * @param phi: angle phi
+ * @return: function value
+ */
+double LamellarModel :: evaluate_rphi(double q, double phi) {
+	double qx = q*cos(phi);
+	double qy = q*sin(phi);
+	return (*this).operator()(qx, qy);
+}
Index: sansmodels/src/sans/models/c_models/lamellarFF_HG.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/lamellarFF_HG.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
+++ sansmodels/src/sans/models/c_models/lamellarFF_HG.cpp	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -0,0 +1,153 @@
+/**
+	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 "lamellarFF_HG.h"
+}
+
+LamellarFFHGModel :: LamellarFFHGModel() {
+	scale      = Parameter(1.0);
+	t_length     = Parameter(15.0, true);
+	t_length.set_min(0.0);
+	h_thickness    = Parameter(10.0, true);
+	h_thickness.set_min(0.0);
+	sld_tail   = Parameter(4e-7);
+	sld_head  = Parameter(3e-6);
+	sld_solvent    = Parameter(6e-6);
+	background = Parameter(0.0);
+
+}
+
+/**
+ * Function to evaluate 1D scattering function
+ * The NIST IGOR library is used for the actual calculation.
+ * @param q: q-value
+ * @return: function value
+ */
+double LamellarFFHGModel :: operator()(double q) {
+	double dp[7];
+
+	// Fill parameter array for IGOR library
+	// Add the background after averaging
+	dp[0] = scale();
+	dp[1] = t_length();
+	dp[2] = h_thickness();
+	dp[3] = sld_tail();
+	dp[4] = sld_head();
+	dp[5] = sld_solvent();
+	dp[6] = background();
+
+	// Get the dispersion points for the tail length
+	vector<WeightPoint> weights_t_length;
+	t_length.get_weights(weights_t_length);
+
+	// Get the dispersion points for the head thickness
+	vector<WeightPoint> weights_h_thickness;
+	h_thickness.get_weights(weights_h_thickness);
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over semi axis A weight points
+	for(int i=0; i< (int)weights_t_length.size(); i++) {
+		dp[1] = weights_t_length[i].value;
+
+		for (int j=0; j< (int)weights_h_thickness.size(); j++){
+			dp[2] = weights_h_thickness[j].value;
+
+			sum += weights_t_length[i].weight* weights_h_thickness[j].weight*LamellarFF_HG(dp, q);
+			norm += weights_t_length[i].weight* weights_h_thickness[j].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 LamellarFFHGModel :: operator()(double qx, double qy) {
+	LamellarFF_HGParameters dp;
+
+	// Fill parameter array for IGOR library
+	// Add the background after averaging
+	dp.scale = scale();
+	dp.t_length = t_length();
+	dp.h_thickness = h_thickness();
+	dp.sld_tail = sld_tail();
+	dp.sld_head = sld_head();
+	dp.sld_solvent = sld_solvent();
+	dp.background = background();
+
+
+	// Get the dispersion points for the tail length
+	vector<WeightPoint> weights_t_length;
+	t_length.get_weights(weights_t_length);
+
+	// Get the dispersion points for the head thickness
+	vector<WeightPoint> weights_h_thickness;
+	h_thickness.get_weights(weights_h_thickness);
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over detla  weight points
+	for(int i=0; i< (int)weights_t_length.size(); i++) {
+		dp.t_length = weights_t_length[i].value;
+
+		for(int j=0; j< (int)weights_h_thickness.size(); j++) {
+			dp.h_thickness = weights_h_thickness[j].value;
+
+			sum += weights_t_length[i].weight* weights_h_thickness[j].weight
+				* lamellarFF_HG_analytical_2DXY(&dp, qx, qy);
+			norm += weights_t_length[i].weight* weights_h_thickness[j].weight;
+		}
+				
+	}
+	return sum/norm + background();
+}
+
+/**
+ * Function to evaluate 2D scattering function
+ * @param pars: parameters of the lamellar
+ * @param q: q-value
+ * @param phi: angle phi
+ * @return: function value
+ */
+double LamellarFFHGModel :: evaluate_rphi(double q, double phi) {
+	double qx = q*cos(phi);
+	double qy = q*sin(phi);
+	return (*this).operator()(qx, qy);
+}
Index: sansmodels/src/sans/models/c_models/models.hh
===================================================================
--- sansmodels/src/sans/models/c_models/models.hh	(revision 27a0771a6ddbafb74959fa451e80b17dcd5ca5ed)
+++ sansmodels/src/sans/models/c_models/models.hh	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -332,4 +332,46 @@
 	double evaluate_rphi(double q, double phi);
 };
+
+class LamellarModel{
+public:
+	// Model parameters
+	Parameter scale;
+	Parameter delta;
+	Parameter sigma;
+	Parameter contrast;
+	Parameter background;
+	
+	// Constructor
+	LamellarModel();
+
+	// Operators to get I(Q)
+	double operator()(double q);
+	double operator()(double qx, double qy);
+	double evaluate_rphi(double q, double phi);
+
+};
+
+class LamellarFFHGModel{
+public:
+	// Model parameters
+	Parameter scale;
+	Parameter t_length;
+	Parameter h_thickness;
+	Parameter sld_tail;
+	Parameter sld_head;
+	Parameter sld_solvent;
+	Parameter background;
+	
+	// Constructor
+	LamellarFFHGModel();
+
+	// Operators to get I(Q)
+	double operator()(double q);
+	double operator()(double qx, double qy);
+	double evaluate_rphi(double q, double phi);
+
+};
+
+
 
 class LamellarPSModel{
Index: sansmodels/src/setup.py
===================================================================
--- sansmodels/src/setup.py	(revision 27a0771a6ddbafb74959fa451e80b17dcd5ca5ed)
+++ sansmodels/src/setup.py	(revision 34c30203f24453aa528815f48e84a90b0bbd95be)
@@ -15,4 +15,6 @@
 
 
+if len(sys.argv) == 1:
+    sys.argv.append('install')
 
 
@@ -146,5 +148,5 @@
         "sans/models/c_models/ellipticalcylinder.cpp",                
         srcdir+"/elliptical_cylinder.c",
-         #srcdir+"/CTriaxialEllipsoidModel.c",
+        #srcdir+"/CTriaxialEllipsoidModel.c",
         "sans/models/c_models/CTriaxialEllipsoidModel.cpp",
         "sans/models/c_models/triaxialellipsoid.cpp",                
@@ -158,4 +160,12 @@
         "sans/models/c_models/stackeddisks.cpp",                
         srcdir+"/stacked_disks.c",
+        #srcdir+"/CLamellarModel.c",
+        "sans/models/c_models/CLamellarModel.cpp",
+        "sans/models/c_models/lamellar.cpp",                
+        srcdir+"/lamellar.c",
+        #srcdir+"/CLamellarFFHGModel.c",
+        "sans/models/c_models/CLamellarFFHGModel.cpp",
+        "sans/models/c_models/lamellarFF_HG.cpp",                
+        srcdir+"/lamellarFF_HG.c",
         #srcdir+"/CLamellarPSModel.c",
         "sans/models/c_models/CLamellarPSModel.cpp",
