Index: smodels/models/micelle_spherical_core.c
===================================================================
--- sasmodels/models/micelle_spherical_core.c	(revision 0d0aee160a94e4d66091b571a5117dc34ac0052a)
+++ 	(revision )
@@ -1,129 +1,0 @@
-double Iq(double q,
-        double ndensity,
-        double v_core,
-        double v_corona,
-        double solvent_sld,
-        double core_sld,
-        double corona_sld,
-        double radius_core,
-        double radius_gyr,
-        double d_penetration,
-        double n_aggreg);
-
-
-double Iqxy(double qx, double qy,
-            double ndensity,
-            double v_core,
-            double v_corona,
-            double solvent_sld,
-            double core_sld,
-            double corona_sld,
-            double radius_core,
-            double radius_gyr,
-            double d_penetration,
-            double n_aggreg);
-
-
-static double micelle_spherical_kernel(double q,
-        double ndensity,
-        double v_core,
-        double v_corona,
-        double solvent_sld,
-        double core_sld,
-        double corona_sld,
-        double radius_core,
-        double radius_gyr,
-        double d_penetration,
-        double n_aggreg)
-{
-    const double rho_solv = solvent_sld;     // sld of solvent [1/A^2]
-    const double rho_core = core_sld;        // sld of core [1/A^2]
-    const double rho_corona = corona_sld;    // sld of corona [1/A^2]
-
-    const double beta_core = v_core * (rho_core - rho_solv);
-    const double beta_corona = v_corona * (rho_corona - rho_solv);
-
-    // Self-correlation term of the core
-    const double bes_core = sph_j1c(q*radius_core);
-    const double term1 = n_aggreg*n_aggreg*beta_core*beta_core*bes_core*bes_core;
-
-    // Self-correlation term of the chains
-    const double qrg2 = q*radius_gyr*q*radius_gyr;
-    const double debye_chain = (qrg2 == 0.0) ? 1.0 : 2.0*(exp(-qrg2)-1+qrg2)/(qrg2*qrg2);
-    const double term2 = n_aggreg * beta_corona * beta_corona * debye_chain;
-
-    // Interference cross-term between core and chains
-    const double chain_ampl = (qrg2 == 0.0) ? 1.0 : (1-exp(-qrg2))/qrg2;
-    const double bes_corona = sinc(q*(radius_core + d_penetration * radius_gyr));
-    const double term3 = 2 * n_aggreg * n_aggreg * beta_core * beta_corona *
-                 bes_core * chain_ampl * bes_corona;
-
-    // Interference cross-term between chains
-    const double term4 = n_aggreg * (n_aggreg - 1.0) * beta_corona * beta_corona *
-                 chain_ampl * chain_ampl * bes_corona * bes_corona;
-
-    // I(q)_micelle : Sum of 4 terms computed above
-    double i_micelle = term1 + term2 + term3 + term4;
-
-    // rescale from [A^2] to [cm^2]
-    i_micelle *= 1.0e-13;
-
-    // "normalize" by number density --> intensity in [cm-1]
-    i_micelle *= ndensity;
-
-    return(i_micelle);
-
-}
-
-double Iq(double q,
-        double ndensity,
-        double v_core,
-        double v_corona,
-        double solvent_sld,
-        double core_sld,
-        double corona_sld,
-        double radius_core,
-        double radius_gyr,
-        double d_penetration,
-        double n_aggreg)
-{
-    return micelle_spherical_kernel(q,
-            ndensity,
-            v_core,
-            v_corona,
-            solvent_sld,
-            core_sld,
-            corona_sld,
-            radius_core,
-            radius_gyr,
-            d_penetration,
-            n_aggreg);
-}
-
-double Iqxy(double qx, double qy,
-            double ndensity,
-            double v_core,
-            double v_corona,
-            double solvent_sld,
-            double core_sld,
-            double corona_sld,
-            double radius_core,
-            double radius_gyr,
-            double d_penetration,
-            double n_aggreg)
-{
-    double q = sqrt(qx*qx + qy*qy);
-    return micelle_spherical_kernel(q,
-            ndensity,
-            v_core,
-            v_corona,
-            solvent_sld,
-            core_sld,
-            corona_sld,
-            radius_core,
-            radius_gyr,
-            d_penetration,
-            n_aggreg);
-
-}
-
Index: smodels/models/micelle_spherical_core.py
===================================================================
--- sasmodels/models/micelle_spherical_core.py	(revision db74c47822e8b4c809499a9d9a0c2e0bfc7940ee)
+++ 	(revision )
@@ -1,76 +1,0 @@
-r"""
-
-This model provides the form factor, $P(q)$, for a micelle with a spherical
-core and Gaussian polymer chains attached to the surface, thus may be applied
-to block copolymer micelles. To work well the Gaussian chains must be much smaller
-than the core, which is often not the case.  Please study the reference carefully.
-
-Definition
-----------
-
-The 1D scattering intensity for this model is calculated according to
-the equations given by Pedersen (Pedersen, 2000).
-
-Validation
-----------
-
-This model has not yet been validated. Feb2015
-
-
-References
-----------
-
-J Pedersen, *J. Appl. Cryst.*, 33 (2000) 637-640
-
-"""
-
-from numpy import inf
-
-name = "micelle_spherical_core"
-title = "Micelle Spherical Core model"
-description = """
-    This model provides the form factor, $P(q)$, for a micelle with
-    a spherical core and Gaussian polymer chains attached to the surface.
-    """
-category = "shape-independent"
-
-# pylint: disable=bad-whitespace, line-too-long
-#   ["name", "units", default, [lower, upper], "type","description"],
-parameters = [
-    ["ndensity",      "1e15/cm^3",  8.94, [0.0, inf], "", "Number density of micelles"],
-    ["v_core",        "Ang^3",  62624.0,  [0.0, inf], "", "Core volume "],
-    ["v_corona",      "Ang^3",  61940.0,  [0.0, inf], "", "Corona volume"],
-    ["sld_solvent",   "1e-6/Ang^2", 6.4,  [0.0, inf], "", "Solvent scattering length density"],
-    ["sld_core",      "1e-6/Ang^2", 0.34, [0.0, inf], "", "Core scattering length density"],
-    ["sld_corona",    "1e-6/Ang^2", 0.8,  [0.0, inf], "", "Corona scattering length density"],
-    ["radius_core",   "Ang",       45.0,  [0.0, inf], "", "Radius of core ( must be >> radius_gyr )"],
-    ["radius_gyr",    "Ang",       20.0,  [0.0, inf], "", "Radius of gyration of chains in corona"],
-    ["d_penetration", "",           1.0,  [-inf, inf], "", "Factor to mimic non-penetration of Gaussian chains"],
-    ["n_aggreg",      "",           6.0,  [-inf, inf], "", "Aggregation number of the micelle"],
-    ]
-# pylint: enable=bad-whitespace, line-too-long
-
-source = ["lib/sph_j1c.c", "micelle_spherical_core.c"]
-
-demo = dict(scale=1, background=0,
-            ndensity=8.94,
-            v_core=62624.0,
-            v_corona=61940.0,
-            sld_solvent=6.4,
-            sld_core=0.34,
-            sld_corona=0.8,
-            radius_core=45.0,
-            radius_gyr=20.0,
-            d_penetration=1.0,
-            n_aggreg=6.0)
-
-
-oldname = 'MicelleSphCoreModel'
-oldpars = dict(sld_solvent='rho_solv',
-               sld_core='rho_core',
-               sld_corona='rho_corona')
-
-tests = [
-    [{}, 0.01, 15.3532],
-    ]
-# RKH 20Mar2016 - need to check whether the core & corona volumes are per monomer ??? and how aggregation number works!
Index: sasmodels/models/polymer_micelle.py
===================================================================
--- sasmodels/models/polymer_micelle.py	(revision 1e9a108a9404075e31ddee58f1d75b34a48df2fb)
+++ sasmodels/models/polymer_micelle.py	(revision 1e9a108a9404075e31ddee58f1d75b34a48df2fb)
@@ -0,0 +1,78 @@
+r"""
+
+This model provides the form factor, $P(q)$, for a micelle with a spherical
+core and Gaussian polymer chains attached to the surface, thus may be applied
+to block copolymer micelles. To work well the Gaussian chains must be much smaller
+than the core, which is often not the case.  Please study the reference carefully.
+
+Definition
+----------
+
+The 1D scattering intensity for this model is calculated according to
+the equations given by Pedersen (Pedersen, 2000).
+
+Validation
+----------
+
+This model has not yet been validated. Feb2015
+
+
+References
+----------
+
+J Pedersen, *J. Appl. Cryst.*, 33 (2000) 637-640
+
+"""
+
+from numpy import inf
+
+name = "polymer_micelle"
+title = "Polymer micelle model"
+description = """
+    This model provides an approximate form factor, P(q), for a micelle with
+    a spherical core with Gaussian polymer chains attached to the surface.
+    """
+category = "shape:sphere"
+
+# pylint: disable=bad-whitespace, line-too-long
+#   ["name", "units", default, [lower, upper], "type","description"],
+parameters = [
+    ["ndensity",      "1e15/cm^3",  8.94, [0.0, inf], "", "Number density of micelles"],
+    ["v_core",        "Ang^3",  62624.0,  [0.0, inf], "", "Core volume "],
+    ["v_corona",      "Ang^3",  61940.0,  [0.0, inf], "", "Corona volume"],
+    ["sld_solvent",   "1e-6/Ang^2", 6.4,  [0.0, inf], "", "Solvent scattering length density"],
+    ["sld_core",      "1e-6/Ang^2", 0.34, [0.0, inf], "", "Core scattering length density"],
+    ["sld_corona",    "1e-6/Ang^2", 0.8,  [0.0, inf], "", "Corona scattering length density"],
+    ["radius_core",   "Ang",       45.0,  [0.0, inf], "", "Radius of core ( must be >> radius_gyr )"],
+    ["radius_gyr",    "Ang",       20.0,  [0.0, inf], "", "Radius of gyration of chains in corona"],
+    ["d_penetration", "",           1.0,  [-inf, inf], "", "Factor to mimic non-penetration of Gaussian chains"],
+    ["n_aggreg",      "",           6.0,  [-inf, inf], "", "Aggregation number of the micelle"],
+    ]
+# pylint: enable=bad-whitespace, line-too-long
+
+source = ["lib/sph_j1c.c", "polymer_micelle_kernel.c"]
+
+demo = dict(scale=1, background=0,
+            ndensity=8.94,
+            v_core=62624.0,
+            v_corona=61940.0,
+            sld_solvent=6.4,
+            sld_core=0.34,
+            sld_corona=0.8,
+            radius_core=45.0,
+            radius_gyr=20.0,
+            d_penetration=1.0,
+            n_aggreg=6.0)
+
+
+oldname = 'MicelleSphCoreModel'
+oldpars = dict(sld_solvent='rho_solv',
+               sld_core='rho_core',
+               sld_corona='rho_corona')
+
+tests = [
+    [{}, 0.01, 15.3532],
+    ]
+# RKH 20Mar2016 - need to check whether the core & corona volumes are per monomer ??? and how aggregation number works!
+# renamed from micelle_spherical_core to polymer_micelle, moved from shape-independent to spheres section.
+# Ought to be able to add polydisp to core? And add ability to x by S(Q) ?
Index: sasmodels/models/polymer_micelle_kernel.c
===================================================================
--- sasmodels/models/polymer_micelle_kernel.c	(revision 1e9a108a9404075e31ddee58f1d75b34a48df2fb)
+++ sasmodels/models/polymer_micelle_kernel.c	(revision 1e9a108a9404075e31ddee58f1d75b34a48df2fb)
@@ -0,0 +1,129 @@
+double Iq(double q,
+        double ndensity,
+        double v_core,
+        double v_corona,
+        double solvent_sld,
+        double core_sld,
+        double corona_sld,
+        double radius_core,
+        double radius_gyr,
+        double d_penetration,
+        double n_aggreg);
+
+
+double Iqxy(double qx, double qy,
+            double ndensity,
+            double v_core,
+            double v_corona,
+            double solvent_sld,
+            double core_sld,
+            double corona_sld,
+            double radius_core,
+            double radius_gyr,
+            double d_penetration,
+            double n_aggreg);
+
+
+static double micelle_spherical_kernel(double q,
+        double ndensity,
+        double v_core,
+        double v_corona,
+        double solvent_sld,
+        double core_sld,
+        double corona_sld,
+        double radius_core,
+        double radius_gyr,
+        double d_penetration,
+        double n_aggreg)
+{
+    const double rho_solv = solvent_sld;     // sld of solvent [1/A^2]
+    const double rho_core = core_sld;        // sld of core [1/A^2]
+    const double rho_corona = corona_sld;    // sld of corona [1/A^2]
+
+    const double beta_core = v_core * (rho_core - rho_solv);
+    const double beta_corona = v_corona * (rho_corona - rho_solv);
+
+    // Self-correlation term of the core
+    const double bes_core = sph_j1c(q*radius_core);
+    const double term1 = n_aggreg*n_aggreg*beta_core*beta_core*bes_core*bes_core;
+
+    // Self-correlation term of the chains
+    const double qrg2 = q*radius_gyr*q*radius_gyr;
+    const double debye_chain = (qrg2 == 0.0) ? 1.0 : 2.0*(exp(-qrg2)-1+qrg2)/(qrg2*qrg2);
+    const double term2 = n_aggreg * beta_corona * beta_corona * debye_chain;
+
+    // Interference cross-term between core and chains
+    const double chain_ampl = (qrg2 == 0.0) ? 1.0 : (1-exp(-qrg2))/qrg2;
+    const double bes_corona = sinc(q*(radius_core + d_penetration * radius_gyr));
+    const double term3 = 2 * n_aggreg * n_aggreg * beta_core * beta_corona *
+                 bes_core * chain_ampl * bes_corona;
+
+    // Interference cross-term between chains
+    const double term4 = n_aggreg * (n_aggreg - 1.0) * beta_corona * beta_corona *
+                 chain_ampl * chain_ampl * bes_corona * bes_corona;
+
+    // I(q)_micelle : Sum of 4 terms computed above
+    double i_micelle = term1 + term2 + term3 + term4;
+
+    // rescale from [A^2] to [cm^2]
+    i_micelle *= 1.0e-13;
+
+    // "normalize" by number density --> intensity in [cm-1]
+    i_micelle *= ndensity;
+
+    return(i_micelle);
+
+}
+
+double Iq(double q,
+        double ndensity,
+        double v_core,
+        double v_corona,
+        double solvent_sld,
+        double core_sld,
+        double corona_sld,
+        double radius_core,
+        double radius_gyr,
+        double d_penetration,
+        double n_aggreg)
+{
+    return micelle_spherical_kernel(q,
+            ndensity,
+            v_core,
+            v_corona,
+            solvent_sld,
+            core_sld,
+            corona_sld,
+            radius_core,
+            radius_gyr,
+            d_penetration,
+            n_aggreg);
+}
+
+double Iqxy(double qx, double qy,
+            double ndensity,
+            double v_core,
+            double v_corona,
+            double solvent_sld,
+            double core_sld,
+            double corona_sld,
+            double radius_core,
+            double radius_gyr,
+            double d_penetration,
+            double n_aggreg)
+{
+    double q = sqrt(qx*qx + qy*qy);
+    return micelle_spherical_kernel(q,
+            ndensity,
+            v_core,
+            v_corona,
+            solvent_sld,
+            core_sld,
+            corona_sld,
+            radius_core,
+            radius_gyr,
+            d_penetration,
+            n_aggreg);
+
+}
+
Index: sasmodels/models/raspberry.c
===================================================================
--- sasmodels/models/raspberry.c	(revision a2d8a67a8370b3bfa30cff11c890597d110cfe2b)
+++ sasmodels/models/raspberry.c	(revision 616df8f1d3e93ff47223b402bbf8dd7c019c0b09)
@@ -27,8 +27,8 @@
 
 
-    double vfL, rL, sldL, vfS, rS, sldS, deltaS, delrhoL, delrhoS, sldSolv, aSs;
+    double vfL, rL, sldL, vfS, rS, sldS, deltaS, delrhoL, delrhoS, sldSolv;
     double VL, VS, Np, f2, fSs;
     double psiL,psiS;
-    double sfLS,sfSS,Np2,fSs2;
+    double sfLS,sfSS;
     double slT;
  
