Index: sasmodels/models/bcc.c
===================================================================
--- sasmodels/models/bcc.c	(revision 82d239a5cb4d8005a4b04bf42b1425792a28383d)
+++ sasmodels/models/bcc.c	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
@@ -100,5 +100,5 @@
 
   double b3_x, b3_y, b1_x, b1_y, b2_x, b2_y; //b3_z,
-  double q_z;
+  //double q_z;
   double cos_val_b3, cos_val_b2, cos_val_b1;
   double a1_dot_q, a2_dot_q,a3_dot_q;
@@ -123,5 +123,5 @@
   const double latticescale = 2.0*(4.0/3.0)*M_PI*(radius*radius*radius)/(s1*s1*s1);
   // q vector
-  q_z = 0.0; // for SANS; assuming qz is negligible
+  //q_z = 0.0; // for SANS; assuming qz is negligible
   /// Angles here are respect to detector coordinate
   ///  instead of against q coordinate(PRB 36(46), 3(6), 1754(3854))
Index: sasmodels/models/hardsphere.py
===================================================================
--- sasmodels/models/hardsphere.py	(revision eb69cce00f0781ad8f3eec0eb5965a8576d815b5)
+++ sasmodels/models/hardsphere.py	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
@@ -23,5 +23,5 @@
 
 
-.. figure:: img/HardSphere_1d.jpg
+.. figure:: img/hardSphere_1d.jpg
 
     1D plot using the default values (in linear scale).
Index: sasmodels/models/mass_surface_fractal.c
===================================================================
--- sasmodels/models/mass_surface_fractal.c	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
+++ sasmodels/models/mass_surface_fractal.c	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
@@ -0,0 +1,76 @@
+double form_volume(double radius);
+
+double Iq(double q,
+          double mass_dim,
+          double surface_dim,
+          double cluster_rg,
+          double primary_rg);
+
+double Iqxy(double qx, double qy,
+          double mass_dim,
+          double surface_dim,
+          double cluster_rg,
+          double primary_rg);
+
+
+static double _mass_surface_fractal_kernel(double q,
+          double mass_dim,
+          double surface_dim,
+          double cluster_rg,
+          double primary_rg)
+{
+     //computation
+    double tot_dim = 6.0 - surface_dim - mass_dim;
+    mass_dim /= 2.0;
+    tot_dim /= 2.0;
+
+    double rc_norm = cluster_rg * cluster_rg / (3.0 * mass_dim);
+    double rp_norm = primary_rg * primary_rg / (3.0 * tot_dim);
+
+    //x for P
+    double x_val1 = 1.0 +  q * q * rc_norm;
+    double x_val2 = 1.0 +  q * q * rp_norm;
+
+    double inv_form = pow(x_val1, mass_dim) * pow(x_val2, tot_dim);
+
+    //another singular
+    if (inv_form == 0.0) return 0.0;
+
+    double form_factor = 1.0;
+    form_factor /= inv_form;
+
+    return (form_factor);
+}
+double form_volume(double radius){
+
+    return 1.333333333333333*M_PI*radius*radius*radius;
+}
+
+double Iq(double q,
+          double mass_dim,
+          double surface_dim,
+          double cluster_rg,
+          double primary_rg)
+{
+    return _mass_surface_fractal_kernel(q,
+            mass_dim,
+            surface_dim,
+            cluster_rg,
+            primary_rg);
+}
+
+// Iqxy is never called since no orientation or magnetic parameters.
+double Iqxy(double qx, double qy,
+          double mass_dim,
+          double surface_dim,
+          double cluster_rg,
+          double primary_rg)
+{
+    double q = sqrt(qx*qx + qy*qy);
+    return _mass_surface_fractal_kernel(q,
+           mass_dim,
+           surface_dim,
+           cluster_rg,
+           primary_rg);
+}
+
Index: sasmodels/models/mass_surface_fractal.py
===================================================================
--- sasmodels/models/mass_surface_fractal.py	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
+++ sasmodels/models/mass_surface_fractal.py	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
@@ -0,0 +1,130 @@
+r"""
+
+A number of natural and commercial processes form high-surface area materials
+as a result of the vapour-phase aggregation of primary particles.
+Examples of such materials include soots, aerosols, and fume or pyrogenic
+silicas. These are all characterised by cluster mass distributions (sometimes
+also cluster size distributions) and internal surfaces that are fractal in
+nature. The scattering from such materials displays two distinct breaks in
+log-log representation, corresponding to the radius-of-gyration of the primary
+particles, $rg$, and the radius-of-gyration of the clusters (aggregates),
+$Rg$. Between these boundaries the scattering follows a power law related to
+the mass fractal dimension, $Dm$, whilst above the high-Q boundary the
+scattering follows a power law related to the surface fractal dimension of
+the primary particles, $Ds$.
+
+Definition
+----------
+
+The scattered intensity I(q) is calculated using a modified
+Ornstein-Zernicke equation
+
+.. math::
+
+    I(q) = scale \times P(q) + background
+
+    P(q) = \left\{ \left[ 1+(q^2a)\right]^{D_m/2} \times
+                   \left[ 1+(q^2b)\right]^{(6-D_s-D_m)/2}
+           \right\}^{-1}
+
+    a = R_{g}^2/(3D_m/2)
+
+    b = r_{g}^2/[-3(D_s+D_m-6)/2]
+
+    scale = scale\_factor \times NV^2 (\rho_{particle} - \rho_{solvent})^2
+
+where $R_g$ is the size of the cluster, $r_g$ is the size of the primary
+particle, $D_s$ is the surface fractal dimension, $D_m$ is the mass fractal
+dimension, $\rho_{solvent}$ is the scattering length density of the solvent,
+and $\rho_{particle}$ is the scattering length density of particles.
+
+.. note::
+
+    The surface ( $D_s$ ) and mass ( $D_m$ ) fractal dimensions are only
+    valid if $0 < surface_dim < 6$ , $0 < mass_dim < 6$ , and
+    $(surface_dim + mass_dim ) < 6$ .
+
+.. figure:: img/mass_surface_fractal_1d.jpg
+
+    1D plot using the default values.
+
+Reference
+---------
+
+P Schmidt, *J Appl. Cryst.*, 24 (1991) 414-435 Equation(19)
+
+A J Hurd, D W Schaefer, J E Martin, *Phys. Rev. A*, 35 (1987) 2361-2364 Equation(2)
+
+"""
+
+from numpy import inf
+
+name = "mass_surface_fractal"
+title = "Mass Surface Fractal model"
+description = """
+        The scattering intensity  I(x) = scale*P(x)*S(x) + background, where
+        p(x)= {[1+(x^2*a)]^(Dm/2) * [1+(x^2*b)]^(6-Ds-Dm)/2}^(-1)
+        a = Rg^2/(3*Dm/2)
+        b = rg^2/(3*(6-Ds-Dm)/2)
+        scale        =  scale factor * N*Volume^2*contrast^2
+        mass_dim       =  Dm (mass fractal dimension)
+        surface_dim  =  Ds
+        cluster_rg  =  Rg
+        primary_rg    =  rg
+        background   =  background
+        Ref: Schmidt, J Appl Cryst, eq(19), (1991), 24, 414-435
+        Hurd, Schaefer, Martin, Phys Rev A, eq(2),(1987),35, 2361-2364
+        Note that 0 < Ds< 6 and 0 < Dm < 6.
+        """
+category = "shape-independent"
+
+#             ["name", "units", default, [lower, upper], "type","description"],
+parameters = [["mass_dim",      "",    1.8, [1e-16, 6.0], "",
+               "Mass fractal dimension"],
+              ["surface_dim",   "",    2.3, [1e-16, 6.0], "",
+               "Surface fractal dimension"],
+              ["cluster_rg", "Ang",   86.7, [0.0, inf], "",
+               "Cluster radius of gyration"],
+              ["primary_rg", "Ang", 4000.,  [0.0, inf], "",
+               "Primary particle radius of gyration"],
+              ]
+
+
+source = ["lib/J1c.c", "mass_surface_fractal.c"]
+
+demo = dict(scale=1, background=0,
+            mass_dim=1.8,
+            surface_dim=2.3,
+            cluster_rg=86.7,
+            primary_rg=4000.0)
+
+oldname = 'MassSurfaceFractal'
+oldpars = dict(radius='radius',
+               mass_dim='mass_dim',
+               surface_dim='surface_dim',
+               cluster_rg='cluster_rg',
+               primary_rg='primary_rg')
+
+tests = [[{'radius':        2.0,
+           'mass_dim':      3.3,
+           'surface_dim':   1.0,
+           'cluster_rg':   90.0,
+           'primary_rg': 4000.0,
+           }, 0.001, 0.18462699016],
+
+         [{'radius':        1.0,
+           'mass_dim':      1.3,
+           'surface_dim':   1.0,
+           'cluster_rg':   90.0,
+           'primary_rg': 2000.0,
+           'background':    0.8,
+           }, 0.001, 1.16539753641],
+
+         [{'radius':        1.0,
+           'mass_dim':      2.3,
+           'surface_dim':   1.0,
+           'cluster_rg':   90.0,
+           'primary_rg': 1000.0,
+           'scale':        10.0,
+           }, 0.051, 0.000169548800377],
+         ]
Index: sasmodels/models/triaxial_ellipsoid.c
===================================================================
--- sasmodels/models/triaxial_ellipsoid.c	(revision 513efc509d218370e6a8ca9cabf24f087a2de902)
+++ sasmodels/models/triaxial_ellipsoid.c	(revision 7ed702f2d0d4ecbcb0115970cdabf0d05ac08de0)
@@ -20,5 +20,5 @@
 
     double sn, cn;
-    double st, ct;
+    //double st, ct;
     //const double lower = 0.0;
     //const double upper = 1.0;
