Index: sansmodels/src/sans/models/c_extensions/parallelepiped.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/parallelepiped.c	(revision 3c102d483d76eaaef80c6c9f1e39089cfbd6799b)
+++ sansmodels/src/sans/models/c_extensions/parallelepiped.c	(revision 8e36cddc31aee946bb051c6a6d4eade849ca2ed4)
@@ -23,6 +23,6 @@
 	dp[0] = pars->scale;
 	dp[1] = pars->short_a;
-	dp[2] = pars->long_b;
-	dp[3] = pars->longer_c;
+	dp[2] = pars->short_b;
+	dp[3] = pars->long_c;
 	dp[4] = pars->contrast;
 	dp[5] = pars->background;
@@ -98,5 +98,5 @@
  */
 double parallelepiped_analytical_2D_scaled(ParallelepipedParameters *pars, double q, double q_x, double q_y) {
-	double parallel_x, parallel_y, parallel_z;
+	double cparallel_x, cparallel_y, cparallel_z, bparallel_x, bparallel_y, parallel_x, parallel_y, parallel_z;
 	double q_z;
 	double alpha, vol, cos_val_c, cos_val_b, cos_val_a, edgeA, edgeB, edgeC;
@@ -106,12 +106,12 @@
 
 	edgeA = pars->short_a;
-	edgeB = pars->long_b;
-	edgeC = pars->longer_c;
+	edgeB = pars->short_b;
+	edgeC = pars->long_c;
 
 
     // parallelepiped c axis orientation
-    parallel_x = sin(pars->parallel_theta) * cos(pars->parallel_phi);
-    parallel_y = sin(pars->parallel_theta) * sin(pars->parallel_phi);
-    parallel_z = cos(pars->parallel_theta);
+    cparallel_x = sin(pars->parallel_theta) * cos(pars->parallel_phi);
+    cparallel_y = sin(pars->parallel_theta) * sin(pars->parallel_phi);
+    cparallel_z = cos(pars->parallel_theta);
 
     // q vector
@@ -120,22 +120,20 @@
     // Compute the angle btw vector q and the
     // axis of the parallelepiped
-    cos_val_c = parallel_x*q_x + parallel_y*q_y + parallel_z*q_z;
+    cos_val_c = cparallel_x*q_x + cparallel_y*q_y + cparallel_z*q_z;
     alpha = acos(cos_val_c);
 
     // parallelepiped a axis orientation
-    parallel_x = -(1-sin(pars->parallel_theta)*sin(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi);
-    parallel_y = (1-sin(pars->parallel_theta)*sin(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi);
+    parallel_x = sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi);
+    parallel_y = cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi);
 
-    //parallel_x = -(1-sin(pars->parallel_theta)*sin(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi);
-    //parallel_y = (1-sin(pars->parallel_theta)*sin(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi);
-    cos_val_a = (parallel_x*q_x + parallel_y*q_y);
+    cos_val_a = parallel_x*q_x + parallel_y*q_y;
 
 
 
     // parallelepiped b axis orientation
-    parallel_x = (1-sin(pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi);
-    parallel_y = (1-sin(pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi);
+    bparallel_x = sqrt(1-sin(pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi);
+    bparallel_y = sqrt(1-sin(pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi);
     // axis of the parallelepiped
-    cos_val_b = (parallel_x*q_x + parallel_y*q_y) ;
+    cos_val_b = sin(acos(cos_val_a)) ;
 
 
@@ -148,5 +146,5 @@
 
 	// Call the IGOR library function to get the kernel
-	answer = pkernel( q*edgeA, q*edgeB, q*edgeC, cos_val_a,cos_val_b,cos_val_c);
+	answer = pkernel( q*edgeA, q*edgeB, q*edgeC, sin(alpha)*cos_val_a,sin(alpha)*cos_val_b,cos_val_c);
 
 	// Multiply by contrast^2
Index: sansmodels/src/sans/models/c_extensions/parallelepiped.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/parallelepiped.h	(revision 2cb89e7643de78c7f4cf32435454270403afcfb9)
+++ sansmodels/src/sans/models/c_extensions/parallelepiped.h	(revision 8e36cddc31aee946bb051c6a6d4eade849ca2ed4)
@@ -7,15 +7,15 @@
 /** Structure definition for Parallelepiped parameters
  * [PYTHONCLASS] = ParallelepipedModel
- * [DISP_PARAMS] = short_a, long_b, longer_c,parallel_phi,parallel_psi, parallel_theta
+ * [DISP_PARAMS] = short_a, short_b, long_c,parallel_phi,parallel_psi, parallel_theta
    [DESCRIPTION] = <text> Form factor for a rectangular solid with uniform scattering length density.
 
 		scale:Scale factor
-		short_a: length of short side of the parallelepiped [A]
-		long_b: length of long side of the parallelepiped [A]
-		longer_c: length of longer side of the parallelepiped [A]
+		short_a: length of short edge  [A]
+		short_b: length of another short edge [A]
+		long_c: length of long edge  of the parallelepiped [A]
 		contrast: particle_sld - solvent_sld
 		background:Incoherent Background [1/cm]
 		</text>
-	[FIXED]= <text>short_a.width; long_b.width; longer_c.width;parallel_phi.width;parallel_psi.width; parallel_theta.width</text>
+	[FIXED]= <text>short_a.width; short_b.width; long_c.width;parallel_phi.width;parallel_psi.width; parallel_theta.width</text>
 	[ORIENTATION_PARAMS]= <text>parallel_phi;parallel_psi; parallel_theta; parallel_phi.width;parallel_psi.width; parallel_theta.width</text>
 
@@ -26,13 +26,13 @@
     //  [DEFAULT]=scale=1.0
     double scale;
-    ///  Length of short side of the parallelepiped [A]
+    ///  Length of short edge of the parallelepiped [A]
     //  [DEFAULT]=short_a=35 [A]
     double short_a;
-	/// Length of long side edge of the parallelepiped [A]
-    //  [DEFAULT]=long_b=75 [A]
-    double long_b;
-	/// Length of longer side of the parallelepiped [A]
-    //  [DEFAULT]=longer_c=400 [A]
-    double longer_c;
+	/// Length of short edge edge of the parallelepiped [A]
+    //  [DEFAULT]=short_b=75 [A]
+    double short_b;
+	/// Length of long edge of the parallelepiped [A]
+    //  [DEFAULT]=long_c=400 [A]
+    double long_c;
     /// Contrast [1/A²]
     //  [DEFAULT]=contrast=5.3e-6 [1/A²]
