Index: kernel/doc/examples/chain.py
===================================================================
--- kernel/doc/examples/chain.py	(revision 531)
+++ kernel/doc/examples/chain.py	(working copy)
@@ -15,7 +15,6 @@
 for i in range(0,20):
     p= IMP.Particle()
     pi= m.add_particle(p)
-    chain.append(p)
     d= IMP.XYZDecorator.create(p)
     d.set_x(random.uniform(0,10))
     d.set_y(random.uniform(0,10))
@@ -27,6 +26,7 @@
         bp= IMP.BondedDecorator.create(p)
         bpr= IMP.BondedDecorator.cast(chain.back())
         b= IMP.custom_bond(bp, bpr, 1.5*radius, 10)
+    chain.append(p)
 
 # If you want to inspect the particles
 # Notice that each bond is a particle
@@ -34,7 +34,7 @@
     p.show()
 
 # Set up the nonbonded list
-nbl= IMP.AllNonbondedListScoreState(rk, chain)
+nbl= IMP.AllNonbondedListScoreState(1, rk, chain)
 nbli= m.add_score_state(nbl)
 # This ScoreState uses the bonds constructed above to restrain
 bl= IMP.BondDecoratorListScoreState(chain)
@@ -43,7 +43,7 @@
 # Set up excluded volume
 ps= IMP.SphereDistancePairScore(IMP.HarmonicLowerBound(0,1),
                                 rk)
-evr= IMP.NonbondedRestraint(ps, nbl, 1)
+evr= IMP.NonbondedRestraint(ps, nbl)
 evri= m.add_restraint(evr)
 
 # Restraint for bonds