Index: sansmodels/src/sans/models/c_extensions/ellipsoid.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/ellipsoid.h	(revision 1ed3834d2e968f8ff632d0b368f55ac28174df7a)
+++ sansmodels/src/sans/models/c_extensions/ellipsoid.h	(revision c1c29b67c42e22e8ebe38ed7aacd5a53ec4f66bb)
@@ -28,6 +28,6 @@
  //		</text>
  //[FIXED]= <text> axis_phi.width; axis_theta.width;radius_a.width;
- //radius_b.width; length.width; r_minor.width
- //, r_ratio.width</text>
+ //radius_b.width; length.width; r_minor.width;
+ //r_ratio.width</text>
  //[ORIENTATION_PARAMS]=  axis_phi.width; axis_theta.width;axis_phi; axis_theta
 
Index: sansmodels/src/sans/models/c_extensions/lamellar.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellar.c	(revision 0cfeff4e034165c71daccb019e3c4b607b334051)
+++ sansmodels/src/sans/models/c_extensions/lamellar.c	(revision c1c29b67c42e22e8ebe38ed7aacd5a53ec4f66bb)
@@ -6,5 +6,5 @@
 #include "lamellar.h"
 #include <math.h>
-#include "libCylinder.h"
+//#include "libCylinder.h"
 #include <stdio.h>
 #include <stdlib.h>
Index: sansmodels/src/sans/models/c_extensions/lamellar.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellar.h	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
+++ sansmodels/src/sans/models/c_extensions/lamellar.h	(revision c1c29b67c42e22e8ebe38ed7aacd5a53ec4f66bb)
@@ -36,6 +36,6 @@
 } LamellarParameters;
 
-
-
+/// kernel
+double lamellar_kernel(double dp[], double q);
 /// 1D scattering function
 double lamellar_analytical_1D(LamellarParameters *pars, double q);
Index: sansmodels/src/sans/models/c_extensions/lamellarPS.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellarPS.c	(revision b4679dee5e210d6a4a960aa3eada337f6dbac554)
+++ sansmodels/src/sans/models/c_extensions/lamellarPS.c	(revision c1c29b67c42e22e8ebe38ed7aacd5a53ec4f66bb)
@@ -10,4 +10,64 @@
 #include <stdlib.h>
 
+/*LamellarPS_kernel() was moved from libigor to get rid of polydipersity in del(thickness) that we provide from control panel.
+/*	LamellarPSX  :  calculates the form factor of a lamellar structure - with S(q) effects included
+-------
+------- resolution effects ARE NOT included, but only a CONSTANT default value, not the real q-dependent resolution!!
+
+	*/
+double
+LamellarPS_kernel(double dp[], double q)
+{
+	double scale,dd,del,contr,NN,Cp,bkg;		//local variables of coefficient wave
+	double inten, qval,Pq,Sq,alpha,temp,t1,t2,t3,dQ;
+	double Pi,Euler,dQDefault,fii;
+	int ii,NNint;
+	Euler = 0.5772156649;		// Euler's constant
+	dQDefault = 0.0;//0.0025;		//[=] 1/A, q-resolution, default value
+	dQ = dQDefault;
+
+	Pi = 4.0*atan(1.0);
+	qval = q;
+
+	scale = dp[0];
+	dd = dp[1];
+	del = dp[2];
+	contr = dp[3];
+	NN = trunc(dp[4]);		//be sure that NN is an integer
+	Cp = dp[5];
+	bkg = dp[6];
+
+	Pq = 2.0*contr*contr/qval/qval*(1.0-cos(qval*del));
+
+	NNint = (int)NN;		//cast to an integer for the loop
+	ii=0;
+	Sq = 0.0;
+	for(ii=1;ii<(NNint-1);ii+=1) {
+
+		fii = (double)ii;		//do I really need to do this?
+
+		temp = 0.0;
+		alpha = Cp/4.0/Pi/Pi*(log(Pi*ii) + Euler);
+		t1 = 2.0*dQ*dQ*dd*dd*alpha;
+		t2 = 2.0*qval*qval*dd*dd*alpha;
+		t3 = dQ*dQ*dd*dd*ii*ii;
+
+		temp = 1.0-ii/NN;
+		temp *= cos(dd*qval*ii/(1.0+t1));
+		temp *= exp(-1.0*(t2 + t3)/(2.0*(1.0+t1)) );
+		temp /= sqrt(1.0+t1);
+
+		Sq += temp;
+	}
+
+	Sq *= 2.0;
+	Sq += 1.0;
+
+	inten = 2.0*Pi*scale*Pq*Sq/(dd*qval*qval);
+
+	inten *= 1.0e8;		// 1/A to 1/cm
+
+    return(inten+bkg);
+}
 
 /**
@@ -18,5 +78,5 @@
  */
 double lamellarPS_analytical_1D(LamellarPSParameters *pars, double q) {
-	double dp[8];
+	double dp[7];
 
 	// Fill paramater array
@@ -24,12 +84,11 @@
 	dp[1] = pars->spacing;
 	dp[2] = pars->delta;
-	dp[3] = pars->sigma;
-	dp[4] = pars->contrast;
-	dp[5] = pars->n_plates;
-	dp[6] = pars->caille;
-	dp[7] = pars->background;
+	dp[3] = pars->contrast;
+	dp[4] = pars->n_plates;
+	dp[5] = pars->caille;
+	dp[6] = pars->background;
 
 	// Call library function to evaluate model
-	return LamellarPS(dp, q);
+	return LamellarPS_kernel(dp, q);
 }
 /**
Index: sansmodels/src/sans/models/c_extensions/lamellarPS.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/lamellarPS.h	(revision 96b593847bbd8eb6072269e750a93261a4f743b3)
+++ sansmodels/src/sans/models/c_extensions/lamellarPS.h	(revision c1c29b67c42e22e8ebe38ed7aacd5a53ec4f66bb)
@@ -7,5 +7,5 @@
 /** Structure definition for concentrated lamellar form factor parameters
  * [PYTHONCLASS] = LamellarPSModel
- * [DISP_PARAMS] = spacing
+ * [DISP_PARAMS] = delta, spacing
    [DESCRIPTION] = <text>[Concentrated Lamellar Form Factor] Calculates the scattered
 	   intensity from a lyotropic lamellar phase.
@@ -21,5 +21,4 @@
 		*Parameters: spacing = repeat spacing,
 		delta = bilayer thickness,
-		sigma = variation in bilayer thickness
 		contrast = SLD_solvent - SLD_bilayer
 		n_plate = # of Lamellar plates
@@ -28,5 +27,5 @@
 		scale = scale factor
 </text>
-   [FIXED]= spacing.width
+   [FIXED]= <text>delta.width; spacing.width</text>
    [ORIENTATION_PARAMS]=
 
@@ -42,7 +41,4 @@
     //  [DEFAULT]=delta=30 [A]
     double delta;
-	/// polydispersity of the bilayer thickness  [A]
-    //  [DEFAULT]=sigma=0.15
-    double sigma;
     /// Contrast [1/A²]
     //  [DEFAULT]=contrast=5.3e-6 [1/A²]
@@ -60,6 +56,6 @@
 } LamellarPSParameters;
 
-
-
+/// kernel
+double LamellarPS_kernel(double dp[], double q);
 /// 1D scattering function
 double lamellarPS_analytical_1D(LamellarPSParameters *pars, double q);
