Index: doc/conf.py
===================================================================
--- doc/conf.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
+++ doc/conf.py	(revision 4a21670c1546b194d340246cfe5d9cc6e112e8e2)
@@ -231,2 +231,4 @@
     with open('rst_prolog') as fid:
         rst_prolog = fid.read()
+
+numfig = True
Index: sasmodels/models/_bessel.py
===================================================================
--- sasmodels/models/_bessel.py	(revision 275b98e55e7cd22a9638e6d15691232d0bc69177)
+++ sasmodels/models/_bessel.py	(revision 0f910a77b103fc5f0d45ae6fa6b2ea4822144c5a)
@@ -1,56 +1,14 @@
 r"""
-For information about polarised and magnetic scattering, click here_.
-
-.. _here: polar_mag_help.html
+This is a test function!
 
 Definition
 ----------
 
-The 1D scattering intensity is calculated in the following way (Guinier, 1955)
-
-.. math::
-
-    I(q) = \frac{\text{scale}}{V} \cdot \left[
-        3V(\Delta\rho) \cdot \frac{\sin(qr) - qr\cos(qr))}{(qr)^3}
-        \right]^2 + \text{background}
-
-where *scale* is a volume fraction, $V$ is the volume of the scatterer,
-$r$ is the radius of the sphere, *background* is the background level and
-*sld* and *solvent_sld* are the scattering length densities (SLDs) of the
-scatterer and the solvent respectively.
-
-Note that if your data is in absolute scale, the *scale* should represent
-the volume fraction (which is unitless) if you have a good fit. If not,
-it should represent the volume fraction times a factor (by which your data
-might need to be rescaled).
-
-The 2D scattering intensity is the same as above, regardless of the
-orientation of $\vec q$.
-
-Validation
-----------
-
-Validation of our code was done by comparing the output of the 1D model
-to the output of the software provided by the NIST (Kline, 2006).
-Figure :numref:`figure #sphere-comparison` shows a comparison of the output
-of our model and the output of the NIST software.
-
-.. _sphere-comparison:
-
-.. figure:: img/sphere_comparison.jpg
-
-    Comparison of the DANSE scattering intensity for a sphere with the
-    output of the NIST SANS analysis software. The parameters were set to:
-    *scale* = 1.0, *radius* = 60 |Ang|, *contrast* = 1e-6 |Ang^-2|, and
-    *background* = 0.01 |cm^-1|.
-
+Calculates a bessel function. Maybe...
 
 References
 ----------
 
-A Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*,
-John Wiley and Sons, New York, (1955)
-
-*2013/09/09 and 2014/01/06 - Description reviewed by S King and P Parker.*
+None
 """
 
@@ -60,7 +18,7 @@
 title = "Bessel function testing"
 description = """\
-Levraging current infrastracture to test Bessel function performance on
+Leveraging current infrastructure to test Bessel function performance on
 """
-category = "special_fucntions:bessel"
+category = "special_functions:bessel"
 
 #             ["name", "units", default, [lower, upper], "type","description"],
Index: sasmodels/models/core_shell_ellipsoid_xt.py
===================================================================
--- sasmodels/models/core_shell_ellipsoid_xt.py	(revision 29172aa52f4fdcefe534e792b14ec43221514fe1)
+++ sasmodels/models/core_shell_ellipsoid_xt.py	(revision 3556ad79872d55bd8cff8b5ca27db3a80f326f98)
@@ -89,7 +89,7 @@
 parameters = [
     ["equat_core",    "Ang",       20,   [0, inf],    "volume",      "Equatorial radius of core"],
-    ["x_core",        "None",       3,   [0, inf],    "volume",      "Polar radius of core"],
-    ["t_shell",       "Ang",       30,   [0, inf],    "volume",      "Equatorial radius of shell"],
-    ["x_polar_shell", "",           1,   [0, inf],    "volume",      "Polar radius of shell"],
+    ["x_core",        "None",       3,   [0, inf],    "volume",      "axial ratio of core, X = r_polar/r_equatorial"],
+    ["t_shell",       "Ang",       30,   [0, inf],    "volume",      "thickness of shell at equator"],
+    ["x_polar_shell", "",           1,   [0, inf],    "volume",      "ratio of thickness of shell at pole to that at equator"],
     ["sld_core",      "1e-6/Ang^2", 2,   [-inf, inf], "",            "Core scattering length density"],
     ["sld_shell",     "1e-6/Ang^2", 1,   [-inf, inf], "",            "Shell scattering length density"],
Index: sasmodels/models/core_shell_sphere.py
===================================================================
--- sasmodels/models/core_shell_sphere.py	(revision aa2edb2b2fb550caed0506dcf63bc7eac7e1779a)
+++ sasmodels/models/core_shell_sphere.py	(revision 3556ad79872d55bd8cff8b5ca27db3a80f326f98)
@@ -19,6 +19,6 @@
     V_s(\rho_s-\rho_{solv})\frac{\sin(qr_s)-qr_s\cos(qr_s)}{(qr_s)^3}\right]
 
-where $V_s$ is the volume of the outer shell, $V_c$ is
-the volume of the core, $r_s$ is the radius of the shell, $r_c$ is the radius of the
+where $V_s$ is the volume of the whole particle, $V_c$ is
+the volume of the core, $r_s$ = $radius$ + $thickness$ is the radius of the particle, $r_c$ is the radius of the
 core, $\rho_c$ is the scattering length density of the core, $\rho_s$ is the scattering length
 density of the shell, $\rho_{solv}$ is the scattering length density of the solvent.
@@ -30,6 +30,6 @@
 effective radius for $S(Q)$ when $P(Q) \cdot S(Q)$ is applied.
 
-Reference
----------
+References
+----------
 
 A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and Sons, New York, (1955)
@@ -49,6 +49,6 @@
 title = "Form factor for a monodisperse spherical particle with particle with a core-shell structure."
 description = """
-    F^2(q) = 3/V_s [V_c (core_sld-shell_sld) (sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^3 
-                   + V_s (shell_sld-solvent_sld) (sin(q*r_s)-q*r_s*cos(q*r_s))/(q*r_s)^3]
+    F^2(q) = 3/V_s [V_c (sld_core-sld_shell) (sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^3 
+                   + V_s (sld_shell-sld_solvent) (sin(q*r_s)-q*r_s*cos(q*r_s))/(q*r_s)^3]
 
             V_s: Volume of the sphere shell
@@ -62,7 +62,7 @@
 parameters = [["radius",      "Ang",        60.0, [0, inf],    "volume", "Sphere core radius"],
               ["thickness",   "Ang",        10.0, [0, inf],    "volume", "Sphere shell thickness"],
-              ["core_sld",    "1e-6/Ang^2", 1.0,  [-inf, inf], "",       "Sphere core scattering length density"],
-              ["shell_sld",   "1e-6/Ang^2", 2.0,  [-inf, inf], "",       "Sphere shell scattering length density"],
-              ["solvent_sld", "1e-6/Ang^2", 3.0,  [-inf, inf],  "",      "Solvent scattering length density"]]
+              ["sld_core",    "1e-6/Ang^2", 1.0,  [-inf, inf], "",       "core scattering length density"],
+              ["sld_shell",   "1e-6/Ang^2", 2.0,  [-inf, inf], "",       "shell scattering length density"],
+              ["sld_solvent", "1e-6/Ang^2", 3.0,  [-inf, inf],  "",      "Solvent scattering length density"]]
 # pylint: enable=bad-whitespace, line-too-long
 
@@ -70,8 +70,10 @@
 
 demo = dict(scale=1, background=0, radius=60, thickness=10,
-            core_sld=1.0, shell_sld=2.0, solvent_sld=0.0)
+            sld_core=1.0, sld_shell=2.0, sld_solvent=0.0)
 
 oldname = 'CoreShellModel'
-oldpars = {}
+oldpars = dict( sld_core='core_sld',
+               sld_shell='shell_sld',
+               sld_solvent='solvent_sld')
 
 def ER(radius, thickness):
@@ -99,7 +101,7 @@
          [{'radius': 60.0,
            'thickness': 10.0,
-           'core_sld': 1.0,
-           'shell_sld':2.0,
-           'solvent_sld':3.0,
+           'sld_core': 1.0,
+           'sld_shell':2.0,
+           'sld_solvent':3.0,
            'background':0.0
           }, 0.4, 0.000698838]]
Index: sasmodels/models/cylinder.py
===================================================================
--- sasmodels/models/cylinder.py	(revision 2f6303248feb26e5c64a30db18b33ccd2d8815af)
+++ sasmodels/models/cylinder.py	(revision 5933c7f896183418b524d1f35d0d589d92e06a1b)
@@ -31,5 +31,5 @@
 To provide easy access to the orientation of the cylinder, we define the
 axis of the cylinder using two angles $\theta$ and $\phi$. Those angles
-are defined in :numref:`figure #cylinder-angle-definition`.
+are defined in :numref:`figure #<cylinder-angle-definition>`.
 
 .. _cylinder-angle-definition:
Index: sasmodels/models/ellipsoid.py
===================================================================
--- sasmodels/models/ellipsoid.py	(revision 43b7eea5794b4eb3362114ebde67ff2fb1c38fdc)
+++ sasmodels/models/ellipsoid.py	(revision 3556ad79872d55bd8cff8b5ca27db3a80f326f98)
@@ -2,5 +2,5 @@
 # Note: model title and parameter table are inserted automatically
 r"""
-The form factor is normalized by the particle volume.
+The form factor is normalized by the particle volume 
 
 Definition
@@ -31,5 +31,5 @@
 
 $\alpha$ is the angle between the axis of the ellipsoid and $\vec q$,
-$V$ is the volume of the ellipsoid, $R_p$ is the polar radius along the
+$V = (4/3)\pi R_pR_e^2$ is the volume of the ellipsoid , $R_p$ is the polar radius along the
 rotational axis of the ellipsoid, $R_e$ is the equatorial radius perpendicular
 to the rotational axis of the ellipsoid and $\Delta \rho$ (contrast) is the
@@ -41,5 +41,5 @@
 :ref:`cylinder orientation figure <cylinder-angle-definition>`.
 For the ellipsoid, $\theta$ is the angle between the rotational axis
-and the $z$-axis.
+and the $z$ -axis.
 
 NB: The 2nd virial coefficient of the solid ellipsoid is calculated based
@@ -54,5 +54,5 @@
 .. figure:: img/ellipsoid_angle_projection.jpg
 
-    The angles for oriented ellipsoid.
+    The angles for oriented ellipsoid, shown here as oblate, $a$ = $R_p$ and $b$ = $R_e$
 
 Validation
@@ -74,5 +74,5 @@
     calculated from our 2D model and the intensity from the NIST SANS
     analysis software. The parameters used were: *scale* = 1.0,
-    *rpolar* = 20 |Ang|, *requatorial* = 400 |Ang|,
+    *r_polar* = 20 |Ang|, *r_equatorial* = 400 |Ang|,
     *contrast* = 3e-6 |Ang^-2|, and *background* = 0.0 |cm^-1|.
 
@@ -102,5 +102,5 @@
 description = """\
 P(q.alpha)= scale*f(q)^2 + background, where f(q)= 3*(sld
-        - solvent_sld)*V*[sin(q*r(Rp,Re,alpha))
+        - sld_solvent)*V*[sin(q*r(Rp,Re,alpha))
         -q*r*cos(qr(Rp,Re,alpha))]
         /[qr(Rp,Re,alpha)]^3"
@@ -110,5 +110,5 @@
 
         sld: SLD of the ellipsoid
-        solvent_sld: SLD of the solvent
+        sld_solvent: SLD of the solvent
         V: volume of the ellipsoid
         Rp: polar radius of the ellipsoid
@@ -120,9 +120,9 @@
 parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "",
                "Ellipsoid scattering length density"],
-              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "",
+              ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "",
                "Solvent scattering length density"],
-              ["rpolar", "Ang", 20, [0, inf], "volume",
+              ["r_polar", "Ang", 20, [0, inf], "volume",
                "Polar radius"],
-              ["requatorial", "Ang", 400, [0, inf], "volume",
+              ["r_equatorial", "Ang", 400, [0, inf], "volume",
                "Equatorial radius"],
               ["theta", "degrees", 60, [-inf, inf], "orientation",
@@ -134,15 +134,15 @@
 source = ["lib/sph_j1c.c", "lib/gauss76.c", "ellipsoid.c"]
 
-def ER(rpolar, requatorial):
+def ER(r_polar, r_equatorial):
     import numpy as np
 
-    ee = np.empty_like(rpolar)
-    idx = rpolar > requatorial
-    ee[idx] = (rpolar[idx] ** 2 - requatorial[idx] ** 2) / rpolar[idx] ** 2
-    idx = rpolar < requatorial
-    ee[idx] = (requatorial[idx] ** 2 - rpolar[idx] ** 2) / requatorial[idx] ** 2
-    idx = rpolar == requatorial
-    ee[idx] = 2 * rpolar[idx]
-    valid = (rpolar * requatorial != 0)
+    ee = np.empty_like(r_polar)
+    idx = r_polar > r_equatorial
+    ee[idx] = (r_polar[idx] ** 2 - r_equatorial[idx] ** 2) / r_polar[idx] ** 2
+    idx = r_polar < r_equatorial
+    ee[idx] = (r_equatorial[idx] ** 2 - r_polar[idx] ** 2) / r_equatorial[idx] ** 2
+    idx = r_polar == r_equatorial
+    ee[idx] = 2 * r_polar[idx]
+    valid = (r_polar * r_equatorial != 0)
     bd = 1.0 - ee[valid]
     e1 = np.sqrt(ee[valid])
@@ -152,19 +152,19 @@
     delta = 0.75 * b1 * b2
 
-    ddd = np.zeros_like(rpolar)
-    ddd[valid] = 2.0 * (delta + 1.0) * rpolar * requatorial ** 2
+    ddd = np.zeros_like(r_polar)
+    ddd[valid] = 2.0 * (delta + 1.0) * r_polar * r_equatorial ** 2
     return 0.5 * ddd ** (1.0 / 3.0)
 
 
 demo = dict(scale=1, background=0,
-            sld=6, solvent_sld=1,
-            rpolar=50, requatorial=30,
+            sld=6, sld_solvent=1,
+            r_polar=50, r_equatorial=30,
             theta=30, phi=15,
-            rpolar_pd=.2, rpolar_pd_n=15,
-            requatorial_pd=.2, requatorial_pd_n=15,
+            r_polar_pd=.2, r_polar_pd_n=15,
+            r_equatorial_pd=.2, r_equatorial_pd_n=15,
             theta_pd=15, theta_pd_n=45,
             phi_pd=15, phi_pd_n=1)
 oldname = 'EllipsoidModel'
 oldpars = dict(theta='axis_theta', phi='axis_phi',
-               sld='sldEll', solvent_sld='sldSolv',
-               rpolar='radius_a', requatorial='radius_b')
+               sld='sldEll', sld_solvent='sldSolv',
+               r_polar='radius_a', r_equatorial='radius_b')
Index: sasmodels/models/elliptical_cylinder.py
===================================================================
--- sasmodels/models/elliptical_cylinder.py	(revision e65a3e76ad1100c96ce720a14336ae8ef3d8e0d7)
+++ sasmodels/models/elliptical_cylinder.py	(revision 74fd96f3cb65aab96542ed09140f082ada4911d6)
@@ -12,5 +12,5 @@
 .. figure:: img/elliptical_cylinder_geometry.png
 
-   Elliptical cylinder geometry $a$ = $r_{minor}$ and \nu = $r_{ratio}$ = $r_{major} / r_{minor}$
+   Elliptical cylinder geometry $a$ = $r_{minor}$ and \nu = $axis\_ratio$ = $r_{major} / r_{minor}$
 
 The function calculated is
@@ -57,5 +57,5 @@
     Examples of the angles for oriented elliptical cylinders against the detector plane.
 
-NB: The 2nd virial coefficient of the cylinder is calculated based on the averaged radius (= sqrt(*r_minor*\ :sup:`2` \* *r_ratio*))
+NB: The 2nd virial coefficient of the cylinder is calculated based on the averaged radius (= sqrt(*r_minor*\ :sup:`2` \* *axis_ratio*))
 and length values, and used as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied.
 
@@ -95,5 +95,5 @@
 #             ["name", "units", default, [lower, upper], "type","description"],
 parameters = [["r_minor",     "Ang",        20.0,  [0, inf],    "volume",      "Ellipse minor radius"],
-              ["r_ratio",     "",           1.5,   [1, inf],    "volume",      "Ratio of major radius over minor radius"],
+              ["axis_ratio",     "",           1.5,   [1, inf],    "volume",      "Ratio of major radius over minor radius"],
               ["length",      "Ang",        400.0, [1, inf],    "volume",      "Length of the cylinder"],
               ["sld",         "1e-6/Ang^2", 4.0,   [-inf, inf], "",            "Cylinder scattering length density"],
@@ -107,27 +107,27 @@
 source = ["lib/polevl.c","lib/sas_J1.c", "lib/gauss76.c", "lib/gauss20.c", "elliptical_cylinder.c"]
 
-demo = dict(scale=1, background=0, r_minor=100, r_ratio=1.5, length=400.0,
+demo = dict(scale=1, background=0, r_minor=100, axis_ratio=1.5, length=400.0,
             sld=4.0, sld_solvent=1.0, theta=10.0, phi=20, psi=30, theta_pd=10, phi_pd=2, psi_pd=3)
 
 oldname = 'EllipticalCylinderModel'
-oldpars = dict(theta='cyl_theta', phi='cyl_phi', psi='cyl_psi', sld='sldCyl', sld_solvent='sldSolv')
+oldpars = dict(axis_ratio="r_ratio",theta='cyl_theta', phi='cyl_phi', psi='cyl_psi', sld='sldCyl', sld_solvent='sldSolv')
 
-def ER(r_minor, r_ratio, length):
+def ER(r_minor, axis_ratio, length):
     """
         Equivalent radius
         @param r_minor: Ellipse minor radius
-        @param r_ratio: Ratio of major radius over minor radius
+        @param axis_ratio: Ratio of major radius over minor radius
         @param length: Length of the cylinder
     """
-    radius = math.sqrt(r_minor * r_minor * r_ratio)
+    radius = math.sqrt(r_minor * r_minor * axis_ratio)
     ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius))
     return 0.5 * (ddd) ** (1. / 3.)
 
-tests = [[{'r_minor': 20.0, 'r_ratio': 1.5, 'length':400.0}, 'ER', 79.89245454155024],
-         [{'r_minor': 20.0, 'r_ratio': 1.2, 'length':300.0}, 'VR', 1],
+tests = [[{'r_minor': 20.0, 'axis_ratio': 1.5, 'length':400.0}, 'ER', 79.89245454155024],
+         [{'r_minor': 20.0, 'axis_ratio': 1.2, 'length':300.0}, 'VR', 1],
 
          # The SasView test result was 0.00169, with a background of 0.001
          [{'r_minor': 20.0,
-           'r_ratio': 1.5,
+           'axis_ratio': 1.5,
            'sld': 4.0,
            'length':400.0,
Index: sasmodels/models/flexible_cylinder_elliptical.c
===================================================================
--- sasmodels/models/flexible_cylinder_elliptical.c	(revision b66d38efa49109d61182ada21c4f30e06f75d4cd)
+++ sasmodels/models/flexible_cylinder_elliptical.c	(revision b66d38efa49109d61182ada21c4f30e06f75d4cd)
@@ -0,0 +1,98 @@
+double form_volume(double length, double kuhn_length, double radius);
+double Iq(double q, double length, double kuhn_length, double radius,
+          double axis_ratio, double sld, double solvent_sld);
+double Iqxy(double qx, double qy, double length, double kuhn_length,
+            double radius, double axis_ratio, double sld, double solvent_sld);
+double flexible_cylinder_ex_kernel(double q, double length, double kuhn_length,
+                                double radius, double axis_ratio, double sld,
+                                double solvent_sld);
+double elliptical_crosssection(double q, double a, double b);
+
+double form_volume(double length, double kuhn_length, double radius)
+{
+    return 1.0;
+}
+
+double
+elliptical_crosssection(double q, double a, double b)
+{
+    double summ=0.0;
+
+    for(int i=0;i<N_POINTS_76;i++) {
+        double zi = ( Gauss76Z[i] + 1.0 )*M_PI/4.0;
+        double sn, cn;
+        SINCOS(zi, sn, cn);
+        double arg = q*sqrt(a*a*sn*sn+b*b*cn*cn);
+        double yyy = pow((double)sas_J1c(arg),2);
+        yyy *= Gauss76Wt[i];
+        summ += yyy;
+    }
+
+    summ /= 2.0;
+    return(summ);
+
+}
+
+double flexible_cylinder_ex_kernel(double q,
+          double length,
+          double kuhn_length,
+          double radius,
+          double axis_ratio,
+          double sld,
+          double solvent_sld)
+{
+
+    double flex,crossSect, cont;
+
+    cont = sld - solvent_sld;
+    crossSect = elliptical_crosssection(q,radius,(radius*axis_ratio));
+
+    flex = Sk_WR(q,length,kuhn_length);
+    flex *= crossSect;
+    flex *= M_PI*radius*radius*axis_ratio*axis_ratio*length;
+    flex *= cont*cont;
+    flex *= 1.0e-4;
+
+    return flex;
+}
+
+double Iq(double q,
+          double length,
+          double kuhn_length,
+          double radius,
+          double axis_ratio,
+          double sld,
+          double solvent_sld)
+{
+
+    double result = flexible_cylinder_ex_kernel(q,
+                    length,
+                    kuhn_length,
+                    radius,
+                    axis_ratio,
+                    sld,
+                    solvent_sld);
+
+    return result;
+}
+
+double Iqxy(double qx, double qy,
+            double length,
+            double kuhn_length,
+            double radius,
+            double axis_ratio,
+            double sld,
+            double solvent_sld)
+{
+    double q;
+    q = sqrt(qx*qx+qy*qy);
+    double result = flexible_cylinder_ex_kernel(q,
+                    length,
+                    kuhn_length,
+                    radius,
+                    axis_ratio,
+                    sld,
+                    solvent_sld);
+
+    return result;
+}
Index: sasmodels/models/flexible_cylinder_elliptical.py
===================================================================
--- sasmodels/models/flexible_cylinder_elliptical.py	(revision b66d38efa49109d61182ada21c4f30e06f75d4cd)
+++ sasmodels/models/flexible_cylinder_elliptical.py	(revision b66d38efa49109d61182ada21c4f30e06f75d4cd)
@@ -0,0 +1,163 @@
+r"""
+This model calculates the form factor for a flexible cylinder with an
+elliptical cross section and a uniform scattering length density.
+The non-negligible diameter of the cylinder is included by accounting
+for excluded volume interactions within the walk of a single cylinder.
+The form factor is normalized by the particle volume such that
+
+.. math::
+
+    P(q) = \text{scale} \left<F^2\right>/V + \text{background}
+
+where the averaging $\left<\ldots\right>$ is over all possible orientations
+of the flexible cylinder.
+
+The 2D scattering intensity is the same as 1D, regardless of the orientation
+of the q vector which is defined as
+
+.. math::
+
+    q = \sqrt{q_x^2 + q_y^2}
+
+
+Definitions
+-----------
+
+The function calculated in a similar way to that for the flexible_cylinder model
+from the reference given below using the author's "Method 3 With Excluded Volume".
+The model is a parameterization of simulations of a discrete representation of
+the worm-like chain model of Kratky and Porod applied in the pseudo-continuous
+limit. See equations (13, 26-27) in the original reference for the details.
+
+.. note::
+
+    There are several typos in the original reference that have been corrected
+    by WRC. Details of the corrections are in the reference below. Most notably
+
+    - Equation (13): the term $(1 - w(QR))$ should swap position with $w(QR)$
+
+    - Equations (23) and (24) are incorrect; WRC has entered these into
+      Mathematica and solved analytically. The results were then converted to
+      code.
+
+    - Equation (27) should be $q0 = max(a3/sqrt(RgSquare),3)$ instead of
+      $max(a3*b/sqrt(RgSquare),3)$
+
+    - The scattering function is negative for a range of parameter values and
+      q-values that are experimentally accessible. A correction function has been
+      added to give the proper behavior.
+
+.. figure:: img/flexible_cylinder_ex_geometry.jpg
+
+
+The chain of contour length, $L$, (the total length) can be described as a chain
+of some number of locally stiff segments of length $l_p$, the persistence length
+(the length along the cylinder over which the flexible cylinder can be considered
+a rigid rod).
+The Kuhn length $(b = 2*l_p)$ is also used to describe the stiffness of a chain.
+
+The cross section of the cylinder is elliptical, with minor radius $a$ .
+The major radius is larger, so of course, **the axis ratio (parameter 5) must be
+greater than one.** Simple constraints should be applied during curve fitting to
+maintain this inequality.
+
+The returned value is in units of $cm^{-1}$, on absolute scale.
+
+In the parameters, the $sld$ and $sld\_solvent$ represent the SLD of the
+chain/cylinder and solvent respectively. The *scale*, and the contrast are both
+multiplicative factors in the model and are perfectly correlated. One or both of
+these parameters must be held fixed during model fitting.
+
+**No inter-cylinder interference effects are included in this calculation.**
+
+References
+----------
+
+J S Pedersen and P Schurtenberger. *Scattering functions of semiflexible polymers
+with and without excluded volume effects.* Macromolecules, 29 (1996) 7602-7612
+
+Correction of the formula can be found in
+
+W R Chen, P D Butler and L J Magid, *Incorporating Intermicellar Interactions in
+the Fitting of SANS Data from Cationic Wormlike Micelles.* Langmuir,
+22(15) 2006 6539-6548
+"""
+from numpy import inf
+
+name = "flexible_cylinder_ex"
+title = "Flexible cylinder wth an elliptical cross section and a uniform " \
+        "scattering length density."
+description = """Note : scale and contrast=sldCyl-sldSolv are both multiplicative
+        factors in the
+        model and are perfectly correlated. One or
+        both of these parameters must be held fixed
+        during model fitting.
+        """
+single = False
+
+category = "shape:cylinder"
+# pylint: disable=bad-whitespace, line-too-long
+#             ["name", "units", default, [lower, upper], "type", "description"],
+parameters = [
+    ["length",      "Ang",       1000.0, [0, inf],    "volume", "Length of the flexible cylinder"],
+    ["kuhn_length", "Ang",        100.0, [0, inf],    "volume", "Kuhn length of the flexible cylinder"],
+    ["radius",      "Ang",         20.0, [1, inf],    "volume", "Radius of the flexible cylinder"],
+    ["axis_ratio",  "",             1.5, [0, inf],    "",       "Axis_ratio (major_radius/minor_radius"],
+    ["sld",         "1e-6/Ang^2",   1.0, [-inf, inf], "",       "Cylinder scattering length density"],
+    ["sld_solvent", "1e-6/Ang^2",   6.3, [-inf, inf], "",       "Solvent scattering length density"],
+    ]
+# pylint: enable=bad-whitespace, line-too-long
+
+source = ["lib/polevl.c","lib/sas_J1.c", "lib/gauss76.c", "lib/wrc_cyl.c", "flexible_cylinder_elliptical.c"]
+
+demo = dict(scale=1.0, background=0.0001,
+            length=1000.0,
+            kuhn_length=100.0,
+            radius=20.0,
+            axis_ratio=1.5,
+            sld=1.0,
+            sld_solvent=6.3)
+
+oldname = 'FlexCylEllipXModel'
+oldpars = dict(sld='sldCyl', sld_solvent='sldSolv')
+
+
+tests = [
+    # Accuracy tests based on content in test/utest_other_models.py
+    # Currently fails in OCL
+    # [{'length':     1000.0,
+    #  'kuhn_length': 100.0,
+    #  'radius':       20.0,
+    #  'axis_ratio':    1.5,
+    #  'sld':           1.0,
+    #  'sld_solvent':   6.3,
+    #  'background':    0.0001,
+    # }, 0.001, 3509.2187],
+
+    # Additional tests with larger range of parameters
+    [{'length':     1000.0,
+      'kuhn_length': 100.0,
+      'radius':       20.0,
+      'axis_ratio':    1.5,
+      'sld':           1.0,
+      'sld_solvent':   6.3,
+      'background':    0.0001,
+     }, 1.0, 0.00223819],
+    [{'length':        10.0,
+      'kuhn_length': 800.0,
+      'radius':        2.0,
+      'axis_ratio':    0.5,
+      'sld':           6.0,
+      'sld_solvent':  12.3,
+      'background':    0.001,
+     }, 0.1, 0.390281],
+    [{'length':        100.0,
+      'kuhn_length': 800.0,
+      'radius':       50.0,
+      'axis_ratio':    4.5,
+      'sld':           0.1,
+      'sld_solvent':   5.1,
+      'background':    0.0,
+     }, 1.0, 0.0016338264790]
+    ]
+
Index: smodels/models/flexible_cylinder_ex.c
===================================================================
--- sasmodels/models/flexible_cylinder_ex.c	(revision 43b7eea5794b4eb3362114ebde67ff2fb1c38fdc)
+++ 	(revision )
@@ -1,98 +1,0 @@
-double form_volume(double length, double kuhn_length, double radius);
-double Iq(double q, double length, double kuhn_length, double radius,
-          double axis_ratio, double sld, double solvent_sld);
-double Iqxy(double qx, double qy, double length, double kuhn_length,
-            double radius, double axis_ratio, double sld, double solvent_sld);
-double flexible_cylinder_ex_kernel(double q, double length, double kuhn_length,
-                                double radius, double axis_ratio, double sld,
-                                double solvent_sld);
-double elliptical_crosssection(double q, double a, double b);
-
-double form_volume(double length, double kuhn_length, double radius)
-{
-    return 1.0;
-}
-
-double
-elliptical_crosssection(double q, double a, double b)
-{
-    double summ=0.0;
-
-    for(int i=0;i<N_POINTS_76;i++) {
-        double zi = ( Gauss76Z[i] + 1.0 )*M_PI/4.0;
-        double sn, cn;
-        SINCOS(zi, sn, cn);
-        double arg = q*sqrt(a*a*sn*sn+b*b*cn*cn);
-        double yyy = pow((double)sas_J1c(arg),2);
-        yyy *= Gauss76Wt[i];
-        summ += yyy;
-    }
-
-    summ /= 2.0;
-    return(summ);
-
-}
-
-double flexible_cylinder_ex_kernel(double q,
-          double length,
-          double kuhn_length,
-          double radius,
-          double axis_ratio,
-          double sld,
-          double solvent_sld)
-{
-
-    double flex,crossSect, cont;
-
-    cont = sld - solvent_sld;
-    crossSect = elliptical_crosssection(q,radius,(radius*axis_ratio));
-
-    flex = Sk_WR(q,length,kuhn_length);
-    flex *= crossSect;
-    flex *= M_PI*radius*radius*axis_ratio*axis_ratio*length;
-    flex *= cont*cont;
-    flex *= 1.0e-4;
-
-    return flex;
-}
-
-double Iq(double q,
-          double length,
-          double kuhn_length,
-          double radius,
-          double axis_ratio,
-          double sld,
-          double solvent_sld)
-{
-
-    double result = flexible_cylinder_ex_kernel(q,
-                    length,
-                    kuhn_length,
-                    radius,
-                    axis_ratio,
-                    sld,
-                    solvent_sld);
-
-    return result;
-}
-
-double Iqxy(double qx, double qy,
-            double length,
-            double kuhn_length,
-            double radius,
-            double axis_ratio,
-            double sld,
-            double solvent_sld)
-{
-    double q;
-    q = sqrt(qx*qx+qy*qy);
-    double result = flexible_cylinder_ex_kernel(q,
-                    length,
-                    kuhn_length,
-                    radius,
-                    axis_ratio,
-                    sld,
-                    solvent_sld);
-
-    return result;
-}
Index: smodels/models/flexible_cylinder_ex.py
===================================================================
--- sasmodels/models/flexible_cylinder_ex.py	(revision ce8bed9d3dac48c0121830280f01547120648cc7)
+++ 	(revision )
@@ -1,163 +1,0 @@
-r"""
-This model calculates the form factor for a flexible cylinder with an
-elliptical cross section and a uniform scattering length density.
-The non-negligible diameter of the cylinder is included by accounting
-for excluded volume interactions within the walk of a single cylinder.
-The form factor is normalized by the particle volume such that
-
-.. math::
-
-    P(q) = \text{scale} \left<F^2\right>/V + \text{background}
-
-where the averaging $\left<\ldots\right>$ is over all possible orientations
-of the flexible cylinder.
-
-The 2D scattering intensity is the same as 1D, regardless of the orientation
-of the q vector which is defined as
-
-.. math::
-
-    q = \sqrt{q_x^2 + q_y^2}
-
-
-Definitions
------------
-
-The function calculated in a similar way to that for the flexible_cylinder model
-from the reference given below using the author's "Method 3 With Excluded Volume".
-The model is a parameterization of simulations of a discrete representation of
-the worm-like chain model of Kratky and Porod applied in the pseudo-continuous
-limit. See equations (13, 26-27) in the original reference for the details.
-
-.. note::
-
-    There are several typos in the original reference that have been corrected
-    by WRC. Details of the corrections are in the reference below. Most notably
-
-    - Equation (13): the term $(1 - w(QR))$ should swap position with $w(QR)$
-
-    - Equations (23) and (24) are incorrect; WRC has entered these into
-      Mathematica and solved analytically. The results were then converted to
-      code.
-
-    - Equation (27) should be $q0 = max(a3/sqrt(RgSquare),3)$ instead of
-      $max(a3*b/sqrt(RgSquare),3)$
-
-    - The scattering function is negative for a range of parameter values and
-      q-values that are experimentally accessible. A correction function has been
-      added to give the proper behavior.
-
-.. figure:: img/flexible_cylinder_ex_geometry.jpg
-
-
-The chain of contour length, $L$, (the total length) can be described as a chain
-of some number of locally stiff segments of length $l_p$, the persistence length
-(the length along the cylinder over which the flexible cylinder can be considered
-a rigid rod).
-The Kuhn length $(b = 2*l_p)$ is also used to describe the stiffness of a chain.
-
-The cross section of the cylinder is elliptical, with minor radius $a$ .
-The major radius is larger, so of course, **the axis ratio (parameter 5) must be
-greater than one.** Simple constraints should be applied during curve fitting to
-maintain this inequality.
-
-The returned value is in units of $cm^{-1}$, on absolute scale.
-
-In the parameters, the $sld$ and $sld\_solvent$ represent the SLD of the
-chain/cylinder and solvent respectively. The *scale*, and the contrast are both
-multiplicative factors in the model and are perfectly correlated. One or both of
-these parameters must be held fixed during model fitting.
-
-**No inter-cylinder interference effects are included in this calculation.**
-
-References
-----------
-
-J S Pedersen and P Schurtenberger. *Scattering functions of semiflexible polymers
-with and without excluded volume effects.* Macromolecules, 29 (1996) 7602-7612
-
-Correction of the formula can be found in
-
-W R Chen, P D Butler and L J Magid, *Incorporating Intermicellar Interactions in
-the Fitting of SANS Data from Cationic Wormlike Micelles.* Langmuir,
-22(15) 2006 6539-6548
-"""
-from numpy import inf
-
-name = "flexible_cylinder_ex"
-title = "Flexible cylinder wth an elliptical cross section and a uniform " \
-        "scattering length density."
-description = """Note : scale and contrast=sldCyl-sldSolv are both multiplicative
-        factors in the
-        model and are perfectly correlated. One or
-        both of these parameters must be held fixed
-        during model fitting.
-        """
-single = False
-
-category = "shape:cylinder"
-# pylint: disable=bad-whitespace, line-too-long
-#             ["name", "units", default, [lower, upper], "type", "description"],
-parameters = [
-    ["length",      "Ang",       1000.0, [0, inf],    "volume", "Length of the flexible cylinder"],
-    ["kuhn_length", "Ang",        100.0, [0, inf],    "volume", "Kuhn length of the flexible cylinder"],
-    ["radius",      "Ang",         20.0, [0, inf],    "volume", "Radius of the flexible cylinder"],
-    ["axis_ratio",  "",             1.5, [0, inf],    "",       "Axis_ratio (major_radius/minor_radius"],
-    ["sld",         "1e-6/Ang^2",   1.0, [-inf, inf], "",       "Cylinder scattering length density"],
-    ["sld_solvent", "1e-6/Ang^2",   6.3, [-inf, inf], "",       "Solvent scattering length density"],
-    ]
-# pylint: enable=bad-whitespace, line-too-long
-
-source = ["lib/polevl.c","lib/sas_J1.c", "lib/gauss76.c", "lib/wrc_cyl.c", "flexible_cylinder_ex.c"]
-
-demo = dict(scale=1.0, background=0.0001,
-            length=1000.0,
-            kuhn_length=100.0,
-            radius=20.0,
-            axis_ratio=1.5,
-            sld=1.0,
-            sld_solvent=6.3)
-
-oldname = 'FlexCylEllipXModel'
-oldpars = dict(sld='sldCyl', sld_solvent='sldSolv')
-
-
-tests = [
-    # Accuracy tests based on content in test/utest_other_models.py
-    # Currently fails in OCL
-    # [{'length':     1000.0,
-    #  'kuhn_length': 100.0,
-    #  'radius':       20.0,
-    #  'axis_ratio':    1.5,
-    #  'sld':           1.0,
-    #  'sld_solvent':   6.3,
-    #  'background':    0.0001,
-    # }, 0.001, 3509.2187],
-
-    # Additional tests with larger range of parameters
-    [{'length':     1000.0,
-      'kuhn_length': 100.0,
-      'radius':       20.0,
-      'axis_ratio':    1.5,
-      'sld':           1.0,
-      'sld_solvent':   6.3,
-      'background':    0.0001,
-     }, 1.0, 0.00223819],
-    [{'length':        10.0,
-      'kuhn_length': 800.0,
-      'radius':        2.0,
-      'axis_ratio':    0.5,
-      'sld':           6.0,
-      'sld_solvent':  12.3,
-      'background':    0.001,
-     }, 0.1, 0.390281],
-    [{'length':        100.0,
-      'kuhn_length': 800.0,
-      'radius':       50.0,
-      'axis_ratio':    4.5,
-      'sld':           0.1,
-      'sld_solvent':   5.1,
-      'background':    0.0,
-     }, 1.0, 0.0016338264790]
-    ]
-
Index: sasmodels/models/fractal.py
===================================================================
--- sasmodels/models/fractal.py	(revision 12dbc9060a2d2f1972cc8df5a80cd114bdf3876f)
+++ sasmodels/models/fractal.py	(revision dff108836e258df8a791996beb52e723f6f0caec)
@@ -48,7 +48,7 @@
 **Author:** N/A **on:**
 
-**Modified by:** Paul Butler **on:** March 18, 2016
+**Last Modified by:** Paul Butler **on:** March 20, 2016
 
-**Reviewed by:** Paul Butler **on:** March 18, 2016
+**Last Reviewed by:** Paul Butler **on:** March 20, 2016
 
 """
@@ -96,6 +96,5 @@
 source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "fractal.c"]
 
-demo = dict(scale=1, background=0,
-            volfraction=0.05,
+demo = dict(volfraction=0.05,
             radius=5.0,
             fractal_dim=2.0,
@@ -115,5 +114,6 @@
 # NOTE: test results taken from values returned by SasView 3.1.2
 tests = [
-    [{}, 0.234959183673, 0.0910228716283],
-    [{}, 0.5, 0.016235799134],
+    [{}, 0.0005, 40.4980069872],
+    [{}, 0.234734468938, 0.0947143166058],
+    [{}, 0.5, 0.0176878183458],
     ]
Index: sasmodels/models/parallelepiped.py
===================================================================
--- sasmodels/models/parallelepiped.py	(revision 2f6303248feb26e5c64a30db18b33ccd2d8815af)
+++ sasmodels/models/parallelepiped.py	(revision 5933c7f896183418b524d1f35d0d589d92e06a1b)
@@ -7,5 +7,5 @@
 ----------
 
-| This model calculates the scattering from a rectangular parallelepiped (:numref:`Figure #parallelepiped-image`).
+| This model calculates the scattering from a rectangular parallelepiped (:numref:`Figure #<parallelepiped-image>`).
 | If you need to apply polydispersity, see also :ref:`rectangular-prism`.
 
Index: sasmodels/models/triaxial_ellipsoid.py
===================================================================
--- sasmodels/models/triaxial_ellipsoid.py	(revision 2f6303248feb26e5c64a30db18b33ccd2d8815af)
+++ sasmodels/models/triaxial_ellipsoid.py	(revision 5933c7f896183418b524d1f35d0d589d92e06a1b)
@@ -36,5 +36,5 @@
 we define the axis of the cylinder using the angles $\theta$, $\phi$
 and $\psi$. These angles are defined on
-:numref:`figure #triaxial-ellipsoid-angles`.
+:numref:`figure #<triaxial-ellipsoid-angles>`.
 The angle $\psi$ is the rotational angle around its own $c$ axis
 against the $q$ plane. For example, $\psi = 0$ when the
