Optimized code for spherical polymers.