Index: sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -192,6 +192,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -206,8 +206,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -192,6 +192,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -206,8 +206,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -203,6 +203,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -217,8 +217,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -206,6 +206,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -220,8 +220,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CCoreShellModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CCoreShellModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -205,8 +205,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -211,8 +211,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -200,8 +200,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -200,8 +200,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -211,8 +211,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -219,8 +219,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -193,6 +193,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -207,8 +207,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CGaussian.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CGaussian.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CGaussian.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -195,8 +195,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -183,6 +183,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -197,8 +197,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -187,6 +187,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -201,8 +201,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -201,6 +201,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -215,8 +215,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -205,8 +205,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CLamellarModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -200,8 +200,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -211,8 +211,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -205,8 +205,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CLogNormal.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLogNormal.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CLogNormal.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -195,8 +195,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CLorentzian.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLorentzian.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CLorentzian.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -195,8 +195,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CMultiShellModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CMultiShellModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CMultiShellModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -195,6 +195,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -209,8 +209,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/COblateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -200,6 +200,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -214,8 +214,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -219,8 +219,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CProlateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CProlateModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CProlateModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -198,6 +198,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -212,8 +212,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CSchulz.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSchulz.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CSchulz.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -195,8 +195,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CSphereModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -199,8 +199,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -199,8 +199,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -219,8 +219,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -199,8 +199,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -196,6 +196,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -210,8 +210,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/CVesicleModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CVesicleModel.cpp	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/CVesicleModel.cpp	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -190,6 +190,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -204,8 +204,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
Index: sansmodels/src/sans/models/c_models/classTemplate.txt
===================================================================
--- sansmodels/src/sans/models/c_models/classTemplate.txt	(revision e0a8a3ccbb7fa14ab3d063bb6214bb4828593f76)
+++ sansmodels/src/sans/models/c_models/classTemplate.txt	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -171,6 +171,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[1];
-        y_len = dims[0]= y->dimensions[0];
+	    x_len = dims[1]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[1];
 	    
 	    // Make a new double matrix of same dims
@@ -185,8 +185,8 @@
         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 x_value = *(double *)(x->data + i*x->strides[0]);
+      		    double y_value = *(double *)(y->data + j*y->strides[1]);
       			double *result_value = (double *)(result->data +
-      			      i*result->strides[1] + j*result->strides[0]);
+      			      j*result->strides[0] + i*result->strides[1]);
       			*result_value = (*model)(x_value, y_value);
             }           
