Index: sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY binaryHS.h
+ *          DO NOT MODIFY THIS FILE, MODIFY binaryHs.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "binaryHS.h"
+#include "binaryHs.h"
 }
 
@@ -192,6 +192,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -206,6 +206,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -192,6 +192,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -206,6 +206,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -203,6 +203,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -217,6 +217,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -206,6 +206,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -220,6 +220,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCoreShellModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCoreShellModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -205,6 +205,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -211,6 +211,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -200,6 +200,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -200,6 +200,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -211,6 +211,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -219,6 +219,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -193,6 +193,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -207,6 +207,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CGaussian.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CGaussian.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CGaussian.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY hardsphere.h
+ *          DO NOT MODIFY THIS FILE, MODIFY Hardsphere.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "hardsphere.h"
+#include "Hardsphere.h"
 }
 
@@ -183,6 +183,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -197,6 +197,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp	(revision 42ae1d9f2dd771551fc069abe53a2638ffcba952)
+++ sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -187,6 +187,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -201,6 +201,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -201,6 +201,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -215,6 +215,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -205,6 +205,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -200,6 +200,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -211,6 +211,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -205,6 +205,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLogNormal.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLogNormal.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLogNormal.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY lognormal.h
+ *          DO NOT MODIFY THIS FILE, MODIFY logNormal.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "lognormal.h"
+#include "logNormal.h"
 }
 
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLorentzian.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLorentzian.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLorentzian.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CMultiShellModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CMultiShellModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CMultiShellModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -195,6 +195,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -209,6 +209,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/COblateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,615 @@
+/**
+	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
+ */
+
+/** COblateModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY oblate.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 "oblate.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * COblateModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    OblateModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} COblateModel;
+
+
+static void
+COblateModel_dealloc(COblateModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+COblateModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    COblateModel *self;
+    
+    self = (COblateModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+COblateModel_init(COblateModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new OblateModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"major_core",Py_BuildValue("d",200.000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"minor_core",Py_BuildValue("d",20.000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"major_shell",Py_BuildValue("d",250.000000));
+        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000001));
+        PyDict_SetItemString(self->params,"minor_shell",Py_BuildValue("d",30.000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->major_core.dispersion->accept_as_source(visitor, self->model->major_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_core.dispersion->accept_as_source(visitor, self->model->minor_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->major_shell.dispersion->accept_as_source(visitor, self->model->major_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_shell.dispersion->accept_as_source(visitor, self->model->minor_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_shell", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef COblateModel_members[] = {
+    {"params", T_OBJECT, offsetof(COblateModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(COblateModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(COblateModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double COblateModel_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(OblateModel* 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( OblateModel* 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[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // 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 ( j=0; j< y_len; j++) {
+            for ( i=0; i< x_len; i++) {
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
+      			double *result_value = (double *)(result->data +
+      			      j*result->strides[0] + i*result->strides[1]);
+      			*result_value = (*model)(x_value, y_value);
+            }           
+        }
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(COblateModelError, 
+                   "COblateModel.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(COblateModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(COblateModelError, 
+	    	"COblateModel.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(COblateModelError, 
+                   "COblateModel.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(COblateModelError, 
+	    		"COblateModel.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(COblateModelError, 
+                   "COblateModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(COblateModelError, 
+                   "COblateModel.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(COblateModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(COblateModelError, 
+	    	"COblateModel.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(COblateModelError, 
+	    		"COblateModel.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 = COblateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = COblateModel_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 = COblateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(COblateModel *self) {
+
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(COblateModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(COblateModelError, 
+	    	"COblateModel.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(COblateModelError, 
+	    		"COblateModel.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 = COblateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = COblateModel_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 = COblateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(COblateModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(COblateModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(COblateModelError,
+	    	"COblateModel.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, "major_core")) {
+        self->model->major_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_core")) {
+        self->model->minor_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "major_shell")) {
+        self->model->major_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_shell")) {
+        self->model->minor_shell.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(COblateModelError,
+	    	"COblateModel.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 COblateModel_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"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+      
+    {"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 COblateModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "COblateModel",             /*tp_name*/
+    sizeof(COblateModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)COblateModel_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*/
+    "COblateModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    COblateModel_methods,             /* tp_methods */
+    COblateModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)COblateModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    COblateModel_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 addCOblateModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&COblateModelType) < 0)
+        return;
+
+    Py_INCREF(&COblateModelType);
+    PyModule_AddObject(module, "COblateModel", (PyObject *)&COblateModelType);
+    
+    d = PyModule_GetDict(module);
+    COblateModelError = PyErr_NewException("COblateModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "COblateModelError", COblateModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -219,6 +219,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CProlateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CProlateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/c_models/CProlateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,605 @@
+/**
+	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
+ */
+
+/** CProlateModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY prolate.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 "prolate.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CProlateModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    ProlateModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CProlateModel;
+
+
+static void
+CProlateModel_dealloc(CProlateModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CProlateModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CProlateModel *self;
+    
+    self = (CProlateModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CProlateModel_init(CProlateModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new ProlateModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"major_core",Py_BuildValue("d",100.000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"minor_core",Py_BuildValue("d",50.000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"major_shell",Py_BuildValue("d",110.000000));
+        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000001));
+        PyDict_SetItemString(self->params,"minor_shell",Py_BuildValue("d",60.000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->major_core.dispersion->accept_as_source(visitor, self->model->major_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_core.dispersion->accept_as_source(visitor, self->model->minor_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->major_shell.dispersion->accept_as_source(visitor, self->model->major_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_shell.dispersion->accept_as_source(visitor, self->model->minor_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_shell", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef CProlateModel_members[] = {
+    {"params", T_OBJECT, offsetof(CProlateModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(CProlateModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(CProlateModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CProlateModel_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(ProlateModel* 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( ProlateModel* 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[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // 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 ( j=0; j< y_len; j++) {
+            for ( i=0; i< x_len; i++) {
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
+      			double *result_value = (double *)(result->data +
+      			      j*result->strides[0] + i*result->strides[1]);
+      			*result_value = (*model)(x_value, y_value);
+            }           
+        }
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CProlateModelError, 
+                   "CProlateModel.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(CProlateModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(CProlateModelError, 
+	    	"CProlateModel.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(CProlateModelError, 
+                   "CProlateModel.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(CProlateModelError, 
+	    		"CProlateModel.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(CProlateModelError, 
+                   "CProlateModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CProlateModelError, 
+                   "CProlateModel.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(CProlateModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(CProlateModelError, 
+	    	"CProlateModel.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(CProlateModelError, 
+	    		"CProlateModel.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 = CProlateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CProlateModel_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 = CProlateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CProlateModel *self) {
+
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CProlateModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(CProlateModelError, 
+	    	"CProlateModel.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(CProlateModelError, 
+	    		"CProlateModel.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 = CProlateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CProlateModel_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 = CProlateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CProlateModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CProlateModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CProlateModelError,
+	    	"CProlateModel.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, "major_core")) {
+        self->model->major_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_core")) {
+        self->model->minor_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "major_shell")) {
+        self->model->major_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_shell")) {
+        self->model->minor_shell.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CProlateModelError,
+	    	"CProlateModel.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 CProlateModel_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"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+      
+    {"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 CProlateModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CProlateModel",             /*tp_name*/
+    sizeof(CProlateModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CProlateModel_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*/
+    "CProlateModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CProlateModel_methods,             /* tp_methods */
+    CProlateModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CProlateModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CProlateModel_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 addCProlateModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CProlateModelType) < 0)
+        return;
+
+    Py_INCREF(&CProlateModelType);
+    PyModule_AddObject(module, "CProlateModel", (PyObject *)&CProlateModelType);
+    
+    d = PyModule_GetDict(module);
+    CProlateModelError = PyErr_NewException("CProlateModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "CProlateModelError", CProlateModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/CSchulz.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSchulz.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CSchulz.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CSphereModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -199,6 +199,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY squarewell.h
+ *          DO NOT MODIFY THIS FILE, MODIFY SquareWell.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "squarewell.h"
+#include "SquareWell.h"
 }
 
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -199,6 +199,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -219,6 +219,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY stickyHS.h
+ *          DO NOT MODIFY THIS FILE, MODIFY StickyHS.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "stickyHS.h"
+#include "StickyHS.h"
 }
 
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -199,6 +199,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -196,6 +196,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -210,6 +210,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CVesicleModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CVesicleModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CVesicleModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -190,6 +190,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -204,6 +204,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/classTemplate.txt
===================================================================
--- sansmodels/src/sans/models/c_models/classTemplate.txt	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/classTemplate.txt	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -171,6 +171,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -185,6 +185,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/wrapping.py
===================================================================
--- sansmodels/src/sans/models/c_models/wrapping.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/c_models/wrapping.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,23 @@
+import sys
+import os
+import os.path
+from WrapperGenerator import WrapperGenerator
+
+
+root= os.path.dirname(os.getcwd())
+
+dir = os.path.join(root, "c_extensions")
+#print "dir", dir
+list= os.listdir(dir)
+nModels=0
+for item in list:
+    toks = os.path.splitext(os.path.basename(item))
+    if toks[1]=='.h':
+        nModels += 1
+        name = toks[0]
+        app = WrapperGenerator(os.path.join('..','c_extensions',name+".h"))
+        app.read()
+        app.write_c_wrapper()
+        app.write_python_wrapper()
+        print app
+print "Number total of models is %s"%nModels
