Index: sasmodels/compare.py
===================================================================
--- sasmodels/compare.py	(revision 69aa451cd7078d77c255be72d487793b00b34eee)
+++ sasmodels/compare.py	(revision 380e8c98ace83133a82a3b450ff1ad58072f8f07)
@@ -306,12 +306,6 @@
     Format the parameter list for printing.
     """
-    if is2d:
-        exclude = lambda n: False
-    else:
-        par1d = model_info['par_type']['1d']
-        exclude = lambda n: n not in par1d
     lines = []
-    for p in model_info['parameters']:
-        if exclude(p.name): continue
+    for p in model_info['parameters'].type['2d' if is2d else '1d']:
         fields = dict(
             value=pars.get(p.name, p.default),
Index: sasmodels/core.py
===================================================================
--- sasmodels/core.py	(revision 60eab2a7f2ffda1a9f4c3f3767712387c0e915cc)
+++ sasmodels/core.py	(revision 380e8c98ace83133a82a3b450ff1ad58072f8f07)
@@ -177,5 +177,5 @@
     value = values.get(parameter.name, parameter.default)
     if parameter.type not in ('volume', 'orientation'):
-        return np.array([value]), np.array([1.0])
+        return [value], [1.0]
     relative = parameter.type == 'volume'
     limits = parameter.limits
@@ -226,5 +226,5 @@
         active = lambda name: True
 
-    vw_pairs = [(get_weights(p, pars) if active(p.name) else ([p.default], [1]))
+    vw_pairs = [(get_weights(p, pars) if active(p.name) else ([p.default], [1.0]))
                 for p in kernel.info['parameters']]
     values, weights = zip(*vw_pairs)
Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision 60eab2a7f2ffda1a9f4c3f3767712387c0e915cc)
+++ sasmodels/generate.py	(revision 380e8c98ace83133a82a3b450ff1ad58072f8f07)
@@ -614,12 +614,11 @@
     # Note: the reversing view, x[::-1], does not require a copy
     pd_length = np.array([len(w) for w in weights])
-    print (pd_length)
-    print (weights)
     pd_offset = np.cumsum(np.hstack((0, pd_length)))
     pd_isvol = np.array([p.type=='volume' for p in pars])
     idx = np.argsort(pd_length)[::-1][:max_pd]
-    print (idx)
     pd_stride = np.cumprod(np.hstack((1, pd_length[idx][:-1])))
     par_offsets = np.cumsum(np.hstack((2, pd_length)))[:-1]
+    coord_offset = par_offset+npars
+    fast_coord_offset = par_offset+2*npars
 
     theta_par = -1
@@ -637,12 +636,31 @@
     details[par_offset+0*npars:par_offset+1*npars] = par_offsets
     details[par_offset+1*npars:par_offset+2*npars] = 0  # no coordination for most
-    details[par_offset+2*npars:par_offset+3*npars] = 0  # no fast coord with 0
-    coord_offset = par_offset+1*npars
     for k,parameter_num in enumerate(idx):
         details[coord_offset+parameter_num] = 2**k
+    details[fast_coord_offset] = idx[0]
+    details[fast_coord_offset+1:fast_coord_offset+npars] = 0  # no fast coord with 0
     details[constants_offset] = 1   # fast_coord_count: one fast index
     details[constants_offset+1] = theta_par
-    print ("details",details)
+    print("polydispersity details")
+    print_details(model_info, details)
     return details
+
+def print_details(model_info, details):
+    max_pd = model_info['max_pd']
+    pars = model_info['parameters'].kernel_pars()
+    npars = len(pars)
+    par_offset = 5*max_pd
+    constants_offset = par_offset + 3*npars
+
+    print("pd_par", details[0*max_pd:1*max_pd])
+    print("pd_length", details[1*max_pd:2*max_pd])
+    print("pd_offset", details[2*max_pd:3*max_pd])
+    print("pd_stride", details[3*max_pd:4*max_pd])
+    print("pd_isvol", details[4*max_pd:5*max_pd])
+    print("par_offsets", details[par_offset+0*npars:par_offset+1*npars])
+    print("par_coord", details[par_offset+1*npars:par_offset+2*npars])
+    print("fast_coord_pars", details[par_offset+2*npars:par_offset+3*npars])
+    print("fast_coord_count", details[constants_offset])
+    print("theta par", details[constants_offset+1])
 
 def constrained_poly_details(model_info, weights, constraints):
Index: sasmodels/kernel_header.c
===================================================================
--- sasmodels/kernel_header.c	(revision 5cf3c33c6d8945e61877718f81a29df7bbd1478d)
+++ sasmodels/kernel_header.c	(revision 380e8c98ace83133a82a3b450ff1ad58072f8f07)
@@ -103,6 +103,6 @@
 #  define M_4PI_3 4.18879020478639
 #endif
-static double square(double x) { return x*x; }
-static double cube(double x) { return x*x*x; }
-static double sinc(double x) { return x==0 ? 1.0 : sin(x)/x; }
+static inline double square(double x) { return x*x; }
+static inline double cube(double x) { return x*x*x; }
+static inline double sinc(double x) { return x==0 ? 1.0 : sin(x)/x; }
 
Index: sasmodels/kernel_iq.c
===================================================================
--- sasmodels/kernel_iq.c	(revision 60eab2a7f2ffda1a9f4c3f3767712387c0e915cc)
+++ sasmodels/kernel_iq.c	(revision 380e8c98ace83133a82a3b450ff1ad58072f8f07)
@@ -54,7 +54,6 @@
   double *pvec = (double *)(&local_values);  // Alias named parameters with a vector
 
-#if MAX_PD > 0
-  if (problem->pd_length[0] == 1) {
-#endif // MAX_PD > 0
+  // Monodisperse computation
+  if (pd_stop == 1) {
     // Shouldn't need to copy!!
     for (int k=0; k < NPARS; k++) {
@@ -72,11 +71,9 @@
     }
     return;
+  }
+
 #if MAX_PD > 0
-  }
-
-  // polydispersity loop index positions
-  local int offset[NPARS];  // NPARS excludes scale/background
-
-  printf("Entering polydispersity\n");
+
+printf("Entering polydispersity\n");
   // Since we are no longer looping over the entire polydispersity hypercube
   // for each q, we need to track the normalization values for each q in a
@@ -107,4 +104,7 @@
   // Location in the polydispersity hypercube, one index per dimension.
   local int pd_index[MAX_PD];
+
+  // polydispersity loop index positions
+  local int offset[NPARS];  // NPARS excludes scale/background
 
   // Trigger the reset behaviour that happens at the end the fast loop
@@ -132,8 +132,9 @@
       for (int k=1; k < MAX_PD; k++) {
         pd_index[k] = (loop_index%problem->pd_length[k])/problem->pd_stride[k];
-        const double wi = weights[problem->pd_offset[0]+pd_index[0]];
+        const double wi = weights[problem->pd_offset[k]+pd_index[k]];
         partial_weight *= wi;
         if (problem->pd_isvol[k]) partial_volweight *= wi;
       }
+      printf("slow %d: ", loop_index);
       for (int k=0; k < NPARS; k++) {
         int coord = problem->par_coord[k];
@@ -149,5 +150,7 @@
         offset[k] = this_offset;
         pvec[k] = values[this_offset];
-      }
+        printf("p[%d]=v[%d]=%g ", k, offset[k], pvec[k]);
+      }
+      printf("\n");
       weight = partial_weight * weights[problem->pd_offset[0]+pd_index[0]];
       if (problem->theta_par >= 0) {
@@ -157,26 +160,23 @@
         weight *= spherical_correction;
       }
+      pd_index[0] += 1;
 
     } else {
 
       // INCREMENT INDICES
-      pd_index[0] += 1;
       const double wi = weights[problem->pd_offset[0]+pd_index[0]];
       weight = partial_weight*wi;
       if (problem->pd_isvol[0]) vol_weight *= wi;
+      printf("fast %d: ", loop_index);
       for (int k=0; k < problem->fast_coord_count; k++) {
-         printf("fast loop %d coord %d idx %d ?%d offset %d %g\n",
-         k,problem->fast_coord_pars[k],pd_index[0],
-        problem->fast_coord_pars[k],
-            offset[problem->fast_coord_pars[k]],
-            values[offset[problem->fast_coord_pars[k]]]
-          );
-        pvec[problem->fast_coord_pars[k]]
-            = values[offset[problem->fast_coord_pars[k]]++];
-
-      }
-      if (problem->theta_par ==problem->pd_par[0]) {
+        const int pindex = problem->fast_coord_pars[k];
+        pvec[pindex] = values[++offset[pindex]];
+        printf("p[%d]=v[%d]=%g ", pindex, offset[pindex], pvec[pindex]);
+      }
+      printf("\n");
+      if (problem->theta_par == problem->pd_par[0]) {
         weight *= fabs(cos(M_PI_180*pvec[problem->theta_par]));
       }
+      pd_index[0] += 1;
     }
     #ifdef INVALID
@@ -201,10 +201,10 @@
   }
 
-  //Makes a normalization available for the next round
+  // Make normalization available for the next round
   result[nq] = norm;
   result[nq+1] = vol;
   result[nq+2] = norm_vol;
 
-  //End of the PD loop we can normalize
+  // End of the PD loop we can normalize
   if (pd_stop >= problem->pd_stride[MAX_PD-1]) {
     #ifdef USE_OPENMP
Index: sasmodels/kerneldll.py
===================================================================
--- sasmodels/kerneldll.py	(revision e69b36f938f0b69df551a70342933fc423388f95)
+++ sasmodels/kerneldll.py	(revision 380e8c98ace83133a82a3b450ff1ad58072f8f07)
@@ -270,5 +270,8 @@
         max_pd = self.info['max_pd']
         start, stop = 0, details[4*max_pd-1]
-        print(details)
+        print("in kerneldll")
+        print("details", details)
+        print("weights", weights)
+        print("values", values)
         args = [
             self.q_input.nq, # nq
