Index: Kernel-CoreShellCylinder.cpp
===================================================================
--- Kernel-CoreShellCylinder.cpp	(revision 2de9a5e5fa221a201e0d071bc49f8bf651f6f679)
+++ Kernel-CoreShellCylinder.cpp	(revision 496b2528aace8ce941bc0fda35e188e39e778443)
@@ -1,6 +1,6 @@
-__kernel void CoreShellCylinderKernel(__global const float *qx, __global const float *qy, __global float *_ptvalue,
-const float axis_theta, const float axis_phi, const float thickness, const float length, const float radius,
-const float scale, const float radius_weight, const float length_weight, const float thickness_weight,
-const float theta_weight, const float phi_weight, const float core_sld, const float shell_sld, const float solvent_sld,
+__kernel void CoreShellCylinderKernel(__global const real *qx, __global const real *qy, __global real *_ptvalue,
+const real axis_theta, const real axis_phi, const real thickness, const real length, const real radius,
+const real scale, const real radius_weight, const real length_weight, const real thickness_weight,
+const real theta_weight, const real phi_weight, const real core_sld, const real shell_sld, const real solvent_sld,
 const int size, const int total)
 {
@@ -8,10 +8,10 @@
     if(i < total)
     {
-        float q = sqrt(qx[i]*qx[i]+qy[i]*qy[i]);
-        float pi = 4.0*atan(1.0);
-        float theta = axis_theta*pi/180.0;
-        float cyl_x = cos(theta)*cos(axis_phi*pi/180.0);
-        float cyl_y = sin(theta);
-        float alpha = acos(cyl_x*qx[i]/q + cyl_y*qx[i]/q);
+        real q = sqrt(qx[i]*qx[i]+qy[i]*qy[i]);
+        real pi = 4.0*atan(1.0);
+        real theta = axis_theta*pi/180.0;
+        real cyl_x = cos(theta)*cos(axis_phi*pi/180.0);
+        real cyl_y = sin(theta);
+        real alpha = acos(cyl_x*qx[i]/q + cyl_y*qy[i]/q);
 
         if (alpha == 0.0){
@@ -19,12 +19,12 @@
         }
 
-        float si1=0; float si2=0; float be1=0; float be2=0;
+        real si1=0; real si2=0; real be1=0; real be2=0;
 
-        float vol2 = pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness);
+        real vol2 = pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness);
 
-        float besarg1 = q*radius*sin(alpha);
-        float besarg2 = q*(radius+thickness)*sin(alpha);
-        float sinarg1 = q*length/2.0*cos(alpha);
-        float sinarg2 = q*(length/2.0+thickness)*cos(alpha);
+        real besarg1 = q*radius*sin(alpha);
+        real besarg2 = q*(radius+thickness)*sin(alpha);
+        real sinarg1 = q*length/2.0*cos(alpha);
+        real sinarg2 = q*(length/2.0+thickness)*cos(alpha);
 
 
@@ -49,8 +49,8 @@
             si2 = sin(sinarg2)/sinarg2;
         }
-        float tt = 2.0*vol2*(shell_sld-solvent_sld)*si2*be2 + 2.0*(pi*radius*radius*(length))*(core_sld-shell_sld)*si1*be1;
+        real tt = 2.0*vol2*(shell_sld-solvent_sld)*si2*be2 + 2.0*(pi*radius*radius*(length))*(core_sld-shell_sld)*si1*be1;
 
-        float answer = (tt*tt)*sin(alpha)/fabs(sin(alpha));
-        float vol=pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness);
+        real answer = (tt*tt)*sin(alpha)/fabs(sin(alpha));
+        real vol=pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness);
         answer = answer/vol*1.0e8*scale;
 
Index: Kernel-Lamellar.cpp
===================================================================
--- Kernel-Lamellar.cpp	(revision 2de9a5e5fa221a201e0d071bc49f8bf651f6f679)
+++ Kernel-Lamellar.cpp	(revision 496b2528aace8ce941bc0fda35e188e39e778443)
@@ -7,7 +7,5 @@
     {
         real q = sqrt(qx[i]*qx[i]+qy[i]*qy[i]);
-        real pi = 4.0*atan(1.0);
-        real Pq = 2.0*sub*(sub/q)/q*(1.0-cos(q*bi_thick));
-        ret[i] = 2.0*pi*scale*Pq/(q*q)/bi_thick*1.0e8 ;
+        ret[i] = 2.0*4.0*atan(1.0)*scale*2.0*sub*(sub/q)/q*(1.0-cos(q*bi_thick))/(q*q)/bi_thick*1.0e8 ;
     }
 }
Index: code_coreshellcyl.py
===================================================================
--- code_coreshellcyl.py	(revision 2de9a5e5fa221a201e0d071bc49f8bf651f6f679)
+++ code_coreshellcyl.py	(revision 496b2528aace8ce941bc0fda35e188e39e778443)
@@ -57,4 +57,5 @@
         size = len(axis_theta.weight)
 
+        real = np.float32 if self.qx.dtype == np.dtype('float32') else np.float64
         for i in xrange(len(radius.weight)):
             for j in xrange(len(length.weight)):
@@ -64,9 +65,9 @@
 
                             self.prg.CoreShellCylinderKernel(queue, self.qx.shape, None, self.qx_b, self.qy_b, self.res_b,
-                                    np.float32(axis_theta.value[k]), np.float32(axis_phi.value[l]), np.float32(thickness.value[f]),
-                                    np.float32(length.value[j]), np.float32(radius.value[i]), np.float32(pars['scale']),
-                                    np.float32(radius.weight[i]), np.float32(length.weight[j]), np.float32(thickness.weight[f]),
-                                    np.float32(axis_theta.weight[k]), np.float32(axis_phi.weight[l]), np.float32(pars['core_sld']),
-                                    np.float32(pars['shell_sld']), np.float32(pars['solvent_sld']),np.uint32(size),
+                                    real(axis_theta.value[k]), real(axis_phi.value[l]), real(thickness.value[f]),
+                                    real(length.value[j]), real(radius.value[i]), real(pars['scale']),
+                                    real(radius.weight[i]), real(length.weight[j]), real(thickness.weight[f]),
+                                    real(axis_theta.weight[k]), real(axis_phi.weight[l]), real(pars['core_sld']),
+                                    real(pars['shell_sld']), real(pars['solvent_sld']),np.uint32(size),
                                     np.uint32(self.qx.size))
                             cl.enqueue_copy(queue, self.res, self.res_b)
Index: code_triaxialellipse.py
===================================================================
--- code_triaxialellipse.py	(revision be5d7dff74cf32f5f7ae0a3fc10d4c8f9c267fcc)
+++ code_triaxialellipse.py	(revision 496b2528aace8ce941bc0fda35e188e39e778443)
@@ -58,6 +58,6 @@
         size = len(theta.weight)
         sub = pars['sldEll'] - pars['sldSolv']
+
         real = np.float32 if self.qx.dtype == np.dtype('float32') else np.float64
-
         for a in xrange(len(axisA.weight)):
             for b in xrange(len(axisB.weight)):
Index: fit.py
===================================================================
--- fit.py	(revision 2de9a5e5fa221a201e0d071bc49f8bf651f6f679)
+++ fit.py	(revision 496b2528aace8ce941bc0fda35e188e39e778443)
@@ -18,17 +18,22 @@
                               cyl_theta=0, cyl_phi=0, radius_pd=0.1, radius_pd_n=10, radius_pd_nsigma=3,length_pd=0.1,
                               length_pd_n=5, length_pd_nsigma=3, cyl_theta_pd=0.1, cyl_theta_pd_n=5, cyl_theta_pd_nsigma=3,
-                              cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3, dtype='float32')
+                              cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3, dtype='float')
 model.radius.range(0,100)
 model.length.range(0, 1000)
 model.cyl_theta.range(0,90)
 model.cyl_phi.range(0,90)
+"""
 
+"""
 model = SasModel(data, GpuEllipse, scale=.027, radius_a=60, radius_b=180, sldEll=.297e-6, sldSolv=5.773e-6, background=4.9,
                  axis_theta=0, axis_phi=90, radius_a_pd=0.1, radius_a_pd_n=10, radius_a_pd_nsigma=3, radius_b_pd=0.1, radius_b_pd_n=10,
                  radius_b_pd_nsigma=3, axis_theta_pd=0.1, axis_theta_pd_n=6, axis_theta_pd_nsigma=3, axis_phi_pd=0.1,
-                 axis_phi_pd_n=6, axis_phi_pd_nsigma=3, dtype='float32')
+                 axis_phi_pd_n=6, axis_phi_pd_nsigma=3, dtype='float')
+"""
 
+"""
 model = SasModel(data, GpuLamellar, scale=1, bi_thick=100, sld_bi=.291e-6, sld_sol=5.77e-6, background=0,
-                 bi_thick_pd=0.1, bi_thick_pd_n=35, bi_thick_pd_nsigma=3, dtype='float32')
+                 bi_thick_pd=0.1, bi_thick_pd_n=35, bi_thick_pd_nsigma=3, dtype='float')
+"""
 
 
@@ -37,10 +42,15 @@
                  length_pd=0.1, length_pd_n=10, length_pd_nsigma=3, thickness_pd=0.1, thickness_pd_n=2, thickness_pd_nsigma=3,
                  axis_theta_pd=0.1, axis_theta_pd_n=2, axis_theta_pd_nsigma=3, axis_phi_pd=0.1, axis_phi_pd_n=2,
-                 axis_phi_pd_nsigma=3, dtype='float32')
+                 axis_phi_pd_nsigma=3, dtype='float')
 
+
+
+"""
 model = SasModel(data, GpuCapCylinder, scale=1, rad_cyl=20, rad_cap=40, length=400, sld_capcyl=1e-6, sld_solv=6.3e-6,
                  background=0, theta=0, phi=0, rad_cyl_pd=.1, rad_cyl_pd_n=10, rad_cyl_nsigma=3, rad_cap_pd=.1, rad_cap_pd_n=1,
                  rad_cap_pd_nsigma=3, length_pd=.1, length_pd_n=10, length_pd_nsigma=3, theta_pd=.1, theta_pd_n=4,
-                 theta_pd_nsigma=3, phi_pd=.1, phi_pd_n=4, phi_pd_nsigma=3, dtype='float32')
+                 theta_pd_nsigma=3, phi_pd=.1, phi_pd_n=4, phi_pd_nsigma=3, dtype='float')
+"""
+
 """
 model = SasModel(data, GpuTriEllipse, scale=1, axisA=35, axisB=100, axisC=400, sldEll=1e-6, sldSolv=6.3e-6,
@@ -49,4 +59,6 @@
                  axisA_pd=.1, axisA_pd_n=4, axisA_pd_nsigma=3, axisB_pd=.1, axisB_pd_n=4, axisB_pd_nsigma=3,
                  axisC_pd=.1, axisC_pd_n=4, axisC_pd_nsigma=3, dtype='float')
+"""
+
 
 model.scale.range(0,1)
