Index: sansmodels/src/sans/models/BinaryHSModel.py
===================================================================
--- sansmodels/src/sans/models/BinaryHSModel.py	(revision 975ec8e8211549489759b5a5ffe3b60607de065b)
+++ sansmodels/src/sans/models/BinaryHSModel.py	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHS.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHs.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class BinaryHSModel(CBinaryHSModel, BaseComponent):
     """ Class that evaluates a BinaryHSModel model. 
-    	This file was auto-generated from ..\c_extensions\binaryHS.h.
+    	This file was auto-generated from ..\c_extensions\binaryHs.h.
     	Refer to that file and the structure it contains
     	for details of the model.
Index: sansmodels/src/sans/models/DiamEllipFunc.py
===================================================================
--- sansmodels/src/sans/models/DiamEllipFunc.py	(revision 40945a3d4359a9408c2685d2bcd7598da9022b6e)
+++ sansmodels/src/sans/models/DiamEllipFunc.py	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY C:\ECLPS\workspace\trunk\sansmodels\src\sans\models\c_extensions\DiamEllip.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\DiamEllip.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class DiamEllipFunc(CDiamEllipFunc, BaseComponent):
     """ Class that evaluates a DiamEllipFunc model. 
-    	This file was auto-generated from C:\ECLPS\workspace\trunk\sansmodels\src\sans\models\c_extensions\DiamEllip.h.
+    	This file was auto-generated from ..\c_extensions\DiamEllip.h.
     	Refer to that file and the structure it contains
     	for details of the model.
@@ -63,4 +63,7 @@
 		## fittable parameters
         self.fixed=['radius_a.width', 'radius_b.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
    
     def clone(self):
@@ -84,4 +87,11 @@
         return CDiamEllipFunc.runXY(self, x)
         
+    def evalDistribition(self, x = []):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q[], or [qx[], qy[]]
+            @return: scattering function P(q[])
+        """
+        return CDiamEllipFunc.evalDistribition(self, x)
+        
     def set_dispersion(self, parameter, dispersion):
         """
Index: sansmodels/src/sans/models/LamellarPSHGModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarPSHGModel.py	(revision 9188cc14902588c2800a2821590f8bac1dd436e7)
+++ sansmodels/src/sans/models/LamellarPSHGModel.py	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -114,4 +114,11 @@
         return CLamellarPSHGModel.runXY(self, x)
         
+    def evalDistribition(self, x = []):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q[], or [qx[], qy[]]
+            @return: scattering function P(q[])
+        """
+        return CLamellarPSHGModel.evalDistribition(self, x)
+        
     def set_dispersion(self, parameter, dispersion):
         """
Index: sansmodels/src/sans/models/LogNormal.py
===================================================================
--- sansmodels/src/sans/models/LogNormal.py	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
+++ sansmodels/src/sans/models/LogNormal.py	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+"""
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\logNormal.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CLogNormal
+import copy    
+    
+class LogNormal(CLogNormal, BaseComponent):
+    """ Class that evaluates a LogNormal model. 
+    	This file was auto-generated from ..\c_extensions\logNormal.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         sigma           = 1.0 
+         center          = 0.0 
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CLogNormal.__init__(self)
+        
+        ## Name of the model
+        self.name = "LogNormal"
+        ## Model description
+        self.description ="""f(x)=scale * 1/(sigma*math.sqrt(2pi))e^(-1/2*((math.log(x)-mu)/sigma)^2)"""
+       
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['sigma'] = ['', None, None]
+        self.details['center'] = ['', None, None]
+
+		## fittable parameters
+        self.fixed=[]
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LogNormal())   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return CLogNormal.run(self, x)
+   
+    def runXY(self, x = 0.0):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q, or [qx, qy]
+            @return: scattering function P(q)
+        """
+        
+        return CLogNormal.runXY(self, x)
+        
+    def evalDistribition(self, x = []):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q[], or [qx[], qy[]]
+            @return: scattering function P(q[])
+        """
+        return CLogNormal.evalDistribition(self, x)
+        
+    def set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CLogNormal.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/VesicleModel.py
===================================================================
--- sansmodels/src/sans/models/VesicleModel.py	(revision b4679dee5e210d6a4a960aa3eada337f6dbac554)
+++ sansmodels/src/sans/models/VesicleModel.py	(revision 870f131f9d526f28fcaa1de9825b193ca97877e6)
@@ -93,4 +93,11 @@
         return CVesicleModel.runXY(self, x)
         
+    def evalDistribition(self, x = []):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q[], or [qx[], qy[]]
+            @return: scattering function P(q[])
+        """
+        return CVesicleModel.evalDistribition(self, x)
+        
     def set_dispersion(self, parameter, dispersion):
         """
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);
             }           
