diff --git a/CHANGES b/CHANGES
index bbeaa441d5136b4eda0d7168f519871e51f084e4..690bace01e8dbb8fecee6a0a4ed8e109e5251605 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,38 @@
+14/09/2019 V2.1.1
+
+I have removed the "default" pointer from the cmd_line_args,
+because it really wasn't used except by WTTS. It now is called
+wtts_string to make this explicit, and most variables have it
+set to WTTS_USE_DEFAULT, so the default is output automatically.
+
+The variables such as star[x].mass, separation, metallicity, etc.
+which were set directly in cmd_line_args.h are now replaced by
+preferences->xyz variables, which are then copied to the appropriate
+locations. This means there is a more logical setup with the command
+line args only setting preferences options, rather than random other
+parts of the code.
+
+The new function set_defaults() should be used to set the default
+parameters in preferences. The "list_args" now uses these.
+
+Fixed a bug in configure where binary_c_version_macros.h had the wrong
+ifndef ... endif macros, clashing with binary_c_version.h.
+
+Added the patch number as a macro, so version numbers like 2.1.1
+are now valid.
+
+Added the major, minor and patch number macros to version.c
+
+Also synced the latest libmemoize and librinterpolate.
+
+Fixed a memory leak in the discs code, and its interaction with
+libmemoize, which only manifests itself when an existing disc
+is appended. A call to free the memoize data before doing this
+fixes the problem.
+
+Fixed a bug in stellar_structure_Hestar which caused lock-ups, this was
+because of a tiny-timestep loop.
+
 07/09/2019 Final cleanup for V2.1
 
 There were issues with old/new gcc clashes on our slurm cluster: this
diff --git a/TODO b/TODO
index 1cf975f3d9eb82ccbcf49ec1a8ba13c78fc06e96..ec02eb1fc198e3ebd3bc4c45fe5c54d43821b3f1 100644
--- a/TODO
+++ b/TODO
@@ -1,9 +1,10 @@
 
+Change fixed-length strings, where possible, to C99 flexible array members
+https://en.wikipedia.org/wiki/Flexible_array_member
 
-find a way to reconstruct the actual derivative over a timestep 
-from the stack.
 
 ------------------------------------------------------------
+
 Magnetic braking for remannts (NS,WD)
 
 mechanism for preventing events within events
diff --git a/configure b/configure
index 4f744e85aa28394eca7280151c46b335da4260dd..52ea70cd918f4fcb850615cfa0ac81be07920a3a 100755
--- a/configure
+++ b/configure
@@ -51,7 +51,7 @@ use Cwd qw/realpath/;
 use vars qw($acmlflags $auto_opt $binary $bits @c_files $cc $cflags $generic $coptflags $cpu %cpuinfo $Dcflags $debug $accurate $duma $extrainc $extralibdirs $extralibs $features $gprof $gcov $hostname %icc_opts $incdirs $ld $ldflags $ldpath $lib $make $makefilename $nolic $nprocessors $objcopy_opts $opt $os $owd $optdebug $src_dir $static %suncc_opts $tbse_test $v $vb $use_precomp $precomp_file $precomp_build_flags $precomp_use_flags $global_warn $compiler_version $sanitize $standard $soname $depsubflags @dataobjects $gcc_hints);
 my $colour = colours();
 
-print "Configuration for $colour->{red}binary_c$colour->{reset}\n\n";
+print "Configuration for ",$colour->{'bold red'},"binary_c$colour->{reset}\n\n";
 
 checks();
 defaults();
@@ -322,7 +322,7 @@ sub secondary_variables
 	    $coptflags=~s/-fomit-frame-pointer// if($opt=~/\-pg/);
 	    
 	    # all warnings, normal optimization, fPIC for shared library
-	    $cflags.=" -fPIC -std=gnu99 -Wall -Wstrict-prototypes -O$opt  ";
+	    $cflags.=" -fPIC -std=gnu99 -Wall -Wformat-signedness -Wformat -Wstrict-prototypes -O$opt  ";
 
             # activate gcc hints
             if(defined $gcc_hints && 
@@ -1205,26 +1205,32 @@ sub make_version_numbers
     my $version = slurp('src/binary_c_version.h');
     $version = ($version =~
                 /\#define\s+BINARY_C_VERSION\s+\"([^\"]+)\"\s+/)[0];
-    my ($major,$minor,$pre) = ($version=~/^(\d+)\.(\d+)(?:pre)?(\d*)/);
-    print "Version $version -> Major $major, Minor $minor, Pre $pre\n";
+    my ($major,$minor,$patch,$pre) = ($version=~/^(\d+)\.(\d+)(?:\.(\d+))?(?:pre)?(\d*)/);
+    print $colour->{'green'},"Version $version -> Major $major, Minor $minor, Patch $patch";
+    if(defined $pre)
+    {
+        print " Pre $pre";
+    }
+    print $colour->{'reset'},"\n";
     open(HEADER,'>','src/binary_c_version_macros.h');
     print HEADER "
 /*
  * This file is automatically generated by the binary_c
  * configure script.
  * 
- * Please do not change it by hand or add it to the SVN 
+ * Please do not change it by hand or add it to the git
  * repository!
  */
 \#pragma once
-\#ifndef BINARY_C_VERSION_H
-\#define BINARY_C_VERSION_H
+\#ifndef BINARY_C_VERSION_MACROS_H
+\#define BINARY_C_VERSION_MACROS_H
 
 \#define BINARY_C_MAJOR_VERSION $major
 \#define BINARY_C_MINOR_VERSION $minor
+\#define BINARY_C_PATCH_VERSION $patch
 \#define BINARY_C_PRE_VERSION $pre
 
-\#endif // BINARY_C_VERSION_H
+\#endif // BINARY_C_VERSION_MACROS_H
 ";
     close HEADER;
 
@@ -1363,7 +1369,7 @@ sub checklib
                              /attempt to open (\S+lib$soname.so) succeeded/)[0];
                     if(defined $path && $path)
                     {
-                        print "Found path (0.5) ";
+                        #print "Found path (0.5) ";
                         last LINKER;
                     }
                 }
diff --git a/doc/binary_c-API.lyx b/doc/binary_c-API.lyx
index 1098cccfdc247d5b0c13b156f180a295e3c6a5e4..41d3b3ceb36f23733787162bf400d3812c2adfd8 100644
--- a/doc/binary_c-API.lyx
+++ b/doc/binary_c-API.lyx
@@ -899,7 +899,7 @@ You may find there is a clash between
 status open
 
 \begin_layout Plain Layout
-MAX
+Max
 \end_layout
 
 \end_inset
@@ -909,12 +909,12 @@ MAX
 status open
 
 \begin_layout Plain Layout
-MIN
+Min
 \end_layout
 
 \end_inset
 
- macros and various standard libraries.
+ macros (and perhaps others) and various standard libraries.
  In which case, use 
 \begin_inset Flex Software
 status open
@@ -960,12 +960,12 @@ status open
 
 \begin_layout Plain Layout
 
-#pragma push_macro("MAX")
+#pragma push_macro("Max")
 \end_layout
 
 \begin_layout Plain Layout
 
-#pragma push_macro("MIN")
+#pragma push_macro("Min")
 \end_layout
 
 \begin_layout Plain Layout
@@ -974,12 +974,12 @@ status open
 
 \begin_layout Plain Layout
 
-#undef MAX
+#undef Max
 \end_layout
 
 \begin_layout Plain Layout
 
-#undef MIN
+#undef Min
 \end_layout
 
 \begin_layout Plain Layout
@@ -1012,12 +1012,12 @@ status open
 
 \begin_layout Plain Layout
 
-#undef MAX 
+#undef Max
 \end_layout
 
 \begin_layout Plain Layout
 
-#undef MIN
+#undef Min
 \end_layout
 
 \begin_layout Plain Layout
@@ -1026,12 +1026,12 @@ status open
 
 \begin_layout Plain Layout
 
-#pragma pop_macro("MIN")
+#pragma pop_macro("Min")
 \end_layout
 
 \begin_layout Plain Layout
 
-#pragma pop_macro("MAX")
+#pragma pop_macro("Max")
 \end_layout
 
 \begin_layout Plain Layout
@@ -1300,7 +1300,28 @@ binary_c_API_function
 \end_layout
 
 \begin_layout Standard
-The skeleton code below can be used as a basis to do whatever you like.
+The skeleton code below can be used as a basis to do whatever you like,
+ see also 
+\begin_inset Flex File
+status open
+
+\begin_layout Plain Layout
+aptitest.f90
+\end_layout
+
+\end_inset
+
+ in the 
+\begin_inset Flex File
+status open
+
+\begin_layout Plain Layout
+apitest
+\end_layout
+
+\end_inset
+
+ directory.
 \end_layout
 
 \begin_layout Standard
@@ -1511,8 +1532,18 @@ Python
 
 \end_inset
 
- backend.
- Please contact Robert Izzard to acquire it.
+ currently interface available at 
+\begin_inset Flex URL
+status open
+
+\begin_layout Plain Layout
+
+https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python
+\end_layout
+
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Subsection
@@ -3173,7 +3204,7 @@ status open
 
 \begin_layout Plain Layout
 
-	int n = 0; // loop until n = 10
+	unsigned int n = 0; // loop until n = 10
 \end_layout
 
 \begin_layout Plain Layout
@@ -3508,7 +3539,7 @@ valgrind
 status open
 
 \begin_layout Plain Layout
-USE_MCHECK
+CODESTATS
 \end_layout
 
 \end_inset
@@ -3518,7 +3549,7 @@ USE_MCHECK
 status open
 
 \begin_layout Plain Layout
-code_options.h
+binary_c_code_options.h
 \end_layout
 
 \end_inset
diff --git a/doc/binary_c2.html b/doc/binary_c2.html
index 4b9ebae2959991b146071cf787e2f9b28eb3e290..3c4324765622cf6da2f0751129caca33b53dcc39 100644
--- a/doc/binary_c2.html
+++ b/doc/binary_c2.html
@@ -2,7 +2,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta name="GENERATOR" content="LyX 2.3.2" />
+<meta name="GENERATOR" content="LyX 2.3.3" />
 <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
 <title>binary_c documentation</title>
 <style type='text/css'>
@@ -129,6 +129,9 @@ a.tocentry {
   color: black;
 }
 a.tocentry:visited { color: black; }
+span.flex_url {
+font-family: monospace;
+}
  
 	span.flex_file {
 	  font-style: italic; 
@@ -153,11 +156,27 @@ div.listings-caption {
 	  font-style: italic; 
 	} 
  
-	span.flex_bashscript {
+	span.flex_software {
 	  font-style: italic; 
 	} 
  
-	span.flex_software {
+	span.flex_envvar {
+	  font-family: monospace; 
+	} 
+ 
+	span.flex_args {
+	  font-family: monospace; 
+	} 
+ 
+	span.flex_command {
+	  font-family: monospace; 
+	} 
+ 
+	span.flex_perlscript {
+	  font-style: italic; 
+	} 
+ 
+	span.flex_bashscript {
 	  font-style: italic; 
 	} 
 div.Boxed {
@@ -184,9 +203,6 @@ div.foot:hover div.foot_inner {
 	border: 1px double black;
 	margin: 0em 1em;
 	padding: 1em;
-}
-span.flex_url {
-font-family: monospace;
 }
  
 	span.flex_programminglanguage {
@@ -197,14 +213,6 @@ font-family: monospace;
 	  font-family: monospace; 
 	} 
  
-	span.flex_args {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_envvar {
-	  font-family: monospace; 
-	} 
- 
 	span.flex_perlmodule {
 	  font-family: monospace; 
 	} 
@@ -235,18 +243,10 @@ div.float-caption {
 	  font-family: monospace; 
 	} 
  
-	span.flex_perlscript {
-	  font-style: italic; 
-	} 
- 
 	span.flex_sourcefile {
 	  font-style: italic; 
 	} 
  
-	span.flex_command {
-	  font-family: monospace; 
-	} 
- 
 	span.flex_cstruct {
 	  font-family: monospace; 
 	} 
@@ -282,12 +282,12 @@ div.float-caption {
 
 </b></div>
 
-<div class="plain_layout" style='text-align: center;' id='magicparlabel-9'><b>Version 2.x (V2.0pre32 GIT revision 4137:20190712:7590abb9)
+<div class="plain_layout" style='text-align: center;' id='magicparlabel-9'><b>Version 2.1
 <br />
 
 </b></div>
 
-<div class="plain_layout" style='text-align: center;' id='magicparlabel-10'><b>Warning: Version 2 of <em><i>binary_c</i></em> is currently under development. Details are likely to change. </b></div>
+<div class="plain_layout" style='text-align: center;' id='magicparlabel-10'><b>Warning: <em><i>binary_c</i></em> is always under development, so details are likely to change. </b></div>
 </div></b></div>
 
 
@@ -301,308 +301,331 @@ div.float-caption {
 <div class='lyxtoc-3'><a href='#magicparlabel-14' class='tocentry'>1.1 Disclaimer</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-16' class='tocentry'>1.2 Licence</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-20' class='tocentry'>1.2 Licence</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-22' class='tocentry'>1.3 Mailing lists</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-26' class='tocentry'>1.3 Mailing lists</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-27' class='tocentry'>1.4 Conventions</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-31' class='tocentry'>1.4 Conventions</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-66' class='tocentry'>2 Introduction</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-70' class='tocentry'>2 Quick start guide</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-107' class='tocentry'>2.1 Binary_c: tools for stellar evolution and population synthesis</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-72' class='tocentry'>2.1 Download and build <i>binary_c</i></a>
 </div>
+
+<div class='lyxtoc-3'><a href='#magicparlabel-284' class='tocentry'>2.2 Running a single- or binary-star system</a>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-117' class='tocentry'>3 Installation</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-317' class='tocentry'>2.3 Running a grid of stars with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow>
+   <mstyle mathvariant='normal'>
+    <mstyle mathvariant='italic'>
+     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
+     </mrow>
+    </mstyle>
+   </mstyle><mn>2</mn>
+  </mrow>
+ </mrow></mstyle></math></a>
+</div>
+</div>
 
+<div class='lyxtoc-2'><a href='#magicparlabel-472' class='tocentry'>3 Introduction</a>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-120' class='tocentry'>3.1 Quick start</a>
+
+<div class='lyxtoc-3'><a href='#magicparlabel-513' class='tocentry'>3.1 Binary_c: tools for stellar evolution and population synthesis</a>
+</div>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-138' class='tocentry'>3.2 Getting <i>binary_c</i></a>
+<div class='lyxtoc-2'><a href='#magicparlabel-523' class='tocentry'>4 Installation</a>
+
+
+<div class='lyxtoc-3'><a href='#magicparlabel-526' class='tocentry'>4.1 Quick start</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-245' class='tocentry'>3.3 System Requirements</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-544' class='tocentry'>4.2 Getting <i>binary_c</i></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-409' class='tocentry'>3.4 Configuring and building <i>binary_c</i></a>
+<div class='lyxtoc-3'><a href='#magicparlabel-651' class='tocentry'>4.3 System Requirements</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-630' class='tocentry'>3.5 Testing <i>binary_c</i></a>
+<div class='lyxtoc-3'><a href='#magicparlabel-815' class='tocentry'>4.4 Configuring and building <i>binary_c</i></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-679' class='tocentry'>3.6 Directory structure</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-1036' class='tocentry'>4.5 Testing <i>binary_c</i></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-709' class='tocentry'>3.7 Building binary_grid2: the population synthesis module</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-1085' class='tocentry'>4.6 Directory structure</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1196' class='tocentry'>3.8 <em><i>binary_grid2</i></em> backends</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-1115' class='tocentry'>4.7 Building binary_grid2: the population synthesis module</a>
+</div>
+
+<div class='lyxtoc-3'><a href='#magicparlabel-1602' class='tocentry'>4.8 <em><i>binary_grid2</i></em> backends</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-1448' class='tocentry'>4 Evolving single and binary stars</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-1854' class='tocentry'>5 Evolving single and binary stars</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1451' class='tocentry'>4.1 Running</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-1857' class='tocentry'>5.1 Running</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-1602' class='tocentry'>5 Making populations of stars with <i>binary_grid2</i></a>
+<div class='lyxtoc-2'><a href='#magicparlabel-2008' class='tocentry'>6 Making populations of stars with <i>binary_grid2</i></a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1622' class='tocentry'>5.1 Introduction</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2028' class='tocentry'>6.1 Introduction</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1645' class='tocentry'>5.2 Aims: what the grid does and why</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2051' class='tocentry'>6.2 Aims: what the grid does and why</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1647' class='tocentry'>5.3 Grid dimensions</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2053' class='tocentry'>6.3 Grid dimensions</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1660' class='tocentry'>5.4 What to do with the grid</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2066' class='tocentry'>6.4 What to do with the grid</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1669' class='tocentry'>5.5 Grid setup (in theory)</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2075' class='tocentry'>6.5 Grid setup (in theory)</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1690' class='tocentry'>5.6 Data parsing</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2096' class='tocentry'>6.6 Data parsing</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1702' class='tocentry'>5.7 Running grids of stars</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2108' class='tocentry'>6.7 Running grids of stars</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1843' class='tocentry'>5.8 Important Subroutines in your grid script</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2249' class='tocentry'>6.8 Important Subroutines in your grid script</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-1878' class='tocentry'>5.9 Your <em>grid script </em>and coupling your population synthesis to <em><i>binary_c</i>/nucsyn</em></a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2284' class='tocentry'>6.9 Your <em>grid script </em>and coupling your population synthesis to <em><i>binary_c</i>/nucsyn</em></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2072' class='tocentry'>5.10 Save your data – or process on the fly?</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2546' class='tocentry'>6.10 Save your data – or process on the fly?</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2103' class='tocentry'>5.11 Flexigrid</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2577' class='tocentry'>6.11 Flexigrid</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2125' class='tocentry'>5.12 Setup in your grid script</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2599' class='tocentry'>6.12 Setup in your grid script</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2225' class='tocentry'>5.13 3D grid example</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2699' class='tocentry'>6.13 3D grid example</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2281' class='tocentry'>5.14 Viewing The (Automatically Generated) Gridcode </a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2755' class='tocentry'>6.14 Viewing The (Automatically Generated) Gridcode </a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2309' class='tocentry'>5.15 Error handling</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2783' class='tocentry'>6.15 Error handling</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2333' class='tocentry'>5.16 Flexigrid variable options</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2807' class='tocentry'>6.16 Flexigrid variable options</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2380' class='tocentry'>5.17 Flexigrid loop structure</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2854' class='tocentry'>6.17 Flexigrid loop structure</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2440' class='tocentry'>5.18 <i>binary_grid</i> with <em>HTCondor</em></a>
+<div class='lyxtoc-3'><a href='#magicparlabel-2914' class='tocentry'>6.18 <i>binary_grid</i> with <em>HTCondor</em></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-2869' class='tocentry'>5.19 Binary_grid with <!-- Output Error: Closing tag `a' when other tags are pending. Discarded pending tags:
-&lt;em&gt;
- -->
-</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-3343' class='tocentry'>6.19 Binary_grid with <em>slurm</em></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3002' class='tocentry'>5.20 Initial distributions (IMF etc.) </a>
+<div class='lyxtoc-3'><a href='#magicparlabel-3472' class='tocentry'>6.20 Initial distributions (IMF etc.) </a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3023' class='tocentry'>5.21 Grid spacings</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-3493' class='tocentry'>6.21 Grid spacings</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3033' class='tocentry'>5.22 The <span class='math'>\binarygrid</span>
+<div class='lyxtoc-3'><a href='#magicparlabel-3503' class='tocentry'>6.22 The <span class='math'>\binarygrid</span>
  thread model</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3194' class='tocentry'>5.23 Debugging, benchmarking and advanced topics</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-3664' class='tocentry'>6.23 Debugging, benchmarking and advanced topics</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3396' class='tocentry'>5.24 Future Plans</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-3866' class='tocentry'>6.24 Future Plans</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3400' class='tocentry'>5.25 Cookbook</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-3870' class='tocentry'>6.25 Cookbook</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3611' class='tocentry'>5.26 FAQ</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4081' class='tocentry'>6.26 FAQ</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3715' class='tocentry'>5.27 Multi-core scaling</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4185' class='tocentry'>6.27 Multi-core scaling</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3723' class='tocentry'>5.28 Testing Setup</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4193' class='tocentry'>6.28 Testing Setup</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3773' class='tocentry'>5.29 Results</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4243' class='tocentry'>6.29 Results</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3830' class='tocentry'>5.30 Conclusions</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4300' class='tocentry'>6.30 Conclusions</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-3915' class='tocentry'>6 <em><i>binary_c</i> </em>API</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-4385' class='tocentry'>7 <em><i>binary_c</i> </em>API</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-3919' class='tocentry'>6.1 Naming conventions</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4389' class='tocentry'>7.1 Naming conventions</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4039' class='tocentry'>6.2 Using the API</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4509' class='tocentry'>7.2 Using the API</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4260' class='tocentry'>6.3 Standard functions</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4742' class='tocentry'>7.3 Standard functions</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4507' class='tocentry'>6.4 Extension functions</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-4989' class='tocentry'>7.4 Extension functions</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4557' class='tocentry'>6.5 API Examples</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-5039' class='tocentry'>7.5 API Examples</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-4777' class='tocentry'>7 Code description and internals</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-5259' class='tocentry'>8 Code description and internals</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4780' class='tocentry'>7.1 History</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-5262' class='tocentry'>8.1 History</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4842' class='tocentry'>7.2 How the <em><i>binary_c</i></em> code works</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-5324' class='tocentry'>8.2 How the <em><i>binary_c</i></em> code works</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-4850' class='tocentry'>7.3 Memory management in <span class='math'>binary_c</i></span>
+<div class='lyxtoc-3'><a href='#magicparlabel-5332' class='tocentry'>8.3 Memory management in <span class='math'>binary_c</i></span>
 </a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-5223' class='tocentry'>7.4 Output</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-5705' class='tocentry'>8.4 Output</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-5303' class='tocentry'>7.5 Debugging <span class='math'>binary_c</i></span>
+<div class='lyxtoc-3'><a href='#magicparlabel-5785' class='tocentry'>8.5 Debugging <span class='math'>binary_c</i></span>
 </a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-5596' class='tocentry'>7.6 Events</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-6078' class='tocentry'>8.6 Events</a>
+</div>
+
+<div class='lyxtoc-3'><a href='#magicparlabel-6333' class='tocentry'>8.7 Timestepping</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-5773' class='tocentry'>7.7 Timestepping</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-6412' class='tocentry'>8.8 Code layout, header files, flow</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-5852' class='tocentry'>7.8 Code layout, header files, flow</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-6814' class='tocentry'>8.9 nucsyn</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6254' class='tocentry'>7.9 nucsyn</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7153' class='tocentry'>8.10 Coding style</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6593' class='tocentry'>7.10 Control scripts</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7215' class='tocentry'>8.11 Control scripts</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-6613' class='tocentry'>8 Advanced Configuration</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-7235' class='tocentry'>9 Advanced Configuration</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6637' class='tocentry'>8.1 configure</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7259' class='tocentry'>9.1 configure</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6664' class='tocentry'>8.2 <i>binary_c</i>-config</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7286' class='tocentry'>9.2 <i>binary_c</i>-config</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6757' class='tocentry'>8.3 Makefile -D&hellip;</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7379' class='tocentry'>9.3 Makefile -D&hellip;</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6791' class='tocentry'>8.4 binary_c_code_options.h</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7413' class='tocentry'>9.4 binary_c_code_options.h</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6830' class='tocentry'>8.5 binary_c_parameters.h</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7452' class='tocentry'>9.5 binary_c_parameters.h</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-6994' class='tocentry'>8.6 nucsyn/nucsyn_parameters.h</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7616' class='tocentry'>9.6 nucsyn/nucsyn_parameters.h</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-7113' class='tocentry'>9 <em><i>binary_c</i> </em>software development cycle</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-7735' class='tocentry'>10 <em><i>binary_c</i> </em>software development cycle</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7117' class='tocentry'>9.1 The git revolution</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7739' class='tocentry'>10.1 The git revolution</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7140' class='tocentry'>9.2 The master(trunk)–branch model</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7762' class='tocentry'>10.2 The master(trunk)–branch model</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-7225' class='tocentry'>10 Cookbook</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-7847' class='tocentry'>11 Cookbook</a>
 
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7226' class='tocentry'>10.1 How to log output</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7848' class='tocentry'>11.1 How to log output</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7240' class='tocentry'>10.2 How to find which source files contain a string</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7862' class='tocentry'>11.2 How to find which source files contain a string</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7264' class='tocentry'>10.3 How to build with debugging output</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7886' class='tocentry'>11.3 How to build with debugging output</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7298' class='tocentry'>10.4 How to check for NaNs (not a numbers)</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7920' class='tocentry'>11.4 How to check for NaNs (not a numbers)</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7320' class='tocentry'>10.5 How to exit <em><i>binary_c</i></em></a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7942' class='tocentry'>11.5 How to exit <em><i>binary_c</i></em></a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7343' class='tocentry'>10.6 How to debug segfaults</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-7965' class='tocentry'>11.6 How to debug segfaults</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7383' class='tocentry'>10.7 How to debug memory leaks</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8005' class='tocentry'>11.7 How to debug memory leaks</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7421' class='tocentry'>10.8 How to show the arguments that <em>tbse</em> would use, but do not evolve a star</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8043' class='tocentry'>11.8 How to show the arguments that <em>tbse</em> would use, but do not evolve a star</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7427' class='tocentry'>10.9 How to run a star which has the arguments in a file</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8049' class='tocentry'>11.9 How to run a star which has the arguments in a file</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7433' class='tocentry'>10.10 How to use profile guided optimization (PGO)</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8055' class='tocentry'>11.10 How to use profile guided optimization (PGO)</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7458' class='tocentry'>10.11 How to get help</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8080' class='tocentry'>11.11 How to get help</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7473' class='tocentry'>10.12 How to add a parameter</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8095' class='tocentry'>11.12 How to add a parameter</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7492' class='tocentry'>10.13 How to build on a Mac</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8114' class='tocentry'>11.13 How to build on a Mac</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7494' class='tocentry'>10.14 How to build as a shared library</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8116' class='tocentry'>11.14 How to build as a shared library</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7500' class='tocentry'>10.15 How to calculate stellar yields or population statistics</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8122' class='tocentry'>11.15 How to calculate stellar yields or population statistics</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7546' class='tocentry'>10.16 <em>bash</em> autocompletion of <i>binary_c</i> arguments</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8168' class='tocentry'>11.16 <em>bash</em> autocompletion of <i>binary_c</i> arguments</a>
 </div>
 
-<div class='lyxtoc-3'><a href='#magicparlabel-7576' class='tocentry'>10.17 How to find the <em>git</em> revision and <em>git</em> URL</a>
+<div class='lyxtoc-3'><a href='#magicparlabel-8198' class='tocentry'>11.17 How to find the <em>git</em> revision and <em>git</em> URL</a>
 </div>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-7612' class='tocentry'>11 Changelog</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-8234' class='tocentry'>12 Changelog</a>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-7639' class='tocentry'>12 Acknowledgements</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-8262' class='tocentry'>13 Acknowledgements</a>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-7646' class='tocentry'>A Grid options (<em>grid_options</em> hash)</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-8269' class='tocentry'>A Grid options (<em>grid_options</em> hash)</a>
 </div>
 
-<div class='lyxtoc-2'><a href='#magicparlabel-7703' class='tocentry'>B Binary_c/nucsyn options (<em>bse_options</em> hash)</a>
+<div class='lyxtoc-2'><a href='#magicparlabel-8326' class='tocentry'>B Binary_c/nucsyn options (<em>bse_options</em> hash)</a>
 </div>
 </div>
 </div>
@@ -612,15 +635,15 @@ div.float-caption {
 Please read this section before continuing.</div>
 <h3 class="subsection" id='magicparlabel-14'><span class="subsection_label">1.1</span> Disclaimer</h3>
 <div class="standard" id='magicparlabel-15'><div id="subsec_Disclaimer"></div>
-Robert Izzard (henceforth RGI) is <em>not responsible</em> for anything you do with this code, for the results, quality of code or results, etc.&nbsp;it is up to you to make sure you get things right! You can check every line of source code if you like. While RGI has done his best to make sure everything that follows (and in his papers) is correct <b>there are certainly bugs and omissions</b>. Please, if you find one, can you let him know.</div>
-<h3 class="subsection" id='magicparlabel-16'><span class="subsection_label">1.2</span> Licence</h3>
-<div class="standard" id='magicparlabel-17'><div id="subsec_Licence"></div>
+Robert Izzard (henceforth RGI) is <em>not responsible</em> for anything you do with this code, for the results, quality of code or results, etc.&nbsp;it is up to you to make sure you get things right! You can check every line of source code if you like. While RGI has done his best to make sure everything that follows (and in his papers) is correct <b>there are certainly bugs and omissions</b>. Please, if you find one, can you let him know, preferably through the gitlab bug reporting interface <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>/issues">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>/issues</a> or by email.</div>
+<h3 class="subsection" id='magicparlabel-20'><span class="subsection_label">1.2</span> Licence</h3>
+<div class="standard" id='magicparlabel-21'><div id="subsec_Licence"></div>
 Please read the <span class="flex_file">LICENCE</span> file provided in the <em><i>binary_c</i></em> directory tree.</div>
-<h3 class="subsection" id='magicparlabel-22'><span class="subsection_label">1.3</span> Mailing lists</h3>
-<div class="standard" id='magicparlabel-23'><div id="subsec_mailing_lists"></div>
+<h3 class="subsection" id='magicparlabel-26'><span class="subsection_label">1.3</span> Mailing lists</h3>
+<div class="standard" id='magicparlabel-27'><div id="subsec_mailing_lists"></div>
 There are two mailing lists for <i>binary_c</i>, both on Google's &ldquo;groups&rdquo; service</div>
 
-<ul class="itemize" id='magicparlabel-24'><li class="itemize_item">The announcements list
+<ul class="itemize" id='magicparlabel-28'><li class="itemize_item">The announcements list
 <br />
 
 <a href=" https://groups.google.com/group/<i>binary_c</i>-nucsyn-announce"> https://groups.google.com/group/<i>binary_c</i>-nucsyn-announce</a>
@@ -639,20 +662,20 @@ This is more of a discussion list outlining specific changes to physics and tech
 
 <a href="https://www.facebook.com/groups/149489915089142/?fref=ts">https://www.facebook.com/groups/149489915089142/?fref=ts</a></li>
 </ul>
-<h3 class="subsection" id='magicparlabel-27'><span class="subsection_label">1.4</span> Conventions</h3>
-<div class="standard" id='magicparlabel-28'>It is assumed you are using a <em>bash</em> shell and are familiar with the <span class="flex_os">Linux</span>/<span class="flex_os">Unix</span> command line. Instructions which should be executed in a <em>bash</em> shells are preceded by <span style='font-family:monospace;font-size: 18px;'>$</span> symbols, which <em>you should not</em> <em>type</em>!, like this<br />
+<h3 class="subsection" id='magicparlabel-31'><span class="subsection_label">1.4</span> Conventions</h3>
+<div class="standard" id='magicparlabel-32'>It is assumed you are using a <em>bash</em> shell and are familiar with the <span class="flex_os">Linux</span>/<span class="flex_os">Unix</span> command line. Instructions which should be executed in a <em>bash</em> shells are preceded by <span style='font-family:monospace;font-size: 18px;'>$</span> symbols, which <em>you should not</em> <em>type</em>!, like this<br />
 <pre class\s*='listings bash'>$ cd $HOME
 $ ls</pre><br />
 bash <em>scripts</em> look like this</div>
 
-<div class="standard" id='magicparlabel-42'><br />
+<div class="standard" id='magicparlabel-46'><br />
 <pre class ='listings'># this is a bash script
 export BINARY_C=$HOME/progs/stars/<i>binary_c</i>
 cd $BINARY_C
 ./<i>binary_c</i> version</pre><br />
 while <em>C</em> code looks like this</div>
 
-<div class="standard" id='magicparlabel-50'><br />
+<div class="standard" id='magicparlabel-54'><br />
 <pre class ='listings'>int x;
 x++;</pre><br />
 and <span class="flex_scriptinglanguage">Perl</span> code looks like this <br />
@@ -660,24 +683,311 @@ and <span class="flex_scriptinglanguage">Perl</span> code looks like this <br />
 $y++;</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-65'><br />
-</div>
-<h2 class="section" id='magicparlabel-66'><span class="section_label">2</span> Introduction</h2>
-<div class="standard" id='magicparlabel-67'><div id="sec_Introduction"></div>
+<div class="standard" id='magicparlabel-69'><br />
+</div>
+<h2 class="section" id='magicparlabel-70'><span class="section_label">2</span> Quick start guide</h2>
+<div class="standard" id='magicparlabel-71'>This section is a quick guide to getting <i>binary_c</i> and <i>binary_grid</i> to work. Please start reading at Section&nbsp;<a href="#sec_Introduction">3</a> if you want the full manual with complete installation instructions in Section&nbsp;<a href="#subsec_Getting_binary_c">4.2</a>.</div>
+<h3 class="subsection" id='magicparlabel-72'><span class="subsection_label">2.1</span> Download and build <i>binary_c</i></h3>
+<div class="standard" id='magicparlabel-73'>In the following, I assume you have internet access. I also assume you are building for a generic 64-bit CPU on Linux, and have software like <span class="flex_software">gcc</span>, <span class="flex_software">make</span>, <span class="flex_software">Perl</span>, <span class="flex_software">wget</span> and other standard build tools installed. I assume your temporary directory is <span class="flex_file">/tmp</span> and you use a shell like <span class="flex_software">bash</span>. Installed libraries will be put in <span class="flex_file">$HOME/lib</span> (with associated files in <span class="flex_file">$HOME/include</span> etc.) so they are private to the user, rather than in system locations. <i>binary_c</i> will be installed in <span class="flex_file">$HOME/progs/stars/<i>binary_c</i></span> and other software will be downloaded and built in <span class="flex_file">$HOME/git</span>.</div>
+
+<ul class="itemize" id='magicparlabel-114'><li class="itemize_item">First, you need access to the git server. Please try to log in with a <em>gmail</em> account at gitlab.eps.surrey.ac.uk and when it blocks you, email Rob (<a href="r.izzard@surrey.ac.uk">r.izzard@surrey.ac.uk</a>) to ask for access. You will then be granted access.</li>
+<li class="itemize_item">(Do this once) Add to your <span class="flex_file">.bashrc</span> or equivalent shell profile<br />
+<pre class ='listings'>export BINARY_C=$HOME/progs/stars/<i>binary_c</i></pre><br />
+and<em> <b>restart your shell</b> </em>so that the environment variable <span class="flex_envvar">BINARY_C</span> is defined.</li>
+<li class="itemize_item">(Do this once) Set up LD_LIBRARY_PATH in <span class="flex_file">.bashrc</span> unless it already points to <span class="flex_file">$HOME/lib</span>. Add the following to <span class="flex_file">.bashrc</span><br />
+<pre class ='listings'>export LD_LIBRARY_PATH=$HOME/lib</pre><br />
+and <em><b>restart your shell</b></em>.</li>
+<li class="itemize_item">If you can, install <span class="flex_software">libbsd</span> – this is a system package so requires root access. You will require the <em>development</em> version which contains the various header files, this is usually called <span class="flex_software">libbsd-dev</span> (or similar). <span class="flex_software">libbsd</span> is not required for <i>binary_c</i> but is useful and speeds up the code.</li>
+<li class="itemize_item">If you can, install RGI's custom <em>GSL</em> which has a few small fixes to make it behave better. At present, the latest release is 2.5. <br />
+<pre class ='listings'>export PREFIX=$HOME
+cd $HOME/git
+git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/GSL-RGI.git
+cd GSL-RGI/2.5
+./configure
+make 
+make install</pre><br />
+</li>
+<li class="itemize_item">If you can, install <span class="flex_software">librinterpolate</span>. <br />
+<pre class ='listings'>export PREFIX=$HOME
+export CFLAGS=&rdquo;-O3 -mtune=generic&rdquo;
+mkdir $HOME/lib $HOME/git
+cd $HOME/git
+git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/librinterpolate.git
+cd $HOME/git/librinterpolate/src
+make 
+make install</pre><br />
+</li>
+<li class="itemize_item">If you can, install <span class="flex_software">libmemoize</span>. <br />
+<pre class ='listings'>export PREFIX=$HOME
+export CFLAGS=&rdquo;-O3 -mtune=generic&rdquo;
+mkdir $HOME/lib $HOME/git
+cd $HOME/git
+git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/libmemoize.git
+cd $HOME/git/librinterpolate/src
+make 
+make install</pre><br />
+</li>
+<li class="itemize_item">Clone the <em>master</em> branch of <i>binary_c</i>.<br />
+<pre class ='listings'>export ARCHFLAGS=" -mtune=generic "
+export CC=gcc
+mkdir -p $HOME/progs/stars/
+cd $HOME/progs/stars
+git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git</pre><br />
+</li>
+<li class="itemize_item">Change to the <i>binary_c</i> directory, configure and build both <i>binary_c</i> and its shared library.<br />
+<pre class ='listings'>cd $BINARY_C
+./configure generic
+make cleanall
+make
+make <i>libbinary_c.so</i></pre><br />
+</li>
+<li class="itemize_item">Install <span class="flex_software">perlbrew</span> which is your own, custom <span class="flex_software">Perl</span>. <br />
+<pre class ='listings'>export NTHREADS=`cat /proc/cpuinfo |grep cpu\ famil|wc -l`
+export LATEST_PERL=`perlbrew available | grep &ldquo;^[[:space:]]\+perl&rdquo; | head -1`
+wget --no-check-certificate -O - http://install.perlbrew.pl | bash
+perlbrew -v install perl-5.31.3 --thread --multi --64bitall --notest -Dusethreads -Duselargefiles -Dcccdlflags=-fPIC -Dpager=/usr/bin/sensible-pager -Doptimize="-O3 mtune=generic" -Duseshrplib -j $NTHREADS</pre><br />
+If you have problems with <span class="flex_software">wget</span>, try removing the <span class="flex_args">–no-check-certificate</span>. 
+<br />
+
+<span class="flex_software">Perl</span> will, on completion of the build (which takes a little while), tell you to append some expressions to your shell profile (e.g.&nbsp;<span class="flex_file">.bashrc</span>). Do this, and then <em><b>restart your shell</b></em>.</li>
+<li class="itemize_item">Switch to using the new <span class="flex_software">Perl</span>, and install <span class="flex_software">cpanminus</span> (which is the command <span class="flex_command">cpanm</span>)<br />
+<pre class ='listings'>perlbrew switch $LATEST_PERL
+perlbrew install-cpanm </pre><br />
+</li>
+<li class="itemize_item">Install <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow>
+   <mstyle mathvariant='normal'>
+    <mstyle mathvariant='italic'>
+     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
+     </mrow>
+    </mstyle>
+   </mstyle><mn>2</mn>
+  </mrow>
+ </mrow></mstyle></math><br />
+<pre class ='listings'>cd $BINARY_C
+cd src/perl
+./install_modules.pl</pre><br />
+you may well need to run the <span class="flex_software">install_modules.pl</span> script repeatedly to satisfy dependencies, or if there is a failure check the error message and install the module manually using the <span class="flex_software">cpanm</span> command.</li>
+</ul>
+<h3 class="subsection" id='magicparlabel-284'><span class="subsection_label">2.2</span> Running a single- or binary-star system</h3>
+<div class="standard" id='magicparlabel-285'>Go to the <span class="flex_envvar">$BINARY_C</span> directory and open the file <span class="flex_file">tbse</span> (where <em>tbse</em> means &ldquo;test binary-star evolution&rdquo;). </div>
+
+<ul class="itemize" id='magicparlabel-294'><li class="itemize_item">In this file you can set every physical parameter of <i>binary_c</i>, for example the masses and orbital parameters<br />
+<pre class ='listings'># stellar masses (solar units)
+M1=6
+M2=0.9
+
+# orbit: 
+# If the period (days) is given, use it. 
+# If the period is zero, use the separation (in Rsun) to calculate the period.
+# (this requires that the masses are already set)
+ORBITAL_PERIOD=0.0
+ORBITAL_SEPARATION=3000.0
+
+# Orbital eccentricity should be in the range 0.0-1.0.
+ECCENTRICITY=0.0</pre><br />
+</li>
+<li class="itemize_item">You can also override physics by running tbse with subsequent command-line arguments, e.g., to run the default star with a metallicity of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow><mn>0.004</mn>
+ </mrow></mstyle></math>:<br />
+<pre class ='listings'>tbse metallicity 0.004</pre><br />
+</li>
+<li class="itemize_item">Do not run many stars this way, use <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow>
+   <mstyle mathvariant='normal'>
+    <mstyle mathvariant='italic'>
+     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
+     </mrow>
+    </mstyle>
+   </mstyle><mn>2</mn>
+  </mrow>
+ </mrow></mstyle></math></li>
+</ul>
+<h3 class="subsection" id='magicparlabel-317'><span class="subsection_label">2.3</span> Running a grid of stars with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow>
+   <mstyle mathvariant='normal'>
+    <mstyle mathvariant='italic'>
+     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
+     </mrow>
+    </mstyle>
+   </mstyle><mn>2</mn>
+  </mrow>
+ </mrow></mstyle></math></h3>
+
+<ul class="itemize" id='magicparlabel-318'><li class="itemize_item">Open the file $BINARY_C/src/perl/scripts2/template.pl</li>
+<li class="itemize_item">This is an example of how to run <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow>
+   <mstyle mathvariant='normal'>
+    <mstyle mathvariant='italic'>
+     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
+     </mrow>
+    </mstyle>
+   </mstyle><mn>2</mn>
+  </mrow>
+ </mrow></mstyle></math> to extract data from a grid of stars. You set up a grid of stars as a $population object, and then call that to set up the physics and run the grid. </li>
+<li class="itemize_item">To make a new population which evolves to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow><mn>15000</mn><mspace width="6px" />
+   <mstyle mathvariant='normal'>
+    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
+    </mrow>
+   </mstyle>
+  </mrow>
+ </mrow></mstyle></math> with metallicity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow><mi>Z</mi><mo>=</mo><mn>0.02</mn>
+  </mrow>
+ </mrow></mstyle></math>, use <span class="flex_perlscript"><i>binary_grid2</i>-&gt;new()</span> to make a population object<br />
+<pre class ='listings'># make a new stellar population
+my $population = <i>binary_grid2</i>-&gt;new(
+    # options can be given now ... 
+    metallicity =&gt; 0.02, # mass fraction of "metals"
+    max_evolution_time =&gt; 15000, # Myr 
+    );</pre><br />
+</li>
+<li class="itemize_item">To set parameters of an existing population, call<span class="flex_perlscript">$population-&gt;set()</span><br />
+<pre class ='listings'>$population-&gt;set(
+    vb=&gt;1, # turn on verbose logging (can be 0,1,2...)
+    return_array_refs=&gt;1, # quicker data parsing mode
+    log_args=&gt;1,
+    sort_args=&gt;1,
+    save_args=&gt;1,
+    log_args_dir=&gt;'/tmp',
+    C_auto_logging =&gt; {
+        'MY_STELLAR_DATA' =&gt;
+            [
+             'model.time',
+             'star[0].mass',
+             'model.probability',
+             'model.dt'
+            ]
+    },
+    );</pre><br />
+</li>
+<li class="itemize_item">To set up the grid, with is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow><mi>N</mi>
+ </mrow></mstyle></math>-dimensional, just call <span class="flex_perlscript">add_grid_variable()</span> for each dimension, for example to set up primary masses in a logarithmic grid between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow><mn>0.1</mn>
+ </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ <mrow>
+  <mrow><mn>50</mn>
+   <mstyle mathvariant='normal'>
+    <mrow><mspace width="6px" />
+     <msub subscriptshift="0.2ex">
+      <mrow><mi>M</mi>
+      </mrow>
+      <mrow><mo> &odot; </mo>
+      </mrow>
+     </msub>
+    </mrow>
+   </mstyle>
+  </mrow>
+ </mrow></mstyle></math> distributed according to Kroupa's 2001 initial mass function.<br />
+<pre class ='listings'>    $population-&gt;add_grid_variable
+        (
+        'name'       =&gt; 'lnm1', 
+        'longname'   =&gt;'Primary mass', 
+        'range'      =&gt;[log(0.1),log(50)],
+        'resolution' =&gt; 100,
+        'spacingfunc'=&gt;"const(log($mmin),log($mmax),$resolution-&gt;{m1})",
+        'precode'    =&gt;'$m1=exp($lnm1);',
+        'probdist'   =&gt;'Kroupa2001($m1)*$m1',
+        'dphasevol'  =&gt;'$dlnm1',
+        );</pre><br />
+</li>
+<li class="itemize_item">To analyse the data output from <i>binary_c</i> and do something useful with it, set up a <span class="flex_perlscript">parse_data()</span> function. In this case, we save to the results hash stored in <span class="flex_perlscript">$results</span>. Each thread contains part of the results, and all the results are automatically combined at the end of the population run. <br />
+<pre class ='listings'># link population to custom data parser function
+$population-&gt;set(
+    parse_bse_function_pointer =&gt; \&amp;main::parse_data
+    );
+
+sub parse_data
+{
+    my ($population, $results) = @_;
+
+    while(1)
+    {
+        # subsequent calls to tbse_line contain
+        # (references to) arrays of data 
+        my $la = $population-&gt;tbse_line();
+        
+        # first element is the "header" line
+        my $header = shift @$la;
+
+        # break out of the look if this is 'fin'
+        last if ($header eq 'fin');
+
+        if($header eq 'MY_STELLAR_DATA')
+        {
+            # matched MY_STELLAR_DATA header
+            my $time = $la-&gt;[0];
+            my $mass = $la-&gt;[1];
+            my $probability = $la-&gt;[2];
+            my $timestep = $la-&gt;[3];
+
+            # bin mass to nearest 1.0 Msun
+            $mass = $population-&gt;rebin($mass, 1.0);
+
+            # add up the initial mass function
+            if($time == 0.0)
+            {
+                $results-&gt;{initial_mass_function}-&gt;{$mass} += $probability;
+            }
+            
+            # add up the mass distribution
+            $results-&gt;{mass_distribution}-&gt;{$mass} += $probability * $timestep; 
+        }
+    }
+}</pre><br />
+</li>
+<li class="itemize_item">To run the population, call <span class="flex_perlscript">evolve()</span><br />
+<pre class ='listings'># evolution the stellar population (this takes some time)
+$population-&gt;evolve();</pre><br />
+</li>
+<li class="itemize_item">To output information, loop through the <span class="flex_perlscript">$results</span> hash. In this case we output to the screen both the initial mass function (with lines headed by <em>IMF</em>) and time-dependent mass function (lines headed by <em>MASS</em>). Naturally, you should save this data to a file if you want to further process it.<br />
+<pre class ='listings'>sub output
+{
+    my ($population) = @_;
+
+    # $results is a hash reference containing
+    # the results that were added up in parse_data()
+    my $results = $population-&gt;results;
+
+    # output the initial mass function
+    foreach my $mass (sort {$a&lt;=&gt;$b} keys %{$results-&gt;{initial_mass_function}})
+    {
+        printf "IMF %g %g\n",$mass,$results-&gt;{initial_mass_function}-&gt;{$mass};
+    }
+
+    # output the mass distribution
+    foreach my $mass (sort {$a&lt;=&gt;$b} keys %{$results-&gt;{mass_distribution}})
+    {
+        printf "MASS %g %g\n",$mass,$results-&gt;{mass_distribution}-&gt;{$mass};
+    }
+}
+</pre><br />
+</li>
+</ul>
+<h2 class="section" id='magicparlabel-472'><span class="section_label">3</span> Introduction</h2>
+<div class="standard" id='magicparlabel-473'><div id="sec_Introduction"></div>
 From <a href='#LyXCite-Izzard_et_al_2003c_Monash'><span class="bib-abbrvciteauthor">Izzard and Tout</span></a> (<span class="bib-year">2003</span>):</div>
 
-<blockquote class="quotation" id='magicparlabel-68'><div class="quotation_item">For many years the study of stellar yields and galactic chemical evolution (GCE) has gone on assuming, mainly for simplicity, that stars are isolated objects (one exception being <a href='#LyXCite-2002NewA____7___55D'><span class="bib-abbrvciteauthor">De Donder and Vanbeveren</span>, <span class="bib-year">2002</span></a>). Reality bites deeply into this picture with the observation that most stars are in multiple systems and that many of these systems are interacting. The state of the art in binary star nucleosynthesis is focused on explosive events such as type Ia supernovae and classical novae but other binary star processes contribute to pollution of the interstellar medium. Mass-transfer by Roche-lobe overflow (RLOF) occurs particularly when the stellar radius is growing rapidly and so commonly when one star is on the asymptotic giant branch (AGB).</div>
+<blockquote class="quotation" id='magicparlabel-474'><div class="quotation_item">For many years the study of stellar yields and galactic chemical evolution (GCE) has gone on assuming, mainly for simplicity, that stars are isolated objects (one exception being <a href='#LyXCite-2002NewA____7___55D'><span class="bib-abbrvciteauthor">De Donder and Vanbeveren</span>, <span class="bib-year">2002</span></a>). Reality bites deeply into this picture with the observation that most stars are in multiple systems and that many of these systems are interacting. The state of the art in binary star nucleosynthesis is focused on explosive events such as type Ia supernovae and classical novae but other binary star processes contribute to pollution of the interstellar medium. Mass-transfer by Roche-lobe overflow (RLOF) occurs particularly when the stellar radius is growing rapidly and so commonly when one star is on the asymptotic giant branch (AGB).</div>
 </blockquote>
-<div class="standard" id='magicparlabel-69'>A recent and complete review of binary stars can be found in <a href='#LyXCite-2017PASA___34____1D'><span class="bib-abbrvciteauthor">De Marco and Izzard</span></a> (<span class="bib-year">2017</span>).</div>
+<div class="standard" id='magicparlabel-475'>A recent review of binary stars can be found in <a href='#LyXCite-2017PASA___34____1D'><span class="bib-abbrvciteauthor">De Marco and Izzard</span></a> (<span class="bib-year">2017</span>).</div>
 
-<div class="standard" id='magicparlabel-70'>To investigate the effect of a companion on stellar nucleosynthesis the <em><i>binary_c</i></em> code was developed. The <em><i>binary_c</i></em> code currently uses the <em>SSE/BSE</em> package at its core to provide most of the stellar evolution modeling, with nucleosynthesis in parallel based on various algorithms, to explore the large parameter spaces associated with binary stars in reasonable periods of time. Binaries are important for nucleosynthesis because of two main effects:</div>
+<div class="standard" id='magicparlabel-476'>To investigate the effect of a companion on stellar nucleosynthesis the <em><i>binary_c</i></em> code was developed. The <em><i>binary_c</i></em> code currently uses the <em>SSE/BSE</em> package at its core to provide most of the stellar evolution modeling, with nucleosynthesis in parallel based on various algorithms, to explore the large parameter spaces associated with binary stars in reasonable periods of time. Binaries are important for nucleosynthesis because of two main effects:</div>
 
-<ul class="itemize" id='magicparlabel-71'><li class="itemize_item">The presence of a companion affects evolution by mass loss and gain. Good examples are Roche-lobe overflow (FLOAT) due to interaction between a giant branch or asymptotic giant branch (GB/AGB) star and a main-sequence (MS) star. Truncation of the GB/AGB phase may prevent dredge-up events and hence reduce the amount of nuclear processing material undergoes prior to expulsion to the ISM. Common envelopes generally result and while the detailed physics is unclear it is likely that mass is ejected to the ISM from some of these stars.</li>
+<ul class="itemize" id='magicparlabel-477'><li class="itemize_item">The presence of a companion affects evolution by mass loss and gain. Good examples are Roche-lobe overflow caused by interaction between a giant branch or asymptotic giant branch (GB/AGB) star and a main-sequence (MS) star. Truncation of the GB/AGB phase may prevent dredge-up events and hence reduce the amount of nuclear processing material undergoes prior to expulsion to the ISM. Common envelopes generally result and while the detailed physics is unclear it is likely that mass is ejected to the ISM from some of these stars.</li>
 <li class="itemize_item">Novae, type Ia supernoave, X-ray bursts, stellar mergers (including neutron-star/black-hole mergers), etc. occur in binaries, as do many tidal disruption events. These may eject material or lead to extra nuclear burning.</li>
 </ul>
-<div class="standard" id='magicparlabel-73'>The physics of binary evolution is not all that well understood and, at the same time, suffers all the uncertainties of single-star evolution. Some effects which must be considered are:</div>
+<div class="standard" id='magicparlabel-479'>The physics of binary evolution is not all that well understood and, at the same time, suffers all the uncertainties of single-star evolution. Some effects which must be considered are:</div>
 
-<ul class="itemize" id='magicparlabel-74'><li class="itemize_item">Duplicity: is the star single or binary or perhaps even triple or quadruple?</li>
+<ul class="itemize" id='magicparlabel-480'><li class="itemize_item">Duplicity: is the star single or binary or perhaps even triple or quadruple?</li>
 <li class="itemize_item">Metallicity and, less importantly, initial abundance mix. The initial abundance mix depends on the galactic evolution history and even the solar mixture is somewhat uncertain.</li>
 <li class="itemize_item">Initial distributions: What is the IMF? What is the initial distribution for primary mass, secondary mass, separation/period and eccentricity in binary stars?</li>
 <li class="itemize_item">Abundance changes at dredge-ups. These changes can depend on the input physics, especially in the case of third dredge-up. Calibration to observations is necessary in this case and leads to the introduction of free parameters to increase the amount of dredge-up. There is also great uncertainty with regard to the s-process isotopes, in particular the size of the C13 pocket during third dredge-up. </li>
@@ -729,9 +1039,9 @@ From <a href='#LyXCite-Izzard_et_al_2003c_Monash'><span class="bib-abbrvciteauth
  </mrow></mstyle></math>) TPAGB stars in binaries overflow their Roche lobes prior to HBB so C12 cannot be converted into N14.</li>
 <li class="itemize_item">Numerical resolution - requires careful consideration!</li>
 </ul>
-<div class="standard" id='magicparlabel-87'><i>binary_c</i> is the trade name for the <i>C</i>-version of the <em>B</em>inary <em>S</em>tar <em>E</em>volution (<em>BSE</em>) code of <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>) with added <em>nucleo</em>synthesis. The nucleosynthesis algorithm runs (mostly) in parallel to the nucleosynthesis code and includes the following (see <a href='#LyXCite-2006A_A___460__565I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2006</span><span class="bib-modifier">b</span></a>; <a href='#LyXCite-2009A_A___508_1359I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2009</span></a>; <a href='#LyXCite-2018MNRAS_473_2984I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2018</span></a> and many subsequent papers):</div>
+<div class="standard" id='magicparlabel-493'><i>binary_c</i> is the trade name for the <i>C</i>-version of the <em>B</em>inary <em>S</em>tar <em>E</em>volution (<em>BSE</em>) code of <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>) with added <em>nucleo</em>synthesis. The nucleosynthesis algorithm runs (mostly) in parallel to the nucleosynthesis code and includes the following (see <a href='#LyXCite-2006A_A___460__565I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2006</span><span class="bib-modifier">b</span></a>; <a href='#LyXCite-2009A_A___508_1359I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2009</span></a>; <a href='#LyXCite-2018MNRAS_473_2984I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2018</span></a> and many subsequent papers):</div>
 
-<ul class="itemize" id='magicparlabel-88'><li class="itemize_item">First and second dredge-up fitted to the detailed nucleosynthesis models of <a href='#LyXCite-Parameterising_3DUP_Karakas_Lattanzio_Pols'><span class="bib-abbrvciteauthor">Karakas et al.</span></a> (<span class="bib-year">2002</span>). </li>
+<ul class="itemize" id='magicparlabel-494'><li class="itemize_item">First and second dredge-up fitted to the detailed nucleosynthesis models of <a href='#LyXCite-Parameterising_3DUP_Karakas_Lattanzio_Pols'><span class="bib-abbrvciteauthor">Karakas et al.</span></a> (<span class="bib-year">2002</span>). </li>
 <li class="itemize_item">A new synthetic model of TPAGB stars (<a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>) in collaboration with Amanda Karakas, Chris Tout and Onno Pols based on the Karakas et al. models. The effects of third dredge-up, the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>s</mi>
  </mrow></mstyle></math>-process, hot-bottom burning (CNO, NeNa and MgAl) and mass loss are included.</li>
@@ -748,34 +1058,34 @@ From <a href='#LyXCite-Izzard_et_al_2003c_Monash'><span class="bib-abbrvciteauth
 <li class="itemize_item">Mergers.</li>
 <li class="itemize_item">SN stripping of companions.</li>
 </ul>
-<div class="standard" id='magicparlabel-100'>What does the <i>binary_c</i> code not do?</div>
+<div class="standard" id='magicparlabel-506'>What does the <i>binary_c</i> code not do?</div>
 
-<ul class="itemize" id='magicparlabel-101'><li class="itemize_item">Diffusion - nobody plans to work on this! </li>
+<ul class="itemize" id='magicparlabel-507'><li class="itemize_item">Diffusion - nobody plans to work on this! </li>
 <li class="itemize_item">"Extra mixing" - dubious although might be the cause of J-stars. </li>
 <li class="itemize_item">Common envelope nucleosynthesis - thought not to be important, but you never know. </li>
 <li class="itemize_item">(Pre-)MS burning of the interior of the star - this means that if a MS star is stripped the increase in C13/N14 due to CNO cycling is not taken into account. However, if the star makes it to 1st dredge up then this is taken into account. Note there is <em>experimental</em> code which can deal with this.</li>
 <li class="itemize_item">WD surface layers - these are very complicated!</li>
 <li class="itemize_item">Probably some other things too.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-107'><span class="subsection_label">2.1</span> Binary_c: tools for stellar evolution and population synthesis</h3>
-<div class="standard" id='magicparlabel-108'>The <i>binary_c</i> software framework consists of a number of tools, in particular:</div>
+<h3 class="subsection" id='magicparlabel-513'><span class="subsection_label">3.1</span> Binary_c: tools for stellar evolution and population synthesis</h3>
+<div class="standard" id='magicparlabel-514'>The <i>binary_c</i> software framework consists of a number of tools, in particular:</div>
 
-<dl class='description' id='magicparlabel-109'><dt class="description_label"><i>binary_c</i></dt>
+<dl class='description' id='magicparlabel-515'><dt class="description_label"><i>binary_c</i></dt>
 <dd class="description_item"> The <i>binary_c</i> code itself. This is the core code, written in <em>C</em>, which contains the stellar evolution and nucleosynthesis algorithms.</dd>
 <dt class="description_label"><i>libbinary_c</i></dt>
 <dd class="description_item"> The shared library based on <i>binary_c</i> which should be accessed through the <i>binary_c</i> API functions. This works with other languages such as <em>Python</em> and <em>FORTRAN</em>.</dd>
 <dt class="description_label"><i>binary_grid</i></dt>
-<dd class="description_item"> A suite of software to run many stars in a stellar population. This is written in <span class="flex_scriptinglanguage">Perl</span> because when I started there was no <em>Python</em>. Sorry!</dd>
+<dd class="description_item"> A suite of software to run many stars in a stellar population. This is written in <span class="flex_scriptinglanguage">Perl</span> because when I started there was no <em>Python</em>. Sorry! But before you say &ldquo;oh but Perl is not <i><a href="https://www.python.org/">Python</a></i>&rdquo; – true, but it's a damned powerful language. You only need it to run the populations: after that, you can process the resulting data however you like (even in Excel if you want – but please don't!).</dd>
 </dl>
-<div class="standard" id='magicparlabel-116'><br />
+<div class="standard" id='magicparlabel-522'><br />
 </div>
-<h2 class="section" id='magicparlabel-117'><span class="section_label">3</span> Installation</h2>
-<div class="standard" id='magicparlabel-118'>The following is an installation guide for installing <i>binary_c</i> and some of its support tools. If you know how to run code, and want to run <i>binary_c</i> as quickly as possible, just go for the quick start guide. If you want to get <i>binary_c</i>, either as source code, a virtual machine or Docker image, see section&nbsp;<a href="#subsec_Getting_binary_c">3.2</a>. Technical system requirements are discussed in section&nbsp;<a href="#subsec_system_requirements">3.3</a>. Building <i>binary_c</i> is describe in section&nbsp;<a href="#subsec_Building">3.4</a>.</div>
+<h2 class="section" id='magicparlabel-523'><span class="section_label">4</span> Installation</h2>
+<div class="standard" id='magicparlabel-524'>The following is an installation guide for installing <i>binary_c</i> and some of its support tools. If you know how to run code, and want to run <i>binary_c</i> as quickly as possible, just go for the quick start guide. If you want to get <i>binary_c</i>, either as source code, a virtual machine or Docker image, see section&nbsp;<a href="#subsec_Getting_binary_c">4.2</a>. Technical system requirements are discussed in section&nbsp;<a href="#subsec_system_requirements">4.3</a>. Building <i>binary_c</i> is describe in section&nbsp;<a href="#subsec_Building">4.4</a>.</div>
 
-<div class="standard" id='magicparlabel-119'>The <i>binary_grid</i> software is described in section&nbsp;<a href="#subsec_installing_binary_grid">3.7.3</a>.</div>
-<h3 class="subsection" id='magicparlabel-120'><span class="subsection_label">3.1</span> Quick start</h3>
+<div class="standard" id='magicparlabel-525'>The <i>binary_grid</i> software is described in section&nbsp;<a href="#subsec_installing_binary_grid">4.7.3</a>.</div>
+<h3 class="subsection" id='magicparlabel-526'><span class="subsection_label">4.1</span> Quick start</h3>
 
-<ul class="itemize" id='magicparlabel-121'><li class="itemize_item">From the git repository check out <i>binary_c</i> and change to its directory</li>
+<ul class="itemize" id='magicparlabel-527'><li class="itemize_item">From the git repository check out <i>binary_c</i> and change to its directory</li>
 <li class="itemize_item">Run one binary system with the <span class="flex_bashscript">tbse</span> (test binary star evolution) script:<br />
 <pre class\s*='listings bash'>$ ./configure
 $ make
@@ -783,17 +1093,17 @@ $ tbse</pre><br />
 </li>
 <li class="itemize_item">Change <span class="flex_bashscript">tbse</span> to suit.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-138'><span class="subsection_label">3.2</span> Getting <i>binary_c</i><div id="subsec_Getting_binary_c"></div>
+<h3 class="subsection" id='magicparlabel-544'><span class="subsection_label">4.2</span> Getting <i>binary_c</i><div id="subsec_Getting_binary_c"></div>
 </h3>
-<div class="standard" id='magicparlabel-139'>You can either get the <i>binary_c</i> source code, and build it yourself, or use the prebuilt <span class="flex_software">Docker</span><em> </em>image.</div>
+<div class="standard" id='magicparlabel-545'>You can either get the <i>binary_c</i> source code, and build it yourself, or use the prebuilt <span class="flex_software">Docker</span><em> </em>image.</div>
 
-<h4 class="subsubsection" id='magicparlabel-146'><span class="subsubsection_label">3.2.1</span> Getting the source code</h4>
-<div class="standard" id='magicparlabel-147'>At present, <em>the <span class='math'>binary_c</i></span>
+<h4 class="subsubsection" id='magicparlabel-552'><span class="subsubsection_label">4.2.1</span> Getting the source code</h4>
+<div class="standard" id='magicparlabel-553'>At present, <em>the <span class='math'>binary_c</i></span>
 </em> source code is accessed through the Faculty of Engineering and Physics (FEPS) of the University of Surrey's <em>git </em>server at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a>. Access requires permission which is done on a user-by-user basis and currently only works easily if you have a Gmail account. If you don't, we can probably arrange something. </div>
 
-<div class="standard" id='magicparlabel-148'>In order to obtain an account, you need to do the following, in order</div>
+<div class="standard" id='magicparlabel-554'>In order to obtain an account, you need to do the following, in order</div>
 
-<ol class="enumerate" id='magicparlabel-149'><li class="enumerate_item">Try to log in at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a> using your Gmail account by clicking on the <img style='width:1.2em;' src='images/1.png' alt='image: 7_tmp_binary_c_lyx_images_8.png' />
+<ol class="enumerate" id='magicparlabel-555'><li class="enumerate_item">Try to log in at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a> using your Gmail account by clicking on the <img style='width:1.2em;' src='images/1.png' alt='image: 7_tmp_binary_c_lyx_images_8.png' />
 . You will be told <em>your account is locked!</em> This poorly-worded message means you have to&hellip;</li>
 <li class="enumerate_item">Email me at r.izzard@surrey.ac.uk and tell me your account is &ldquo;locked&rdquo;. I will then email IT support, who will unlock your account.</li>
 <li class="enumerate_item">IT support should then tell me your account is unlocked so I should then be able to tell you. However, IT support have been known to unlock accounts and <em>not </em>let me know, so please keep trying. If you find you <em>can </em>access the gitlab server (i.e.&nbsp;you can log in) but get a &ldquo;404 The page could not be found or you don't have permission to view it&rdquo; error when trying to view <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a>, then I can probably fix the problem. But you have to tell me, so keep trying to log in :)</li>
@@ -801,7 +1111,7 @@ $ tbse</pre><br />
 <li class="enumerate_item">Once you have confirmation from me (or before, if you are impatient) go back to the website, please click on the <img style='width:1.2em;' src='images/2.png' alt='image: 8_tmp_binary_c_lyx_images_9.png' />
  to sign in, and grab the code. If everything works, great! If not, I may have to talk with IT support, yet again.</li>
 </ol>
-<div class="standard" style='text-align: center;' id='magicparlabel-154'><div class='Boxed' style='width: 75%; '><div class="plain_layout" id='magicparlabel-158'>If you do not know me, it would really help me – and those who fund <em><span class='math'>binary_c</i></span>
+<div class="standard" style='text-align: center;' id='magicparlabel-560'><div class='Boxed' style='width: 75%; '><div class="plain_layout" id='magicparlabel-564'>If you do not know me, it would really help me – and those who fund <em><span class='math'>binary_c</i></span>
 </em> – if you could include in your email to me a little about you and why you want to download and use <span class='math'>binary_c</i></span>
 .
 <br />
@@ -812,12 +1122,12 @@ $ tbse</pre><br />
 Please also let me know if you publish a paper which uses results derived from <em><span class='math'>binary_c</i></span>
 </em>.</div>
 </div></div>
-<h4 class="subsubsection" id='magicparlabel-159'><span class="subsubsection_label">3.2.2</span> Getting the Docker image</h4>
-<div class="standard" id='magicparlabel-160'>You can access <em><span class='math'>binary_c</i></span>
-</em> through <em>docker</em><div class="foot"><span class="foot_label">1</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-164'><a href="https://www.docker.com/">https://www.docker.com/</a></div>
+<h4 class="subsubsection" id='magicparlabel-565'><span class="subsubsection_label">4.2.2</span> Getting the Docker image</h4>
+<div class="standard" id='magicparlabel-566'>You can access <em><span class='math'>binary_c</i></span>
+</em> through <em>docker</em><div class="foot"><span class="foot_label">1</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-570'><a href="https://www.docker.com/">https://www.docker.com/</a></div>
 </div></div>.</div>
 
-<ol class="enumerate" id='magicparlabel-165'><li class="enumerate_item">I assume you have installed and signed in to <em>docker</em>. I cannot provide support for <em>Docker</em>!</li>
+<ol class="enumerate" id='magicparlabel-571'><li class="enumerate_item">I assume you have installed and signed in to <em>docker</em>. I cannot provide support for <em>Docker</em>!</li>
 <li class="enumerate_item">The newest <em><span class='math'>binary_c</i></span>
 </em> container is <b><span style='font-family:monospace;font-size: 18px;'>robizzard/<i>binary_c</i>:master2.0pre32
 <br />
@@ -895,22 +1205,22 @@ rm $XAUTH
 </li>
 </ol>
 
-<h3 class="subsection" id='magicparlabel-245'><span class="subsection_label">3.3</span> System Requirements</h3>
-<div class="standard" id='magicparlabel-246'><div id="subsec_system_requirements"></div>
+<h3 class="subsection" id='magicparlabel-651'><span class="subsection_label">4.3</span> System Requirements</h3>
+<div class="standard" id='magicparlabel-652'><div id="subsec_system_requirements"></div>
 In the following I assume you are using a <span class="flex_os">Linux</span>-type system (e.g&nbsp;running an distribution like <span class="flex_os">Ubuntu</span>). If you are not, I highly recommend using a virtual machine (e.g.&nbsp;<span class="flex_software">Virtualbox</span>) to run <span class="flex_os">Linux</span> on your system. <span class="flex_os">MacOS</span> and <span class="flex_os">Windows</span> have a quite different build structure compared to <span class="flex_os">Linux</span>, and while the code itself should work I have no Mac on which to test it. You can also run the <em><span class="flex_software">Docker</span></em> directly on <span class="flex_os">MacOS</span>.</div>
 
-<div class="standard" id='magicparlabel-283'>To build <i>binary_c</i> from source, the following software is required on your system:</div>
+<div class="standard" id='magicparlabel-689'>To build <i>binary_c</i> from source, the following software is required on your system:</div>
 
-<ul class="itemize" id='magicparlabel-284'><li class="itemize_item">A <em><span class="flex_programminglanguage"><em>C</em></span></em> compiler e.g.&nbsp;one of,
+<ul class="itemize" id='magicparlabel-690'><li class="itemize_item">A <em><span class="flex_programminglanguage"><em>C</em></span></em> compiler e.g.&nbsp;one of,
 <br />
 
 
 
-<ul class="itemize" id='magicparlabel-289'><li class="itemize_item"><span class="flex_software">gcc</span> (the <em>GNU</em> compiler <a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a>) this comes as standard on most <span class="flex_os">Linux</span> and <span class="flex_os">MacOS</span> systems and is easily installed on others,</li>
+<ul class="itemize" id='magicparlabel-695'><li class="itemize_item"><span class="flex_software">gcc</span> (the <em>GNU</em> compiler <a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a>) this comes as standard on most <span class="flex_os">Linux</span> and <span class="flex_os">MacOS</span> systems and is easily installed on others,</li>
 <li class="itemize_item"><span class="flex_software">icc</span> (Intel compiler <a href="http://software.intel.com/en-us/articles/intel-compilers/">http://software.intel.com/en-us/articles/intel-compilers/</a>) this costs money but it is probably faster than <span class="flex_software">gcc</span>,</li>
 <li class="itemize_item"><span class="flex_software">clang</span> (<em>C</em> compiler for <span class="flex_software">LLVM</span> <a href="http://clang.llvm.org/">http://clang.llvm.org/</a>) is also free, and may be faster than <span class="flex_software">gcc</span><em>.</em></li>
 </ul>
-<div class="standard" id='magicparlabel-324'>Your system should include such a compiler unless you're using <span class="flex_os">Windows</span>. <em>Binary_c</em> has been tested on <span class="flex_os">Linux</span> and various <span class="flex_os">Solaris</span> machines. Note that (for an unknown reason!) it does not run (but does compile) on older versions of <span class="flex_os">MacOS</span>. If you can fix this problem please let me know! Also, there has been trouble with <span class="flex_software">gcc</span><em> </em>on Xeon machines. This is not my fault, please use <span class="flex_software">icc</span> or perhaps a newer <em><span class="flex_software">gcc</span></em>.<div class="foot"><span class="foot_label">2</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-356'>This information may be out of date! Please test the build and let me know.</div>
+<div class="standard" id='magicparlabel-730'>Your system should include such a compiler unless you're using <span class="flex_os">Windows</span>. <em>Binary_c</em> has been tested on <span class="flex_os">Linux</span> and various <span class="flex_os">Solaris</span> machines. Note that (for an unknown reason!) it does not run (but does compile) on older versions of <span class="flex_os">MacOS</span>. If you can fix this problem please let me know! Also, there has been trouble with <span class="flex_software">gcc</span><em> </em>on Xeon machines. This is not my fault, please use <span class="flex_software">icc</span> or perhaps a newer <em><span class="flex_software">gcc</span></em>.<div class="foot"><span class="foot_label">2</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-762'>This information may be out of date! Please test the build and let me know.</div>
 </div></div></div>
 </li><li class="itemize_item"><span class="flex_scriptinglanguage">Perl</span>  - this is required for the configuration script and, should you wish to evolve stellar populations, the <em><i>binary_grid</i></em> software. <span class="flex_scriptinglanguage">Perl</span>  is usually installed on your system, and for configuration of <em><i>binary_c</i></em> this should be sufficient. You can download <span class="flex_scriptinglanguage">Perl</span>  at <a href="www.perl.com">www.perl.com</a>, or use your system <span class="flex_scriptinglanguage">Perl</span>, but I recommend <em>Perlbrew</em> instead. Please try to use a version of <span class="flex_scriptinglanguage">Perl</span>  that is 5.16 or later: 5.29.8 is currently the latest version and works just fine.
 <em><br />
@@ -919,110 +1229,110 @@ NOTE: </em><span class="flex_software">Perlbrew</span> and <span class="flex_sof
 <li class="itemize_item">You will want to use <em>git</em> to get<em> <i>binary_c</i></em>, see the document </li>
 <li class="itemize_item">If you plan to modify <em><i>binary_c</i> </em>you probably want a debugger of some sort. <span class="flex_software">Valgrind</span> is the tool of choice although you can also use <span class="flex_software">gdb</span>.</li>
 </ul>
-<div class="standard" id='magicparlabel-396'>By using <em><i>binary_c</i></em> and <em><i>binary_grid</i></em> you are part of a community. You are therefore jointly responsible for helping with the never-ending process of improvement and bug fixing.<em> Binary_c</em> (and its  <span class="flex_scriptinglanguage">Perl</span>  modules, such as <em><i>binary_grid</i></em>) is stored on a<em> </em><span class="flex_software">git</span> server. Please read the <span class="flex_file">LICENCE</span> file before use.</div>
-<h3 class="subsection" id='magicparlabel-409'><span class="subsection_label">3.4</span> Configuring and building <i>binary_c</i></h3>
-<div class="standard" id='magicparlabel-410'><div id="subsec_Building"></div>
-</div>
-<h4 class="subsubsection" id='magicparlabel-411'><span class="subsubsection_label">3.4.1</span> From <em>git</em></h4>
-<div class="standard" id='magicparlabel-412'>Assuming you have checked out your branch, a release or the trunk, from the <em>git</em> repository (see Sec.&nbsp;<a href="#subsec_Getting_binary_c">3.2</a>), go to that directory (which will be called the <span class="flex_file"><i>binary_c</i></span> directory below) and skip to <a href="#subsec_Configuration">3.4.3</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-417'><span class="subsubsection_label">3.4.2</span> From a <em>zip</em> file or tarball</h4>
-<div class="standard" id='magicparlabel-418'>If have been given a file <span class="flex_software">zip</span> file <span class="flex_file"><i>binary_c</i>.zip</span><span style='font-family:monospace;font-size: 18px;'>,</span> or a tarball e.g.&nbsp;<span class="flex_file"><i>binary_c</i>.tar.gz</span> or <span class="flex_file"><i>binary_c</i>.tar.bz2</span>, you should copy it to a directory (hereafter <span class="flex_file"><i>binary_c</i></span>, usually I put everything in <span class="flex_file"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-802'>By using <em><i>binary_c</i></em> and <em><i>binary_grid</i></em> you are part of a community. You are therefore jointly responsible for helping with the never-ending process of improvement and bug fixing.<em> Binary_c</em> (and its  <span class="flex_scriptinglanguage">Perl</span>  modules, such as <em><i>binary_grid</i></em>) is stored on a<em> </em><span class="flex_software">git</span> server. Please read the <span class="flex_file">LICENCE</span> file before use.</div>
+<h3 class="subsection" id='magicparlabel-815'><span class="subsection_label">4.4</span> Configuring and building <i>binary_c</i></h3>
+<div class="standard" id='magicparlabel-816'><div id="subsec_Building"></div>
+</div>
+<h4 class="subsubsection" id='magicparlabel-817'><span class="subsubsection_label">4.4.1</span> From <em>git</em></h4>
+<div class="standard" id='magicparlabel-818'>Assuming you have checked out your branch, a release or the trunk, from the <em>git</em> repository (see Sec.&nbsp;<a href="#subsec_Getting_binary_c">4.2</a>), go to that directory (which will be called the <span class="flex_file"><i>binary_c</i></span> directory below) and skip to <a href="#subsec_Configuration">4.4.3</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-823'><span class="subsubsection_label">4.4.2</span> From a <em>zip</em> file or tarball</h4>
+<div class="standard" id='magicparlabel-824'>If have been given a file <span class="flex_software">zip</span> file <span class="flex_file"><i>binary_c</i>.zip</span><span style='font-family:monospace;font-size: 18px;'>,</span> or a tarball e.g.&nbsp;<span class="flex_file"><i>binary_c</i>.tar.gz</span> or <span class="flex_file"><i>binary_c</i>.tar.bz2</span>, you should copy it to a directory (hereafter <span class="flex_file"><i>binary_c</i></span>, usually I put everything in <span class="flex_file"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mo> &sim; </mo>
  </mrow></mstyle></math>/progs/stars/<i>binary_c</i></span> where <span class="flex_file"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mo> &sim; </mo>
  </mrow></mstyle></math></span> is your home directory – if you put it there then all the scripts will work) and <span class="flex_software">unzip</span> it with one of the following commands (depending on the type of file you were given):</div>
 
-<div class="standard" id='magicparlabel-451'><b><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-857'><b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ unzip <i>binary_c</i>.zip 
 $ tar -xvf <i>binary_c</i>.tar.gz
 $ tar -xvf <i>binary_c</i>.tar.bz2</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-458'>which will <span class="flex_software">unzip</span> the files in the appropriate places.</div>
-<h4 class="subsubsection" id='magicparlabel-463'><span class="subsubsection_label">3.4.3</span> Configuration<div id="subsec_Configuration"></div>
+<div class="standard" id='magicparlabel-864'>which will <span class="flex_software">unzip</span> the files in the appropriate places.</div>
+<h4 class="subsubsection" id='magicparlabel-869'><span class="subsubsection_label">4.4.3</span> Configuration<div id="subsec_Configuration"></div>
 </h4>
-<div class="standard" id='magicparlabel-464'>Now, from the <span class="flex_file"><i>binary_c</i></span> directory, you need to run the configuration script with</div>
+<div class="standard" id='magicparlabel-870'>Now, from the <span class="flex_file"><i>binary_c</i></span> directory, you need to run the configuration script with</div>
 
-<div class="standard" id='magicparlabel-469'><b><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-875'><b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ ./configure</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-474'>which creates some object files and the <span class="flex_file">Makefile</span>. Now type</div>
+<div class="standard" id='magicparlabel-880'>which creates some object files and the <span class="flex_file">Makefile</span>. Now type</div>
 
-<div class="standard" id='magicparlabel-479'><b><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-885'><b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ ./make</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-484'>to build the code. The make script is a wrapper around <span class="flex_software">GNU make</span> that executes the build on as many CPUs as you have, and pretties up the output so that it is more readable. Note that you may need to use</div>
+<div class="standard" id='magicparlabel-890'>to build the code. The make script is a wrapper around <span class="flex_software">GNU make</span> that executes the build on as many CPUs as you have, and pretties up the output so that it is more readable. Note that you may need to use</div>
 
-<div class="standard" id='magicparlabel-489'><b><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-895'><b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ gmake</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-494'>from the <span class="flex_file">src</span> directory if <span class="flex_software">GNU make</span> is not your default (e.g.&nbsp;on <span class="flex_os">Solaris</span>). 
+<div class="standard" id='magicparlabel-900'>from the <span class="flex_file">src</span> directory if <span class="flex_software">GNU make</span> is not your default (e.g.&nbsp;on <span class="flex_os">Solaris</span>). 
 <br />
 
 The code will now build, assuming <span style='font-family:monospace;font-size: 18px;'>configure</span> worked ok. If configure does <em>not</em> work then please try to fix it before running to me with complaints. It works fine on <span class="flex_os">Linux</span> and will revert to <span class="flex_software">gcc</span> as the default compiler if something goes wrong. The executable is called <span class="flex_file"><i>binary_c</i></span><span style='font-family:monospace;font-size: 18px;'>.</span></div>
 
-<div class="standard" id='magicparlabel-519'>Note: <span class="flex_file"><i>binary_c</i></span> is built as a single, possibly <em>large</em> (many MB) executable. The reason for this is the ease of use when transferring the executable from one machine to another (e.g.&nbsp;for use with distributed computing). It is possible to build a shared library instead (see below) and future <i>binary_c</i> versions will probably use environment variables to point to data directories.</div>
-<h4 class="subsubsection" id='magicparlabel-524'><span class="subsubsection_label">3.4.4</span> Building the shared library <i>libbinary_c</i></h4>
-<div class="standard" id='magicparlabel-525'>To build the shared library, run</div>
+<div class="standard" id='magicparlabel-925'>Note: <span class="flex_file"><i>binary_c</i></span> is built as a single, possibly <em>large</em> (many MB) executable. The reason for this is the ease of use when transferring the executable from one machine to another (e.g.&nbsp;for use with distributed computing). It is possible to build a shared library instead (see below) and future <i>binary_c</i> versions will probably use environment variables to point to data directories.</div>
+<h4 class="subsubsection" id='magicparlabel-930'><span class="subsubsection_label">4.4.4</span> Building the shared library <i>libbinary_c</i></h4>
+<div class="standard" id='magicparlabel-931'>To build the shared library, run</div>
 
-<div class="standard" id='magicparlabel-526'><br />
+<div class="standard" id='magicparlabel-932'><br />
 <pre class\s*='listings bash'>$ ./configure
 $ make <i>libbinary_c.so</i></pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-532'>This makes the <span class="flex_file"><i>libbinary_c.so</i></span> shared library which can be used, for example, by the <span class="flex_programminglanguage">C</span> backend to <i>binary_grid</i><em>2</em>, or to access <i>binary_c</i> through its <em>API</em> functions.</div>
-<h4 class="subsubsection" id='magicparlabel-541'><span class="subsubsection_label">3.4.5</span> Alternative compiler</h4>
-<div class="standard" id='magicparlabel-542'>You can build with another compiler, e.g.<em>&nbsp;<span class="flex_software">clang</span></em>, with</div>
+<div class="standard" id='magicparlabel-938'>This makes the <span class="flex_file"><i>libbinary_c.so</i></span> shared library which can be used, for example, by the <span class="flex_programminglanguage">C</span> backend to <i>binary_grid</i><em>2</em>, or to access <i>binary_c</i> through its <em>API</em> functions.</div>
+<h4 class="subsubsection" id='magicparlabel-947'><span class="subsubsection_label">4.4.5</span> Alternative compiler</h4>
+<div class="standard" id='magicparlabel-948'>You can build with another compiler, e.g.<em>&nbsp;<span class="flex_software">clang</span></em>, with</div>
 
-<div class="standard" id='magicparlabel-547'><br />
+<div class="standard" id='magicparlabel-953'><br />
 <pre class\s*='listings bash'>$ export CC=clang
 $ ./configure
 $ ./make</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-554'><span class="subsubsection_label">3.4.6</span> Debugging build</h4>
-<div class="standard" id='magicparlabel-555'>To enable full debugging, run</div>
+<h4 class="subsubsection" id='magicparlabel-960'><span class="subsubsection_label">4.4.6</span> Debugging build</h4>
+<div class="standard" id='magicparlabel-961'>To enable full debugging, run</div>
 
-<div class="standard" id='magicparlabel-556'><br />
+<div class="standard" id='magicparlabel-962'><br />
 <pre class\s*='listings bash'>$ ./configure debug
 $ ./make</pre><br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 
 </span></b>You require debugging to use <span class="flex_software">gdb</span>, <span class="flex_software">valgrind</span>, etc.&nbsp;as well as <span class="flex_software">libbacktrace</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-574'><span class="subsubsection_label">3.4.7</span> Accurate floating point build</h4>
-<div class="standard" id='magicparlabel-575'>Binary_c generally does not require perfect floating-point accuracy and uses <span class="flex_cflags">-ffast-math</span> for extra speed, but you can turn on <span class="flex_software">gcc</span>'s various flags to improve accuracy with <br />
+<h4 class="subsubsection" id='magicparlabel-980'><span class="subsubsection_label">4.4.7</span> Accurate floating point build</h4>
+<div class="standard" id='magicparlabel-981'>Binary_c generally does not require perfect floating-point accuracy and uses <span class="flex_cflags">-ffast-math</span> for extra speed, but you can turn on <span class="flex_software">gcc</span>'s various flags to improve accuracy with <br />
 <pre class\s*='listings bash'>$ ./configure accurate</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-588'><span class="subsubsection_label">3.4.8</span> Generic build, e.g.&nbsp;for <em>HTCondor</em></h4>
-<div class="standard" id='magicparlabel-589'>You may wish to build a generic version of <i>binary_c</i> which is not tied to the CPU architecture or operating system on which you are building, e.g.&nbsp;if your <i>binary_c</i> is required for use on the many machines of an <span class="flex_software">HTCondor</span><em> </em>or <span class="flex_software">Slurm</span> grid. Try <b><span style='font-family:monospace;font-size: 18px;'><br />
+<h4 class="subsubsection" id='magicparlabel-994'><span class="subsubsection_label">4.4.8</span> Generic build, e.g.&nbsp;for <em>HTCondor</em></h4>
+<div class="standard" id='magicparlabel-995'>You may wish to build a generic version of <i>binary_c</i> which is not tied to the CPU architecture or operating system on which you are building, e.g.&nbsp;if your <i>binary_c</i> is required for use on the many machines of an <span class="flex_software">HTCondor</span><em> </em>or <span class="flex_software">Slurm</span> grid. Try <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ ./configure generic</pre><br />
 </span></b></div>
-<h4 class="subsubsection" id='magicparlabel-602'><span class="subsubsection_label">3.4.9</span> Libraries for <i>binary_c</i></h4>
-<div class="standard" id='magicparlabel-603'><i>binary_c</i> uses <a href="https://gitlab.eps.surrey.ac.uk/ri0005/libmemoize">libmemoize</a> and <a href="https://gitlab.eps.surrey.ac.uk/ri0005/librinterpolate">librinterpolate</a>, written by RGI, and RGI's customized <i>GNU</i> Scientific Library (at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/GSL-RGI">this link</a>). These should really just be installed locally, but there are internal versions inside <i>binary_c</i> just in case you cannot install them, and a standard system <span class="flex_software">GSL</span> should work.</div>
-<h4 class="subsubsection" id='magicparlabel-608'><span class="subsubsection_label">3.4.10</span> Extra libraries</h4>
-<div class="standard" id='magicparlabel-609'>A number of external libraries can be used, particularly during debugging. These include <span class="flex_software">libiberty</span>, <span class="flex_software">libbfd</span> (part of <span class="flex_software">gcc</span>) and <em><span class="flex_software">libbacktrace</span></em>. The latter is particularly useful, and I recommend installing it if you want to do any serious debugging. You can download <span class="flex_software">libbacktrace</span> from <a href="https://github.com/ianlancetaylor/libbacktrace">https://github.com/ianlancetaylor/libbacktrace</a>.</div>
-<h3 class="subsection" id='magicparlabel-630'><span class="subsection_label">3.5</span> Testing <i>binary_c</i></h3>
-<div class="standard" id='magicparlabel-631'>Run the <span class="flex_scriptinglanguage">bash</span> script to &ldquo;test binary star evolution&rdquo; called,</div>
-
-<div class="standard" id='magicparlabel-636'><br />
+<h4 class="subsubsection" id='magicparlabel-1008'><span class="subsubsection_label">4.4.9</span> Libraries for <i>binary_c</i></h4>
+<div class="standard" id='magicparlabel-1009'><i>binary_c</i> uses <a href="https://gitlab.eps.surrey.ac.uk/ri0005/libmemoize">libmemoize</a> and <a href="https://gitlab.eps.surrey.ac.uk/ri0005/librinterpolate">librinterpolate</a>, written by RGI, and RGI's customized <i>GNU</i> Scientific Library (at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/GSL-RGI">this link</a>). These should really just be installed locally, but there are internal versions inside <i>binary_c</i> just in case you cannot install them, and a standard system <span class="flex_software">GSL</span> should work.</div>
+<h4 class="subsubsection" id='magicparlabel-1014'><span class="subsubsection_label">4.4.10</span> Extra libraries</h4>
+<div class="standard" id='magicparlabel-1015'>A number of external libraries can be used, particularly during debugging. These include <span class="flex_software">libiberty</span>, <span class="flex_software">libbfd</span> (part of <span class="flex_software">gcc</span>) and <em><span class="flex_software">libbacktrace</span></em>. The latter is particularly useful, and I recommend installing it if you want to do any serious debugging. You can download <span class="flex_software">libbacktrace</span> from <a href="https://github.com/ianlancetaylor/libbacktrace">https://github.com/ianlancetaylor/libbacktrace</a>.</div>
+<h3 class="subsection" id='magicparlabel-1036'><span class="subsection_label">4.5</span> Testing <i>binary_c</i></h3>
+<div class="standard" id='magicparlabel-1037'>Run the <span class="flex_scriptinglanguage">bash</span> script to &ldquo;test binary star evolution&rdquo; called,</div>
+
+<div class="standard" id='magicparlabel-1042'><br />
 <pre class\s*='listings bash'>$ tbse</pre><br />
 You should see some output. 
 <br />
 
 You may have to symbolically link the executable at <span class="flex_file">src/<i>binary_c</i> to <i>binary_c</i></span> in the root <i>binary_c</i> directory to make this work, e.g.,</div>
 
-<div class="standard" id='magicparlabel-645'><br />
+<div class="standard" id='magicparlabel-1051'><br />
 <pre class\s*='listings bash'>$ cd &lt;binary_c_directory&gt;
 $ ln -s src/<i>binary_c</i></pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-651'><span class="subsubsection_label">3.5.1</span> tbse commands<div id="subsec_tbse_commands"></div>
+<h4 class="subsubsection" id='magicparlabel-1057'><span class="subsubsection_label">4.5.1</span> tbse commands<div id="subsec_tbse_commands"></div>
 </h4>
-<div class="standard" id='magicparlabel-652'><span class="flex_bashscript">tbse</span><em> </em>can take extra arguments, which are often passed to <em><i>binary_c</i></em> directly or are directives to perform special tasks.</div>
+<div class="standard" id='magicparlabel-1058'><span class="flex_bashscript">tbse</span><em> </em>can take extra arguments, which are often passed to <em><i>binary_c</i></em> directly or are directives to perform special tasks.</div>
 
-<dl class='description' id='magicparlabel-657'><dt class="description_label">tbse&nbsp;echo</dt>
+<dl class='description' id='magicparlabel-1063'><dt class="description_label">tbse&nbsp;echo</dt>
 <dd class="description_item"> This outputs (to <em>stdout</em>) the arguments that would have been sent to <em><i>binary_c</i></em>.</dd>
 <dt class="description_label">tbse_echolines</dt>
 <dd class="description_item"> As <em>tbse echo</em> but in a single line of output. Newlines are converted to <span style='font-family:monospace;font-size: 18px;'>\n</span>.</dd>
@@ -1067,39 +1377,39 @@ $ ln -s src/<i>binary_c</i></pre><br />
 <dt class="description_label">tbse&nbsp;clip</dt>
 <dd class="description_item"> Runs <i>binary_c</i> and saves the output to the clipboard (requires <em>xclip</em>).</dd>
 </dl>
-<h3 class="subsection" id='magicparlabel-679'><span class="subsection_label">3.6</span> Directory structure</h3>
+<h3 class="subsection" id='magicparlabel-1085'><span class="subsection_label">4.6</span> Directory structure</h3>
 
-<ul class="itemize" id='magicparlabel-680'><li class="itemize_item">The <span class="flex_file">src</span> directory, which holds all the <span style='font-family:monospace;font-size: 18px;'>.c</span> files</li>
+<ul class="itemize" id='magicparlabel-1086'><li class="itemize_item">The <span class="flex_file">src</span> directory, which holds all the <span style='font-family:monospace;font-size: 18px;'>.c</span> files</li>
 <li class="itemize_item"><span class="flex_file">src/doc</span> contains documentation</li>
 <li class="itemize_item"><span class="flex_file">src/perl</span> contains the <span class="flex_scriptinglanguage">Perl</span>  scripts e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_file">grid.pl</span><span style='font-family:monospace;font-size: 18px;'> </span>as well as latest <em><i>binary_grid</i></em> and helper modules, as well as some useful scripts. Please see the installation guide for help on installing these components.</li>
 <li class="itemize_item"><span class="flex_file">unit_tests</span> contains some test components</li>
 </ul>
-<div class="standard" id='magicparlabel-708'><br />
+<div class="standard" id='magicparlabel-1114'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-709'><span class="subsection_label">3.7</span> Building binary_grid2: the population synthesis module</h3>
-<div class="standard" id='magicparlabel-710'>This section describes in some detail the installation of <em><i>binary_grid2</i></em>. Note that sometimes you will require the latest version of pieces of software, in particular <span class="flex_scriptinglanguage">Perl</span> which should be at least version 5.16. I show you how to do this <em>without</em> requiring root permissions on your machine. Should you require packages to be installed that require root permission, you can always set up <em><i>binary_c</i></em> and <em><i>binary_grid</i></em> on a <em>virtual machine</em> which runs as a guest on your operating system, I do this with <span class="flex_software">Virtualbox</span> (<a href="https://www.virtualbox.org/">https://www.virtualbox.org/</a>). This would be my advice if you are running on a non-standard operating system, e.g.<em>&nbsp;</em><span class="flex_os">Windows</span>. You will have the root password for your virtual machine, so there are never permissions problems.</div>
+<h3 class="subsection" id='magicparlabel-1115'><span class="subsection_label">4.7</span> Building binary_grid2: the population synthesis module</h3>
+<div class="standard" id='magicparlabel-1116'>This section describes in some detail the installation of <em><i>binary_grid2</i></em>. Note that sometimes you will require the latest version of pieces of software, in particular <span class="flex_scriptinglanguage">Perl</span> which should be at least version 5.16. I show you how to do this <em>without</em> requiring root permissions on your machine. Should you require packages to be installed that require root permission, you can always set up <em><i>binary_c</i></em> and <em><i>binary_grid</i></em> on a <em>virtual machine</em> which runs as a guest on your operating system, I do this with <span class="flex_software">Virtualbox</span> (<a href="https://www.virtualbox.org/">https://www.virtualbox.org/</a>). This would be my advice if you are running on a non-standard operating system, e.g.<em>&nbsp;</em><span class="flex_os">Windows</span>. You will have the root password for your virtual machine, so there are never permissions problems.</div>
 
-<div class="standard" id='magicparlabel-723'>You will need some basic tools installed to make everything work: <span class="flex_scriptinglanguage">bash</span>, <span class="flex_software">subversion</span>, <span class="flex_scriptinglanguage">Perl</span>, <span class="flex_software">gmake</span>, <span class="flex_software">wget</span>, <span class="flex_software">gcc</span>. These are available on all good operating systems, and come by default – or after a simple install – with most flavours of <span class="flex_os">Linux</span>/<span class="flex_os">Unix</span> and <span class="flex_os">MacOS</span>.</div>
+<div class="standard" id='magicparlabel-1129'>You will need some basic tools installed to make everything work: <span class="flex_scriptinglanguage">bash</span>, <span class="flex_software">subversion</span>, <span class="flex_scriptinglanguage">Perl</span>, <span class="flex_software">gmake</span>, <span class="flex_software">wget</span>, <span class="flex_software">gcc</span>. These are available on all good operating systems, and come by default – or after a simple install – with most flavours of <span class="flex_os">Linux</span>/<span class="flex_os">Unix</span> and <span class="flex_os">MacOS</span>.</div>
 
-<div class="standard" id='magicparlabel-760'>Some <span class="flex_scriptinglanguage">Perl</span><em> </em>modules also require some other system libraries and development files. It is difficult to know exactly what these would be for every operating system. You may have to use a web search to find out, but that's fine because you are smart!</div>
-<h4 class="subsubsection" id='magicparlabel-765'><span class="subsubsection_label">3.7.1</span> Get the latest <span class="flex_scriptinglanguage">Perl</span>  with<em> perlbrew</em></h4>
-<div class="standard" id='magicparlabel-770'>I highly recommend that you install the latest version of <span class="flex_scriptinglanguage">Perl</span><em> </em>using <span class="flex_software">perlbrew</span> and install modules using <span class="flex_software">cpanm</span><em>.</em> I describe how to do this below, but also please see <a href="http://perlbrew.pl/">http://perlbrew.pl/</a> and <a href="http://perlbrew.pl/Perlbrew-and-Friends.html ">http://perlbrew.pl/Perlbrew-and-Friends.html </a>for further instructions and documentation.</div>
-<h4 class="subsubsection" id='magicparlabel-783'><span class="subsubsection_label">3.7.2</span> Installing <em><i>binary_c</i></em></h4>
-<div class="standard" id='magicparlabel-784'>Please see Sec.&nbsp;<a href="#subsec_Building">3.4</a> above for details about how to install <i>binary_c</i>. </div>
-<h4 class="subsubsection" id='magicparlabel-785'><span class="subsubsection_label">3.7.3</span> Installing <em><i>binary_grid2</i></em></h4>
-<div class="standard" id='magicparlabel-786'><div id="subsec_installing_binary_grid"></div>
+<div class="standard" id='magicparlabel-1166'>Some <span class="flex_scriptinglanguage">Perl</span><em> </em>modules also require some other system libraries and development files. It is difficult to know exactly what these would be for every operating system. You may have to use a web search to find out, but that's fine because you are smart!</div>
+<h4 class="subsubsection" id='magicparlabel-1171'><span class="subsubsection_label">4.7.1</span> Get the latest <span class="flex_scriptinglanguage">Perl</span>  with<em> perlbrew</em></h4>
+<div class="standard" id='magicparlabel-1176'>I highly recommend that you install the latest version of <span class="flex_scriptinglanguage">Perl</span><em> </em>using <span class="flex_software">perlbrew</span> and install modules using <span class="flex_software">cpanm</span><em>.</em> I describe how to do this below, but also please see <a href="http://perlbrew.pl/">http://perlbrew.pl/</a> and <a href="http://perlbrew.pl/Perlbrew-and-Friends.html ">http://perlbrew.pl/Perlbrew-and-Friends.html </a>for further instructions and documentation.</div>
+<h4 class="subsubsection" id='magicparlabel-1189'><span class="subsubsection_label">4.7.2</span> Installing <em><i>binary_c</i></em></h4>
+<div class="standard" id='magicparlabel-1190'>Please see Sec.&nbsp;<a href="#subsec_Building">4.4</a> above for details about how to install <i>binary_c</i>. </div>
+<h4 class="subsubsection" id='magicparlabel-1191'><span class="subsubsection_label">4.7.3</span> Installing <em><i>binary_grid2</i></em></h4>
+<div class="standard" id='magicparlabel-1192'><div id="subsec_installing_binary_grid"></div>
 </div>
 
-<div class="standard" id='magicparlabel-787'><em><i>binary_grid2</i></em> is written in <span class="flex_scriptinglanguage"><span class="flex_scriptinglanguage">Perl</span> </span> (<a href="http://www.perl.org/">http://www.perl.org/</a>) which is available on almost every modern operating system, although to my knowledge <em><i>binary_grid2</i></em> has never been tested on anything other than <span class="flex_os">Linux</span> (<a href="http://www.linux.org/">http://www.linux.org/</a>), <span class="flex_os">Solaris</span> and <span class="flex_os">MacOS</span>.</div>
+<div class="standard" id='magicparlabel-1193'><em><i>binary_grid2</i></em> is written in <span class="flex_scriptinglanguage"><span class="flex_scriptinglanguage">Perl</span> </span> (<a href="http://www.perl.org/">http://www.perl.org/</a>) which is available on almost every modern operating system, although to my knowledge <em><i>binary_grid2</i></em> has never been tested on anything other than <span class="flex_os">Linux</span> (<a href="http://www.linux.org/">http://www.linux.org/</a>), <span class="flex_os">Solaris</span> and <span class="flex_os">MacOS</span>.</div>
 
-<div class="standard" id='magicparlabel-808'>The newest <em><i>binary_grid2</i></em> uses features from the latest <span class="flex_scriptinglanguage">Perl</span>  (5.16 or above, currently testing on 5.29.8) so you'll need a recent <span class="flex_scriptinglanguage">Perl</span>  to be installed. Unfortunately most versions of <span class="flex_os">Linux</span> run an older <span class="flex_scriptinglanguage">Perl</span>  without support for many of the required features. You will also need to have the latest versions of a number of <span class="flex_scriptinglanguage">Perl</span>  modules which come from either from the online resource <em>CPAN</em><div class="foot"><span class="foot_label">3</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-832'><em>Comprehensive Perl Archive Network</em></div>
+<div class="standard" id='magicparlabel-1214'>The newest <em><i>binary_grid2</i></em> uses features from the latest <span class="flex_scriptinglanguage">Perl</span>  (5.16 or above, currently testing on 5.29.8) so you'll need a recent <span class="flex_scriptinglanguage">Perl</span>  to be installed. Unfortunately most versions of <span class="flex_os">Linux</span> run an older <span class="flex_scriptinglanguage">Perl</span>  without support for many of the required features. You will also need to have the latest versions of a number of <span class="flex_scriptinglanguage">Perl</span>  modules which come from either from the online resource <em>CPAN</em><div class="foot"><span class="foot_label">3</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-1238'><em>Comprehensive Perl Archive Network</em></div>
 </div></div> (<a href="http://www.cpan.org/">http://www.cpan.org/</a>) or as part of the <em><i>binary_c</i></em> package.</div>
 
-<div class="standard" id='magicparlabel-833'>My recommendation is to use <em><b>perlbrew</b> </em>to make your own <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_software">cpanminus</span> (the command is <span class="flex_software">cpanm</span>) to install the modules.</div>
+<div class="standard" id='magicparlabel-1239'>My recommendation is to use <em><b>perlbrew</b> </em>to make your own <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_software">cpanminus</span> (the command is <span class="flex_software">cpanm</span>) to install the modules.</div>
 
-<div class="standard" id='magicparlabel-846'>You can find <span class="flex_software">perlbrew</span> at <a href="http://perlbrew.pl/">http://perlbrew.pl/</a> : please follow the instructions on that page to install the latest <span class="flex_scriptinglanguage">Perl</span>  on your system if you do not trust my instructions below. Typically do the following, but remember you <em>must</em> install <span class="flex_software">perlbrew</span> with <span class="flex_cflags">-Dusethreads</span> otherwise <span class="flex_scriptinglanguage">Perl</span>  will not use threads and you will lose the multi-CPU features of <em><i>binary_grid</i></em>2. Please note that I assume you are using the <span class="flex_software">bash</span> shell.</div>
+<div class="standard" id='magicparlabel-1252'>You can find <span class="flex_software">perlbrew</span> at <a href="http://perlbrew.pl/">http://perlbrew.pl/</a> : please follow the instructions on that page to install the latest <span class="flex_scriptinglanguage">Perl</span>  on your system if you do not trust my instructions below. Typically do the following, but remember you <em>must</em> install <span class="flex_software">perlbrew</span> with <span class="flex_cflags">-Dusethreads</span> otherwise <span class="flex_scriptinglanguage">Perl</span>  will not use threads and you will lose the multi-CPU features of <em><i>binary_grid</i></em>2. Please note that I assume you are using the <span class="flex_software">bash</span> shell.</div>
 
-<ol class="enumerate" id='magicparlabel-871'><li class="enumerate_item"><br />
+<ol class="enumerate" id='magicparlabel-1277'><li class="enumerate_item"><br />
 <pre class\s*='listings bash'>$ wget --no-check-certificate -O - http://install.perlbrew.pl | bash</pre><br />
  or <br />
 <pre class\s*='listings bash'>$ curl -kL http://install.perlbrew.pl | bash</pre><br />
@@ -1109,7 +1419,7 @@ If you have problems with <span class="flex_software">wget</span>, try removing
 You can use <span class="flex_cflags">-march=native -mtune=native</span> if you are quite sure you will not use this version of <span class="flex_scriptinglanguage">Perl</span> , or its modules, on a machine with a different architecture. If you are building for use with an <span class="flex_software">HTCondor</span> grid or on a shared (e.g.&nbsp;<em><span class="flex_software">NFS</span></em>) filesystem which is used on many different machines, I highly recommend using the <span class="flex_args">generic</span> option.
 <br />
 
-Note that the final <em>8</em> should be replaced by the number of CPUs you wish to use for the build (it is an option passed to <em>make</em>). Note also that <span class="flex_cflags">-Duseshrplib</span> may no longer be required. I have recently added <span class="flex_cflags">–thread-multi –64bitall</span> so if you have trouble, please remove these and try again. <div class="foot"><span class="foot_label">4</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-936'>In <span class="flex_scriptinglanguage">Perl</span>  5.27.5 there is a (known) bug in the test routines which may (or may not) stop your installation. For this reason the <span class="flex_cflags">--notest</span> flag if set. Remove this if you want testing back (also, it is slow).</div>
+Note that the final <em>8</em> should be replaced by the number of CPUs you wish to use for the build (it is an option passed to <em>make</em>). Note also that <span class="flex_cflags">-Duseshrplib</span> may no longer be required. I have recently added <span class="flex_cflags">–thread-multi –64bitall</span> so if you have trouble, please remove these and try again. <div class="foot"><span class="foot_label">4</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-1342'>In <span class="flex_scriptinglanguage">Perl</span>  5.27.5 there is a (known) bug in the test routines which may (or may not) stop your installation. For this reason the <span class="flex_cflags">--notest</span> flag if set. Remove this if you want testing back (also, it is slow).</div>
 </div></div>The installation process can take a long time, go and have lunch&hellip; then:</li>
 <li class="enumerate_item">Do what <span class="flex_software">perlbrew</span> suggests with your <span class="flex_file">.bashrc</span> (or whatever shell initialization script you use) to fix the <span class="flex_envvar">PERLBREW_PATH</span>.</li>
 <li class="enumerate_item">Restart your shell (e.g.&nbsp;close your terminal and open a new one, or just run <span class="flex_scriptinglanguage">bash</span> again) to update your environment and <span class="flex_envvar">$PATH</span>.</li>
@@ -1140,9 +1450,9 @@ If you have a previous version of <span class="flex_scriptinglanguage">Perl</spa
 <pre class\s*='listings bash'>$ perlbrew install-cpanm </pre><br />
 </li>
 </ol>
-<div class="standard" id='magicparlabel-1022'>Now you have the latest <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_software">cpanm</span> installed, you can start to install the modules needed for <em><i>binary_grid</i></em>2. (Un?)fortunately, there are many of them, so I have made a script to do it for you</div>
+<div class="standard" id='magicparlabel-1428'>Now you have the latest <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_software">cpanm</span> installed, you can start to install the modules needed for <em><i>binary_grid</i></em>2. (Un?)fortunately, there are many of them, so I have made a script to do it for you</div>
 
-<ol class="enumerate" id='magicparlabel-1031'><li class="enumerate_item">From the <span class="flex_file"><i>binary_c</i></span> directory, go to <span class="flex_file">src/perl</span> with <br />
+<ol class="enumerate" id='magicparlabel-1437'><li class="enumerate_item">From the <span class="flex_file"><i>binary_c</i></span> directory, go to <span class="flex_file">src/perl</span> with <br />
 <pre class\s*='listings bash'>$ cd src/perl</pre><br />
 </li>
 <li class="enumerate_item">Run the install script which uses <span class="flex_software">cpanminus</span> to install the modules
@@ -1175,10 +1485,10 @@ If you <em>do</em> have trouble, try <br />
 <pre class\s*='listings bash'>$ export PERL5LIB=$HOME/perl5/perlbrew/perls/5.29.8/lib/site_perl/5.29.8</pre><br />
  (or similar).</li>
 </ol>
-<div class="standard" id='magicparlabel-1106'>Now you should have everything installed and be able to run a <em><i>binary_grid</i></em> script.</div>
-<h4 class="subsubsection" id='magicparlabel-1107'><span class="subsubsection_label">3.7.4</span> Troubleshooting <em><span class="flex_scriptinglanguage"><em>Perl</em></span></em></h4>
+<div class="standard" id='magicparlabel-1512'>Now you should have everything installed and be able to run a <em><i>binary_grid</i></em> script.</div>
+<h4 class="subsubsection" id='magicparlabel-1513'><span class="subsubsection_label">4.7.4</span> Troubleshooting <em><span class="flex_scriptinglanguage"><em>Perl</em></span></em></h4>
 
-<dl class='description' id='magicparlabel-1112'><dt class="description_label">Module&nbsp;not&nbsp;found</dt>
+<dl class='description' id='magicparlabel-1518'><dt class="description_label">Module&nbsp;not&nbsp;found</dt>
 <dd class="description_item"> Check the <span class="flex_envvar">PERL5LIB</span> environment variable. When it is empty, <span class="flex_software">cpanm</span>/<span class="flex_software">perlbrew</span> should find your modules automatically, <em>if</em> they are installed correctly by <span class="flex_software">cpanm</span> (in the <span class="flex_file">site_perl</span> directory, see above). You can try installing modules again with <br />
 <pre class\s*='listings bash'>$ cpanm --force --reinstall</pre><br />
  to force a reinstallation, and with <span class="flex_args">-v</span> for extra logging.</dd>
@@ -1205,22 +1515,22 @@ I also recommend <span class="flex_cflags">-Dcccdlflags=-fPIC</span><span style=
 <pre class\s*='listings bash'>$ perlbrew list-modules | perlbrew exec --with 5.xx.yy cpanm</pre><br />
 </dd>
 </dl>
-<h3 class="subsection" id='magicparlabel-1196'><span class="subsection_label">3.8</span> <em><i>binary_grid2</i></em> backends<div id="subsec_binary_grid2_backends"></div>
+<h3 class="subsection" id='magicparlabel-1602'><span class="subsection_label">4.8</span> <em><i>binary_grid2</i></em> backends<div id="subsec_binary_grid2_backends"></div>
 </h3>
-<div class="standard" id='magicparlabel-1197'>The &ldquo;backend&rdquo; of <em><i>binary_c</i></em> is a set of interface code between <em><i>binary_c</i></em> and <i>binary_grid</i><em>2</em>. To understand what a backend is, please see <a href="https://en.wikipedia.org/wiki/Front_and_back_ends">https://en.wikipedia.org/wiki/Front_and_back_ends</a>. There are two backends – <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_programminglanguage">C</span> – corresponding to the two different ways <em><i>binary_c</i></em> can talk to <i>binary_grid</i>. You should always use the <span class="flex_programminglanguage">C</span> backend if at all possible: it is faster and has more features, and the <span class="flex_scriptinglanguage">Perl</span>  backend will be deprecated at some point.</div>
-<h4 class="subsubsection" id='magicparlabel-1214'><span class="subsubsection_label">3.8.1</span> <span class="flex_programminglanguage">C</span> backend</h4>
-<div class="standard" id='magicparlabel-1219'>New to <em><i>binary_grid2</i></em> is the<em> </em><span class="flex_programminglanguage">C</span> backend. This features simpler code and uses <em><i>binary_c</i></em>'s <em>API</em> to access data directly, hence it is a lot faster than the <span class="flex_scriptinglanguage">Perl</span>  backend, and scales better on multi-core architectures. The down side is that installation is more difficult, especially if you have multiple projects.</div>
+<div class="standard" id='magicparlabel-1603'>The &ldquo;backend&rdquo; of <em><i>binary_c</i></em> is a set of interface code between <em><i>binary_c</i></em> and <i>binary_grid</i><em>2</em>. To understand what a backend is, please see <a href="https://en.wikipedia.org/wiki/Front_and_back_ends">https://en.wikipedia.org/wiki/Front_and_back_ends</a>. There are two backends – <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_programminglanguage">C</span> – corresponding to the two different ways <em><i>binary_c</i></em> can talk to <i>binary_grid</i>. You should always use the <span class="flex_programminglanguage">C</span> backend if at all possible: it is faster and has more features, and the <span class="flex_scriptinglanguage">Perl</span>  backend will be deprecated at some point.</div>
+<h4 class="subsubsection" id='magicparlabel-1620'><span class="subsubsection_label">4.8.1</span> <span class="flex_programminglanguage">C</span> backend</h4>
+<div class="standard" id='magicparlabel-1625'>New to <em><i>binary_grid2</i></em> is the<em> </em><span class="flex_programminglanguage">C</span> backend. This features simpler code and uses <em><i>binary_c</i></em>'s <em>API</em> to access data directly, hence it is a lot faster than the <span class="flex_scriptinglanguage">Perl</span>  backend, and scales better on multi-core architectures. The down side is that installation is more difficult, especially if you have multiple projects.</div>
 
-<div class="standard" id='magicparlabel-1228'>If you see errors like:</div>
+<div class="standard" id='magicparlabel-1634'>If you see errors like:</div>
 
-<div class="standard" id='magicparlabel-1229'><b><br />
+<div class="standard" id='magicparlabel-1635'><b><br />
 <pre class ='listings'>perl: symbol lookup error: /.../perl5/perlbrew/perls/perl-5.29.8/lib/site_perl/5.29.8/x86_64-linux-thread-multi/auto/<i>binary_grid</i>/C/C.so: undefined symbol: new_system</pre><br />
 </b>then you have failed to build the shared library as is required when using the <span class="flex_programminglanguage">C</span> backend.
 <br />
 
 To make the <span class="flex_programminglanguage">C</span> backend work, you have to <em>first</em> build <span class="flex_file"><i>libbinary_c.so</i></span> and <em>then</em> install <em><i>binary_grid2</i></em>. In summary:</div>
 
-<ol class="enumerate" id='magicparlabel-1246'><li class="enumerate_item">Build <em><i>binary_c</i></em> as normal <br />
+<ol class="enumerate" id='magicparlabel-1652'><li class="enumerate_item">Build <em><i>binary_c</i></em> as normal <br />
 <pre class\s*='listings bash'>$ make</pre><br />
 </li>
 <li class="enumerate_item">Make the shared library, <em><i>libbinary_c.so</i></em> <br />
@@ -1230,11 +1540,11 @@ To make the <span class="flex_programminglanguage">C</span> backend work, you ha
 <pre class\s*='listings bash'>$ ./install_modules.pl Histogram <i>binary_grid</i></pre><br />
 </li>
 </ol>
-<div class="standard" id='magicparlabel-1261'>Because this module is written partly in <span class="flex_programminglanguage">C</span> and partly in <span class="flex_scriptinglanguage">Perl</span> , everything has to work perfectly or it will crash (usually with a segmentation fault). The shared library file <span class="flex_file"><i>libbinary_c.so</i></span><em> </em>must match with <em><i>binary_grid2</i></em> <b>at compile time</b>, and if you change anything in <em><i>binary_c</i></em> you probably have to follow the above instructions to reinstall the <span class="flex_programminglanguage">C</span> backend. </div>
+<div class="standard" id='magicparlabel-1667'>Because this module is written partly in <span class="flex_programminglanguage">C</span> and partly in <span class="flex_scriptinglanguage">Perl</span> , everything has to work perfectly or it will crash (usually with a segmentation fault). The shared library file <span class="flex_file"><i>libbinary_c.so</i></span><em> </em>must match with <em><i>binary_grid2</i></em> <b>at compile time</b>, and if you change anything in <em><i>binary_c</i></em> you probably have to follow the above instructions to reinstall the <span class="flex_programminglanguage">C</span> backend. </div>
 
-<div class="standard" id='magicparlabel-1278'>You can change the name of the shared library by setting the environment variable <span style='font-family:monospace;font-size: 18px;'>BINARY_GRID2_LIB</span> to the name of the library, and pointing <span class="flex_envvar">BINARY_C</span> to your <em><i>binary_c</i></em> tree. Then rebuild, e.g.,</div>
+<div class="standard" id='magicparlabel-1684'>You can change the name of the shared library by setting the environment variable <span style='font-family:monospace;font-size: 18px;'>BINARY_GRID2_LIB</span> to the name of the library, and pointing <span class="flex_envvar">BINARY_C</span> to your <em><i>binary_c</i></em> tree. Then rebuild, e.g.,</div>
 
-<div class="standard" id='magicparlabel-1283'><br />
+<div class="standard" id='magicparlabel-1689'><br />
 <pre class\s*='listings bash'>$ export BINARY_GRID2_LIB=binary_c_custom
 $ export BINARY_C=$HOME/<i>binary_c</i>
 $ ./configure
@@ -1242,43 +1552,43 @@ $ make libbinary_c_custom.so
 $ cpanm <i>binary_grid2</i>.tar.gz</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1292'>The <em><i>binary_grid2</i></em> module respects the <span class="flex_envvar">BINARY_GRID2_LIB</span> environment variable. </div>
+<div class="standard" id='magicparlabel-1698'>The <em><i>binary_grid2</i></em> module respects the <span class="flex_envvar">BINARY_GRID2_LIB</span> environment variable. </div>
 
-<div class="standard" id='magicparlabel-1297'>I do not yet know how to have custom <span class="flex_programminglanguage">C</span> backend modules with different shared libraries. It is quite possible that you could use the <span class="flex_envvar">PERL_INLINE_DIRECTORY</span> environment variable to have multiple builds, and point to the appropriate one. Please read <a href="http://search.cpan.org/~ingy/Inline-0.44/Inline.pod">http://search.cpan.org/~ingy/Inline-0.44/Inline.pod</a> especially the section <em>The Inline DIRECTORY</em> for instructions on how it is best to set up production code for multiple projects. Let RGI know if it works, so better instructions can be put in here.</div>
+<div class="standard" id='magicparlabel-1703'>I do not yet know how to have custom <span class="flex_programminglanguage">C</span> backend modules with different shared libraries. It is quite possible that you could use the <span class="flex_envvar">PERL_INLINE_DIRECTORY</span> environment variable to have multiple builds, and point to the appropriate one. Please read <a href="http://search.cpan.org/~ingy/Inline-0.44/Inline.pod">http://search.cpan.org/~ingy/Inline-0.44/Inline.pod</a> especially the section <em>The Inline DIRECTORY</em> for instructions on how it is best to set up production code for multiple projects. Let RGI know if it works, so better instructions can be put in here.</div>
 
-<div class="standard" id='magicparlabel-1306'>There are a number of environment variables which can be set when installing <em><i>binary_grid2</i></em>'s <em>C</em> backend:</div>
+<div class="standard" id='magicparlabel-1712'>There are a number of environment variables which can be set when installing <em><i>binary_grid2</i></em>'s <em>C</em> backend:</div>
 
-<dl class='description' id='magicparlabel-1307'><dt class="description_label">BINARY_C</dt>
+<dl class='description' id='magicparlabel-1713'><dt class="description_label">BINARY_C</dt>
 <dd class="description_item"> The directory in which your <i>binary_c</i> source tree lives. From this, the <span class="flex_file">src</span> directory is at <span class="flex_file"><span class="flex_envvar">$BINARY_C</span>/src</span></dd>
 <dt class="description_label">BINARY_GRID2_LIB</dt>
 <dd class="description_item"> The name of the shared library. Usually this is <em>'<i>binary_c</i></em>'.</dd>
 <dt class="description_label">BINARY_GRID2_CC</dt>
-<dd class="description_item"> The name of the compiler used to build the <span class="flex_programminglanguage">C</span> backend. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">8.2</a>).</dd>
+<dd class="description_item"> The name of the compiler used to build the <span class="flex_programminglanguage">C</span> backend. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
 <dt class="description_label">BINARY_GRID2_LD</dt>
-<dd class="description_item"> The name of the linker used to build the <span class="flex_programminglanguage">C</span> backend. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">8.2</a>).</dd>
+<dd class="description_item"> The name of the linker used to build the <span class="flex_programminglanguage">C</span> backend. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
 <dt class="description_label">BINARY_GRID2_INC</dt>
-<dd class="description_item"> Include flags for the build. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">8.2</a>).</dd>
+<dd class="description_item"> Include flags for the build. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
 <dt class="description_label">BINARY_GRID2_EXTRAINC</dt>
 <dd class="description_item"> Include flags to be postfixed to the <em>inc</em> flags set above.</dd>
 <dt class="description_label">BINARY_GRID2_LIBS</dt>
-<dd class="description_item"> Library flags. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">8.2</a>).</dd>
+<dd class="description_item"> Library flags. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
 <dt class="description_label">BINARY_GRID2_EXTRALIBS</dt>
 <dd class="description_item"> Library flags appended to the <em>libs</em> flags set above.</dd>
 <dt class="description_label">BINARY_GRID2_CCFLAGS</dt>
-<dd class="description_item"> Compiler flags.<span style='font-family:monospace;font-size: 18px;'> </span>Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">8.2</a>).</dd>
+<dd class="description_item"> Compiler flags.<span style='font-family:monospace;font-size: 18px;'> </span>Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
 <dt class="description_label">BINARY_GRID2_EXTRACCFLAGS</dt>
 <dd class="description_item"> <i>C</i> compiler flags postfixed to the <em>ccflags </em>set above.</dd>
 <dt class="description_label">BINARY_GRID2_DEBUG</dt>
 <dd class="description_item"> If non-zero, is used at the debugging flag when building the <span class="flex_perlmodule">binary_grid::C</span> backend.</dd>
 </dl>
-<h4 class="subsubsection" id='magicparlabel-1362'><span class="subsubsection_label">3.8.2</span> The <i>C</i> backend with multiple versions of <em><i>binary_c</i></em></h4>
-<div class="standard" id='magicparlabel-1363'>You may well have several branches, each of which uses a different <em><i>binary_c</i></em> setup (e.g. one with <span class="flex_cmacro">NUCSYN</span>, one without). However, using <span class="flex_software">cpanm</span> the <span class="flex_perlmodule">binary_grid::C</span> module is installed only <em>once</em> and cannot possibly thus work with all your branches. (The reason is that in each branch the various structures used by <em><i>binary_c</i></em> will be of different sizes in memory, so trying to access them from an incompatible version will likely give you a segmentation fault.)</div>
+<h4 class="subsubsection" id='magicparlabel-1768'><span class="subsubsection_label">4.8.2</span> The <i>C</i> backend with multiple versions of <em><i>binary_c</i></em></h4>
+<div class="standard" id='magicparlabel-1769'>You may well have several branches, each of which uses a different <em><i>binary_c</i></em> setup (e.g. one with <span class="flex_cmacro">NUCSYN</span>, one without). However, using <span class="flex_software">cpanm</span> the <span class="flex_perlmodule">binary_grid::C</span> module is installed only <em>once</em> and cannot possibly thus work with all your branches. (The reason is that in each branch the various structures used by <em><i>binary_c</i></em> will be of different sizes in memory, so trying to access them from an incompatible version will likely give you a segmentation fault.)</div>
 
-<div class="standard" id='magicparlabel-1376'>There is a solution. Make two directories containing your <em><i>binary_c</i></em> trees. You can either check out new copies of your git branches, or use &ldquo;git archive&rdquo; to copy a tree. In each tree, build a local copy of the <em><i>binary_grid</i></em> modules using <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlmodule">local::lib</span> and use this when calling your <span class="flex_scriptinglanguage">Perl</span>  grid script.</div>
+<div class="standard" id='magicparlabel-1782'>There is a solution. Make two directories containing your <em><i>binary_c</i></em> trees. You can either check out new copies of your git branches, or use &ldquo;git archive&rdquo; to copy a tree. In each tree, build a local copy of the <em><i>binary_grid</i></em> modules using <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlmodule">local::lib</span> and use this when calling your <span class="flex_scriptinglanguage">Perl</span>  grid script.</div>
 
-<div class="standard" id='magicparlabel-1389'>Note: it is important to set <span class="flex_envvar">BINARY_C</span> prior to the rebuild, this points to your <i>binary_c</i> directory (as checked out using <em>git</em>), because the <i>binary_grid</i> module looks in these locations for source code (which is different from tree to tree). So, from within the tree directory, run the following:</div>
+<div class="standard" id='magicparlabel-1795'>Note: it is important to set <span class="flex_envvar">BINARY_C</span> prior to the rebuild, this points to your <i>binary_c</i> directory (as checked out using <em>git</em>), because the <i>binary_grid</i> module looks in these locations for source code (which is different from tree to tree). So, from within the tree directory, run the following:</div>
 
-<div class="standard" id='magicparlabel-1394'><br />
+<div class="standard" id='magicparlabel-1800'><br />
 <pre class\s*='listings bash'>$ export BINARY_C=&rdquo;path_to_tree&rdquo; # you have to set this to the git checkout directory
 $ PERL_LIBDIR=&rdquo;path_to_binary_grid_perl_module&rdquo; # you have to set this
 $ 
@@ -1297,34 +1607,34 @@ $ # run your grid
 $ perl -Mlocal::lib=$PER_MODDIR your_grid_script.pl ...
 $ </pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-1415'><span class="subsubsection_label">3.8.3</span> Perl backend</h4>
-<div class="standard" id='magicparlabel-1416'><b>Warning: the <span class="flex_scriptinglanguage">Perl</span>  backend will soon be deprecated.</b></div>
+<h4 class="subsubsection" id='magicparlabel-1821'><span class="subsubsection_label">4.8.3</span> Perl backend</h4>
+<div class="standard" id='magicparlabel-1822'><b>Warning: the <span class="flex_scriptinglanguage">Perl</span>  backend will soon be deprecated.</b></div>
 
-<div class="standard" id='magicparlabel-1421'>In <em><i>binary_grid</i> </em>version 1, the only backend available was the <span class="flex_scriptinglanguage">Perl</span>  backend which communicates with <em><i>binary_c</i></em> via a set of <span class="flex_os">Unix</span> pipes. This is portable and flexible, and hence for many years was the default. It does not, however, scale very well in multi-CPU architectures (mostly because of the bandwidth required for the pipes). In <em><i>binary_grid2</i></em> a pure  <span class="flex_scriptinglanguage">Perl</span>  module is also provided, both for backwards compatibility and because the code is well tested and stable. The  <span class="flex_scriptinglanguage">Perl</span>  backend is installed by default with <em><i>binary_grid2</i> </em>although the <span class="flex_programminglanguage">C</span><em> </em>backend will replace it eventually.</div>
+<div class="standard" id='magicparlabel-1827'>In <em><i>binary_grid</i> </em>version 1, the only backend available was the <span class="flex_scriptinglanguage">Perl</span>  backend which communicates with <em><i>binary_c</i></em> via a set of <span class="flex_os">Unix</span> pipes. This is portable and flexible, and hence for many years was the default. It does not, however, scale very well in multi-CPU architectures (mostly because of the bandwidth required for the pipes). In <em><i>binary_grid2</i></em> a pure  <span class="flex_scriptinglanguage">Perl</span>  module is also provided, both for backwards compatibility and because the code is well tested and stable. The  <span class="flex_scriptinglanguage">Perl</span>  backend is installed by default with <em><i>binary_grid2</i> </em>although the <span class="flex_programminglanguage">C</span><em> </em>backend will replace it eventually.</div>
 
-<div class="standard" id='magicparlabel-1442'>It is a simple matter of changing the <span class="flex_perlcode">prog</span> grid variable if you want to use a different version of <em><i>binary_c</i></em> with each grid script.</div>
+<div class="standard" id='magicparlabel-1848'>It is a simple matter of changing the <span class="flex_perlcode">prog</span> grid variable if you want to use a different version of <em><i>binary_c</i></em> with each grid script.</div>
 
-<div class="standard" id='magicparlabel-1447'><br />
+<div class="standard" id='magicparlabel-1853'><br />
 </div>
-<h2 class="section" id='magicparlabel-1448'><span class="section_label">4</span> Evolving single and binary stars</h2>
-<div class="standard" id='magicparlabel-1449'><div id="sec_Simple_Use"></div>
+<h2 class="section" id='magicparlabel-1854'><span class="section_label">5</span> Evolving single and binary stars</h2>
+<div class="standard" id='magicparlabel-1855'><div id="sec_Simple_Use"></div>
 This section describes how to run <em><i>binary_c</i></em> on one stellar system, be it single or binary. The web home of <i>binary_c</i> is <a href="http://personal.ph.surrey.ac.uk/~ri0005/<i>binary_c</i>.html">http://personal.ph.surrey.ac.uk/~ri0005/<i>binary_c</i>.html</a>. The online binary-star simulator is at <a href="http://personal.ph.surrey.ac.uk/~ri0005/cgi-bin/binary5.cgi">http://personal.ph.surrey.ac.uk/~ri0005/cgi-bin/binary5.cgi</a>. If these should move, you can use your favourite web-search engine to locate the code.</div>
 
-<div class="standard" id='magicparlabel-1450'>You should consider joining the mailing lists (see Sec.&nbsp;<a href="#subsec_mailing_lists">1.3</a>).</div>
-<h3 class="subsection" id='magicparlabel-1451'><span class="subsection_label">4.1</span> Running</h3>
-<div class="standard" id='magicparlabel-1452'><div id="subsec_Running"></div>
+<div class="standard" id='magicparlabel-1856'>You should consider joining the mailing lists (see Sec.&nbsp;<a href="#subsec_mailing_lists">1.3</a>).</div>
+<h3 class="subsection" id='magicparlabel-1857'><span class="subsection_label">5.1</span> Running</h3>
+<div class="standard" id='magicparlabel-1858'><div id="subsec_Running"></div>
 </div>
 
-<div class="standard" id='magicparlabel-1453'>A <span class="flex_scriptinglanguage">bash</span> script called <span class="flex_file">tbse</span> is provided to run one single or binary star system. Run it with
+<div class="standard" id='magicparlabel-1859'>A <span class="flex_scriptinglanguage">bash</span> script called <span class="flex_file">tbse</span> is provided to run one single or binary star system. Run it with
 <br />
 
 <br />
 <pre class\s*='listings bash'>$ ./tbse</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1466'>from the <em><i>binary_c</i></em> directory (you can omit the <span class="flex_file">.</span> if it is in your <span class="flex_envvar">PATH</span>). The script sets a number of <span class="flex_scriptinglanguage">bash</span> variables (in capital letters) which are then passed to <i>binary_c</i>. In general, the capitalized <span class="flex_scriptinglanguage">bash</span><em> </em>variable corresponds to the same variable in <i>binary_c</i> in lower case. For example,</div>
+<div class="standard" id='magicparlabel-1872'>from the <em><i>binary_c</i></em> directory (you can omit the <span class="flex_file">.</span> if it is in your <span class="flex_envvar">PATH</span>). The script sets a number of <span class="flex_scriptinglanguage">bash</span> variables (in capital letters) which are then passed to <i>binary_c</i>. In general, the capitalized <span class="flex_scriptinglanguage">bash</span><em> </em>variable corresponds to the same variable in <i>binary_c</i> in lower case. For example,</div>
 
-<div class="standard" id='magicparlabel-1483'><br />
+<div class="standard" id='magicparlabel-1889'><br />
 <pre class ='listings'># Initial primary mass
 M1=6
 # Initial secondary mass
@@ -1339,7 +1649,7 @@ METALLICITY=0.02
 MAX_EVOLUTION_TIME=16000</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1499'>Many parameters are not just simple numbers, they are choices of algorithms. You can replace the numerical algorithm number, as usually defined by a macro in a header file, with the macro itself. For example, the following two are equivalent because the macro <span class="flex_cmacro">MAGNETIC_BRAKING_ALGORITHM_HURLEY_2002</span> is defined to be <span class="flex_cvar">0</span>,<br />
+<div class="standard" id='magicparlabel-1905'>Many parameters are not just simple numbers, they are choices of algorithms. You can replace the numerical algorithm number, as usually defined by a macro in a header file, with the macro itself. For example, the following two are equivalent because the macro <span class="flex_cmacro">MAGNETIC_BRAKING_ALGORITHM_HURLEY_2002</span> is defined to be <span class="flex_cvar">0</span>,<br />
 <pre class ='listings'>MAGNETIC_BRAKING_ALGORITHM=0
 MAGNETIC_BRAKING_ALGORITHM=MAGNETIC_BRAKING_ALGORITHM_HURLEY_2002</pre><br />
 similarly, you can use <span class="flex_cmacro">True</span> and <span class="flex_cmacro">False</span> (or <span class="flex_cmacro">t</span>, <span class="flex_cmacro">T</span>, <span class="flex_cmacro">true</span>, etc.) to represent <span class="flex_cvar">1</span> and <span class="flex_cvar">0</span> respectively,<br />
@@ -1347,13 +1657,13 @@ similarly, you can use <span class="flex_cmacro">True</span> and <span class="fl
 PRE_MAIN_SEQUENCE_FIT_LOBES=False</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1546'>A simple output log is sent to the file defined in <span class="flex_cmacro">LOG_FILENAME</span> which is <span class="flex_file">/tmp/c_log2.dat</span> by default. What gets output to the screen depends on what options you select (see section <a href="#subsec_Advanced_Configuration">8</a>).</div>
+<div class="standard" id='magicparlabel-1952'>A simple output log is sent to the file defined in <span class="flex_cmacro">LOG_FILENAME</span> which is <span class="flex_file">/tmp/c_log2.dat</span> by default. What gets output to the screen depends on what options you select (see section <a href="#subsec_Advanced_Configuration">9</a>).</div>
 
-<div class="standard" id='magicparlabel-1555'>Run <br />
+<div class="standard" id='magicparlabel-1961'>Run <br />
 <pre class\s*='listings bash'>$ tbse help</pre><br />
-to obtain general help for <span class="flex_file">tbse</span> or read Section&nbsp;<a href="#subsec_tbse_commands">3.5.1</a> to see more options.</div>
+to obtain general help for <span class="flex_file">tbse</span> or read Section&nbsp;<a href="#subsec_tbse_commands">4.5.1</a> to see more options.</div>
 
-<div class="standard" id='magicparlabel-1564'>Use<br />
+<div class="standard" id='magicparlabel-1970'>Use<br />
 <pre class\s*='listings bash'>$ ./<i>binary_c</i> help </pre><br />
 for general <i>binary_c</i> help, or <br />
 <pre class\s*='listings bash'>$ ./<i>binary_c</i> help &lt;string&gt;</pre><br />
@@ -1372,12 +1682,12 @@ MAGNETIC_BRAKING_ALGORITHM_RAPPAPORT_1983 = 3
 </pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1592'>Do <em>not</em> use <span class="flex_file">tbse</span> to run many stars in a stellar population! This is amazingly inefficient: you'll waste a huge amount of time just loading <span class="flex_scriptinglanguage">bash</span> and saving your data.</div>
+<div class="standard" id='magicparlabel-1998'>Do <em>not</em> use <span class="flex_file">tbse</span> to run many stars in a stellar population! This is amazingly inefficient: you'll waste a huge amount of time just loading <span class="flex_scriptinglanguage">bash</span> and saving your data.</div>
 
-<div class="standard" id='magicparlabel-1601'><br />
+<div class="standard" id='magicparlabel-2007'><br />
 </div>
-<h2 class="section" id='magicparlabel-1602'><span class="section_label">5</span> Making populations of stars with <i>binary_grid2</i></h2>
-<div class="standard" id='magicparlabel-1603'><div id="subsec_Running_a_grid"></div>
+<h2 class="section" id='magicparlabel-2008'><span class="section_label">6</span> Making populations of stars with <i>binary_grid2</i></h2>
+<div class="standard" id='magicparlabel-2009'><div id="subsec_Running_a_grid"></div>
 You <em>could</em> run many stars by directly calling <em><i>binary_c</i></em> with the appropriate arguments or making many <span class="flex_file">tbse</span><em> </em>scripts. This is <em><b>very</b></em> <em><b>inefficient</b></em>. Instead, <em><i>binary_c</i></em> can be controlled by a <span class="flex_scriptinglanguage">Perl</span>  script, e.g.&nbsp;<span class="flex_file">grid.pl</span>, which uses a library of functions in the <em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
@@ -1390,8 +1700,8 @@ You <em>could</em> run many stars by directly calling <em><i>binary_c</i></em> w
   </mrow>
  </mrow></mstyle></math></em> <span class="flex_scriptinglanguage">Perl</span>  module to run the stars on a grid for you.</div>
 
-<h3 class="subsection" id='magicparlabel-1622'><span class="subsection_label">5.1</span> Introduction</h3>
-<div class="standard" id='magicparlabel-1623'>The <em><span class='math'>\binarygrid</span>
+<h3 class="subsection" id='magicparlabel-2028'><span class="subsection_label">6.1</span> Introduction</h3>
+<div class="standard" id='magicparlabel-2029'>The <em><span class='math'>\binarygrid</span>
 </em> software has been developed over the last ten years or so by Robert Izzard with help from many people around the world. It is designed to work with the <em><span class='math'>binary_c</i></span>
 </em> stellar evolution code, based on <em>BSE</em> of <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>), but should work with any suitably prepared stellar evolution code. In 2011 and 2012, the old <em><span class='math'>\binarygrid</span>
 </em> code was replaced with the <em>flexigrid</em> – this document is the guide to the <em>flexigrid</em> version of software. In 2016 a new <em><span class='math'>\binarygrid</span>
@@ -1399,14 +1709,14 @@ You <em>could</em> run many stars by directly calling <em><i>binary_c</i></em> w
  code. In the future, only the (faster, simpler) <span class="flex_programminglanguage">C</span> backend will be supported. In the following, <em><span class='math'>\binarygrid</span>
  </em>implies <em><span class='math'>\binarygrid</span>
 2</em>, although there may be parts of the documentation which require an update to the newer version (please let RGI know if you find an example).</div>
-<h3 class="subsection" id='magicparlabel-1645'><span class="subsection_label">5.2</span> Aims: what the grid does and why</h3>
-<div class="standard" id='magicparlabel-1646'><div id="sec_aims"></div>
+<h3 class="subsection" id='magicparlabel-2051'><span class="subsection_label">6.2</span> Aims: what the grid does and why</h3>
+<div class="standard" id='magicparlabel-2052'><div id="sec_aims"></div>
 Binary population synthesis is a glorified form of accountancy, without the huge pay but with of course much more fun! It involves modelling perhaps millions of binary stars in a population to pick out those few that contribute to the population of scientific interest. The rate of formation, or number of these stars, or some other property of them can then be examined in a <em>quantitative</em> and <em>statistical</em> manner. This manual explains how the <em><span class='math'>\binarygrid</span>
  </em>module – part of the <em><span class='math'>binary_c</i></span>
 </em> code package – can be used to model populations of single and binary stars. This guide is <em>only</em> concerned with the details of running grids of models, not about the details of the models themselves.</div>
-<h3 class="subsection" id='magicparlabel-1647'><span class="subsection_label">5.3</span> Grid dimensions<div id="subsec_Grid_dimensions"></div>
+<h3 class="subsection" id='magicparlabel-2053'><span class="subsection_label">6.3</span> Grid dimensions<div id="subsec_Grid_dimensions"></div>
 </h3>
-<div class="standard" id='magicparlabel-1648'>There are many parameters which can be set before running a stellar model. The most important, for single stars, are the stellar mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2054'>There are many parameters which can be set before running a stellar model. The most important, for single stars, are the stellar mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>M</mi>
  </mrow></mstyle></math> and metallicity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>Z</mi>
@@ -1418,7 +1728,7 @@ Binary population synthesis is a glorified form of accountancy, without the huge
  <mrow><mi>Z</mi>
  </mrow></mstyle></math>. </div>
 
-<div class="standard" id='magicparlabel-1649'>The situation is more complicated in binaries because instead of just <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2055'>The situation is more complicated in binaries because instead of just <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>M</mi>
  </mrow></mstyle></math> there are two stellar masses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -1444,7 +1754,7 @@ Binary population synthesis is a glorified form of accountancy, without the huge
  <mrow><mi>e</mi>
  </mrow></mstyle></math>. To run a population of binary stars then requires a grid of models in four dimensions. Often the eccentricity is ignored because close binaries – which are the ones in which you may be interested – tend to circularise rapidly. This reduces the problem to three dimensions.</div>
 
-<div class="standard" id='magicparlabel-1650'>The number of stars on each side of the grid, i.e. the <em>resolution</em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2056'>The number of stars on each side of the grid, i.e. the <em>resolution</em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>n</mi>
  </mrow></mstyle></math>, roughly determines the total runtime of your simulation. In single stars this is just <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -1507,11 +1817,11 @@ Binary population synthesis is a glorified form of accountancy, without the huge
    </mstyle>
   </mrow>
  </mrow></mstyle></math>. </div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-1654'><img style='width:45%;' src='images/3.png' alt='image: 9_tmp_binary_c_lyx_images_1.png' />
+<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-2060'><img style='width:45%;' src='images/3.png' alt='image: 9_tmp_binary_c_lyx_images_1.png' />
 <img style='width:45%;' src='images/4.png' alt='image: 10_tmp_binary_c_lyx_images_2.png' />
 </div>
 
-<div class="plain_layout" id='magicparlabel-1655'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 1:  <div id="fig_grid_size"></div>
+<div class="plain_layout" id='magicparlabel-2061'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 1:  <div id="fig_grid_size"></div>
 The relative size of the single- and binary-star grids. In single stars only one mass is required, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
@@ -1579,17 +1889,17 @@ The relative size of the single- and binary-star grids. In single stars only one
  </mrow></mstyle></math> PC.</span></div>
 </div>
 
-<h3 class="subsection" id='magicparlabel-1660'><span class="subsection_label">5.4</span> What to do with the grid<div id="subsec_What_to_do"></div>
+<h3 class="subsection" id='magicparlabel-2066'><span class="subsection_label">6.4</span> What to do with the grid<div id="subsec_What_to_do"></div>
 </h3>
-<div class="standard" id='magicparlabel-1661'>What do we do once the grid of stars is set up? In most cases this involves adding up some statistics related to each star on the grid. There are two approaches which are commonly used, constant star formation and a starburst. The one that suits you depends on what you are trying to calculate and to which observations you hope to compare.</div>
-<h4 class="subsubsection" id='magicparlabel-1662'><span class="subsubsection_label">5.4.1</span> Constant star formation rate</h4>
-<div class="standard" id='magicparlabel-1663'>In this case the formation rate or (perhaps <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2067'>What do we do once the grid of stars is set up? In most cases this involves adding up some statistics related to each star on the grid. There are two approaches which are commonly used, constant star formation and a starburst. The one that suits you depends on what you are trying to calculate and to which observations you hope to compare.</div>
+<h4 class="subsubsection" id='magicparlabel-2068'><span class="subsubsection_label">6.4.1</span> Constant star formation rate</h4>
+<div class="standard" id='magicparlabel-2069'>In this case the formation rate or (perhaps <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi>
   </mrow>
  </mrow></mstyle></math>-weighted) probabilities for each star corresponding to those in which you are interested are simply added up. This is why I say it is like accountancy! Because the rate of star formation is assumed to be <em>constant</em> the evolution time of the stellar evolution is irrelevant. A hybrid scheme can also be used, you might only consider stars older than a given age (e.g. for halo stars).</div>
-<h4 class="subsubsection" id='magicparlabel-1664'><span class="subsubsection_label">5.4.2</span> Starburst</h4>
-<div class="standard" id='magicparlabel-1665'>All stars form at time zero and you add up the (probably <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<h4 class="subsubsection" id='magicparlabel-2070'><span class="subsubsection_label">6.4.2</span> Starburst</h4>
+<div class="standard" id='magicparlabel-2071'>All stars form at time zero and you add up the (probably <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi>
   </mrow>
@@ -1598,16 +1908,16 @@ The relative size of the single- and binary-star grids. In single stars only one
 
 </div>
 
-<div class="standard" id='magicparlabel-1666'>The statistic you wish to add up is usually output from <em><span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-2072'>The statistic you wish to add up is usually output from <em><span class='math'>binary_c</i></span>
 . </em>Your &ldquo;grid script&rdquo; runs each star in your population, takes the output of <em><span class='math'>binary_c</i></span>
 </em> and adds up the statistic. You can generate single numbers, histograms or arbitrarily complicated statistical constructs for comparison with observations. You can choose whether to do the calculations on the fly or save the progenitor information for later data processing.</div>
 
-<div class="standard" id='magicparlabel-1667'>The grid script can be used on multi-CPU machines and handles the administrative issues regarding parallel processing.</div>
+<div class="standard" id='magicparlabel-2073'>The grid script can be used on multi-CPU machines and handles the administrative issues regarding parallel processing.</div>
 
-<div class="standard" id='magicparlabel-1668'><br />
+<div class="standard" id='magicparlabel-2074'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-1669'><span class="subsection_label">5.5</span> Grid setup (in theory)</h3>
-<div class="standard" id='magicparlabel-1670'><div id="sec_grid_setup_theory"></div>
+<h3 class="subsection" id='magicparlabel-2075'><span class="subsection_label">6.5</span> Grid setup (in theory)</h3>
+<div class="standard" id='magicparlabel-2076'><div id="sec_grid_setup_theory"></div>
 This section presents the <em>theory</em> behind the setup of a grid in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>M</mi>
  </mrow></mstyle></math>, for single stars, or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -1654,7 +1964,7 @@ This section presents the <em>theory</em> behind the setup of a grid in <math xm
   </mrow>
  </mrow></mstyle></math>. This is rather subjective but you can chose the bounds of your grid to reflect the stars in which your interest lies.</div>
 
-<div class="standard" id='magicparlabel-1671'>Each star in the grid represents a <em>phase volume</em>. This means that a star of mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2077'>Each star in the grid represents a <em>phase volume</em>. This means that a star of mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>M</mi>
  </mrow></mstyle></math> represents stars which, in reality, have masses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -1678,7 +1988,7 @@ This section presents the <em>theory</em> behind the setup of a grid in <math xm
   </mrow>
  </mrow></mstyle></math> decreased) until your &ldquo;answer&rdquo; converges.</div>
 
-<div class="standard" id='magicparlabel-1672'>One concept which must be grasped is that the bounds of the <em>grid</em> are not necessarily the bounds of the <em>initial distributions</em> you will be using (e.g. the initial mass function, IMF). This is a critical point which can lead to confusion, it is best explained with an example. Say you wish to calculate the ratio of type II to type Ib/c supernovae. You would do this by adding up the number of stars that explode as type IIs and divide by the number of stars that explode as type Ib/cs. You <em>could</em> do this with a grid from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2078'>One concept which must be grasped is that the bounds of the <em>grid</em> are not necessarily the bounds of the <em>initial distributions</em> you will be using (e.g. the initial mass function, IMF). This is a critical point which can lead to confusion, it is best explained with an example. Say you wish to calculate the ratio of type II to type Ib/c supernovae. You would do this by adding up the number of stars that explode as type IIs and divide by the number of stars that explode as type Ib/cs. You <em>could</em> do this with a grid from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mn>0.1</mn>
  </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -1818,13 +2128,13 @@ This section presents the <em>theory</em> behind the setup of a grid in <math xm
     </mrow>
    </msub>
   </mrow>
- </mrow></mstyle></math>. Note that the <em>grid</em> has changed, but the result has not. This is because the initial distributions have fixed bounds independent of the grid bounds. See Section&nbsp;<a href="#sec_initial_dists">5.20</a> for more details on initial distributions. </div>
+ </mrow></mstyle></math>. Note that the <em>grid</em> has changed, but the result has not. This is because the initial distributions have fixed bounds independent of the grid bounds. See Section&nbsp;<a href="#sec_initial_dists">6.20</a> for more details on initial distributions. </div>
 
-<div class="standard" id='magicparlabel-1673'>This process requires some knowledge in advance, which you may not have. In that case, run a low resolution grid, find suitable grid bounds and then repeat at higher resolution until you are happy. The downside to the process is that you may well miss small parts of the parameter space which contain interesting systems. In practice this is often a compromise worth making and, if in doubt, test your model runs at low resolution but then crank the resolution to the maximum you think is possible for the final model run.</div>
+<div class="standard" id='magicparlabel-2079'>This process requires some knowledge in advance, which you may not have. In that case, run a low resolution grid, find suitable grid bounds and then repeat at higher resolution until you are happy. The downside to the process is that you may well miss small parts of the parameter space which contain interesting systems. In practice this is often a compromise worth making and, if in doubt, test your model runs at low resolution but then crank the resolution to the maximum you think is possible for the final model run.</div>
 
-<div class="standard" id='magicparlabel-1674'>Another advantage of choosing the grid bounds is that sub-grids can be run on different computers or CPU cores and the results combined. This is discussed further in Section&nbsp;<a href="#sec_The_Thread_Model">5.22</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-1675'><span class="subsubsection_label">5.5.1</span> Phase Volume</h4>
-<div class="standard" id='magicparlabel-1676'><div id="subsec_phase_volume"></div>
+<div class="standard" id='magicparlabel-2080'>Another advantage of choosing the grid bounds is that sub-grids can be run on different computers or CPU cores and the results combined. This is discussed further in Section&nbsp;<a href="#sec_The_Thread_Model">6.22</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-2081'><span class="subsubsection_label">6.5.1</span> Phase Volume</h4>
+<div class="standard" id='magicparlabel-2082'><div id="subsec_phase_volume"></div>
 Given a chosen set of these distributions a logarithmic grid is set up in one-dimensional <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>M</mi>
  </mrow></mstyle></math> space for single stars or in 3D <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -1853,7 +2163,7 @@ Given a chosen set of these distributions a logarithmic grid is set up in one-di
   </mrow>
  </mrow></mstyle></math> where </div>
 
-<div class="standard" id='magicparlabel-1677'><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2083'><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mtable>
   <mtr>
    <mtd>
@@ -2003,11 +2313,11 @@ Given a chosen set of these distributions a logarithmic grid is set up in one-di
   </mrow>
  </mrow></mstyle></math> for binary stars.</div>
 
-<div class="standard" id='magicparlabel-1678'>The probability of existence of star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2084'>The probability of existence of star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>i</mi>
  </mrow></mstyle></math> is given by</div>
 
-<div class="standard" id='magicparlabel-1679'><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2085'><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mtable>
   <mtr>
    <mtd>
@@ -2035,9 +2345,9 @@ Given a chosen set of these distributions a logarithmic grid is set up in one-di
   </mrow>
  </mrow></mstyle></math> is a constant. The function <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mo> &Psi; </mo>
- </mrow></mstyle></math> is discussed in Section&nbsp;<a href="#sec_initial_dists">5.20</a>. </div>
+ </mrow></mstyle></math> is discussed in Section&nbsp;<a href="#sec_initial_dists">6.20</a>. </div>
 
-<div class="standard" id='magicparlabel-1680'>The probability, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2086'>The probability, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi>
    <msub subscriptshift="0.2ex">
@@ -2074,8 +2384,8 @@ Given a chosen set of these distributions a logarithmic grid is set up in one-di
    </msub>
   </mrow>
  </mrow></mstyle></math>. You have to be careful to calculate the appropriate statistics for comparison with the observations.</div>
-<h4 class="subsubsection" id='magicparlabel-1681'><span class="subsubsection_label">5.5.2</span> Grid loops</h4>
-<div class="standard" id='magicparlabel-1682'><div id="subsec_grid_loops"></div>
+<h4 class="subsubsection" id='magicparlabel-2087'><span class="subsubsection_label">6.5.2</span> Grid loops</h4>
+<div class="standard" id='magicparlabel-2088'><div id="subsec_grid_loops"></div>
 In binary systems, the secondary mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
@@ -2098,7 +2408,7 @@ In binary systems, the secondary mass <math xmlns="http://www.w3.org/1998/Math/M
  <mrow><mi>P</mi>
  </mrow></mstyle></math>, may depend on both. This means that usually the grid must be constructed in a series of nested loops:</div>
 
-<div class="standard" id='magicparlabel-1683'><div id="eq_grid_loops"></div>
+<div class="standard" id='magicparlabel-2089'><div id="eq_grid_loops"></div>
 <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mtable>
   <mtr>
@@ -2262,7 +2572,7 @@ In binary systems, the secondary mass <math xmlns="http://www.w3.org/1998/Math/M
   </mrow>
  </mrow></mstyle></math>, distribution. The default mass-ratio distribution is flat in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>q</mi>
- </mrow></mstyle></math> (see Section&nbsp;<a href="#sec_initial_dists">5.20</a>), with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ </mrow></mstyle></math> (see Section&nbsp;<a href="#sec_initial_dists">6.20</a>), with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>0.1</mn><mspace width="6px" />
    <msub subscriptshift="0.2ex">
@@ -2303,8 +2613,8 @@ In binary systems, the secondary mass <math xmlns="http://www.w3.org/1998/Math/M
    </mrow>
   </msub>
  </mrow></mstyle></math>.</div>
-<h4 class="subsubsection" id='magicparlabel-1684'><span class="subsubsection_label">5.5.3</span> Resolution</h4>
-<div class="standard" id='magicparlabel-1685'><div id="subsec_resolution"></div>
+<h4 class="subsubsection" id='magicparlabel-2090'><span class="subsubsection_label">6.5.3</span> Resolution</h4>
+<div class="standard" id='magicparlabel-2091'><div id="subsec_resolution"></div>
 The choice of grid resolution depends very much on the problem you wish to address and what you are trying to calculate. As a general rule, assuming you are modelling stars from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
@@ -2363,9 +2673,9 @@ The choice of grid resolution depends very much on the problem you wish to addre
   </msub>
  </mrow></mstyle></math>) dimension. </div>
 
-<div class="standard" id='magicparlabel-1686'>However, before rushing off to run millions of stars, run some low-resolution test models and gradually increase the number of stars. The best way to determine the required resolution is simply the brute force method: keep increasing the resolution until your answers converge.</div>
+<div class="standard" id='magicparlabel-2092'>However, before rushing off to run millions of stars, run some low-resolution test models and gradually increase the number of stars. The best way to determine the required resolution is simply the brute force method: keep increasing the resolution until your answers converge.</div>
 
-<div class="standard" id='magicparlabel-1687'>You can roughly estimate the <em>statistical </em>error by counting the number of stars that satisfy your criterion (say <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2093'>You can roughly estimate the <em>statistical </em>error by counting the number of stars that satisfy your criterion (say <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>k</mi>
  </mrow></mstyle></math> stars) and then use Poisson statistics (i.e. the error on a value <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>x</mi>
@@ -2377,20 +2687,20 @@ The choice of grid resolution depends very much on the problem you wish to addre
   </mrow>
  </mrow></mstyle></math>). <b>Be warned that this is <em>not</em> the error due to the use of a grid.</b> If your data calculation binning is <em>over</em>-resolved you may see problems with artefacts and aliasing. These may or may not affect your results. If in doubt, increase the resolution until the problem goes away (if it goes away!). In some cases this may not be possible because your computer is not fast enough. You could always buy a time machine&hellip; but then you wouldn't be doing astrophysics!</div>
 
-<div class="standard" id='magicparlabel-1688'>Overall resolution is often not your only concern: perhaps you want more stars in a certain region of the parameter space. Well, with the flexigrid and its spacing_functions module you can define your own grid spacing function which as flexible as you like (see Sections&nbsp;<a href="#sec_flexigrid">5.11</a> and <a href="#sec_The_spacing_functions_module">5.21</a>). </div>
+<div class="standard" id='magicparlabel-2094'>Overall resolution is often not your only concern: perhaps you want more stars in a certain region of the parameter space. Well, with the flexigrid and its spacing_functions module you can define your own grid spacing function which as flexible as you like (see Sections&nbsp;<a href="#sec_flexigrid">6.11</a> and <a href="#sec_The_spacing_functions_module">6.21</a>). </div>
 
-<div class="standard" id='magicparlabel-1689'><br />
+<div class="standard" id='magicparlabel-2095'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-1690'><span class="subsection_label">5.6</span> Data parsing</h3>
-<div class="standard" id='magicparlabel-1691'><div id="sec_data_parsing"></div>
+<h3 class="subsection" id='magicparlabel-2096'><span class="subsection_label">6.6</span> Data parsing</h3>
+<div class="standard" id='magicparlabel-2097'><div id="sec_data_parsing"></div>
  Before you actually run your own population synthesis grid you have to think about what you want to discover from your stellar models. A few standard cases are outlined here. It is vital to decide what you want in advance, because often data analysis takes up a large chunk of CPU time when evolving a population. While <em><span class='math'>\binarygrid</span>
 2</em> is a great advance over earlier versions of <span class='math'>\binarygrid</span>
  in this regard, it is still good to be <em>efficient</em>.</div>
 
-<div class="standard" id='magicparlabel-1692'>This section describes the theory, the practical aspects of combining<em> <span class='math'>binary_c</i></span>
- </em>with your grid script are described in the following, e.g. Section&nbsp;<a href="#sec_grid_pl">5.9</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-1693'><span class="subsubsection_label">5.6.1</span> Rates of things</h4>
-<div class="standard" id='magicparlabel-1694'><div id="subsec_rates_of_things"></div>
+<div class="standard" id='magicparlabel-2098'>This section describes the theory, the practical aspects of combining<em> <span class='math'>binary_c</i></span>
+ </em>with your grid script are described in the following, e.g. Section&nbsp;<a href="#sec_grid_pl">6.9</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-2099'><span class="subsubsection_label">6.6.1</span> Rates of things</h4>
+<div class="standard" id='magicparlabel-2100'><div id="subsec_rates_of_things"></div>
 The simplest thing to calculate is the rate of formation of some type of star, or alternatively the rate of stellar death (e.g. the supernova rate), merger rate, etc. These are <em>events </em>which have no duration so the important thing to log is the <em>time at which the event happened</em>,<em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
@@ -2409,7 +2719,7 @@ The simplest thing to calculate is the rate of formation of some type of star, o
   </msub>
  </mrow></mstyle></math>.</div>
 
-<div class="standard" id='magicparlabel-1695'>You will probably want to count the number of systems that explode in a given time bin, i.e. between time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2101'>You will probably want to count the number of systems that explode in a given time bin, i.e. between time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>t</mi>
  </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -2420,7 +2730,7 @@ The simplest thing to calculate is the rate of formation of some type of star, o
   <mrow><mo> &Delta; </mo><mi>t</mi>
   </mrow>
  </mrow></mstyle></math> is the time bin width (<em>not</em> the <span class='math'>binary_c</i></span>
- timestep! see also section&nbsp;<a href="#subsec_Timestepping">7.7</a>). The formation rate is the product of the star formation rate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+ timestep! see also section&nbsp;<a href="#subsec_Timestepping">8.7</a>). The formation rate is the product of the star formation rate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>S</mi>
  </mrow></mstyle></math> and the summed probability of the stars that do whatever it is that is interesting in time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>t</mi>
@@ -2444,7 +2754,7 @@ The simplest thing to calculate is the rate of formation of some type of star, o
  <mrow><mi>S</mi>
  </mrow></mstyle></math> (and its associated uncertainty) cancels out.</div>
 
-<div class="standard" id='magicparlabel-1696'>This is all correct for a starburst at time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2102'>This is all correct for a starburst at time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>t</mi><mo>=</mo><mn>0</mn>
   </mrow>
@@ -2452,11 +2762,11 @@ The simplest thing to calculate is the rate of formation of some type of star, o
  <mrow><mi>t</mi>
  </mrow></mstyle></math>) or use a pre-existing code such as RGI's Galactic Chemical Evolution (<em>GCE</em>) code. The latter has the advantage that it already exists and is well tested. You will, however, have to ask RGI about it because it is not (yet) a part of the standard<em> <span class='math'>binary_c</i></span>
  </em>distribution. </div>
-<h4 class="subsubsection" id='magicparlabel-1697'><span class="subsubsection_label">5.6.2</span> Numbers of things</h4>
-<div class="standard" id='magicparlabel-1698'><div id="subsec_numbers_of_things"></div>
+<h4 class="subsubsection" id='magicparlabel-2103'><span class="subsubsection_label">6.6.2</span> Numbers of things</h4>
+<div class="standard" id='magicparlabel-2104'><div id="subsec_numbers_of_things"></div>
 </div>
 
-<div class="standard" id='magicparlabel-1699'>Alternatively, perhaps you wish to calculate the number of stars of a certain type e.g. the number of carbon stars or the number of K-type stars. In this case you have to count both the probability of the existence of the star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2105'>Alternatively, perhaps you wish to calculate the number of stars of a certain type e.g. the number of carbon stars or the number of K-type stars. In this case you have to count both the probability of the existence of the star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>p</mi>
@@ -2492,7 +2802,7 @@ The simplest thing to calculate is the rate of formation of some type of star, o
   </mrow>
  </mrow></mstyle></math> if the star is interesting to you, but zero otherwise.</div>
 
-<div class="standard" id='magicparlabel-1700'>As in the previous example, if <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2106'>As in the previous example, if <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>S</mi>
  </mrow></mstyle></math> is not simply a constant things get tricky. But usually a constant star formation rate is &ldquo;good enough&rdquo; for e.g. Galactic stellar population studies of anything but the youngest stars. In other cases a starburst is more appropriate and you will have to factor in a check on the time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>t</mi>
@@ -2504,36 +2814,36 @@ The simplest thing to calculate is the rate of formation of some type of star, o
   </mover>
  </mrow></mstyle></math> to match the present-day age of the population. </div>
 
-<div class="standard" id='magicparlabel-1701'><br />
+<div class="standard" id='magicparlabel-2107'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-1702'><span class="subsection_label">5.7</span> Running grids of stars</h3>
-<div class="standard" id='magicparlabel-1703'><div id="sec_grid_setup_practice"></div>
-You run a grid of stars using a combination of the <em><i>binary_grid2</i></em> module and a chosen backend (see Section&nbsp;<a href="#subsec_binary_grid2_backends">3.8</a>).</div>
+<h3 class="subsection" id='magicparlabel-2108'><span class="subsection_label">6.7</span> Running grids of stars</h3>
+<div class="standard" id='magicparlabel-2109'><div id="sec_grid_setup_practice"></div>
+You run a grid of stars using a combination of the <em><i>binary_grid2</i></em> module and a chosen backend (see Section&nbsp;<a href="#subsec_binary_grid2_backends">4.8</a>).</div>
 
-<dl class='description' id='magicparlabel-1704'><dt class="description_label"><i>binary_grid2</i></dt>
+<dl class='description' id='magicparlabel-2110'><dt class="description_label"><i>binary_grid2</i></dt>
 <dd class="description_item"> is the code which sets out the parameter space, and defines the (object oriented) interface to your stellar population. </dd>
 <dt class="description_label">the&nbsp;backend</dt>
 <dd class="description_item"> is the code that connects your <span class='math'>\binarygrid</span>
 2 stellar population to the stellar evolution code (usually<em> <span class='math'>binary_c</i></span>
 </em>). As of V2.00 there is a <span class="flex_programminglanguage">C</span> and a <span class="flex_scriptinglanguage">Perl</span> backend. Please use the <span class="flex_programminglanguage">C</span> backend, the <span class="flex_scriptinglanguage">Perl</span> backend is for backwards compatibility reasons and testing only, and the <span class="flex_programminglanguage">C</span> version is <em>much</em> more efficient.</dd>
 </dl>
-<div class="standard" id='magicparlabel-1726'>For details on how the grid is set up, and how it is multithreaded, please see Section&nbsp;<a href="#sec_flexigrid">5.11</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-1727'><span class="subsubsection_label">5.7.1</span> Your <em>grid script</em></h4>
-<div class="standard" id='magicparlabel-1728'>You load the<em> <span class='math'>\binarygrid</span>
-2 </em>module from your <em>grid</em> <em>script</em> (see Sec.&nbsp;<a href="#sec_grid_pl">5.9</a> for full details). This is a<em> </em><span class="flex_scriptinglanguage">Perl</span> script which contains the definition of both your population synthesis grid and your input physics. Do not make this yourself: instead, use the template script in the <span class="flex_file">src/perl/scripts2</span> directory of the<em> <span class='math'>binary_c</i></span>
- </em>tree and modify appropriately (Sec.&nbsp;<a href="#sec_grid_pl">5.9</a>). The most appropriate starting place is the script <span class="flex_file">src/perl/scripts2/template.pl</span> which is a basic grid that can be adapted.</div>
-<h4 class="subsubsection" id='magicparlabel-1741'><span class="subsubsection_label">5.7.2</span> The <em><i>binary_grid2</i></em> Module</h4>
-<div class="standard" id='magicparlabel-1742'><div id="subsec_the_binary_grid_perl_module"></div>
+<div class="standard" id='magicparlabel-2132'>For details on how the grid is set up, and how it is multithreaded, please see Section&nbsp;<a href="#sec_flexigrid">6.11</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-2133'><span class="subsubsection_label">6.7.1</span> Your <em>grid script</em></h4>
+<div class="standard" id='magicparlabel-2134'>You load the<em> <span class='math'>\binarygrid</span>
+2 </em>module from your <em>grid</em> <em>script</em> (see Sec.&nbsp;<a href="#sec_grid_pl">6.9</a> for full details). This is a<em> </em><span class="flex_scriptinglanguage">Perl</span> script which contains the definition of both your population synthesis grid and your input physics. Do not make this yourself: instead, use the template script in the <span class="flex_file">src/perl/scripts2</span> directory of the<em> <span class='math'>binary_c</i></span>
+ </em>tree and modify appropriately (Sec.&nbsp;<a href="#sec_grid_pl">6.9</a>). The most appropriate starting place is the script <span class="flex_file">src/perl/scripts2/template.pl</span> which is a basic grid that can be adapted.</div>
+<h4 class="subsubsection" id='magicparlabel-2147'><span class="subsubsection_label">6.7.2</span> The <em><i>binary_grid2</i></em> Module</h4>
+<div class="standard" id='magicparlabel-2148'><div id="subsec_the_binary_grid_perl_module"></div>
 </div>
 
-<div class="standard" id='magicparlabel-1743'>The <em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-2149'>The <em><span class='math'>\binarygrid</span>
 2</em> module contains all the code to set up, manage and run your stellar grid(s). The internal workings should be (almost) transparent to you, the user, and the process is as automated as possible. You still have to do something, of course, and – most importantly – decide on input physics.</div>
-<h4 class="subsubsection" id='magicparlabel-1744'><span class="subsubsection_label">5.7.3</span> <span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-2150'><span class="subsubsection_label">6.7.3</span> <span class='math'>\binarygrid</span>
 2 objects</h4>
-<div class="standard" id='magicparlabel-1745'>You should make <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-2151'>You should make <span class='math'>\binarygrid</span>
 2 objects, each of which is one of your stellar populations. You can have multiple populations in the same grid (they are independent) but usually you just want one. Make a new one with code like the following:</div>
 
-<div class="standard" id='magicparlabel-1746'><br />
+<div class="standard" id='magicparlabel-2152'><br />
 <pre class ='listings Perl'># number of computational threads to launch
 my $nthreads = rob_misc::ncpus();
 
@@ -2546,12 +2856,12 @@ my $population = <i>binary_grid2</i>-&gt;new(
 </pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1760'>You can now access the object, <span class="flex_perlcode">$population</span>, through the various methods of the <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-2166'>You can now access the object, <span class="flex_perlcode">$population</span>, through the various methods of the <span class='math'>\binarygrid</span>
 2 module.</div>
-<h4 class="subsubsection" id='magicparlabel-1765'><span class="subsubsection_label">5.7.4</span> Variables</h4>
-<div class="standard" id='magicparlabel-1766'>You can set variables:</div>
+<h4 class="subsubsection" id='magicparlabel-2171'><span class="subsubsection_label">6.7.4</span> Variables</h4>
+<div class="standard" id='magicparlabel-2172'>You can set variables:</div>
 
-<ul class="itemize" id='magicparlabel-1767'><li class="itemize_item">When defining the object, as shown above.</li>
+<ul class="itemize" id='magicparlabel-2173'><li class="itemize_item">When defining the object, as shown above.</li>
 <li class="itemize_item">With calls the <span style='font-family:monospace;font-size: 18px;'>set</span> method, e.g.,<br />
 <pre class ='listings Perl'>$population-&gt;set(
     vb=&gt;1, # turn on verbose logging (can be 0,1,2...)
@@ -2564,12 +2874,12 @@ $population-&gt;{_bse_options}-&gt;{metallicity} = 0.004;</pre><br />
 This method is <b>not recommended unless you know exactly what you are doing.</b></li>
 <li class="itemize_item">Calls to object methods which are <em>undefined</em> are passed to the <span class="flex_perlcode">AUTOLOAD</span> method which issues a warning. This usually indicates a typo or mistake on your part.</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-1787'><span class="subsubsection_label">5.7.5</span> Important Subroutines in <em><i>binary_grid</i></em></h4>
-<div class="standard" id='magicparlabel-1788'><div id="subsec_subs_in_binary_grid"></div>
+<h4 class="subsubsection" id='magicparlabel-2193'><span class="subsubsection_label">6.7.5</span> Important Subroutines in <em><i>binary_grid</i></em></h4>
+<div class="standard" id='magicparlabel-2194'><div id="subsec_subs_in_binary_grid"></div>
 A few <span class='math'>\binarygrid</span>
 2 methods are used often</div>
 
-<dl class='description' id='magicparlabel-1789'><dt class="description_label">parse&nbsp;args</dt>
+<dl class='description' id='magicparlabel-2195'><dt class="description_label">parse&nbsp;args</dt>
 <dd class="description_item"> This scans the command line arguments to your script and sets any variables thus defined as <span class="flex_perlcode">&lt;variable&gt;=&lt;value&gt;</span> pairs.</dd>
 <dt class="description_label">set</dt>
 <dd class="description_item"> Sets a list of variables in <span class="flex_perlcode">&lt;variable&gt; =&gt; &lt;value&gt;</span> pairs.</dd>
@@ -2588,11 +2898,11 @@ If the grid variable <span class="flex_perlcode">return_array_refs</span><em> </
 <dt class="description_label">results</dt>
 <dd class="description_item"> Returns (a reference to) the hash containing the results of the evolution. At the end of the evolution of your population you can acquire statistics through this hash reference.</dd>
 </dl>
-<h3 class="subsection" id='magicparlabel-1843'><span class="subsection_label">5.8</span> Important Subroutines in your grid script</h3>
-<div class="standard" id='magicparlabel-1844'><div id="subsec_subs_in_your_script"></div>
+<h3 class="subsection" id='magicparlabel-2249'><span class="subsection_label">6.8</span> Important Subroutines in your grid script</h3>
+<div class="standard" id='magicparlabel-2250'><div id="subsec_subs_in_your_script"></div>
 </div>
-<h4 class="subsubsection" id='magicparlabel-1845'><span class="subsubsection_label">5.8.1</span> <em>parse_data </em>(required)</h4>
-<div class="standard" id='magicparlabel-1846'>You have to write a function to parse the data which comes from your <span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-2251'><span class="subsubsection_label">6.8.1</span> <em>parse_data </em>(required)</h4>
+<div class="standard" id='magicparlabel-2252'>You have to write a function to parse the data which comes from your <span class='math'>\binarygrid</span>
 2 object and return when there is no more data. 
 <br />
 
@@ -2630,11 +2940,11 @@ An example function is the following.
 </pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-1877'><br />
+<div class="standard" id='magicparlabel-2283'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-1878'><span class="subsection_label">5.9</span> Your <em>grid script </em>and coupling your population synthesis to <em><i>binary_c</i>/nucsyn</em></h3>
-<div class="standard" id='magicparlabel-1879'><div id="sec_grid_pl"></div>
-This describes what you should do in your grid script in order to make the <em>flexigrid </em>work. Learn about the <em>flexigrid</em> in Section&nbsp;<a href="#sec_flexigrid">5.11</a>.
+<h3 class="subsection" id='magicparlabel-2284'><span class="subsection_label">6.9</span> Your <em>grid script </em>and coupling your population synthesis to <em><i>binary_c</i>/nucsyn</em></h3>
+<div class="standard" id='magicparlabel-2285'><div id="sec_grid_pl"></div>
+This describes what you should do in your grid script in order to make the <em>flexigrid </em>work. Learn about the <em>flexigrid</em> in Section&nbsp;<a href="#sec_flexigrid">6.11</a>.
 <br />
 
 
@@ -2647,34 +2957,62 @@ Before you start: you should copy the <span class="flex_perlscript">grid-flexigr
 <br />
 
 </div>
-<h4 class="subsubsection" id='magicparlabel-1896'><span class="subsubsection_label">5.9.1</span> Logging in <em><i>binary_c</i></em></h4>
-<div class="standard" id='magicparlabel-1897'><div id="subsec_logging_in_binary_c"></div>
+<h4 class="subsubsection" id='magicparlabel-2302'><span class="subsubsection_label">6.9.1</span> Logging in <em><i>binary_c</i></em></h4>
+<div class="standard" id='magicparlabel-2303'><div id="subsec_logging_in_binary_c"></div>
 </div>
 
-<div class="standard" id='magicparlabel-1898'>When <em><span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-2304'>When <em><span class='math'>binary_c</i></span>
 </em> is run for one star with the <span class="flex_bashscript">tbse</span> script the output is dumped to the screen (known in <span class="flex_os">UNIX</span> as <span class="flex_cvar">stdout</span>). A standard build of <em><span class='math'>binary_c</i></span>
 </em> outputs very little information because it does not know what you wish to know (this is a <em>known unknown</em>). Every line that is output is expensive in terms of CPU time, and CPU time is critical when running millions of stars. This means you have to think carefully about what you will output from <em><span class='math'>binary_c</i></span>
 </em> and when. Too much information slows things down, too little is useless – you have to decide.</div>
 
-<div class="standard" id='magicparlabel-1911'>You may want to choose whether to output one line of information every <em><span class='math'>binary_c</i></span>
-</em> timestep. This should be done in the <span class="flex_sourcefile">src/logging/log_every_timestep.c</span> subroutine which is called every timestep. Once you have decided to output, your logging code should look something like:</div>
-
-<div class="standard" id='magicparlabel-1916'><br />
-<pre class ='listings <i>C</i>'>Printf(&ldquo;MYLOG %g %g %g %i\n&rdquo;,
-       stardata-&gt;model.model_time,
-       stardata-&gt;model.probability,
-       dt,
-       stardata-&gt;star[0].mass,
-       stardata-&gt;star[0].stellar_type);</pre><br />
-</div>
+<div class="standard" id='magicparlabel-2317'>You may want to choose whether to output one line of information every <em><span class='math'>binary_c</i></span>
+</em> timestep. This should be done either in your grid script by setting <span class="flex_perlscript">C_auto_logging</span> or <span class="flex_perlcode">C_logging_code</span> or manually in the <span class="flex_sourcefile">src/logging/log_every_timestep.c</span> subroutine which is called every timestep.</div>
 
-<div class="standard" id='magicparlabel-1926'>The string <span class="flex_cmacro">MYLOG</span> is critical: this is the <em>header</em> that is recognised by your <span class="flex_perlscript">parse_data</span> function as <span class="flex_perlcode">$header</span> and on the basis of which your <span class="flex_perlcode">parse_data</span> function decides how to act and save data for later statistical analysis.</div>
+<ul class="itemize" id='magicparlabel-2330'><li class="itemize_item"><em><b>C_auto_logging</b></em> This is the recommended route to logging when coupling <span class='math'>binary_c</i></span>
+ to <span class='math'>\binarygrid</span>
+ but only works for simple variables that are inside stardata. In your grid script, do something like the following to set <span class="flex_perlscript">C_auto_logging</span>. This is a hash of headers (in this case MY_STELLAR_DATA) which correspond to lines of output from <span class='math'>binary_c</i></span>
+ which are then prefixed with the header. Following this is a set of numerical data items, in the case below time, mass of star 0 (the primary star), the system probability and the timestep. All the items are assumed to be floating point variables, and are processed with the <span class="flex_cvar">%g</span> format statement so that (small) integers are output as integers.<br />
+<pre class ='listings'>$population-&gt;set(
+     C_auto_logging =&gt; {
+        'MY_STELLAR_DATA' =&gt;
+            [
+             'model.time',
+             'star[0].mass',
+             'model.probability',
+             'model.dt'
+            ]
+    }
+};</pre><br />
+</li>
+<li class="itemize_item"><em><b>C_logging_code</b></em> You can enter more complicated code to be evaluated each timestep by using the <span class="flex_perlcode">C_logging_code</span> variable. The following code does the same as the above <span class="flex_perlcode">C_auto_logging</span> example.<br />
+<pre class ='listings'>$population-&gt;set(
+    C_logging_code =&gt; '
+             Printf("MY_STELLAR_DATA %g %g %g %g\n",
+                 stardata-&gt;model.time,
+                 stardata-&gt;star[0].mass,
+                 stardata-&gt;model.probability,
+                 stardata-&gt;model.dt);
+                       '
+);</pre><br />
+</li>
+<li class="itemize_item">In <span class="flex_cfunction">log_every_timestep</span> you can enter code that is evaluated every timestep, just as above. However, unlike the above, any updates to this code <em>must</em> be recompiled with a call to <span class="flex_command">make <i>libbinary_c.so</i></span> and the <span class='math'>\binarygrid</span>
+ module reinstalled.<br />
+<pre class ='listings'>           Printf("MY_STELLAR_DATA %g %g %g %g\n",
+                 stardata-&gt;model.time,
+                 stardata-&gt;star[0].mass,
+                 stardata-&gt;model.probability,
+                 stardata-&gt;model.dt);
+</pre><br />
+</li>
+</ul>
+<div class="standard" id='magicparlabel-2392'>The string <span class="flex_cmacro">MY_STELLAR_DATA</span> is critical: this is the <em>header</em> that is recognised by your <span class="flex_perlscript">parse_data</span> function as <span class="flex_perlcode">$header</span> and on the basis of which your <span class="flex_perlcode">parse_data</span> function decides how to act and save data for later statistical analysis, output, plotting, etc.</div>
 
-<div class="standard" id='magicparlabel-1943'>You should have a think (and consult Section&nbsp;<a href="#sec_data_parsing">5.6</a>) to determine whether you want to output either the probability (<span class="flex_cvar">stardata-&gt;model.probability</span>) or both the probability and timestep<div class="foot"><span class="foot_label">5</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-1951'>Do not use stardata-&gt;model.dt or stardata-&gt;model.dtm: use the local variable dt.</div>
+<div class="standard" id='magicparlabel-2409'>You should have a think (and consult Section&nbsp;<a href="#sec_data_parsing">6.6</a>) to determine whether you want to output either the probability (<span class="flex_cvar">stardata-&gt;model.probability</span>) or both the probability and timestep<div class="foot"><span class="foot_label">5</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-2417'>Do not use stardata-&gt;model.dt or stardata-&gt;model.dtm: use the local variable dt.</div>
 </div></div> (<span class="flex_cvar">dt</span> in years, or <span class="flex_cvar">dtm</span> in megayears). Often it is the number of stars in a particular phase that you want to count, in which case you want to add up the product: <span class="flex_cvar">stardata-&gt; model.probability*dt</span>, which is set up for you as the local variable <span class="flex_cvar">dtp</span>. If you are counting the rate of an event, e.g.&nbsp;supernovae, then the probability alone is more likely to be what you want.</div>
-<h4 class="subsubsection" id='magicparlabel-1968'><span class="subsubsection_label">5.9.2</span> Adding things up</h4>
-<div class="standard" id='magicparlabel-1969'><div id="subsec_adding_things_up"></div>
-The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perlscript">parse_data</span> is where you should put data which you later want to analyse. You should scan for the appropriate header, e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_cvar">MYLOG</span>, and then act on the rest of the data. An example <span style='font-family:monospace;font-size: 18px;'>parse_data</span> function corresponding to the above <span style='font-family:monospace;font-size: 18px;'>Printf</span> statement is (assuming <span class="flex_perlcode">return_array_refs</span> is set to <span class="flex_perlcode">1</span>)<br />
+<h4 class="subsubsection" id='magicparlabel-2434'><span class="subsubsection_label">6.9.2</span> Adding things up</h4>
+<div class="standard" id='magicparlabel-2435'><div id="subsec_adding_things_up"></div>
+The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perlscript">parse_data</span> is where you should put data which you later want to analyse. You should scan for the appropriate header, e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_cvar">MY_STELLAR_DATA</span>, and then act on the rest of the data. An example <span style='font-family:monospace;font-size: 18px;'>parse_data</span> function corresponding to the above <span style='font-family:monospace;font-size: 18px;'>Printf</span> statement is (assuming <span class="flex_perlcode">return_array_refs</span> is set to <span class="flex_perlcode">1</span>)<br />
 <pre class ='listings Perl'>sub parse_data
 {
    my ($population, $results) = @_;
@@ -2691,9 +3029,9 @@ The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perl
         # break out of the look if this is 'fin'
         last if ($header eq 'fin');
  	
-        if($header eq 'MYLOG')
+        if($header eq 'MY_STELLAR_DATA')
         {
-            # matched MYLOG header
+            # matched MY_STELLAR_DATA header
             #
             #
             my $time = $la-&gt;[0];
@@ -2711,16 +3049,16 @@ The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perl
     }
 }</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-2028'><span class="subsubsection_label">5.9.3</span> Joining the results</h4>
-<div class="standard" id='magicparlabel-2029'>The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perlcode">parse_data</span> is unique to a single thread: it does not contain your final result, just the part of it corresponding to the population of stars which ran on that thread. You have to add up the results by joining the various threads at the end of the run. In practice this is done automatically by <span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-2494'><span class="subsubsection_label">6.9.3</span> Joining the results</h4>
+<div class="standard" id='magicparlabel-2495'>The <span class="flex_perlcode">$results</span> hash pointer in <span class="flex_perlcode">parse_data</span> is unique to its thread: it does not contain your final result, just the part of it corresponding to the population of stars which ran on that thread. You have to add up the results by joining the various threads at the end of the run. In practice this is done automatically by <span class='math'>\binarygrid</span>
 2 in combination with some <span class="flex_scriptinglanguage">Perl</span> wizardry. You can, however, override this yourself by writing your own join function, which should be set in the following manner:
 <br />
 
 <br />
-<pre class ='listings Perl'>$binary_grid::grid_options{'threads_join_function_pointer'}=\&amp;join_thread; </pre><br />
+<pre class ='listings Perl'>$binary_grid::grid_options{'threads_join_function_pointer'}=\&amp;join_thread;</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-2046'><b>Beware that joining large hashes may require a lot of RAM. </b>If you are running <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2512'><b>Beware that joining large hashes may require a lot of RAM. </b>If you are running <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>N</mi>
  </mrow></mstyle></math> threads which each uses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>M</mi>
@@ -2733,11 +3071,11 @@ The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perl
 <mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
 <mi>M</mi>
   </mrow>
- </mrow></mstyle></math> MB to join the data (probably a bit more).</div>
-<h4 class="subsubsection" id='magicparlabel-2047'><span class="subsubsection_label">5.9.4</span> Outputting the results</h4>
-<div class="standard" id='magicparlabel-2048'>At the end of the grid script you should output the results, usually by writing an <em>output</em> subroutine and calling it. An example is the following which outputs to <span class="flex_cvar">stdout</span>, but you could of course open files and save your output to them.</div>
+ </mrow></mstyle></math> MB to join the data (probably a bit more). If you have trouble, say on a cluster, you might consider saving the results hash from each thread to a file, then joining the results on another machine. When running on <span class="flex_software">condor</span> or <span class="flex_software">slurm</span>, this is done automatically if you postpone the join.</div>
+<h4 class="subsubsection" id='magicparlabel-2521'><span class="subsubsection_label">6.9.4</span> Outputting the results</h4>
+<div class="standard" id='magicparlabel-2522'>At the end of the grid script you should output the results, usually by writing an <em>output</em> subroutine and calling it. An example is the following which outputs to <span class="flex_cvar">stdout</span>, but you could of course open files and save your output to them.</div>
 
-<div class="standard" id='magicparlabel-2053'><br />
+<div class="standard" id='magicparlabel-2527'><br />
 <pre class ='listings Perl'>sub output
 {
     my $population = shift;
@@ -2754,10 +3092,10 @@ The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perl
 }
 </pre><br />
 </div>
-<h3 class="subsection" id='magicparlabel-2072'><span class="subsection_label">5.10</span> Save your data – or process on the fly?</h3>
-<div class="standard" id='magicparlabel-2073'>Before running a grid you have to make the big decision: do you save your data or process it all on the fly? Above I have shown you the latter, and there is good reason to teach this first and use this method preferably. That said, there are advantages and disadvantages to both, as described below.</div>
-<h4 class="subsubsection" id='magicparlabel-2074'><span class="subsubsection_label">5.10.1</span> Saving data </h4>
-<div class="standard" id='magicparlabel-2075'><div id="subsec_saving_data"></div>
+<h3 class="subsection" id='magicparlabel-2546'><span class="subsection_label">6.10</span> Save your data – or process on the fly?</h3>
+<div class="standard" id='magicparlabel-2547'>Before running a grid you have to make the big decision: do you save your data or process it all on the fly? Above I have shown you the latter, and there is good reason to teach this first and use this method preferably. That said, there are advantages and disadvantages to both, as described below.</div>
+<h4 class="subsubsection" id='magicparlabel-2548'><span class="subsubsection_label">6.10.1</span> Saving data </h4>
+<div class="standard" id='magicparlabel-2549'><div id="subsec_saving_data"></div>
 In this case you run a grid and tag the initial parameters of each system of interest (i.e. the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
@@ -2795,7 +3133,7 @@ In this case you run a grid and tag the initial parameters of each system of int
  </mrow></mstyle></math>). <em>You save these initial parameters into a large datafile </em>(possibly in a binary format)<em>.</em> The big advantage of this technique is that you can rerun the saved grid <em>from the datafile, </em>possibly<em> </em>without running <em><span class='math'>binary_c</i></span>
 </em> again, and with a different initial distribution function (e.g. initial mass function) or very slightly different physics (on the assumption that changing the physics will not change the systems which were saved). </div>
 
-<div class="standard" id='magicparlabel-2076'>You could save, as well as the initial parameters of the systems, the time spent in the phase of interest, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2550'>You could save, as well as the initial parameters of the systems, the time spent in the phase of interest, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mo> &Delta; </mo><mi>t</mi>
   </mrow>
@@ -2819,7 +3157,7 @@ In this case you run a grid and tag the initial parameters of each system of int
   </mrow>
  </mrow></mstyle></math> which is your required &ldquo;number of stars&rdquo;. You can either </div>
 
-<ol class="enumerate" id='magicparlabel-2077'><li class="enumerate_item">Change <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<ol class="enumerate" id='magicparlabel-2551'><li class="enumerate_item">Change <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>p</mi>
@@ -2840,14 +3178,14 @@ In this case you run a grid and tag the initial parameters of each system of int
  </mrow></mstyle></math> and some physics, which requires rerunning of <span class='math'>binary_c</i></span>
 . This is slower, but still faster than running the full grid.</li>
 </ol>
-<div class="standard" id='magicparlabel-2079'>Saving the progenitor data set is a very useful way of saving time after an initial high-resolution grid run.</div>
+<div class="standard" id='magicparlabel-2553'>Saving the progenitor data set is a very useful way of saving time after an initial high-resolution grid run.</div>
 
-<div class="standard" id='magicparlabel-2080'>You may want to consider converting your saved data from <span class="flex_software">ASCII</span> to binary format, particularly if you will be processing it repeatedly. This can save a lot of time, but it renders your data very difficult to read, and it is hard to make such code truly backwards compatible. If someone comes to look at your results in ten years' time, will you remember exactly what is going on? Sacrificing clarity for speed is not necessarily a good thing.</div>
-<h4 class="subsubsection" id='magicparlabel-2085'><span class="subsubsection_label">5.10.2</span> On the fly data processing</h4>
-<div class="standard" id='magicparlabel-2086'><div id="subsec_on_the_fly"></div>
+<div class="standard" id='magicparlabel-2554'>You may want to consider converting your saved data from <span class="flex_software">ASCII</span> to binary format, particularly if you will be processing it repeatedly. This can save a lot of time, but it renders your data very difficult to read, and it is hard to make such code truly backwards compatible. If someone comes to look at your results in ten years' time, will you remember exactly what is going on? Sacrificing clarity for speed is not necessarily a good thing.</div>
+<h4 class="subsubsection" id='magicparlabel-2559'><span class="subsubsection_label">6.10.2</span> On the fly data processing</h4>
+<div class="standard" id='magicparlabel-2560'><div id="subsec_on_the_fly"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2087'>If you do not want to recalculate your answer with different initial functions, you might be better off calculating the results you require &ldquo;on the fly&rdquo;. This means you do your data processing <em>in your grid script</em>. The main advantages to this are speed and data storage. For example, if you have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2561'>If you do not want to recalculate your answer with different initial functions, you might be better off calculating the results you require &ldquo;on the fly&rdquo;. This means you do your data processing <em>in your grid script</em>. The main advantages to this are speed and data storage. For example, if you have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>1</mn>
    <msup>
@@ -2869,7 +3207,7 @@ In this case you run a grid and tag the initial parameters of each system of int
   </mrow>
  </mrow></mstyle></math>&nbsp;lines of data – this might be a lot of data.</div>
 
-<div class="standard" id='magicparlabel-2088'>In some cases you <em>must</em> do this. If you are looking at data which is time dependent then you will have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2562'>In some cases you <em>must</em> do this. If you are looking at data which is time dependent then you will have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>1</mn>
    <msup>
@@ -2942,15 +3280,15 @@ In this case you run a grid and tag the initial parameters of each system of int
  </mrow></mstyle></math>. The time it takes to process all this data may be longer than the time to <em>rerun</em> <em><span class='math'>binary_c</i></span>
  </em>for each system, especially if your data storage is non-local (e.g.&nbsp;on an <em>NFS</em> (network) partition). </div>
 
-<div class="standard" id='magicparlabel-2089'>You can save some space by outputting data every, say, Myr, but this may not be the time resolution you require to catch systems of interest.</div>
+<div class="standard" id='magicparlabel-2563'>You can save some space by outputting data every, say, Myr, but this may not be the time resolution you require to catch systems of interest.</div>
 
-<div class="standard" id='magicparlabel-2090'>You can increase the speed of your run by using the <span class="flex_programminglanguage">C</span> backend and setting <span class="flex_perlcode">return_array_refs</span> to <span class="flex_perlcode">1</span>.<br />
+<div class="standard" id='magicparlabel-2564'>You can increase the speed of your run by using the <span class="flex_programminglanguage">C</span> backend and setting <span class="flex_perlcode">return_array_refs</span> to <span class="flex_perlcode">1</span>.<br />
 </div>
-<h3 class="subsection" id='magicparlabel-2103'><span class="subsection_label">5.11</span> Flexigrid</h3>
-<div class="standard" id='magicparlabel-2104'><div id="sec_flexigrid"></div>
+<h3 class="subsection" id='magicparlabel-2577'><span class="subsection_label">6.11</span> Flexigrid</h3>
+<div class="standard" id='magicparlabel-2578'><div id="sec_flexigrid"></div>
 As of summer 2011, the &ldquo;flexi<em>grid</em>&rdquo; was developed. This is an attempt to replace much of the old, rigid grid framework with a new, dynamic and flexible API. The key concepts are the following:</div>
 
-<ul class="itemize" id='magicparlabel-2105'><li class="itemize_item">When a <em>flexigrid</em> is run, it sets up <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<ul class="itemize" id='magicparlabel-2579'><li class="itemize_item">When a <em>flexigrid</em> is run, it sets up <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>n</mi>
  </mrow></mstyle></math> concurrently running <em>threads</em>. Each of these is fed with stars until the population is complete. Because of this, <em>flexigrid</em> is designed specifically to work on the latest multi-core CPUs on shared-memory machines (which are the typical PCs of the early 21st century). It scales quite well if you use the <span class="flex_programminglanguage">C</span> backend, less well with the <em>Perl</em> backend on more than a few CPUs.</li>
 <li class="itemize_item"><em>Flexigrid</em> sets up its <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -2976,13 +3314,13 @@ As of summer 2011, the &ldquo;flexi<em>grid</em>&rdquo; was developed. This is a
 <li class="itemize_item">Probabilities are calculated more efficiently and flexibly by the <span class="flex_perlmodule">distribution_functions</span> module.</li>
 <li class="itemize_item">Grid spacings are calculated with the <span class="flex_perlmodule">spacing_functions</span> module.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-2125'><span class="subsection_label">5.12</span> Setup in your grid script</h3>
-<div class="standard" id='magicparlabel-2126'><div id="subsec_setup_grid_script"></div>
+<h3 class="subsection" id='magicparlabel-2599'><span class="subsection_label">6.12</span> Setup in your grid script</h3>
+<div class="standard" id='magicparlabel-2600'><div id="subsec_setup_grid_script"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2127'>You need to do a few things to define the variables which describe your grid. </div>
-<h4 class="subsubsection" id='magicparlabel-2128'><span class="subsubsection_label">5.12.1</span> Grid variables: 1D example</h4>
-<div class="standard" id='magicparlabel-2129'>Setting up which variables you use is best defined by example. Let's start with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2601'>You need to do a few things to define the variables which describe your grid. </div>
+<h4 class="subsubsection" id='magicparlabel-2602'><span class="subsubsection_label">6.12.1</span> Grid variables: 1D example</h4>
+<div class="standard" id='magicparlabel-2603'>Setting up which variables you use is best defined by example. Let's start with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>M</mi>
@@ -3007,7 +3345,7 @@ Next, use your <em><span class='math'>\binarygrid</span>
 
 </div>
 
-<div class="standard" id='magicparlabel-2142'><br />
+<div class="standard" id='magicparlabel-2616'><br />
 <pre class ='listings Perl'>  # Mass 1
   my $mmin=0.1;
   my $mmax=80.0;
@@ -3026,9 +3364,9 @@ Next, use your <em><span class='math'>\binarygrid</span>
         );</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-2162'>What does this mean?</div>
+<div class="standard" id='magicparlabel-2636'>What does this mean?</div>
 
-<ol class='lyxlist' id='magicparlabel-2163'><li class="labeling_item"><span class='lyxlist'>name&nbsp;string</span>
+<ol class='lyxlist' id='magicparlabel-2637'><li class="labeling_item"><span class='lyxlist'>name&nbsp;string</span>
  This is the variable name. It should be parsable in <span class="flex_scriptinglanguage">Perl</span>, e.g. in the above case it is expanded to <span class="flex_perlcode">$lnm1</span> in the gridcode.</li>
 <li class="labeling_item"><span class='lyxlist'>longname&nbsp;string</span>
  This is a long (human-readable) name used in logging. It should contain no spaces (use underscores).</li>
@@ -3081,11 +3419,11 @@ Next, use your <em><span class='math'>\binarygrid</span>
 <li class="labeling_item"><span class='lyxlist'>dphasevol&nbsp;expression</span>
 <em> </em>This defines the contribution to the phase volume of each stellar system from this variable. In general this is just <span class="flex_perlcode">$dlnm1</span> (i.e.&nbsp;should be <span class="flex_perlcode">$dname</span>) but you can set it to whatever you like. </li>
 </ol>
-<h3 class="subsection" id='magicparlabel-2225'><span class="subsection_label">5.13</span> 3D grid example</h3>
-<div class="standard" id='magicparlabel-2226'><div id="subsec_3d_grid_example"></div>
+<h3 class="subsection" id='magicparlabel-2699'><span class="subsection_label">6.13</span> 3D grid example</h3>
+<div class="standard" id='magicparlabel-2700'><div id="subsec_3d_grid_example"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2227'>The next step is to set up the further grid variables. Usually these are <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-2701'>The next step is to set up the further grid variables. Usually these are <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>M</mi>
@@ -3097,7 +3435,7 @@ Next, use your <em><span class='math'>\binarygrid</span>
  <mrow><mi>a</mi>
  </mrow></mstyle></math>, as defined in the code below.</div>
 
-<div class="standard" id='magicparlabel-2228'><br />
+<div class="standard" id='magicparlabel-2702'><br />
 <pre class ='listings Perl'>    my $resolution = {
         m1 =&gt; 10,
         q =&gt; 10,
@@ -3148,34 +3486,34 @@ my \$eccentricity = 0.0;
           'dphasevol'=&gt;'$dln10per'
          );</pre><br />
 </div>
-<h3 class="subsection" id='magicparlabel-2281'><span class="subsection_label">5.14</span> Viewing The (Automatically Generated) Gridcode </h3>
-<div class="standard" id='magicparlabel-2282'><div id="subsec_viewing_the_gridcode"></div>
+<h3 class="subsection" id='magicparlabel-2755'><span class="subsection_label">6.14</span> Viewing The (Automatically Generated) Gridcode </h3>
+<div class="standard" id='magicparlabel-2756'><div id="subsec_viewing_the_gridcode"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2283'>When you evolve your <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-2757'>When you evolve your <span class='math'>\binarygrid</span>
 2 object, the<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_perlcode">flexigrid</span> is run. First the grid code is generated, then this processed by <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlcode">eval()</span>.</div>
 
-<div class="standard" id='magicparlabel-2296'>You can find the grid code in the file <span class="flex_file">/tmp/gridcode</span> where <span class="flex_file">/tmp</span> can be changed, e.g.&nbsp;with,<br />
+<div class="standard" id='magicparlabel-2770'>You can find the grid code in the file <span class="flex_file">/tmp/gridcode</span> where <span class="flex_file">/tmp</span> can be changed, e.g.&nbsp;with,<br />
 <pre class ='listings Perl'>$population-&gt;set(tmp=&gt;&rdquo;/directory/of/your/choice&rdquo;);</pre><br />
 </div>
-<h3 class="subsection" id='magicparlabel-2309'><span class="subsection_label">5.15</span> Error handling</h3>
-<div class="standard" id='magicparlabel-2310'><div id="subsec_flexigrid_error_handling"></div>
+<h3 class="subsection" id='magicparlabel-2783'><span class="subsection_label">6.15</span> Error handling</h3>
+<div class="standard" id='magicparlabel-2784'><div id="subsec_flexigrid_error_handling"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2311'>Things do go wrong. Usually when this happens, the threads will be shut down and your grid script will exit, telling you as much as it can about the error. </div>
+<div class="standard" id='magicparlabel-2785'>Things do go wrong. Usually when this happens, the threads will be shut down and your grid script will exit, telling you as much as it can about the error. </div>
 
-<div class="standard" id='magicparlabel-2312'>When running with the <span class="flex_programminglanguage">C</span> backend, the grid will crash. If you have built <span class="flex_file"><i>libbinary_c.so</i></span> with debugging (e.g.&nbsp;<span class="flex_command">configure debug</span>) you should see a stack trace so that you can debug the crash. With the <span class="flex_scriptinglanguage">Perl</span> backend this is more difficult, but you should see an error message. Beware that if the <span class="flex_scriptinglanguage">Perl</span> backend crashes at the wrong place, there may be zombie processes hanging around, or worse: processes that eat your CPU time. Please check for these when testing your code! </div>
-<h3 class="subsection" id='magicparlabel-2333'><span class="subsection_label">5.16</span> Flexigrid variable options</h3>
-<div class="standard" id='magicparlabel-2334'><div id="subsec_flexigrid_variable_options"></div>
+<div class="standard" id='magicparlabel-2786'>When running with the <span class="flex_programminglanguage">C</span> backend, the grid will crash. If you have built <span class="flex_file"><i>libbinary_c.so</i></span> with debugging (e.g.&nbsp;<span class="flex_command">configure debug</span>) you should see a stack trace so that you can debug the crash. With the <span class="flex_scriptinglanguage">Perl</span> backend this is more difficult, but you should see an error message. Beware that if the <span class="flex_scriptinglanguage">Perl</span> backend crashes at the wrong place, there may be zombie processes hanging around, or worse: processes that eat your CPU time. Please check for these when testing your code! </div>
+<h3 class="subsection" id='magicparlabel-2807'><span class="subsection_label">6.16</span> Flexigrid variable options</h3>
+<div class="standard" id='magicparlabel-2808'><div id="subsec_flexigrid_variable_options"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2335'><b>FIXME! This is out of date.</b></div>
+<div class="standard" id='magicparlabel-2809'><b>FIXME! This is out of date.</b></div>
 
-<div class="standard" id='magicparlabel-2336'>Note that any <em>code</em> is executed in the context of the flexigrid <span class="flex_perlcode">eval</span> call, so you should prepend calls to subroutines with <span class="flex_perlmodule">main::</span> or <span class="flex_perlmodule">module_name::</span> or, if they are part of <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-2810'>Note that any <em>code</em> is executed in the context of the flexigrid <span class="flex_perlcode">eval</span> call, so you should prepend calls to subroutines with <span class="flex_perlmodule">main::</span> or <span class="flex_perlmodule">module_name::</span> or, if they are part of <span class='math'>\binarygrid</span>
 2, <span class="flex_perlcode">$self</span> to access them through the <span class='math'>\binarygrid</span>
 2 object.</div>
 
-<ol class='lyxlist' id='magicparlabel-2353'><li class="labeling_item"><span class='lyxlist'>condition&nbsp;code</span>
+<ol class='lyxlist' id='magicparlabel-2827'><li class="labeling_item"><span class='lyxlist'>condition&nbsp;code</span>
  The loop is executed only if <em>condition</em> is true. </li>
 <li class="labeling_item"><span class='lyxlist'>dphasevol&nbsp;expression</span>
 <em> </em>This defines the contribution to the phase volume from this variable.</li>
@@ -3188,7 +3526,7 @@ my \$eccentricity = 0.0;
 <li class="labeling_item"><span class='lyxlist'>noprobdist&nbsp;n</span>
 <em> </em>If this is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mn>1</mn>
- </mrow></mstyle></math> then no probability is calculated. Useful for changing, e.g., the duplicity (see Recipe&nbsp;<a href="#Recipe_Single_and_binary_stars">5.25.4</a>).</li>
+ </mrow></mstyle></math> then no probability is calculated. Useful for changing, e.g., the duplicity (see Recipe&nbsp;<a href="#Recipe_Single_and_binary_stars">6.25.4</a>).</li>
 <li class="labeling_item"><span class='lyxlist'>preloopcode&nbsp;code</span>
 <em> </em>This is code executed before the loop is set up.</li>
 <li class="labeling_item"><span class='lyxlist'>precode&nbsp;code</span>
@@ -3206,15 +3544,15 @@ my \$eccentricity = 0.0;
 <li class="labeling_item"><span class='lyxlist'>spacingfunc&nbsp;func</span>
 <em> </em>This defines the spacing function which should be in the <span class="flex_perlmodule">spacing_functions</span> Perl module. </li>
 </ol>
-<div class="standard" id='magicparlabel-2379'><br />
+<div class="standard" id='magicparlabel-2853'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-2380'><span class="subsection_label">5.17</span> Flexigrid loop structure</h3>
-<div class="standard" id='magicparlabel-2381'><div id="subsec_flexigrid_loop_structure"></div>
+<h3 class="subsection" id='magicparlabel-2854'><span class="subsection_label">6.17</span> Flexigrid loop structure</h3>
+<div class="standard" id='magicparlabel-2855'><div id="subsec_flexigrid_loop_structure"></div>
 </div>
 
-<div class="standard" id='magicparlabel-2382'>Each loop is logically structured as follows:</div>
+<div class="standard" id='magicparlabel-2856'>Each loop is logically structured as follows:</div>
 
-<ul class="itemize" id='magicparlabel-2383'><li class="itemize_item">setup <span class="flex_perlcode">%fvar</span> (min, max, initial grid spacing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<ul class="itemize" id='magicparlabel-2857'><li class="itemize_item">setup <span class="flex_perlcode">%fvar</span> (min, max, initial grid spacing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi> &delta; </mi>
  </mrow></mstyle></math> from the <em>spacing_functions, </em>type=<em>grid</em> or <em>edge</em>)</li>
 <li class="itemize_item">calculate the resolution (with an <span class="flex_perlcode">eval</span><em> </em>call)</li>
@@ -3244,28 +3582,28 @@ my \$eccentricity = 0.0;
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>}</span> (close the loop)</li>
 <li class="itemize_item">execute <span class="flex_perlcode">postloopcode</span></li>
 </ul>
-<div class="standard" id='magicparlabel-2438'>Only the innermost loop contains the calls to push commands onto the thread queue.</div>
+<div class="standard" id='magicparlabel-2912'>Only the innermost loop contains the calls to push commands onto the thread queue.</div>
 
-<div class="standard" id='magicparlabel-2439'><br />
+<div class="standard" id='magicparlabel-2913'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-2440'><span class="subsection_label">5.18</span> <i>binary_grid</i> with <em>HTCondor<div id="sec_Working_with_HTCondor"></div>
+<h3 class="subsection" id='magicparlabel-2914'><span class="subsection_label">6.18</span> <i>binary_grid</i> with <em>HTCondor<div id="sec_Working_with_HTCondor"></div>
 </em></h3>
-<div class="standard" id='magicparlabel-2441'>The <span class="flex_software">HTCondor</span> system allows you to distribute your computing of stellar populations over many PCs and hence greatly increase your available computing power. In the following we define the following terms:</div>
+<div class="standard" id='magicparlabel-2915'>The <span class="flex_software">HTCondor</span> system allows you to distribute your computing of stellar populations over many PCs and hence greatly increase your available computing power. In the following we define the following terms:</div>
 
-<dl class='description' id='magicparlabel-2446'><dt class="description_label">Launching</dt>
+<dl class='description' id='magicparlabel-2920'><dt class="description_label">Launching</dt>
 <dd class="description_item"> jobs means sending a grid of stars to be run on a remote PC by submitting an <span class="flex_software">HTCondor</span> script.</dd>
 <dt class="description_label">Joining</dt>
 <dd class="description_item"> jobs means taking all the data that you have generated on remote PCs and making your final dataset. By default, <em><span class='math'>\binarygrid</span>
 </em> tries to join the data when all the jobs have finished. However, this places a considerable load on the machine in question (often far greater, especially in terms of memory, than running a single job). You may want to load a local machine, or one which has faster access to the data store (e.g.&nbsp;if it is an <em>NFS </em>mountpoint). Use the <span class="flex_perlcode">condor_postpone_join</span><span style='font-family:monospace;font-size: 18px;'> </span>variable to postpone the join in this manner (see below).</dd>
 </dl>
 
-<ul class="itemize" id='magicparlabel-2456'><li class="itemize_item">You need to decide how many condor jobs to run (<span class="flex_perlcode">condor_njobs</span>). This is a tradeoff between how many <em>HTCondor</em> slots you have available (probably this is the number of cores you have available on your PCs), how much disk space you want to take up, and how long you would like to wait in the joining process (which scales linearly with the number of jobs). In general, joining is fast compared to running large stellar populations, so the joining is irrelevant. Thus, you want to set this to the number of slots available, unless there is some limit set by your administrator, or you are short of disk space (the amount of disk space you require is linear in the number of slots you use).</li>
+<ul class="itemize" id='magicparlabel-2930'><li class="itemize_item">You need to decide how many condor jobs to run (<span class="flex_perlcode">condor_njobs</span>). This is a tradeoff between how many <em>HTCondor</em> slots you have available (probably this is the number of cores you have available on your PCs), how much disk space you want to take up, and how long you would like to wait in the joining process (which scales linearly with the number of jobs). In general, joining is fast compared to running large stellar populations, so the joining is irrelevant. Thus, you want to set this to the number of slots available, unless there is some limit set by your administrator, or you are short of disk space (the amount of disk space you require is linear in the number of slots you use).</li>
 <li class="itemize_item">You will need to set a <span class="flex_perlcode">condor_dir</span> directory which stores the <span class="flex_software">HTCondor</span> scripts, logs, <span class="flex_cvar">stdout</span>, <span class="flex_cvar">stderr</span>, status and the data which is to be joined. This directory must be accessible to <em>all the compute nodes </em>(e.g.&nbsp;mounted as an <em>NFS</em> partition).</li>
 <li class="itemize_item">The data that is to be joined is stored in your <span class="flex_perlcode">condor_dir</span> directory. There are <span class="flex_perlcode">condor_njobs</span> of these files, one for each job. Together they contain your raw population data (prior to <span style='font-family:monospace;font-size: 18px;'>output()</span> being called).</li>
 <li class="itemize_item">The generated scripts are actually called from wrapper scripts (appended with <span class="flex_file">.wrap</span>) which catch errors. See below for more details.</li>
 </ul>
 
-<dl class='description' id='magicparlabel-2492'><dt class="description_label">Binary_c</dt>
+<dl class='description' id='magicparlabel-2966'><dt class="description_label">Binary_c</dt>
 <dd class="description_item"> You should configure <span class='math'>binary_c</i></span>
  to use generic flags by running,<br />
 <pre class\s*='listings bash'>$ ./configure generic</pre><br />
@@ -3279,9 +3617,9 @@ You will need to completely rebuild <span class='math'>binary_c</i></span>
 .so on the <span class="flex_software">HTCondor</span> submission machine after setting <span class="flex_envvar">ARCHFLAGS</span> and (perhaps) each time you change <span class='math'>binary_c</i></span>
 . If you do not, you will suffer from (seemingly random) segmentation faults.</dd>
 </dl>
-<div class="standard" id='magicparlabel-2513'>Other parameters include:</div>
+<div class="standard" id='magicparlabel-2987'>Other parameters include:</div>
 
-<dl class='description' id='magicparlabel-2514'><dt class="description_label">condor_memory</dt>
+<dl class='description' id='magicparlabel-2988'><dt class="description_label">condor_memory</dt>
 <dd class="description_item"> The amount of RAM allocated to your run. Since each job uses only one CPU at a time, this is generally small (less than 1GB) however there may be occasions where you require more.</dd>
 <dt class="description_label">condor_universe</dt>
 <dd class="description_item"> This must be <span class="flex_args">vanilla</span>. I have not tried to compile all the required tools using <span class="flex_software">HTCondor</span>'s compiler.</dd>
@@ -3297,25 +3635,25 @@ You will need to completely rebuild <span class='math'>binary_c</i></span>
 
 Other, less common, options are <span class="flex_perlcode">join_datafiles</span> to use a specified list of datafiles rather than the list automatically generated, or <span class="flex_perlcode">run_flexigrid</span> to run a grid of stars (this is done automatically by each of the <span class="flex_software">HTCondor</span> submit scripts). </dd>
 <dt class="description_label">condor_resubmit_submitted</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">5.18.4</a>.</dd>
+<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
 <dt class="description_label">condor_resubmit_running</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">5.18.4</a>.</dd>
+<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
 <dt class="description_label">condor_resubmit_crashed</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">5.18.4</a>.</dd>
+<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
 <dt class="description_label">condor_resubmit_finished</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">5.18.4</a>.</dd>
+<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
 </dl>
-<h4 class="subsubsection" id='magicparlabel-2580'><span class="subsubsection_label">5.18.1</span> Modifying your grid script for HTCondor<div id="subsec_Modifying_your_grid"></div>
+<h4 class="subsubsection" id='magicparlabel-3054'><span class="subsubsection_label">6.18.1</span> Modifying your grid script for HTCondor<div id="subsec_Modifying_your_grid"></div>
 </h4>
-<div class="standard" id='magicparlabel-2581'>You need to:</div>
+<div class="standard" id='magicparlabel-3055'>You need to:</div>
 
-<ol class="enumerate" id='magicparlabel-2582'><li class="enumerate_item">load in the <span class="flex_perlmodule">binary_grid::condor</span> module</li>
+<ol class="enumerate" id='magicparlabel-3056'><li class="enumerate_item">load in the <span class="flex_perlmodule">binary_grid::condor</span> module</li>
 <li class="enumerate_item">set some parameters and </li>
 <li class="enumerate_item">modify the call to your <span style='font-family:monospace;font-size: 18px;'>output</span> function. </li>
 </ol>
-<div class="standard" id='magicparlabel-2589'>The following is a basic example.</div>
+<div class="standard" id='magicparlabel-3063'>The following is a basic example.</div>
 
-<div class="standard" id='magicparlabel-2590'><br />
+<div class="standard" id='magicparlabel-3064'><br />
 <pre class ='listings Perl'>#!/usr/bin/env perl
 use strict; # recommended
 use 5.16.0; # recommended
@@ -3358,29 +3696,29 @@ output($population) if($population-&gt;output_allowed());
 # the rest of the script remains unchanged
 </pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-2635'><span class="subsubsection_label">5.18.2</span> Launching your jobs<div id="subsec_Launching_your_jobs"></div>
+<h4 class="subsubsection" id='magicparlabel-3109'><span class="subsubsection_label">6.18.2</span> Launching your jobs<div id="subsec_Launching_your_jobs"></div>
 </h4>
-<div class="standard" id='magicparlabel-2636'>Once your grid script is modified, you just have to run it on a PC which is allowed to submit jobs using <span class="flex_perlcode">condor_submit</span>. </div>
+<div class="standard" id='magicparlabel-3110'>Once your grid script is modified, you just have to run it on a PC which is allowed to submit jobs using <span class="flex_perlcode">condor_submit</span>. </div>
 
-<div class="standard" id='magicparlabel-2641'>If you want the script to sometimes run condor (e.g.&nbsp;if you are on the condor submit machine), and sometimes not (e.g.&nbsp;you are on your personal PC or laptop), set <span class="flex_args">condor=&gt;0</span> in the above example, and run with <span class="flex_args">condor=1</span> as an argument <em>only </em>on the condor submit machine.</div>
+<div class="standard" id='magicparlabel-3115'>If you want the script to sometimes run condor (e.g.&nbsp;if you are on the condor submit machine), and sometimes not (e.g.&nbsp;you are on your personal PC or laptop), set <span class="flex_args">condor=&gt;0</span> in the above example, and run with <span class="flex_args">condor=1</span> as an argument <em>only </em>on the condor submit machine.</div>
 
-<div class="standard" id='magicparlabel-2650'><br />
+<div class="standard" id='magicparlabel-3124'><br />
 <pre class\s*='listings bash'>$ mygridscript.pl condor=1</pre><br />
 </div>
-<h4 class="subsubsection_" id='magicparlabel-2655'>Job IDs<div id="subsec_Job_IDs"></div>
+<h4 class="subsubsection_" id='magicparlabel-3129'>Job IDs<div id="subsec_Job_IDs"></div>
 </h4>
-<div class="standard" id='magicparlabel-2656'>Each job is given an ID string, <span style='font-family:monospace;font-size: 18px;'>x.y</span>, where <span style='font-family:monospace;font-size: 18px;'>x</span> is a counter which ranges from <span style='font-family:monospace;font-size: 18px;'>0</span> to <span style='font-family:monospace;font-size: 18px;'>y-1</span>, where <span style='font-family:monospace;font-size: 18px;'>y</span> is the number of jobs to be launched (<span class="flex_args">condor_njobs</span>). The files in the various subdirectories that control your jobs are named <span style='font-family:monospace;font-size: 18px;'>x.y</span>. </div>
+<div class="standard" id='magicparlabel-3130'>Each job is given an ID string, <span style='font-family:monospace;font-size: 18px;'>x.y</span>, where <span style='font-family:monospace;font-size: 18px;'>x</span> is a counter which ranges from <span style='font-family:monospace;font-size: 18px;'>0</span> to <span style='font-family:monospace;font-size: 18px;'>y-1</span>, where <span style='font-family:monospace;font-size: 18px;'>y</span> is the number of jobs to be launched (<span class="flex_args">condor_njobs</span>). The files in the various subdirectories that control your jobs are named <span style='font-family:monospace;font-size: 18px;'>x.y</span>. </div>
 
-<div class="standard" id='magicparlabel-2661'>Please note: <b>if you change </b><span class="flex_perlcode">condor_njobs</span><b> or </b><span class="flex_perlcode">condor_dir</span><b> then you are also changing your job IDs. If you make changes to these variables and then try to join your data after postponing the join, things will break.</b> Please see Section&nbsp;<a href="#subsec_Joining_your_jobs">5.18.5</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-2670'><span class="subsubsection_label">5.18.3</span> Status of your jobs<div id="subsec_Status_of_your_jobs"></div>
+<div class="standard" id='magicparlabel-3135'>Please note: <b>if you change </b><span class="flex_perlcode">condor_njobs</span><b> or </b><span class="flex_perlcode">condor_dir</span><b> then you are also changing your job IDs. If you make changes to these variables and then try to join your data after postponing the join, things will break.</b> Please see Section&nbsp;<a href="#subsec_Joining_your_jobs">6.18.5</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-3144'><span class="subsubsection_label">6.18.3</span> Status of your jobs<div id="subsec_Status_of_your_jobs"></div>
 </h4>
 
-<ul class="itemize" id='magicparlabel-2671'><li class="itemize_item">You can use the <span class="flex_command">condor_q</span> command and its various options to enquire about the status of your jobs.</li>
+<ul class="itemize" id='magicparlabel-3145'><li class="itemize_item">You can use the <span class="flex_command">condor_q</span> command and its various options to enquire about the status of your jobs.</li>
 <li class="itemize_item">You can also use the <span class="flex_file">condor_dir/status</span> files which are used by <span class='math'>\binarygrid</span>
  to monitor the status of your jobs. These have the values:</li>
 </ul>
 
-<dl class='description' id='magicparlabel-2681'><dt class="description_label">submitted</dt>
+<dl class='description' id='magicparlabel-3155'><dt class="description_label">submitted</dt>
 <dd class="description_item"> The job is submitted and will (hopefully) soon be run.</dd>
 <dt class="description_label">running</dt>
 <dd class="description_item"> The job is currently running (and a crash has not been detected).</dd>
@@ -3389,11 +3727,11 @@ output($population) if($population-&gt;output_allowed());
 <dt class="description_label">crash&nbsp;n</dt>
 <dd class="description_item"> The job crashed with exit code <em>n.</em></dd>
 </dl>
-<h4 class="subsubsection" id='magicparlabel-2685'><span class="subsubsection_label">5.18.4</span> Rerunning your jobs<div id="subsec_Rerunning_your_jobs"></div>
+<h4 class="subsubsection" id='magicparlabel-3159'><span class="subsubsection_label">6.18.4</span> Rerunning your jobs<div id="subsec_Rerunning_your_jobs"></div>
 </h4>
-<div class="standard" id='magicparlabel-2686'>Sometimes you would like to rerun your jobs, especially if some of them fail to run and you later fix the bug. Four variables allow you to restart a job, depending on its current status.</div>
+<div class="standard" id='magicparlabel-3160'>Sometimes you would like to rerun your jobs, especially if some of them fail to run and you later fix the bug. Four variables allow you to restart a job, depending on its current status.</div>
 
-<dl class='description' id='magicparlabel-2687'><dt class="description_label">condor_resubmit_submitted</dt>
+<dl class='description' id='magicparlabel-3161'><dt class="description_label">condor_resubmit_submitted</dt>
 <dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>submitted</span>, it is resubmitted. </dd>
 <dt class="description_label">condor_resubmit_running</dt>
 <dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>running</span>, it is resubmitted.</dd>
@@ -3402,27 +3740,27 @@ output($population) if($population-&gt;output_allowed());
 <dt class="description_label">condor_resubmit_finished</dt>
 <dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>finished</span>, it is resubmitted.</dd>
 </dl>
-<div class="standard" id='magicparlabel-2691'>By default, all the <span class="flex_perlcode">condor_resubmit_*</span> variables are <span style='font-family:monospace;font-size: 18px;'>0</span>, so jobs that have already been started are not resubmitted.</div>
-<h4 class="subsubsection" id='magicparlabel-2696'><span class="subsubsection_label">5.18.5</span> Joining your jobs<div id="subsec_Joining_your_jobs"></div>
+<div class="standard" id='magicparlabel-3165'>By default, all the <span class="flex_perlcode">condor_resubmit_*</span> variables are <span style='font-family:monospace;font-size: 18px;'>0</span>, so jobs that have already been started are not resubmitted.</div>
+<h4 class="subsubsection" id='magicparlabel-3170'><span class="subsubsection_label">6.18.5</span> Joining your jobs<div id="subsec_Joining_your_jobs"></div>
 </h4>
-<div class="standard" id='magicparlabel-2697'>If you postponed the join of your jobs with <span class="flex_perlcode">condor_postpone_join</span> set to <span class="flex_perlcode">1</span>, you have to join them in order to finish your population calculations. You can either:</div>
+<div class="standard" id='magicparlabel-3171'>If you postponed the join of your jobs with <span class="flex_perlcode">condor_postpone_join</span> set to <span class="flex_perlcode">1</span>, you have to join them in order to finish your population calculations. You can either:</div>
 
-<ul class="itemize" id='magicparlabel-2706'><li class="itemize_item">Rerun your script with <span class="flex_args">condor_command=join</span> appended to the command line. This automatically locates the list of files require, joins them and calls <span class="flex_perlcode">output()</span>. This is the simplest, and recommended, way to do it.</li>
+<ul class="itemize" id='magicparlabel-3180'><li class="itemize_item">Rerun your script with <span class="flex_args">condor_command=join</span> appended to the command line. This automatically locates the list of files require, joins them and calls <span class="flex_perlcode">output()</span>. This is the simplest, and recommended, way to do it.</li>
 <li class="itemize_item">Locate the <span class="flex_file">condor_dir/scripts/joincmd</span> file and run the command in it to join the data and call <span class="flex_perlcode">output()</span>.</li>
 </ul>
-<div class="standard" id='magicparlabel-2724'>You <b>must not change</b> <span class="flex_perlcode">condor_njobs</span><b> or <span style='font-family:monospace;font-size: 18px;'>condor_dir </span>prior to joining your jobs</b>. This is because these variables are used to construct job IDs. See section&nbsp;<a href="#subsec_Job_IDs">5.18.2</a> for more details.</div>
-<h4 class="subsubsection" id='magicparlabel-2729'><span class="subsubsection_label">5.18.6</span> Debugging <em>HTCondor</em> jobs<div id="subsec_Debugging_HTCondor_jobs"></div>
+<div class="standard" id='magicparlabel-3198'>You <b>must not change</b> <span class="flex_perlcode">condor_njobs</span><b> or <span style='font-family:monospace;font-size: 18px;'>condor_dir </span>prior to joining your jobs</b>. This is because these variables are used to construct job IDs. See section&nbsp;<a href="#subsec_Job_IDs">6.18.2</a> for more details.</div>
+<h4 class="subsubsection" id='magicparlabel-3203'><span class="subsubsection_label">6.18.6</span> Debugging <em>HTCondor</em> jobs<div id="subsec_Debugging_HTCondor_jobs"></div>
 </h4>
-<div class="standard" id='magicparlabel-2730'>All the <span class="flex_software">HTCondor</span> logs, <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span> from your jobs are stored in the <span class="flex_file">condor_dir</span>. I cannot guide you on how <span class="flex_software">HTCondor</span> works or what its error codes mean, I suggest you look at their website for these instructions. However, you can check the log files to see whether a job that has stopped has crashed (as opposed to having been <em>evicted</em>). </div>
+<div class="standard" id='magicparlabel-3204'>All the <span class="flex_software">HTCondor</span> logs, <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span> from your jobs are stored in the <span class="flex_file">condor_dir</span>. I cannot guide you on how <span class="flex_software">HTCondor</span> works or what its error codes mean, I suggest you look at their website for these instructions. However, you can check the log files to see whether a job that has stopped has crashed (as opposed to having been <em>evicted</em>). </div>
 
-<div class="standard" id='magicparlabel-2751'>When a job crashes and the crash has been caught by<em> </em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-3225'>When a job crashes and the crash has been caught by<em> </em><span class='math'>\binarygrid</span>
 's wrapper script (this is usually the case), its status file contains crashed <em>n</em> where <em>n</em> is the crashed exit code from <span class='math'>binary_c</i></span>
 .</div>
-<h4 class="subsubsection" id='magicparlabel-2752'><span class="subsubsection_label">5.18.7</span> &ldquo;Random&rdquo; segmentation faults (segfaults)</h4>
-<div class="standard" id='magicparlabel-2753'>Sometimes you may find that the grid does not start. This looks like a random segmentation fault (such faults are almost never random). The most common cause is that your <span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-3226'><span class="subsubsection_label">6.18.7</span> &ldquo;Random&rdquo; segmentation faults (segfaults)</h4>
+<div class="standard" id='magicparlabel-3227'>Sometimes you may find that the grid does not start. This looks like a random segmentation fault (such faults are almost never random). The most common cause is that your <span class='math'>\binarygrid</span>
  <span class="flex_scriptinglanguage">Perl</span> module must be reinstalled after you recompile <span class="flex_file"><i>libbinary_c.so</i></span>.</div>
 
-<ul class="itemize" id='magicparlabel-2762'><li class="itemize_item">Recompile <span style='font-family:monospace;font-size: 18px;'><span class='math'>libbinary_c</i></span>
+<ul class="itemize" id='magicparlabel-3236'><li class="itemize_item">Recompile <span style='font-family:monospace;font-size: 18px;'><span class='math'>libbinary_c</i></span>
 :
 <br />
 
@@ -3437,11 +3775,11 @@ output($population) if($population-&gt;output_allowed());
 <pre class\s*='listings bash'>$ cpanm <i>binary_grid</i> --force -v</pre><br />
 </li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-2772'><span class="subsubsection_label">5.18.8</span> <span style='font-family:monospace;font-size: 18px;'>SIGILL</span> – Error code 4</h4>
-<div class="standard" id='magicparlabel-2773'>If you find &ldquo;Error code 4&rdquo;, a <span class="flex_cvar">SIGILL</span>, is occurring, then you have a problem because it turns out that your build of either <span class='math'>libbinary_c</i></span>, <em><span class='math'>binary_c</i></span>
+<h4 class="subsubsection" id='magicparlabel-3246'><span class="subsubsection_label">6.18.8</span> <span style='font-family:monospace;font-size: 18px;'>SIGILL</span> – Error code 4</h4>
+<div class="standard" id='magicparlabel-3247'>If you find &ldquo;Error code 4&rdquo;, a <span class="flex_cvar">SIGILL</span>, is occurring, then you have a problem because it turns out that your build of either <span class='math'>libbinary_c</i></span>, <em><span class='math'>binary_c</i></span>
 </em> or <span class="flex_scriptinglanguage">Perl</span> (and its modules) is incompatible with the architecture on one of your slots. This problem can overcome by:</div>
 
-<ul class="itemize" id='magicparlabel-2782'><li class="itemize_item">Setting the <span class="flex_envvar">ARCHFLAGS</span> environment variable, e.g.
+<ul class="itemize" id='magicparlabel-3256'><li class="itemize_item">Setting the <span class="flex_envvar">ARCHFLAGS</span> environment variable, e.g.
 <br />
 
 <br />
@@ -3452,34 +3790,34 @@ then run <br />
 .</li>
 <li class="itemize_item">Replacing the <span class="flex_args">mtune</span> and <span class="flex_args">march</span> flags in your <span class="flex_software">Perlbrew</span> build with the above &ldquo;generic&rdquo; flags. To do this:
 
-<ul class="itemize" id='magicparlabel-2808'><li class="itemize_item">Move (or remove) your <span class="flex_file">perlbrew</span><em> </em>and <span class="flex_file">perl5</span><em> </em>directories. </li>
+<ul class="itemize" id='magicparlabel-3282'><li class="itemize_item">Move (or remove) your <span class="flex_file">perlbrew</span><em> </em>and <span class="flex_file">perl5</span><em> </em>directories. </li>
 <li class="itemize_item">Reinstall <span class="flex_scriptinglanguage">Perl</span> and <em><b>all</b></em> its modules. </li>
 <li class="itemize_item">If in doubt, check that the <span class="flex_perlmodule">binary_grid::C</span> module has the generic flags set rather than anything else. (If you are reading this documentation, then your version is fixed.)</li>
 </ul>
 </li></ul>
-<div class="standard" id='magicparlabel-2827'>Note that using the above flags slows <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-3301'>Note that using the above flags slows <span class='math'>binary_c</i></span>
  but hopefully not by too much.</div>
-<h4 class="subsubsection" id='magicparlabel-2828'><span class="subsubsection_label">5.18.9</span> Timeouts</h4>
-<div class="standard" id='magicparlabel-2829'><em><span class='math'>binary_c</i></span>
+<h4 class="subsubsection" id='magicparlabel-3302'><span class="subsubsection_label">6.18.9</span> Timeouts</h4>
+<div class="standard" id='magicparlabel-3303'><em><span class='math'>binary_c</i></span>
  </em>automatically stops if <span class="flex_cmacro">TIMEOUT_SECONDS</span> (defined in <em><span class="flex_file">code_options.h</span></em>) have passed without a call to the <span class="flex_cfunction">reset_timeout()</span> function. This may happen if the host machine locks up for some reason, or if the network fails to write a file. There is not much I can do about this, but you could always set <span class="flex_cmacro">TIMEOUT_SECONDS</span> to <span class="flex_cmacro">0</span>, or comment out <span class="flex_cvar">CATCH_SIGVTALRM</span>. You will have to rebuild <span class='math'>libbinary_c</i></span>
 /<span class='math'>binary_c</i></span>
  if you do this.</div>
-<h4 class="subsubsection_" id='magicparlabel-2854'>Checkpointing<div id="subsec_Checkpointing"></div>
+<h4 class="subsubsection_" id='magicparlabel-3328'>Checkpointing<div id="subsec_Checkpointing"></div>
 </h4>
-<div class="standard" id='magicparlabel-2855'>At one point there was an option to stop and start <span class='math'>\binarygrid</span>, however this has not been used in a long time. Because your jobs are running in the <em>vanilla</em> universe, they cannot be checkpointed by <span class="flex_software">HTCondor</span>. This might be considered a disadvantage, and annoying because checkpointing is one of the big features of <span class="flex_software">HTCondor</span>. However, I would disagree with this assessment. Your jobs will, if split onto enough PCs, not (each) take long to run. This means that should the <span class="flex_software">HTCondor</span> grid go down (e.g.&nbsp;there is a power cut) you can simply restart when it is up and your runtime will be delayed only by as long as one script takes to run (typically an hour or two if you have not too many stars in your population and you have plenty of compute machines). This is probably less time than your power cut. It is simply not worth my while programming in more features to deal with such a situation when the solution is so cheap.</div>
+<div class="standard" id='magicparlabel-3329'>At one point there was an option to stop and start <span class='math'>\binarygrid</span>, however this has not been used in a long time. Because your jobs are running in the <em>vanilla</em> universe, they cannot be checkpointed by <span class="flex_software">HTCondor</span>. This might be considered a disadvantage, and annoying because checkpointing is one of the big features of <span class="flex_software">HTCondor</span>. However, I would disagree with this assessment. Your jobs will, if split onto enough PCs, not (each) take long to run. This means that should the <span class="flex_software">HTCondor</span> grid go down (e.g.&nbsp;there is a power cut) you can simply restart when it is up and your runtime will be delayed only by as long as one script takes to run (typically an hour or two if you have not too many stars in your population and you have plenty of compute machines). This is probably less time than your power cut. It is simply not worth my while programming in more features to deal with such a situation when the solution is so cheap.</div>
 
-<div class="standard" id='magicparlabel-2868'><br />
+<div class="standard" id='magicparlabel-3342'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-2869'><span class="subsection_label">5.19</span> Binary_grid with <span class="flex_software">slurm</span><em><div id="sec_Working_with_slurm"></div>
+<h3 class="subsection" id='magicparlabel-3343'><span class="subsection_label">6.19</span> Binary_grid with <em>slurm<div id="sec_Working_with_slurm"></div>
 </em></h3>
-<div class="standard" id='magicparlabel-2874'><span class="flex_software">Slurm</span> is a distributed computing system similar to <span class="flex_software">HTCondor</span>. <em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-3344'><span class="flex_software">Slurm</span> is a distributed computing system similar to <span class="flex_software">HTCondor</span>. <em><span class='math'>\binarygrid</span>
 </em>2 has a dedicated <span class="flex_software">slurm</span> module which you can load simply with:<br />
 <pre class ='listings Perl'>use binary_grid2; 
 use binary_grid::C; 
 use binary_grid::slurm;</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-2893'>After setting up your population as usual, just insert some <em><span class="flex_software">slurm</span></em>-specific parameters<br />
+<div class="standard" id='magicparlabel-3363'>After setting up your population as usual, just insert some <em><span class="flex_software">slurm</span></em>-specific parameters<br />
 <pre class ='listings Perl'># set up slurm
 $population-&gt;set(
     slurm=&gt;1, # use slurm if 1
@@ -3495,21 +3833,21 @@ $population-&gt;set(
     );</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-2914'>Hopefully the options are obvious, but you will need to set them all.</div>
+<div class="standard" id='magicparlabel-3384'>Hopefully the options are obvious, but you will need to set them all.</div>
 
-<ul class="itemize" id='magicparlabel-2915'><li class="itemize_item">The <span class="flex_perlcode">slurm_dir</span> is a space that needs to be writable by all the nodes of your <span class="flex_software">slurm</span> setup. The <em>partition</em> is a queue name which you will have to find out from your local <span class="flex_software">slurm</span> setup (e.g. with <span class="flex_command">sinfo</span> or <em><span class="flex_command">squeue</span></em>). The <em>jobname</em> should be set to something sensible so you can identify your jobs.</li>
+<ul class="itemize" id='magicparlabel-3385'><li class="itemize_item">The <span class="flex_perlcode">slurm_dir</span> is a space that needs to be writable by all the nodes of your <span class="flex_software">slurm</span> setup. The <em>partition</em> is a queue name which you will have to find out from your local <span class="flex_software">slurm</span> setup (e.g. with <span class="flex_command">sinfo</span> or <em><span class="flex_command">squeue</span></em>). The <em>jobname</em> should be set to something sensible so you can identify your jobs.</li>
 <li class="itemize_item"><span class="flex_perlcode">slurm_time</span> is the maximum time your job has to run (<span class="flex_perlcode">0</span> means infinite).</li>
 <li class="itemize_item"><span class="flex_perlcode">slurm_use_all_node_CPUs</span> should be set to <span class="flex_perlcode">1</span> if you are running the default setup where each <span class="flex_software">slurm</span> job gets a single node and all its CPUs.</li>
 <li class="itemize_item"><span class="flex_perlcode">slurm_control_CPUs</span> is the number of CPUs belonging to the control script, i.e. if you set this to <span class="flex_perlcode">1</span> then one of the CPUs is <em>not</em> given to calculations but rather to the <span class="flex_scriptinglanguage">Perl</span> grid. It is safe to leave this at zero.</li>
 </ul>
-<div class="standard" id='magicparlabel-2971'>One big advantage of <span class="flex_software">slurm</span> compared to <span class="flex_software">HTCondor</span> is that <span class="flex_software">slurm</span> has array jobs which make it easy to set up a grid of models (the details are handled internally by the <span class="flex_software">slurm</span> module and all CPUs are used by default). </div>
+<div class="standard" id='magicparlabel-3441'>One big advantage of <span class="flex_software">slurm</span> compared to <span class="flex_software">HTCondor</span> is that <span class="flex_software">slurm</span> has array jobs which make it easy to set up a grid of models (the details are handled internally by the <span class="flex_software">slurm</span> module and all CPUs are used by default). </div>
 
-<div class="standard" id='magicparlabel-2988'>Please note that the <span class="flex_software">slurm</span> module has only been tested with <span class="flex_perlmodule"><i>binary_grid2</i></span> and <span class="flex_perlmodule">binary_grid::C</span>.</div>
+<div class="standard" id='magicparlabel-3458'>Please note that the <span class="flex_software">slurm</span> module has only been tested with <span class="flex_perlmodule"><i>binary_grid2</i></span> and <span class="flex_perlmodule">binary_grid::C</span>.</div>
 
-<div class="standard" id='magicparlabel-3001'><br />
+<div class="standard" id='magicparlabel-3471'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3002'><span class="subsection_label">5.20</span> Initial distributions (IMF etc.) </h3>
-<div class="standard" id='magicparlabel-3003'><div id="sec_initial_dists"></div>
+<h3 class="subsection" id='magicparlabel-3472'><span class="subsection_label">6.20</span> Initial distributions (IMF etc.) </h3>
+<div class="standard" id='magicparlabel-3473'><div id="sec_initial_dists"></div>
 The initial distributions of stellar masses, mass ratios, separations and periods are handled by the <span class="flex_perlmodule">distribution_functions</span> <span class="flex_scriptinglanguage">Perl</span> module. The general idea is that given a set of stellar parameters <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
@@ -3562,7 +3900,7 @@ The initial distributions of stellar masses, mass ratios, separations and period
  <mrow><mi>i</mi>
  </mrow></mstyle></math> is calculated from </div>
 
-<div class="standard" id='magicparlabel-3012'><div id="eq_prob_eq"></div>
+<div class="standard" id='magicparlabel-3482'><div id="eq_prob_eq"></div>
 <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mtable>
   <mtr>
@@ -3773,12 +4111,12 @@ The initial distributions of stellar masses, mass ratios, separations and period
   </mrow>
  </mrow></mstyle></math>.</div>
 
-<div class="standard" id='magicparlabel-3013'>There are many forms for each initial distributions and they depend on which authors you believe and/or which stars you are looking at (e.g. low- or high-mass stars). There is no one true answer – yet!</div>
-<h4 class="subsubsection" id='magicparlabel-3014'><span class="subsubsection_label">5.20.1</span> Predefined functions in the distribution_functions module</h4>
-<div class="standard" id='magicparlabel-3015'><div id="subsec_distribution_functions_predefined_functions"></div>
+<div class="standard" id='magicparlabel-3483'>There are many forms for each initial distributions and they depend on which authors you believe and/or which stars you are looking at (e.g. low- or high-mass stars). There is no one true answer – yet!</div>
+<h4 class="subsubsection" id='magicparlabel-3484'><span class="subsubsection_label">6.20.1</span> Predefined functions in the distribution_functions module</h4>
+<div class="standard" id='magicparlabel-3485'><div id="subsec_distribution_functions_predefined_functions"></div>
 </div>
 
-<dl class='description' id='magicparlabel-3016'><dt class="description_label">const(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<dl class='description' id='magicparlabel-3486'><dt class="description_label">const(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>a</mi>
  </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>b</mi>
@@ -4020,13 +4358,13 @@ The initial distributions of stellar masses, mass ratios, separations and period
  <mrow><mi>x</mi>
  </mrow></mstyle></math>.</dd>
 </dl>
-<div class="standard" id='magicparlabel-3022'><br />
+<div class="standard" id='magicparlabel-3492'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3023'><span class="subsection_label">5.21</span> Grid spacings</h3>
-<div class="standard" id='magicparlabel-3024'><div id="sec_The_spacing_functions_module"></div>
+<h3 class="subsection" id='magicparlabel-3493'><span class="subsection_label">6.21</span> Grid spacings</h3>
+<div class="standard" id='magicparlabel-3494'><div id="sec_The_spacing_functions_module"></div>
 The <span class="flex_perlmodule">spacing_functions</span><em> </em>module is used to set up the grid spacings. At the moment there are only a few functions, but you can add your own of course.</div>
 
-<dl class='description' id='magicparlabel-3029'><dt class="description_label">const(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<dl class='description' id='magicparlabel-3499'><dt class="description_label">const(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>x</mi>
@@ -4157,24 +4495,24 @@ The <span class="flex_perlmodule">spacing_functions</span><em> </em>module is us
   </mrow>
  </mrow></mstyle></math> instead of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>t</mi>
- </mrow></mstyle></math>. See Sec.&nbsp;<a href="#Recipe_time_resolved_mass_grid">5.25.3</a> for an example of its use.</dd>
+ </mrow></mstyle></math>. See Sec.&nbsp;<a href="#Recipe_time_resolved_mass_grid">6.25.3</a> for an example of its use.</dd>
 </dl>
-<div class="standard" id='magicparlabel-3032'><br />
+<div class="standard" id='magicparlabel-3502'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3033'><span class="subsection_label">5.22</span> The <span class='math'>\binarygrid</span>
+<h3 class="subsection" id='magicparlabel-3503'><span class="subsection_label">6.22</span> The <span class='math'>\binarygrid</span>
  thread model</h3>
-<div class="standard" id='magicparlabel-3034'><div id="sec_The_Thread_Model"></div>
+<div class="standard" id='magicparlabel-3504'><div id="sec_The_Thread_Model"></div>
 CPUs used to be simple devices that did one job at a time. No more: every CPU these days has multiple <em>cores</em> which can run simultaneously while sharing system resources (e.g. RAM, disk). <span class='math'>\binarygrid</span>
  takes advantage of this by splitting the workload of running stars over a parameter space into multiple <em>threads</em> which run concurrently, thus speeding up execution of the grid.</div>
 
-<div class="standard" id='magicparlabel-3035'>Note: you should <em>not</em> call <span class="flex_perlcode">flexigrid</span> directly with <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-3505'>Note: you should <em>not</em> call <span class="flex_perlcode">flexigrid</span> directly with <span class='math'>\binarygrid</span>
 2: instead call <br />
 <pre class ='listings'>$population-&gt;evolve();</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-3044'>When you call <span class="flex_perlcode">$population-&gt;evolve()</span> it sends a single argument to <span class="flex_perlcode">flexigrid()</span>: the number of child threads. Let's say you launch <span class="flex_perlcode">flexigrid(4);</span><em> </em>then the parent thread launches four children which are managed in a thread queue (using <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlmodule">Thread::Queue</span> module). Each star you want to run is placed in the queue and the threads pull them off one by one until the parameter space is complete.</div>
-<h4 class="subsubsection" id='magicparlabel-3065'><span class="subsubsection_label">5.22.1</span> Thread resources</h4>
-<div class="standard" id='magicparlabel-3066'><div id="subsec_thread_resources"></div>
+<div class="standard" id='magicparlabel-3514'>When you call <span class="flex_perlcode">$population-&gt;evolve()</span> it sends a single argument to <span class="flex_perlcode">flexigrid()</span>: the number of child threads. Let's say you launch <span class="flex_perlcode">flexigrid(4);</span><em> </em>then the parent thread launches four children which are managed in a thread queue (using <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlmodule">Thread::Queue</span> module). Each star you want to run is placed in the queue and the threads pull them off one by one until the parameter space is complete.</div>
+<h4 class="subsubsection" id='magicparlabel-3535'><span class="subsubsection_label">6.22.1</span> Thread resources</h4>
+<div class="standard" id='magicparlabel-3536'><div id="subsec_thread_resources"></div>
 Each thread stores its results in a <em>hash table </em>(marked by <span class="flex_perlcode">%</span> in <em>Perl</em>, see 
 <br />
 
@@ -4183,7 +4521,7 @@ Each thread stores its results in a <em>hash table </em>(marked by <span class="
 
 <a href="http://www.perltutorial.org/perl-hash.aspx">http://www.perltutorial.org/perl-hash.aspx</a>, if you know about <span class="flex_scriptinglanguage">Python</span><em> </em>dictionaries, these are pretty much the same). This is like an array, which is probably familiar to you from other programming languages e.g. <em>C</em>, <em>C++</em> and <em>FORTRAN</em>, but instead of using numbers (e.g. 0, 1, 2&hellip;) as indices, it uses <em>keys</em> instead which can be any scalar, i.e. strings or numbers. Hashes can be nested, e.g. as hashes of hashes or hashes of arrays or arrays of hashes etc. This concept is very powerful because it allows you to store the results of your population synthesis in a <em>single hash table.</em> Because hashes can be nested, a single table can store <em>everything</em> you can throw at it. </div>
 
-<div class="standard" id='magicparlabel-3075'>Each thread has its own hash, usually accessed (e.g. in <em><span class="flex_perlcode">parse_bse</span></em>) through the variable
+<div class="standard" id='magicparlabel-3545'>Each thread has its own hash, usually accessed (e.g. in <em><span class="flex_perlcode">parse_bse</span></em>) through the variable
 <br />
 
  <span class="flex_perlcode">$population-&gt;results</span> where <span class="flex_perlcode">$population</span> is your <em><span class='math'>\binarygrid</span>
@@ -4191,14 +4529,14 @@ Each thread stores its results in a <em>hash table </em>(marked by <span class="
 <pre class ='listings Perl'>$h=$population-&gt;results();</pre><br />
  into which you put your data in <span style='font-family:monospace;font-size: 18px;'>$h</span> and it is propagated where it is required.</div>
 
-<div class="standard" id='magicparlabel-3100'>When the threads finish they are <em>joined</em> together – in this process, the thread's<em> </em>results hash is added to a global hash which ends up in your <span class="flex_perlcode">$population</span> object. The mechanism to do this is automatically included in <span class='math'>\binarygrid</span>, you do not usually have to do anything yourself. At the end of the grid, the<em> </em><span class="flex_perlcode">$population-&gt;results</span> hash contains the sum of the population synthesis over all the stars you have run.</div>
+<div class="standard" id='magicparlabel-3570'>When the threads finish they are <em>joined</em> together – in this process, the thread's<em> </em>results hash is added to a global hash which ends up in your <span class="flex_perlcode">$population</span> object. The mechanism to do this is automatically included in <span class='math'>\binarygrid</span>, you do not usually have to do anything yourself. At the end of the grid, the<em> </em><span class="flex_perlcode">$population-&gt;results</span> hash contains the sum of the population synthesis over all the stars you have run.</div>
 
-<div class="standard" id='magicparlabel-3109'>Beware that the default hash join function <em>only </em>knows how to add up scalars, arrays and hashes. It cannot know how to add a hash to an array. I cannot think of a case where this would be a problem unless you make your results hash structure depend on thread number. I cannot think of a reason why you would do this.</div>
-<h4 class="subsubsection" id='magicparlabel-3110'><span class="subsubsection_label">5.22.2</span> CPU load and thread number</h4>
-<div class="standard" id='magicparlabel-3111'><div id="subsec_CPU_load"></div>
+<div class="standard" id='magicparlabel-3579'>Beware that the default hash join function <em>only </em>knows how to add up scalars, arrays and hashes. It cannot know how to add a hash to an array. I cannot think of a case where this would be a problem unless you make your results hash structure depend on thread number. I cannot think of a reason why you would do this.</div>
+<h4 class="subsubsection" id='magicparlabel-3580'><span class="subsubsection_label">6.22.2</span> CPU load and thread number</h4>
+<div class="standard" id='magicparlabel-3581'><div id="subsec_CPU_load"></div>
 </div>
 
-<dl class='description' id='magicparlabel-3112'><dt class="description_label">C&nbsp;backend</dt>
+<dl class='description' id='magicparlabel-3582'><dt class="description_label">C&nbsp;backend</dt>
 <dd class="description_item"> Using the <em>C</em> backend, the number of threads scales well with CPU usage and runtime, tested up to 8 threads (or 16 with hyperthreading, which obviously isn't really a valid test given how dodgy hyperthreading is). <b>It is highly recommended to use the <i>C</i> backend for greatly increased performance.</b></dd>
 <dt class="description_label">Perl&nbsp;backend</dt>
 <dd class="description_item"> It is not obviously clear how many threads you should launch even if you know the number of CPUs in your system. If your <span class='math'>binary_c</i></span>
@@ -4216,12 +4554,12 @@ will not have much processing to do and you may as well launch as many threads a
   </mrow>
  </mrow></mstyle></math> threads for the fastest possible grid.</dd>
 </dl>
-<div class="standard" id='magicparlabel-3114'>The best option is to experiment with a limited (low-resolution) parameter space and gradually increase the number of stars while changing the number of threads. This is, in any case, good practice for debugging your newly programmed code. When debugging, use <em>only one thread.</em></div>
-<h4 class="subsubsection" id='magicparlabel-3115'><span class="subsubsection_label">5.22.3</span> Memory usage</h4>
-<div class="standard" id='magicparlabel-3116'><div id="subsec_memory_usage"></div>
+<div class="standard" id='magicparlabel-3584'>The best option is to experiment with a limited (low-resolution) parameter space and gradually increase the number of stars while changing the number of threads. This is, in any case, good practice for debugging your newly programmed code. When debugging, use <em>only one thread.</em></div>
+<h4 class="subsubsection" id='magicparlabel-3585'><span class="subsubsection_label">6.22.3</span> Memory usage</h4>
+<div class="standard" id='magicparlabel-3586'><div id="subsec_memory_usage"></div>
 Each thread stores its data in its own hash, so the more threads you have the more memory you will use. If you are not saving much data, this will not bother you, but obviously if you save a lot of high-resolution data you may start to use a lot of RAM. </div>
 
-<div class="standard" id='magicparlabel-3117'>You should bin your hash keys to save RAM: consider this example. If you save the luminosity at each timestep, you will end up with hashes with keys (e.g.) 1.0, 1.0001, 1.0002, 1.0003 etc. Very quickly – in seconds! – you will have more data than you or your RAM can handle. Instead, bin your data and use logarithms when you can. Binary_grid has a bin_data function for this, e.g.&nbsp;<br />
+<div class="standard" id='magicparlabel-3587'>You should bin your hash keys to save RAM: consider this example. If you save the luminosity at each timestep, you will end up with hashes with keys (e.g.) 1.0, 1.0001, 1.0002, 1.0003 etc. Very quickly – in seconds! – you will have more data than you or your RAM can handle. Instead, bin your data and use logarithms when you can. Binary_grid has a bin_data function for this, e.g.&nbsp;<br />
 <pre class ='listings Perl'>$logL=bin_data(log10($L),0.1);</pre><br />
  bins the logarithm of <span style='font-family:monospace;font-size: 18px;'>$L</span> (e.g. the luminosity) to the nearest <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -4233,7 +4571,7 @@ Each thread stores its data in its own hash, so the more threads you have the mo
   </mrow>
  </mrow></mstyle></math>. </div>
 
-<div class="standard" id='magicparlabel-3122'>Remember that if each thread uses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3592'>Remember that if each thread uses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>N</mi>
  </mrow></mstyle></math> megabytes of RAM and you have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>n</mi>
@@ -4247,12 +4585,12 @@ Each thread stores its data in its own hash, so the more threads you have the mo
   <mrow><mo>&lt;</mo><mn>2</mn><mi>n</mi><mi>N</mi>
   </mrow>
  </mrow></mstyle></math>, your grid may fail at the thread join step if there is not sufficient RAM. In the case of an <span class="flex_software">HTCondor</span> or <span class="flex_software">slurm</span> grid, your data files are preserved and you can simply rerun the final grid join step on a machine with more memory.</div>
-<h4 class="subsubsection" id='magicparlabel-3131'><span class="subsubsection_label">5.22.4</span> <span style='font-family:monospace;font-size: 18px;'>threadinfo</span> variables</h4>
-<div class="standard" id='magicparlabel-3132'><div id="subsec_thread_variables"></div>
+<h4 class="subsubsection" id='magicparlabel-3601'><span class="subsubsection_label">6.22.4</span> <span style='font-family:monospace;font-size: 18px;'>threadinfo</span> variables</h4>
+<div class="standard" id='magicparlabel-3602'><div id="subsec_thread_variables"></div>
 Each thread sets its own copy of the<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_perlcode">_threadinfo</span> hash inside the<em> <span class='math'>\binarygrid2</span>
  </em>object, containing information relevant only to the thread. Most of this is used internally but you have access to it (do not change it unless you know what you are doing!).</div>
 
-<ol class='lyxlist' id='magicparlabel-3137'><li class="labeling_item"><span class='lyxlist'>evcode_pid</span>
+<ol class='lyxlist' id='magicparlabel-3607'><li class="labeling_item"><span class='lyxlist'>evcode_pid</span>
  <span class='math'>binary_c</i></span>
  process id associated with this thread (only for <span class="flex_scriptinglanguage">Perl</span><em> </em>backend)</li>
 <li class="labeling_item"><span class='lyxlist'>cmd</span>
@@ -4287,20 +4625,20 @@ Each thread sets its own copy of the<span style='font-family:monospace;font-size
 <li class="labeling_item"><span class='lyxlist'>thread_prev_complaint</span>
  Thread timer (from <span class="flex_perlcode">time()</span>): this is the time the thread last registered a complaint about taking too long</li>
 </ol>
-<div class="standard" id='magicparlabel-3193'><br />
+<div class="standard" id='magicparlabel-3663'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3194'><span class="subsection_label">5.23</span> Debugging, benchmarking and advanced topics</h3>
-<div class="standard" id='magicparlabel-3195'><div id="sec_debugging"></div>
+<h3 class="subsection" id='magicparlabel-3664'><span class="subsection_label">6.23</span> Debugging, benchmarking and advanced topics</h3>
+<div class="standard" id='magicparlabel-3665'><div id="sec_debugging"></div>
 This section provides a summary of debugging options and suggestions for ways to fix your code (or<em> <span class='math'>\binarygrid</span>
 </em>!). </div>
-<h4 class="subsubsection" id='magicparlabel-3196'><span class="subsubsection_label">5.23.1</span> Debugging options</h4>
-<div class="standard" id='magicparlabel-3197'>The following <span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-3666'><span class="subsubsection_label">6.23.1</span> Debugging options</h4>
+<div class="standard" id='magicparlabel-3667'>The following <span class='math'>\binarygrid</span>
 2 object variables affect debugging:</div>
 
-<ul class="itemize" id='magicparlabel-3198'><li class="itemize_item"><span class="flex_perlcode">vb</span>
+<ul class="itemize" id='magicparlabel-3668'><li class="itemize_item"><span class="flex_perlcode">vb</span>
 <br />
 
-See Section&nbsp;<a href="#subsec_Verbosity">5.23.2</a> below.</li>
+See Section&nbsp;<a href="#subsec_Verbosity">6.23.2</a> below.</li>
 <li class="itemize_item"><span class="flex_perlcode">tvb</span><span style='font-family:monospace;font-size: 18px;'> </span>controls individual thread logging.</li>
 <li class="itemize_item"><span class="flex_perlcode">log_args</span> will output the arguments sent to<em> <span class='math'>binary_c</i></span>
  </em>in files in 
@@ -4407,9 +4745,9 @@ See Section&nbsp;<a href="#subsec_Verbosity">5.23.2</a> below.</li>
  </mrow></mstyle></math>, and the values contain the appropriate data. Again, this is accessible from <span class="flex_perlcode">parse_bse</span>. </li>
 <li class="itemize_item">Use the <span class="flex_perlcode">timeout</span> feature if your code is freezing. This is <em>not</em> the same as fixing your problem, but you may be able to stop the code from using all your CPU when it freezes! (Note that this uses <span class="flex_os">Unix</span> signals to test for timeouts: it may not work e.g.&nbsp;with the <span class="flex_software">HTCondor</span>/<span class="flex_software">slurm</span> queueing system).</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-3277'><span class="subsubsection_label">5.23.2</span> Verbosity<div id="subsec_Verbosity"></div>
+<h4 class="subsubsection" id='magicparlabel-3747'><span class="subsubsection_label">6.23.2</span> Verbosity<div id="subsec_Verbosity"></div>
 </h4>
-<div class="standard" id='magicparlabel-3278'><span style='font-family:monospace;font-size: 18px;'>vb</span> controls the amount of grid output to the screen, usually lines showing the number of stars evolved, the total number in the grid, the current time, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3748'><span style='font-family:monospace;font-size: 18px;'>vb</span> controls the amount of grid output to the screen, usually lines showing the number of stars evolved, the total number in the grid, the current time, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>M</mi>
@@ -4435,13 +4773,13 @@ See Section&nbsp;<a href="#subsec_Verbosity">5.23.2</a> below.</li>
  <mrow>%
  </mrow></mstyle></math> grid completion, estimated time until arrival (finish) i.e. <em>ETA</em>, <em>tpr</em> (time per run), <em>ETF</em> (estimated time at which it will finish) and memory usage. If set to 1 it shows output every second or every <span style='font-family:monospace;font-size: 18px;'>nmod</span> models. </div>
 
-<div class="standard" id='magicparlabel-3279'>If <span style='font-family:monospace;font-size: 18px;'>vb</span> is set to <span style='font-family:monospace;font-size: 18px;'>2</span> then more output, showing the arguments sent to <span class='math'>binary_c</i></span>, will be dumped onto the screen for each model. This is only useful for small grids, for large grids it will overwhelm you. It is possible to set <span style='font-family:monospace;font-size: 18px;'>vb=3</span> for even more output.
+<div class="standard" id='magicparlabel-3749'>If <span style='font-family:monospace;font-size: 18px;'>vb</span> is set to <span style='font-family:monospace;font-size: 18px;'>2</span> then more output, showing the arguments sent to <span class='math'>binary_c</i></span>, will be dumped onto the screen for each model. This is only useful for small grids, for large grids it will overwhelm you. It is possible to set <span style='font-family:monospace;font-size: 18px;'>vb=3</span> for even more output.
 <br />
 
 Note that as of <em><span class='math'>\binarygrid</span>
-</em> 0.18 it is impossible to set <span style='font-family:monospace;font-size: 18px;'>vb</span> from inside your script if you are using the two-stage bootstrapping (which you really should, see Section&nbsp;<a href="#subsec_Two_stage_bootstrapping">5.23.4</a> below): it <em>must</em> be sent on the command line that runs your script.</div>
+</em> 0.18 it is impossible to set <span style='font-family:monospace;font-size: 18px;'>vb</span> from inside your script if you are using the two-stage bootstrapping (which you really should, see Section&nbsp;<a href="#subsec_Two_stage_bootstrapping">6.23.4</a> below): it <em>must</em> be sent on the command line that runs your script.</div>
 
-<div class="standard" id='magicparlabel-3280'>Inside <span class="flex_perlmodule"><i>binary_grid2</i>.pm</span> are many <span class="flex_perlcode">vbout(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3750'>Inside <span class="flex_perlmodule"><i>binary_grid2</i>.pm</span> are many <span class="flex_perlcode">vbout(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>n</mi>
  </mrow></mstyle></math>,&hellip;);</span> statements. These control the verbose output from<em> <span class='math'>\binarygrid</span>
 2</em>, such that the statement is output to the screen <em>only if </em><span style='font-family:monospace;font-size: 18px;'>vb</span><em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -4449,52 +4787,52 @@ Note that as of <em><span class='math'>\binarygrid</span>
   <mrow><mo> &ge; </mo><mi>n</mi>
   </mrow>
  </mrow></mstyle></math></em>. If you want to insert new verbose statements, please use this format!</div>
-<h4 class="subsubsection" id='magicparlabel-3289'><span class="subsubsection_label">5.23.3</span> Benchmarking with subroutine timers<div id="subsec_Subroutine_timers"></div>
+<h4 class="subsubsection" id='magicparlabel-3759'><span class="subsubsection_label">6.23.3</span> Benchmarking with subroutine timers<div id="subsec_Subroutine_timers"></div>
 </h4>
-<div class="standard" id='magicparlabel-3290'><b>Warning:timers have not been tested with <i>binary_grid2</i></b></div>
+<div class="standard" id='magicparlabel-3760'><b>Warning:timers have not been tested with <i>binary_grid2</i></b></div>
 
-<div class="standard" id='magicparlabel-3291'>If your grid is running slowly, you can use subroutine timers by first setting:</div>
+<div class="standard" id='magicparlabel-3761'>If your grid is running slowly, you can use subroutine timers by first setting:</div>
 
-<div class="standard" id='magicparlabel-3292'><br />
+<div class="standard" id='magicparlabel-3762'><br />
 <pre class ='listings Perl'>$population-&gt;timers=1;</pre><br />
 <span style='font-family:monospace;font-size: 18px;'> </span>and then make a list of subroutines you would like to time:</div>
 
-<div class="standard" id='magicparlabel-3297'><br />
+<div class="standard" id='magicparlabel-3767'><br />
 <pre class ='listings Perl'>$population-&gt;timer_subroutines=['main::parse_bse','binary_out','print_binary_in'];</pre><br />
 Note that a default subroutine list is used (see <span class="flex_file"><i>binary_grid2</i>.pm</span>) which includes most of the subroutines in <span class='math'>\binarygrid</span>
 . To see the results of the subroutine timing, put a call to</div>
 
-<div class="standard" id='magicparlabel-3306'><br />
+<div class="standard" id='magicparlabel-3776'><br />
 <pre class ='listings Perl'>output_binary_grid_timers();</pre><br />
 in your script before it exits.</div>
 
-<div class="standard" id='magicparlabel-3311'>There is considerable overhead in activating subroutine timers, so your grid will run possibly up to twice as slow as normal. Timers should <em>not</em> be used for production code, but are very useful if you want to know what is slowing you down.</div>
+<div class="standard" id='magicparlabel-3781'>There is considerable overhead in activating subroutine timers, so your grid will run possibly up to twice as slow as normal. Timers should <em>not</em> be used for production code, but are very useful if you want to know what is slowing you down.</div>
 
-<div class="standard" id='magicparlabel-3312'>Note that some subroutines are designed to sit and wait for something to happen (e.g. <em>binary_out</em>) and these will therefore use up a lot of time. This is normal: I have gone to great length to make these functions as fast as possible (while keeping debugging and code-crash checking) – if you can make them faster, great, but this will be difficult if you want stability and error-checking.</div>
-<h4 class="subsubsection" id='magicparlabel-3313'><span class="subsubsection_label">5.23.4</span> Two-stage bootstrapping<div id="subsec_Two_stage_bootstrapping"></div>
+<div class="standard" id='magicparlabel-3782'>Note that some subroutines are designed to sit and wait for something to happen (e.g. <em>binary_out</em>) and these will therefore use up a lot of time. This is normal: I have gone to great length to make these functions as fast as possible (while keeping debugging and code-crash checking) – if you can make them faster, great, but this will be difficult if you want stability and error-checking.</div>
+<h4 class="subsubsection" id='magicparlabel-3783'><span class="subsubsection_label">6.23.4</span> Two-stage bootstrapping<div id="subsec_Two_stage_bootstrapping"></div>
 </h4>
-<div class="standard" id='magicparlabel-3314'><b>Warning: bootstrapping is no longer of much concern in <em><i>binary_grid2</i></em>, even though it still works for some of the module code. The backend modules are <em>not </em>bootstrapped because it is simply impossible to do so.</b></div>
+<div class="standard" id='magicparlabel-3784'><b>Warning: bootstrapping is no longer of much concern in <em><i>binary_grid2</i></em>, even though it still works for some of the module code. The backend modules are <em>not </em>bootstrapped because it is simply impossible to do so.</b></div>
 
-<div class="standard" id='magicparlabel-3315'>As of version 0.18 of <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-3785'>As of version 0.18 of <span class='math'>\binarygrid</span>
  and hence inherited in <span class='math'>\binarygrid</span>
 2, the <span class='math'>\binarygrid</span>
 2 module is loaded using a two-stage bootstrap technique. The aim of this is to reduce the overhead of using verbose debugging statements (and the like) in the <em><span class='math'>\binarygrid</span>
  </em>code by removing unnecessary code at runtime <em>prior to compilation</em>. Perl is a superb language for doing this by means of its <span class="flex_perlcode">eval</span> command. Roughly, when you load <span class="flex_file"><i>binary_grid2</i>.pm</span> the following happens:</div>
 
-<ol class="enumerate" id='magicparlabel-3324'><li class="enumerate_item">The module loads a few basic subroutines, including <span class="flex_perlcode">parse_args</span> to check the command line arguments, especially to look for a <span class="flex_args">vb=n</span> switch that controls verbosity.</li>
+<ol class="enumerate" id='magicparlabel-3794'><li class="enumerate_item">The module loads a few basic subroutines, including <span class="flex_perlcode">parse_args</span> to check the command line arguments, especially to look for a <span class="flex_args">vb=n</span> switch that controls verbosity.</li>
 <li class="enumerate_item">The variable <span class="flex_perlcode">$binary_grid_code</span> is set up: this contains most of the module code. This is then filtered to remove <span class="flex_perlcode">vbout()</span> and <span class="flex_perlcode">verbose_output()</span> statements that would never output anything, based on your choice of the <span class="flex_perlcode">vb</span> <span class="flex_perlcode">grid_option</span> (as given in the arguments to your script). Note that the useless code is <em>completely removed</em> rather than left to always do nothing.</li>
 <li class="enumerate_item">The <span class="flex_perlcode">$binary_grid_code</span> is <span class="flex_perlcode">eval</span>d, i.e. compiled at runtime.</li>
 </ol>
-<div class="standard" id='magicparlabel-3363'>This <em>bootstrapping</em> eliminates the overhead of calls to the vbout subroutine, and its check of the <span style='font-family:monospace;font-size: 18px;'>vb</span> variable. You may think this overhead is small, but it really is not. The reason is that the arguments to a <span class="flex_software">Perl</span> subroutine are evaluated <em>prior </em>to the call. This often makes sense, but if the arguments are (say) long lists that need joining, this takes valuable CPU time – and for nothing!</div>
+<div class="standard" id='magicparlabel-3833'>This <em>bootstrapping</em> eliminates the overhead of calls to the vbout subroutine, and its check of the <span style='font-family:monospace;font-size: 18px;'>vb</span> variable. You may think this overhead is small, but it really is not. The reason is that the arguments to a <span class="flex_software">Perl</span> subroutine are evaluated <em>prior </em>to the call. This often makes sense, but if the arguments are (say) long lists that need joining, this takes valuable CPU time – and for nothing!</div>
 
-<div class="standard" id='magicparlabel-3368'>Benchmarking tests with subroutine timers (see Section&nbsp;<a href="#subsec_Subroutine_timers">5.23.3</a>) show a considerable saving by using this technique, sometimes up to a factor of two in runtime. Bootstrapping is set to be on by default, but can be disabled by setting
+<div class="standard" id='magicparlabel-3838'>Benchmarking tests with subroutine timers (see Section&nbsp;<a href="#subsec_Subroutine_timers">6.23.3</a>) show a considerable saving by using this technique, sometimes up to a factor of two in runtime. Bootstrapping is set to be on by default, but can be disabled by setting
 <br />
 
 <br />
 <pre class ='listings Perl'>$binary_grid::grid_options{binary_grid_code_filtering}=0;</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-3373'>If you have problems, e.g. the <span class="flex_perlcode">eval()</span><em> </em>step fails, you should be able to spot this at module installation time (e.g.<em> </em><span class="flex_software">cpanm</span> will fail). Alternatively, you can set
+<div class="standard" id='magicparlabel-3843'>If you have problems, e.g. the <span class="flex_perlcode">eval()</span><em> </em>step fails, you should be able to spot this at module installation time (e.g.<em> </em><span class="flex_software">cpanm</span> will fail). Alternatively, you can set
 <br />
 
 <span class="flex_perlcode">$binary_grid::grid_options{pre_filter_file}</span> and
@@ -4502,27 +4840,27 @@ in your script before it exits.</div>
 
  <span class="flex_perlcode">$binary_grid::grid_options{post_filter_file}</span> to dump the contents of <span class="flex_perlcode">$binary_grid_code</span> to files, which you can then diff to determine what went wrong. </div>
 
-<div class="standard" id='magicparlabel-3394'>Note that, if you use the bootstrapping – which you really should! – you <em>must</em> set <span style='font-family:monospace;font-size: 18px;'>vb</span> in the arguments to your script. Any later settings (e.g. setting the variable manually inside your script) will be ignored.</div>
+<div class="standard" id='magicparlabel-3864'>Note that, if you use the bootstrapping – which you really should! – you <em>must</em> set <span style='font-family:monospace;font-size: 18px;'>vb</span> in the arguments to your script. Any later settings (e.g. setting the variable manually inside your script) will be ignored.</div>
 
-<div class="standard" id='magicparlabel-3395'><br />
+<div class="standard" id='magicparlabel-3865'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3396'><span class="subsection_label">5.24</span> Future Plans</h3>
-<div class="standard" id='magicparlabel-3397'><div id="sec_future_plans"></div>
+<h3 class="subsection" id='magicparlabel-3866'><span class="subsection_label">6.24</span> Future Plans</h3>
+<div class="standard" id='magicparlabel-3867'><div id="sec_future_plans"></div>
 </div>
 
-<ul class="itemize" id='magicparlabel-3398'><li class="itemize_item">A graphical frontend would be good! Please write one for me.</li>
+<ul class="itemize" id='magicparlabel-3868'><li class="itemize_item">A graphical frontend would be good! Please write one for me.</li>
 </ul>
-<div class="standard" id='magicparlabel-3399'><br />
+<div class="standard" id='magicparlabel-3869'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3400'><span class="subsection_label">5.25</span> Cookbook</h3>
-<div class="standard" id='magicparlabel-3401'><div id="sec_Cookbook"></div>
+<h3 class="subsection" id='magicparlabel-3870'><span class="subsection_label">6.25</span> Cookbook</h3>
+<div class="standard" id='magicparlabel-3871'><div id="sec_Cookbook"></div>
 This section contains some examples of how to use <i>binary_grid</i>, so refers to old code (which I have updated where I can). I will fill this in for<b> <span class='math'>\binarygrid2</span>
  </b>at some point.</div>
-<h4 class="subsubsection" id='magicparlabel-3402'><span class="subsubsection_label">5.25.1</span> Star Formation History</h4>
-<div class="standard" id='magicparlabel-3403'><div id="Recipe_SFR"></div>
+<h4 class="subsubsection" id='magicparlabel-3872'><span class="subsubsection_label">6.25.1</span> Star Formation History</h4>
+<div class="standard" id='magicparlabel-3873'><div id="Recipe_SFR"></div>
 You may not want to use a constant star formation rate (SFR). If you can live with all your models having the same input physics (i.e. metallicity, etc.) you can easily fold in a star formation history (SFH).</div>
 
-<ol class="enumerate" id='magicparlabel-3404'><li class="enumerate_item">Make sure you know the <em>time</em> at each output of <span class='math'>binary_c</i></span>, let's call this <span style='font-family:monospace;font-size: 18px;'>$t</span>.</li>
+<ol class="enumerate" id='magicparlabel-3874'><li class="enumerate_item">Make sure you know the <em>time</em> at each output of <span class='math'>binary_c</i></span>, let's call this <span style='font-family:monospace;font-size: 18px;'>$t</span>.</li>
 <li class="enumerate_item">You also need <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>d</mi><mi>t</mi><mo> &times; </mo><mi>p</mi>
@@ -4532,9 +4870,9 @@ You may not want to use a constant star formation rate (SFR). If you can live wi
 <pre class ='listings Perl'>$dtp *= SFR($binary_grid::bse_options{'max_evolution_time'}-$t);</pre><br />
 </span></li>
 </ol>
-<div class="standard" id='magicparlabel-3419'>You have to write the SFR function yourself, e.g.,</div>
+<div class="standard" id='magicparlabel-3889'>You have to write the SFR function yourself, e.g.,</div>
 
-<div class="standard" id='magicparlabel-3420'><br />
+<div class="standard" id='magicparlabel-3890'><br />
 <pre class ='listings Perl'>sub SFR
 {
 	# SFR as a function of Galactic age in Myr
@@ -4545,7 +4883,7 @@ You may not want to use a constant star formation rate (SFR). If you can live wi
 }</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-3432'>How does this work? What you're passing into the SFR function is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3902'>How does this work? What you're passing into the SFR function is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
    <msub subscriptshift="0.2ex">
@@ -4573,26 +4911,26 @@ You may not want to use a constant star formation rate (SFR). If you can live wi
   </msub>
  </mrow></mstyle></math> ago.</div>
 
-<div class="standard" id='magicparlabel-3433'>This does not describe the overall normalization, e.g. if you want <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3903'>This does not describe the overall normalization, e.g. if you want <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>N</mi>
  </mrow></mstyle></math> stars in total. You have to add up the statistic appropriate to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>N</mi>
  </mrow></mstyle></math> (i.e. the number of stars seen <em>now</em>) and apply this to your results.</div>
-<h4 class="subsubsection" id='magicparlabel-3434'><span class="subsubsection_label">5.25.2</span> Aliasing</h4>
-<div class="standard" id='magicparlabel-3435'><div id="Recipe_aliasing"></div>
+<h4 class="subsubsection" id='magicparlabel-3904'><span class="subsubsection_label">6.25.2</span> Aliasing</h4>
+<div class="standard" id='magicparlabel-3905'><div id="Recipe_aliasing"></div>
 You output your histogram but it's all spiky and noisy! What's wrong? The simple answer is that you don't have enough stars on your grid for the bin width of your histogram. (See e.g. 
 <br />
 
 <a href="http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem">http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem</a>) Solutions are:</div>
 
-<ol class="enumerate" id='magicparlabel-3436'><li class="enumerate_item">More stars</li>
+<ol class="enumerate" id='magicparlabel-3906'><li class="enumerate_item">More stars</li>
 <li class="enumerate_item">Wider bins</li>
 </ol>
-<div class="standard" id='magicparlabel-3438'>Now, I hear you cry that your old Monte Carlo code gives a lovely smooth histogram. Yes, for the same number of stars, it might. But it might also give you worse spikes. With a MC code you can never guarantee resolution, and in the limit of a large number of stars the result is the same. At least with a grid-based solution you can <em>see</em> the spikes so you <em>know </em>the limit of your resolution. With an MC code you're just playing dice (see the FAQ <a href="#FAQ_why_not_MC_">5.26.1</a>).</div>
+<div class="standard" id='magicparlabel-3908'>Now, I hear you cry that your old Monte Carlo code gives a lovely smooth histogram. Yes, for the same number of stars, it might. But it might also give you worse spikes. With a MC code you can never guarantee resolution, and in the limit of a large number of stars the result is the same. At least with a grid-based solution you can <em>see</em> the spikes so you <em>know </em>the limit of your resolution. With an MC code you're just playing dice (see the FAQ <a href="#FAQ_why_not_MC_">6.26.1</a>).</div>
 
-<div class="standard" id='magicparlabel-3439'>Usually I just run with more stars. See also Recipe&nbsp;<a href="#Recipe_SFR">5.25.1</a> above.</div>
-<h4 class="subsubsection" id='magicparlabel-3440'><span class="subsubsection_label">5.25.3</span> Time-resolved mass grid</h4>
-<div class="standard" id='magicparlabel-3441'><div id="Recipe_time_resolved_mass_grid"></div>
+<div class="standard" id='magicparlabel-3909'>Usually I just run with more stars. See also Recipe&nbsp;<a href="#Recipe_SFR">6.25.1</a> above.</div>
+<h4 class="subsubsection" id='magicparlabel-3910'><span class="subsubsection_label">6.25.3</span> Time-resolved mass grid</h4>
+<div class="standard" id='magicparlabel-3911'><div id="Recipe_time_resolved_mass_grid"></div>
 Some problems require a more carefully spaced grid than the simple <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mo> ln </mo><mi>M</mi>
@@ -4648,7 +4986,7 @@ Some problems require a more carefully spaced grid than the simple <math xmlns="
  <mrow><mi>t</mi>
  </mrow></mstyle></math> is large. </div>
 
-<div class="standard" id='magicparlabel-3442'>We could just set a normal log-mass grid and have a very large resolution. A smarter alternative is to set up the grid to <em>enforce </em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3912'>We could just set a normal log-mass grid and have a very large resolution. A smarter alternative is to set up the grid to <em>enforce </em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>M</mi><mo>=</mo><mi>f</mi><mo> &times; </mo><mi> &delta; </mi><mi>t</mi><mo>/</mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
 
@@ -4673,9 +5011,9 @@ Some problems require a more carefully spaced grid than the simple <math xmlns="
   </mrow>
  </mrow></mstyle></math> grid, are available in <em><i>binary_grid</i></em> via the <em>spacing_functions </em>module.</div>
 
-<div class="standard" id='magicparlabel-3443'>In the HRD project with Peter Anders, I use the following:</div>
+<div class="standard" id='magicparlabel-3913'>In the HRD project with Peter Anders, I use the following:</div>
 
-<div class="standard" id='magicparlabel-3444'><br />
+<div class="standard" id='magicparlabel-3914'><br />
 <pre class ='listings Perl'># Mass 1
 $binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
 {
@@ -4712,7 +5050,7 @@ $binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
 };</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-3482'>The key line is <span class="flex_perlcode">time_adaptive_mass_grid_log10_step=&gt;0.05</span> which specifies that I want (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-3952'>The key line is <span class="flex_perlcode">time_adaptive_mass_grid_log10_step=&gt;0.05</span> which specifies that I want (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mo> log </mo>
@@ -4729,8 +5067,8 @@ $binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
    </mstyle>
   </mrow>
  </mrow></mstyle></math>. Note how I set up the <span class="flex_perlcode">$const_dt_opts</span> anonymous hash of options and then send it via the spacing function with the option '<span class="flex_perlcode">reset</span>'. This sets up a list of masses which are just returned for each call to <span class="flex_perlcode">const_dt()</span> with the '<span class="flex_perlcode">next</span>' parameter. Calling <span class="flex_perlcode">const_dt()</span> with the '<span class="flex_perlcode">resolution</span>' parameter just returns the number of masses in the list, which is trivially the resolution.</div>
-<h4 class="subsubsection" id='magicparlabel-3511'><span class="subsubsection_label">5.25.4</span> Single and binary stars combined</h4>
-<div class="standard" id='magicparlabel-3512'><div id="Recipe_Single_and_binary_stars"></div>
+<h4 class="subsubsection" id='magicparlabel-3981'><span class="subsubsection_label">6.25.4</span> Single and binary stars combined</h4>
+<div class="standard" id='magicparlabel-3982'><div id="Recipe_Single_and_binary_stars"></div>
 You can set up a grid containing both single and binary stars quite easily. The following code defines a grid variable &ldquo;<em>duplicity</em>&rdquo; which is either <span class="flex_perlcode">0</span> or <span class="flex_perlcode">1</span>, and sets the <span class="flex_perlcode">grid_option</span> &ldquo;binary&rdquo; appropriately. Deeper nested grid variables can then depend on the duplicity and choose, through the <em>condition </em>variable, whether to execute grids over <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
@@ -4741,7 +5079,7 @@ You can set up a grid containing both single and binary stars quite easily. The
   </msub>
  </mrow></mstyle></math> and beyond.</div>
 
-<div class="standard" id='magicparlabel-3525'><br />
+<div class="standard" id='magicparlabel-3995'><br />
 <pre class ='listings Perl'># duplicity
 $binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
 {
@@ -4755,45 +5093,45 @@ $binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
 	'noprobdist'=&gt;1,
 };</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-3541'><span class="subsubsection_label">5.25.5</span> Snapshots: I want to stop a grid and restart later</h4>
-<div class="standard" id='magicparlabel-3542'><div id="subsec_snapshotting"></div>
+<h4 class="subsubsection" id='magicparlabel-4011'><span class="subsubsection_label">6.25.5</span> Snapshots: I want to stop a grid and restart later</h4>
+<div class="standard" id='magicparlabel-4012'><div id="subsec_snapshotting"></div>
 The ability to stop and restart the grid is called <em>snapshotting</em>. Note that while this currently works, it assumes that you:</div>
 
-<ol class="enumerate" id='magicparlabel-3543'><li class="enumerate_item">Use the identical grid script to restart</li>
+<ol class="enumerate" id='magicparlabel-4013'><li class="enumerate_item">Use the identical grid script to restart</li>
 <li class="enumerate_item">Do not change any of your installation (<span class='math'>binary_c</i></span>, <span class='math'>\binarygrid</span>
 &nbsp;etc.) between stopping and restarting, </li>
 </ol>
-<div class="standard" id='magicparlabel-3545'>thus snapshotting is quite limited in its functionality but it might save your data when your computer is about to die.</div>
-<h4 class="subsubsection" id='magicparlabel-3546'><span class="subsubsection_label">5.25.6</span> Suspending the grid</h4>
-<div class="standard" id='magicparlabel-3547'><em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4015'>thus snapshotting is quite limited in its functionality but it might save your data when your computer is about to die.</div>
+<h4 class="subsubsection" id='magicparlabel-4016'><span class="subsubsection_label">6.25.6</span> Suspending the grid</h4>
+<div class="standard" id='magicparlabel-4017'><em><span class='math'>\binarygrid</span>
 </em> looks in files, defined in <span class="flex_perlcode">$binary_grid::grid_options{'suspend_files'}=[&hellip;]</span>, and if one exists, it executes its snapshot code. To make one exist, use the <span class="flex_scriptinglanguage">Unix</span> command <span class="flex_command">touch</span><em> </em>e.g. </div>
 
-<div class="standard" id='magicparlabel-3560'><br />
+<div class="standard" id='magicparlabel-4030'><br />
 <pre class ='listings'>touch /tmp/force_binary_c_suspend</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-3565'>This joins all the current threads and saves their data in one file so you can restart it later. It may take some time to join all the threads, so please be patient. By default, <i>binary_grid</i> looks at the files <span class="flex_file">/tmp/force_binary_c_suspend</span> and <span class="flex_perlcode">./force_binary_c_suspend</span> (although you can add your own with <span class="flex_perlcode">push(@$binary_grid::grid_options{'suspend_files'}, &ldquo;new filename&rdquo;);)</span></div>
+<div class="standard" id='magicparlabel-4035'>This joins all the current threads and saves their data in one file so you can restart it later. It may take some time to join all the threads, so please be patient. By default, <i>binary_grid</i> looks at the files <span class="flex_file">/tmp/force_binary_c_suspend</span> and <span class="flex_perlcode">./force_binary_c_suspend</span> (although you can add your own with <span class="flex_perlcode">push(@$binary_grid::grid_options{'suspend_files'}, &ldquo;new filename&rdquo;);)</span></div>
 
-<div class="standard" id='magicparlabel-3578'>The saved file name is defined in <span class="flex_perlcode">$binary_grid::grid_options{'snapshot_file'}</span> (default <span style='font-family:monospace;font-size: 18px;'>'</span><span class="flex_file">/tmp/<i>binary_c</i>-snapshot</span><span style='font-family:monospace;font-size: 18px;'>'</span>).</div>
+<div class="standard" id='magicparlabel-4048'>The saved file name is defined in <span class="flex_perlcode">$binary_grid::grid_options{'snapshot_file'}</span> (default <span style='font-family:monospace;font-size: 18px;'>'</span><span class="flex_file">/tmp/<i>binary_c</i>-snapshot</span><span style='font-family:monospace;font-size: 18px;'>'</span>).</div>
 
-<div class="standard" id='magicparlabel-3587'>All the above <span class="flex_file">/tmp/</span> are actually <span class="flex_perlcode">$binary_grid::grid_options{tmp}</span> so you can define your own location for all the files (which is probably more secure, because then you can prevent anyone from touching the file and stopping your grid).</div>
-<h4 class="subsubsection" id='magicparlabel-3596'><span class="subsubsection_label">5.25.7</span> Restarting the grid</h4>
-<div class="standard" id='magicparlabel-3597'>If <span class="flex_perlcode">$binary_grid::grid_options{starting_snapshot_file}</span> is defined, it is used to load in a previously saved snapshot and the grid is restarted. You can usually just load this on the command line, e.g. by running your grid script as</div>
+<div class="standard" id='magicparlabel-4057'>All the above <span class="flex_file">/tmp/</span> are actually <span class="flex_perlcode">$binary_grid::grid_options{tmp}</span> so you can define your own location for all the files (which is probably more secure, because then you can prevent anyone from touching the file and stopping your grid).</div>
+<h4 class="subsubsection" id='magicparlabel-4066'><span class="subsubsection_label">6.25.7</span> Restarting the grid</h4>
+<div class="standard" id='magicparlabel-4067'>If <span class="flex_perlcode">$binary_grid::grid_options{starting_snapshot_file}</span> is defined, it is used to load in a previously saved snapshot and the grid is restarted. You can usually just load this on the command line, e.g. by running your grid script as</div>
 
-<div class="standard" id='magicparlabel-3602'><span class="flex_perlcode">./src/perl/scripts/my_grid_script.pl starting_snapshot_file=my_snapshot_file</span></div>
-<h4 class="subsubsection" id='magicparlabel-3607'><span class="subsubsection_label">5.25.8</span> World Domination</h4>
-<div class="standard" id='magicparlabel-3608'><div id="subsec_World_Domination"></div>
+<div class="standard" id='magicparlabel-4072'><span class="flex_perlcode">./src/perl/scripts/my_grid_script.pl starting_snapshot_file=my_snapshot_file</span></div>
+<h4 class="subsubsection" id='magicparlabel-4077'><span class="subsubsection_label">6.25.8</span> World Domination</h4>
+<div class="standard" id='magicparlabel-4078'><div id="subsec_World_Domination"></div>
 </div>
 
-<div class="standard" id='magicparlabel-3609'>I'm working on it. I have started to brew my own beer, does that count?</div>
+<div class="standard" id='magicparlabel-4079'>I'm working on it. I have started to brew my own beer, does that count?</div>
 
-<div class="standard" id='magicparlabel-3610'><br />
+<div class="standard" id='magicparlabel-4080'><br />
 </div>
-<h3 class="subsection" id='magicparlabel-3611'><span class="subsection_label">5.26</span> FAQ</h3>
-<div class="standard" id='magicparlabel-3612'><div id="sec_FAQ"></div>
+<h3 class="subsection" id='magicparlabel-4081'><span class="subsection_label">6.26</span> FAQ</h3>
+<div class="standard" id='magicparlabel-4082'><div id="sec_FAQ"></div>
 Frequently asked questions. </div>
-<h4 class="subsubsection" id='magicparlabel-3613'><span class="subsubsection_label">5.26.1</span> Why&nbsp;not&nbsp;Monte&nbsp;Carlo?</h4>
-<div class="standard" id='magicparlabel-3614'><div id="FAQ_why_not_MC_"></div>
+<h4 class="subsubsection" id='magicparlabel-4083'><span class="subsubsection_label">6.26.1</span> Why&nbsp;not&nbsp;Monte&nbsp;Carlo?</h4>
+<div class="standard" id='magicparlabel-4084'><div id="FAQ_why_not_MC_"></div>
 The alternative to running a grid is a Monte Carlo method, where you throw systems in according to some initial distribution and a random number generator. In the high number limit this should give the <em>same</em> <em>result </em>as a grid. However, in the low-number limit, the results are probably going to be different, and this is when you test your code. The big advantage of a grid is that you have a good handle on <em>errors</em> due to the finite resolution of your sampling of the initial distribution(s) without the smearing out of a Monte Carlo approach. Furthermore, MC may accidentally miss part of the initial parameter space (it is, after all, random) which you know is covered by a grid approach (at least to within a known error e.g. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mo> ln </mo>
@@ -4814,9 +5152,9 @@ The alternative to running a grid is a Monte Carlo method, where you throw syste
   </msub>
  </mrow></mstyle></math>, but on the other hand these might be the systems of particular interest to you!</div>
 
-<div class="standard" id='magicparlabel-3615'><b>Update: there is a monte carlo option to the flexigrid. It is not well tested, but could work for you if you really need it.</b></div>
-<h4 class="subsubsection" id='magicparlabel-3616'><span class="subsubsection_label">5.26.2</span> Why&nbsp;MC&nbsp;SN&nbsp;kicks?</h4>
-<div class="standard" id='magicparlabel-3617'><div id="FAQ_WhyMCSNkicks_"></div>
+<div class="standard" id='magicparlabel-4085'><b>Update: there is a monte carlo option to the flexigrid. It is not well tested, but could work for you if you really need it.</b></div>
+<h4 class="subsubsection" id='magicparlabel-4086'><span class="subsubsection_label">6.26.2</span> Why&nbsp;MC&nbsp;SN&nbsp;kicks?</h4>
+<div class="standard" id='magicparlabel-4087'><div id="FAQ_WhyMCSNkicks_"></div>
 Traditionally supernova (and white dwarf) kicks have had their velocity chosen in a Monte-Carlo way, rather than on a grid. This was left as-is because there are four dimensions for each kick, which – given a coarse grid of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>10</mn><mo> &times; </mo><mn>10</mn><mo> &times; </mo><mn>10</mn><mo> &times; </mo><mn>10</mn>
@@ -4844,37 +5182,37 @@ Traditionally supernova (and white dwarf) kicks have had their velocity chosen i
  </mrow></mstyle></math>, but probably not <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>a</mi>
  </mrow></mstyle></math>.</div>
-<h4 class="subsubsection" id='magicparlabel-3618'><span class="subsubsection_label">5.26.3</span> Zombie&nbsp;<i>binary_c</i>&nbsp;processes </h4>
-<div class="standard" id='magicparlabel-3619'><div id="FAQ_Zombie_binary_c"></div>
+<h4 class="subsubsection" id='magicparlabel-4088'><span class="subsubsection_label">6.26.3</span> Zombie&nbsp;<i>binary_c</i>&nbsp;processes </h4>
+<div class="standard" id='magicparlabel-4089'><div id="FAQ_Zombie_binary_c"></div>
 </div>
 
-<div class="standard" id='magicparlabel-3620'><b>This section is only relevant if you use the <em>Perl </em>backend.</b></div>
+<div class="standard" id='magicparlabel-4090'><b>This section is only relevant if you use the <em>Perl </em>backend.</b></div>
 
-<div class="standard" id='magicparlabel-3621'>When the grid exits abnormally, or is killed, a <em><span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-4091'>When the grid exits abnormally, or is killed, a <em><span class='math'>binary_c</i></span>
  </em>process may be left behind in an infinite loop state and as such will take up your precious CPU time. You will have to kill it manually <em>if you are sure it is not doing anything with another grid process! </em>(Be careful and do <em>not</em> do &ldquo;killall <i>binary_c</i>&rdquo; as root&hellip;)</div>
-<h4 class="subsubsection" id='magicparlabel-3622'><span class="subsubsection_label">5.26.4</span> Zombie&nbsp;Perl&nbsp;processes </h4>
-<div class="standard" id='magicparlabel-3623'><b>This section is only relevant if you use the <em>Perl </em>backend.</b></div>
+<h4 class="subsubsection" id='magicparlabel-4092'><span class="subsubsection_label">6.26.4</span> Zombie&nbsp;Perl&nbsp;processes </h4>
+<div class="standard" id='magicparlabel-4093'><b>This section is only relevant if you use the <em>Perl </em>backend.</b></div>
 
-<div class="standard" id='magicparlabel-3624'><div id="FAQ_Zombie_perl"></div>
+<div class="standard" id='magicparlabel-4094'><div id="FAQ_Zombie_perl"></div>
 These should die naturally when the grid finishes and the Perl script exits. They are harmless and have never been seen to consume CPU time.</div>
-<h4 class="subsubsection" id='magicparlabel-3625'><span class="subsubsection_label">5.26.5</span> Setting&nbsp;functions&nbsp;and/or&nbsp;function&nbsp;pointers </h4>
-<div class="standard" id='magicparlabel-3626'><div id="FAQ_functions_and_pointers"></div>
+<h4 class="subsubsection" id='magicparlabel-4095'><span class="subsubsection_label">6.26.5</span> Setting&nbsp;functions&nbsp;and/or&nbsp;function&nbsp;pointers </h4>
+<div class="standard" id='magicparlabel-4096'><div id="FAQ_functions_and_pointers"></div>
 </div>
 
-<div class="standard" id='magicparlabel-3627'><b>Please set function pointers, not function names, especially with the <i>C</i> backend. I may remove this functionality in future, however convenient it once was. Function names will definitely not work with the <i>C</i> backend.</b></div>
+<div class="standard" id='magicparlabel-4097'><b>Please set function pointers, not function names, especially with the <i>C</i> backend. I may remove this functionality in future, however convenient it once was. Function names will definitely not work with the <i>C</i> backend.</b></div>
 
-<div class="standard" id='magicparlabel-3628'>In the good old days you had to set up function pointers, e.g. <span class="flex_perlcode">\&amp;parse_bse</span>, manually when setting up your grid. However, in the latest version of <em><span class="flex_perlcode">flexigrid()</span></em>, this is set automatically (from <span class="flex_perlcode">\&amp;main::parse_bse</span>). However, you can override the settings. </div>
+<div class="standard" id='magicparlabel-4098'>In the good old days you had to set up function pointers, e.g. <span class="flex_perlcode">\&amp;parse_bse</span>, manually when setting up your grid. However, in the latest version of <em><span class="flex_perlcode">flexigrid()</span></em>, this is set automatically (from <span class="flex_perlcode">\&amp;main::parse_bse</span>). However, you can override the settings. </div>
 
-<div class="standard" id='magicparlabel-3641'>As an example, if you want to set the <span class="flex_perlcode">parse_bse_function_pointer</span>, just set<span style='font-family:monospace;font-size: 18px;'> <br />
+<div class="standard" id='magicparlabel-4111'>As an example, if you want to set the <span class="flex_perlcode">parse_bse_function_pointer</span>, just set<span style='font-family:monospace;font-size: 18px;'> <br />
 <pre class ='listings Perl'>$binary_grid::grid_options{parse_bse_function}='my_parse_bse';</pre><br />
 </span>where <span class="flex_perlcode">my_parse_bse</span> is your new function name. 
 <br />
 
 This will automatically be converted into <span class="flex_perlcode">\&amp;main::my_parse_bse</span> at runtime.</div>
 
-<div class="standard" id='magicparlabel-3658'>This process is applied to any <span class="flex_perlcode">grid_option</span> whose key ends in <span class="flex_perlcode">_function</span>. These include </div>
+<div class="standard" id='magicparlabel-4128'>This process is applied to any <span class="flex_perlcode">grid_option</span> whose key ends in <span class="flex_perlcode">_function</span>. These include </div>
 
-<ul class="itemize" id='magicparlabel-3667'><li class="itemize_item"><span class="flex_perlcode">thread_precreate_function</span></li>
+<ul class="itemize" id='magicparlabel-4137'><li class="itemize_item"><span class="flex_perlcode">thread_precreate_function</span></li>
 <li class="itemize_item"><span class="flex_perlcode">threads_entry_function</span></li>
 <li class="itemize_item"><span class="flex_perlcode">threads_flush_function</span></li>
 <li class="itemize_item"><span class="flex_perlcode">thread_postrun_function</span></li>
@@ -4882,25 +5220,25 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 <li class="itemize_item"><span class="flex_perlcode">threads_join_function</span></li>
 <li class="itemize_item"><span class="flex_perlcode">thread_postjoin_function</span></li>
 </ul>
-<div class="standard" id='magicparlabel-3702'>These are all <span class="flex_perlcode">undef</span> by default, so are ignored (unless you override them with function names), except
+<div class="standard" id='magicparlabel-4172'>These are all <span class="flex_perlcode">undef</span> by default, so are ignored (unless you override them with function names), except
 <br />
 
  <span class="flex_perlcode">threads_join_function</span> which is set to <span class="flex_perlcode">binary_grid::join_flexigrid_thread</span> as usual.</div>
-<h3 class="subsection" id='magicparlabel-3715'><span class="subsection_label">5.27</span> Multi-core scaling</h3>
-<div class="standard" id='magicparlabel-3718'>The <i>binary_grid</i> software is used to run <i>binary_c</i>, and other stellar evolution codes, on either a single CPU or a grid of machines, e.g. with its <span class="flex_software">HTCondor</span> extension module. It is important to know whether <span class='math'>\binarygrid</span>
+<h3 class="subsection" id='magicparlabel-4185'><span class="subsection_label">6.27</span> Multi-core scaling</h3>
+<div class="standard" id='magicparlabel-4188'>The <i>binary_grid</i> software is used to run <i>binary_c</i>, and other stellar evolution codes, on either a single CPU or a grid of machines, e.g. with its <span class="flex_software">HTCondor</span> extension module. It is important to know whether <span class='math'>\binarygrid</span>
  scales appropriately to running on <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>N</mi>
  </mrow></mstyle></math> CPUs. This document answers this question by looking at <em>CPU-bound </em>and <em>IO-bound</em> jobs. In conclusion: it scales very well.<em> </em></div>
-<h3 class="subsection" id='magicparlabel-3723'><span class="subsection_label">5.28</span> Testing Setup</h3>
-<div class="standard" id='magicparlabel-3724'>It is not ideal to use <span class='math'>binary_c</i></span>
+<h3 class="subsection" id='magicparlabel-4193'><span class="subsection_label">6.28</span> Testing Setup</h3>
+<div class="standard" id='magicparlabel-4194'>It is not ideal to use <span class='math'>binary_c</i></span>
  as an evolution code. Instead, a <span class="flex_scriptinglanguage">Perl</span> script called
 <br />
 
-<span class="flex_file">./src/perl/scripts-flexigrid/<i>binary_c</i>-dummy.pl</span> was developed<div class="foot"><span class="foot_label">6</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-3736'>All files are relative to my<em> <span class='math'>binary_c</i></span>
+<span class="flex_file">./src/perl/scripts-flexigrid/<i>binary_c</i>-dummy.pl</span> was developed<div class="foot"><span class="foot_label">6</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-4206'>All files are relative to my<em> <span class='math'>binary_c</i></span>
  </em>branch – or maybe the trunk if I have time to merge it!</div>
 </div></div>. This has the following features:</div>
 
-<ol class="enumerate" id='magicparlabel-3737'><li class="enumerate_item">It can output <em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<ol class="enumerate" id='magicparlabel-4207'><li class="enumerate_item">It can output <em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>n</mi>
@@ -4925,18 +5263,18 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
    </mrow>
   </msub>
  </mrow></mstyle></math> stars, both are free parameters. This simulates I/O limited runs.</li>
-<li class="enumerate_item">It simulates CPU burn (&ldquo;spin&rdquo; mode<div class="foot"><span class="foot_label">7</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-3742'>A <span class="flex_perlcode">while{}</span> loop until a specified time has lapsed.</div>
-</div></div>) or can simply &ldquo;sleep&rdquo; (with no CPU activity<div class="foot"><span class="foot_label">8</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-3750'>A call to the <span class="flex_perlmodule">Time::HiRes</span> <span style='font-family:monospace;font-size: 18px;'>sleep</span> function.</div>
+<li class="enumerate_item">It simulates CPU burn (&ldquo;spin&rdquo; mode<div class="foot"><span class="foot_label">7</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-4212'>A <span class="flex_perlcode">while{}</span> loop until a specified time has lapsed.</div>
+</div></div>) or can simply &ldquo;sleep&rdquo; (with no CPU activity<div class="foot"><span class="foot_label">8</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-4220'>A call to the <span class="flex_perlmodule">Time::HiRes</span> <span style='font-family:monospace;font-size: 18px;'>sleep</span> function.</div>
 </div></div>) for a specified time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi>
   </mrow>
  </mrow></mstyle></math>.</li>
 </ol>
-<div class="standard" id='magicparlabel-3755'>By using this dummy script instead of <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-4225'>By using this dummy script instead of <span class='math'>binary_c</i></span>
  we control the CPU and I/O usage precisely without relying on a complicated, and difficult to predict, piece of code to do it for us.</div>
-<h4 class="subsubsection" id='magicparlabel-3756'><span class="subsubsection_label">5.28.1</span> Multithread overhead</h4>
-<div class="standard" id='magicparlabel-3757'>The <em><span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-4226'><span class="subsubsection_label">6.28.1</span> Multithread overhead</h4>
+<div class="standard" id='magicparlabel-4227'>The <em><span class='math'>\binarygrid</span>
 </em> software is designed to speed up running a full parameter space by splitting the work into <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>N</mi>
  </mrow></mstyle></math> threads (or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -4979,7 +5317,7 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
   </mrow>
  </mrow></mstyle></math>. The runtime of this grid is then subtracted from the runtime of the true grid to accurately calculate the runtime of the grid while it is doing useful work.</div>
 
-<div class="standard" id='magicparlabel-3766'>When the grid resolution is large, e.g. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-4236'>When the grid resolution is large, e.g. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
    <msub subscriptshift="0.2ex">
@@ -4994,16 +5332,16 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
    </msub><mo> &gsim; </mo><mn>1000</mn>
   </mrow>
  </mrow></mstyle></math>, the overhead cost is negligible. It is really only useful to subtract it to obtain more precise results and work with fewer stars.</div>
-<h4 class="subsubsection" id='magicparlabel-3767'><span class="subsubsection_label">5.28.2</span> PC setup</h4>
-<div class="standard" id='magicparlabel-3768'>The tests were run on the <em>klaipeda2 </em>machine at the Argelander Institute for Astronomy (AIfA). This is a 16-core (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<h4 class="subsubsection" id='magicparlabel-4237'><span class="subsubsection_label">6.28.2</span> PC setup</h4>
+<div class="standard" id='magicparlabel-4238'>The tests were run on the <em>klaipeda2 </em>machine at the Argelander Institute for Astronomy (AIfA). This is a 16-core (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>4</mn><mo> &times; </mo>
   </mrow>
  </mrow></mstyle></math> quad-core AMD Opteron 8378) machine with CPU speeds of 2.4GHz (4800 bogomips), 512KB cache and 64GB (shared) RAM. Mostly the cores were empty, occasionally only 15 were available. This has a negligible effect on the results.</div>
 
-<div class="standard" id='magicparlabel-3769'>A few smaller scale tests were carried out on <em>aibn36</em> at the AIfA. This is a 4-core AMD Phenom II X4 945 running at 3GHz (6027 bogomips) with 8GB RAM. This machine was often multitasking with (background) jobs and a full KDE desktop running in the foreground. </div>
-<h4 class="subsubsection" id='magicparlabel-3770'><span class="subsubsection_label">5.28.3</span> Score</h4>
-<div class="standard" id='magicparlabel-3771'>Each test run has an associated <em>score </em>which is defined as, <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-4239'>A few smaller scale tests were carried out on <em>aibn36</em> at the AIfA. This is a 4-core AMD Phenom II X4 945 running at 3GHz (6027 bogomips) with 8GB RAM. This machine was often multitasking with (background) jobs and a full KDE desktop running in the foreground. </div>
+<h4 class="subsubsection" id='magicparlabel-4240'><span class="subsubsection_label">6.28.3</span> Score</h4>
+<div class="standard" id='magicparlabel-4241'>Each test run has an associated <em>score </em>which is defined as, <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mtable>
   <mtr>
    <mtd>
@@ -5080,19 +5418,19 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
   </msub>
  </mrow></mstyle></math> is the number of threads used.</div>
 
-<div class="standard" id='magicparlabel-3772'>A score of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-4242'>A score of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mn>1.0</mn>
  </mrow></mstyle></math> is considered <em>perfect scaling.</em> Higher scores are <em>bad scaling</em> and occasionally scores slightly less than <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mn>1.0</mn>
  </mrow></mstyle></math> are seen. If <span class='math'>\binarygrid</span>
  does its job properly, the score should be around 1.0.</div>
-<h3 class="subsection" id='magicparlabel-3773'><span class="subsection_label">5.29</span> Results</h3>
-<h4 class="subsubsection" id='magicparlabel-3774'><span class="subsubsection_label">5.29.1</span> No CPU (sleep mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<h3 class="subsection" id='magicparlabel-4243'><span class="subsection_label">6.29</span> Results</h3>
+<h4 class="subsubsection" id='magicparlabel-4244'><span class="subsubsection_label">6.29.1</span> No CPU (sleep mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
   </mrow>
  </mrow></mstyle></math>)</h4>
-<div class="standard" id='magicparlabel-3775'>When measuring runtimes in &ldquo;sleep&rdquo; mode it is trivial to test the pure grid and I/O overheads, as the sleep time can be set to zero (i.e. no &ldquo;runtime&rdquo; at all for <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-4245'>When measuring runtimes in &ldquo;sleep&rdquo; mode it is trivial to test the pure grid and I/O overheads, as the sleep time can be set to zero (i.e. no &ldquo;runtime&rdquo; at all for <span class='math'>binary_c</i></span>
 ). <em>By definition</em> these runs are I/O limited because there is no CPU use associated with &ldquo;stellar evolution&rdquo;. Figure&nbsp;<a href="#fig_Timing_tests_klaipeda_dt0">2</a> shows the results. The scaling is <em>not good </em>with scores above 1.0 for all but the runs with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
@@ -5109,9 +5447,9 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
   </mrow>
  </mrow></mstyle></math>. The tests on aibn36 show similar results (Fig.&nbsp;<a href="#fig_Timing_tests_aibn36_dt0">3</a>). </div>
 
-<div class="standard" id='magicparlabel-3776'>The poor results suggest that I/O limited runs do not perfect well when large numbers of threads are employed. Using two threads is still a <em>lot</em> faster than using just one, but after that there is no improvement. </div>
+<div class="standard" id='magicparlabel-4246'>The poor results suggest that I/O limited runs do not perfect well when large numbers of threads are employed. Using two threads is still a <em>lot</em> faster than using just one, but after that there is no improvement. </div>
 
-<div class="standard" id='magicparlabel-3777'>The results can be understood if we consider that our I/O limited jobs <em>run at the maximum possible bandwidth of the CPU</em>. If the <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4247'>The results can be understood if we consider that our I/O limited jobs <em>run at the maximum possible bandwidth of the CPU</em>. If the <span class='math'>\binarygrid</span>
  software <em>already maximises</em> its use of the I/O resources of the machine when running two threads, then running three or more will <em>never </em>result in reduced runtime. This describes the behaviour we see perfectly and is a limitation of the PC rather than <em><span class='math'>\binarygrid</span>
 </em>. The runtime then depends linearly on the product <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -5140,10 +5478,10 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
  </mrow></mstyle></math>, as clearly shown in Figs.&nbsp;<a href="#fig_Timing_tests_klaipeda_dt0">2</a>&nbsp;and&nbsp;<a href="#fig_Timing_tests_aibn36_dt0">3</a>.</div>
 
 
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-3782'><img style='width:85%;' src='images/5.png' alt='image: 11_tmp_binary_c_lyx_images_3.png' />
+<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4252'><img style='width:85%;' src='images/5.png' alt='image: 11_tmp_binary_c_lyx_images_3.png' />
 </div>
 
-<div class="plain_layout" id='magicparlabel-3783'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 2:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="plain_layout" id='magicparlabel-4253'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 2:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
   </mrow>
@@ -5152,10 +5490,10 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 
 
 </div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-3792'><img style='width:85%;' src='images/6.png' alt='image: 12_tmp_binary_c_lyx_images_4.png' />
+<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4262'><img style='width:85%;' src='images/6.png' alt='image: 12_tmp_binary_c_lyx_images_4.png' />
 </div>
 
-<div class="plain_layout" id='magicparlabel-3793'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 3:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="plain_layout" id='magicparlabel-4263'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 3:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
   </mrow>
@@ -5163,12 +5501,12 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 </span></div>
 </div>
 
-<h4 class="subsubsection" id='magicparlabel-3798'><span class="subsubsection_label">5.29.2</span> 1.0s runs (sleep mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<h4 class="subsubsection" id='magicparlabel-4268'><span class="subsubsection_label">6.29.2</span> 1.0s runs (sleep mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1.0</mn>
   </mrow>
  </mrow></mstyle></math>)</h4>
-<div class="standard" id='magicparlabel-3799'>Next up are sleep mode runs with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-4269'>Next up are sleep mode runs with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1.0</mn>
    <mstyle mathvariant='normal'><mi>s</mi>
@@ -5179,10 +5517,10 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
  <mrow><mn>1.0</mn>
  </mrow></mstyle></math> are <em>always</em> achieved, showing the <span class='math'>\binarygrid</span>
  does an excellent job in this case.</div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-3803'><img style='width:85%;' src='images/7.png' alt='image: 13_tmp_binary_c_lyx_images_5.png' />
+<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4273'><img style='width:85%;' src='images/7.png' alt='image: 13_tmp_binary_c_lyx_images_5.png' />
 </div>
 
-<div class="plain_layout" id='magicparlabel-3804'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 4:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="plain_layout" id='magicparlabel-4274'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 4:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1</mn>
   </mrow>
@@ -5190,12 +5528,12 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 </span></div>
 </div>
 
-<h4 class="subsubsection" id='magicparlabel-3809'><span class="subsubsection_label">5.29.3</span> 1.0s runs (spin mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<h4 class="subsubsection" id='magicparlabel-4279'><span class="subsubsection_label">6.29.3</span> 1.0s runs (spin mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1.0</mn>
   </mrow>
  </mrow></mstyle></math>)</h4>
-<div class="standard" id='magicparlabel-3810'>With no I/O (Fig.&nbsp;<a href="#fig_Timing_tests_klaipeda_spin_dt1_Nlines0">5</a>), i.e. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-4280'>With no I/O (Fig.&nbsp;<a href="#fig_Timing_tests_klaipeda_spin_dt1_Nlines0">5</a>), i.e. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
    <msub subscriptshift="0.2ex">
@@ -5215,10 +5553,10 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
   <mrow><mo> &gsim; </mo><mn>100</mn>
   </mrow>
  </mrow></mstyle></math>). With 10 stars and 32 threads, the tests are pretty much meaningless in any case because 22 threads do no work at all! </div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-3814'><img style='width:85%;' src='images/8.png' alt='image: 14_tmp_binary_c_lyx_images_6.png' />
+<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4284'><img style='width:85%;' src='images/8.png' alt='image: 14_tmp_binary_c_lyx_images_6.png' />
 </div>
 
-<div class="plain_layout" id='magicparlabel-3815'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 5:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="plain_layout" id='magicparlabel-4285'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 5:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1</mn>
   </mrow>
@@ -5227,7 +5565,7 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 </div>
 
 
-<div class="standard" id='magicparlabel-3820'>With large amounts of I/O (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-4290'>With large amounts of I/O (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
    <msub subscriptshift="0.2ex">
@@ -5257,10 +5595,10 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
   </mrow>
  </mrow></mstyle></math><em>.</em> Again <span class='math'>\binarygrid</span>
  does a great job.</div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-3824'><img style='width:95%;' src='images/9.png' alt='image: 15_tmp_binary_c_lyx_images_7.png' />
+<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4294'><img style='width:95%;' src='images/9.png' alt='image: 15_tmp_binary_c_lyx_images_7.png' />
 </div>
 
-<div class="plain_layout" id='magicparlabel-3825'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 6:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="plain_layout" id='magicparlabel-4295'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 6:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1</mn>
   </mrow>
@@ -5282,44 +5620,44 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 </span></div>
 </div>
 
-<h3 class="subsection" id='magicparlabel-3830'><span class="subsection_label">5.30</span> Conclusions</h3>
-<div class="standard" id='magicparlabel-3831'><em><span class='math'>\binarygrid</span>
+<h3 class="subsection" id='magicparlabel-4300'><span class="subsection_label">6.30</span> Conclusions</h3>
+<div class="standard" id='magicparlabel-4301'><em><span class='math'>\binarygrid</span>
  </em>does an excellent job of scaling to the number of CPUs available on multi-core architectures. The only exception is when a) the runtime is very short and b) the amount of data I/O is very large.</div>
 
-<div class="standard" id='magicparlabel-3832'>How can we improve this situation? Naturally, the first choice is the limit the amount of output from <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-4302'>How can we improve this situation? Naturally, the first choice is the limit the amount of output from <span class='math'>binary_c</i></span>
  whenever possible. A first step is to for the user to choose what output is <em>truly necessary </em>for their project and only output this. However, this is not always a trivial question to answer. At some level, the CPU and I/O bus of the machine has limited bandwidth, and if it is this that is the bottleneck there is little that can be done <em>except </em>buy better machines or just wait.</div>
 
-<div class="standard" id='magicparlabel-3833'>To investigate whether Perl is the problem, I wrote a new function <span class="flex_perlcode">tbse_lines</span> which, instead of returning data line by line (as traditional calls to <span class="flex_perlcode">tbse_line</span> do) takes the data for each star, bundles it in an array and then sends this back instead (as an array reference). In my tests this actually <em>costs more time</em> than simply sending data line by line, probably because there is overhead involved in setting up an array and returning it. I will leave this in <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4303'>To investigate whether Perl is the problem, I wrote a new function <span class="flex_perlcode">tbse_lines</span> which, instead of returning data line by line (as traditional calls to <span class="flex_perlcode">tbse_line</span> do) takes the data for each star, bundles it in an array and then sends this back instead (as an array reference). In my tests this actually <em>costs more time</em> than simply sending data line by line, probably because there is overhead involved in setting up an array and returning it. I will leave this in <span class='math'>\binarygrid</span>
  (as of version 0.24) for you to try.</div>
 
-<div class="standard" id='magicparlabel-3842'>Other updates to <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4312'>Other updates to <span class='math'>\binarygrid</span>
  version 0.24 include the complete removal of support for separate <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span> streams from the evolution code. I used to handle these streams separately, but if either stream buffer should fill then there would be deadlock. This could happen, for example, if there were a lot of errors so the <span class="flex_cvar">stderr</span> buffer fills before <span class="flex_cvar">stdout</span> is checked again. See also <a href="http://perl.plover.com/FAQs/Buffering.html">http://perl.plover.com/FAQs/Buffering.html</a>.</div>
 
-<div class="standard" id='magicparlabel-3859'>The latest grid <em>should</em> be faster because it combines <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span>. Instead of having to flush the <span class="flex_cvar">stderr</span> buffer for each <span class="flex_cvar">stdout</span> read, it now just blocks on the combined <span class="flex_cvar">stdout</span>/<span class="flex_cvar">stderr</span>. The downside is that the user must detect errors:<em> <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4329'>The latest grid <em>should</em> be faster because it combines <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span>. Instead of having to flush the <span class="flex_cvar">stderr</span> buffer for each <span class="flex_cvar">stdout</span> read, it now just blocks on the combined <span class="flex_cvar">stdout</span>/<span class="flex_cvar">stderr</span>. The downside is that the user must detect errors:<em> <span class='math'>\binarygrid</span>
  </em>can no longer do it. This is generally not a problem because the user only cares about their own lines of data, prefixed with the appropriate header string (e.g.&nbsp;in <span class="flex_perlcode">parse_bse()</span>).</div>
 
-<div class="standard" id='magicparlabel-3888'>I have also considered whether it is the<em> </em>use of pipes to communicate to/from the evolution code that slows down <em><i>binary_grid</i></em> in an I/O dominated case. One way to test this would be to compress the returned data and send it in (say) <span class="flex_software">7zipped</span> or <span class="flex_software">bzipped</span> chunks of data instead of raw <em>ASCII</em> as at present. However, the overhead required for the compression slows down the data transfer so much that this seems to be a non-starter. I tried to compress the array provided by <span class="flex_perlscript">tbse_lines</span> with <span class="flex_perlmodule">Compress::Zlib::memGzip</span> and, while it works, it slowed the test grid – with lots of I/O! – by more than 30%. Perhaps there is a smarter way to do this, but I haven't found it yet. If you're interested, find the <span class="flex_perlcode">tbse_compressed_lines()</span> function in <em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4358'>I have also considered whether it is the<em> </em>use of pipes to communicate to/from the evolution code that slows down <em><i>binary_grid</i></em> in an I/O dominated case. One way to test this would be to compress the returned data and send it in (say) <span class="flex_software">7zipped</span> or <span class="flex_software">bzipped</span> chunks of data instead of raw <em>ASCII</em> as at present. However, the overhead required for the compression slows down the data transfer so much that this seems to be a non-starter. I tried to compress the array provided by <span class="flex_perlscript">tbse_lines</span> with <span class="flex_perlmodule">Compress::Zlib::memGzip</span> and, while it works, it slowed the test grid – with lots of I/O! – by more than 30%. Perhaps there is a smarter way to do this, but I haven't found it yet. If you're interested, find the <span class="flex_perlcode">tbse_compressed_lines()</span> function in <em><span class='math'>\binarygrid</span>
 .</em></div>
 
-<div class="standard" id='magicparlabel-3909'>Of course, none of this matters if you don't use <em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-4379'>Of course, none of this matters if you don't use <em><span class='math'>\binarygrid</span>
 </em> the way it's designed. Sure, you can save your million-line data file to disk and reprocess it, but <em>nothing</em> will be faster than processing data on the fly. Also, when using <em><span class="flex_software">HTCondor</span></em>, remember to be smart and join the threads on the machine containing the data rather than across an NFS mountpoint on a PC in another building. Nothing I do in programming <em><span class='math'>\binarygrid</span>
 </em> better can make up stupid user decisions&hellip;</div>
 
 
 
-<div class="standard" id='magicparlabel-3914'><br />
+<div class="standard" id='magicparlabel-4384'><br />
 </div>
-<h2 class="section" id='magicparlabel-3915'><span class="section_label">6</span> <em><i>binary_c</i> </em>API</h2>
-<div class="standard" id='magicparlabel-3918'>The following describes functions in the <em><i>binary_c</i></em> <em>C</em> API. These functions are provided for access to <em><i>binary_c</i></em> through its shared library interface, <i>libbinary_c.so</i>, which is used by (for example) <em><i>binary_grid2</i> </em>with its <em>C</em> backend.</div>
-<h3 class="subsection" id='magicparlabel-3919'><span class="subsection_label">6.1</span> Naming conventions</h3>
+<h2 class="section" id='magicparlabel-4385'><span class="section_label">7</span> <em><i>binary_c</i> </em>API</h2>
+<div class="standard" id='magicparlabel-4388'>The following describes functions in the <em><i>binary_c</i></em> <em>C</em> API. These functions are provided for access to <em><i>binary_c</i></em> through its shared library interface, <i>libbinary_c.so</i>, which is used by (for example) <em><i>binary_grid2</i> </em>with its <em>C</em> backend.</div>
+<h3 class="subsection" id='magicparlabel-4389'><span class="subsection_label">7.1</span> Naming conventions</h3>
 
-<ul class="itemize" id='magicparlabel-3920'><li class="itemize_item">Names of functions in the <span class='math'>binary_c</i></span>
+<ul class="itemize" id='magicparlabel-4390'><li class="itemize_item">Names of functions in the <span class='math'>binary_c</i></span>
  API start with binary_c_</li>
 <li class="itemize_item">Functions are declared with the attribute <span class="flex_cmacro">binary_c_API_function</span></li>
 <li class="itemize_item">The <span class='math'>binary_c</i></span>
  structure types 
 
-<ul class="itemize" id='magicparlabel-3927'><li class="itemize_item"><span class="flex_cstruct">stardata_t</span></li>
+<ul class="itemize" id='magicparlabel-4397'><li class="itemize_item"><span class="flex_cstruct">stardata_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">star_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">preferences_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">store_t</span></li>
@@ -5328,9 +5666,9 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 <li class="itemize_item"><span class="flex_cstruct">common_t</span></li>
 <li class="itemize_item">etc.</li>
 </ul>
-<div class="standard" id='magicparlabel-3963'>should be declared in external code as</div>
+<div class="standard" id='magicparlabel-4433'>should be declared in external code as</div>
 
-<ul class="itemize" id='magicparlabel-3964'><li class="itemize_item"><span class="flex_cstruct">libbinary_c_stardata_t</span></li>
+<ul class="itemize" id='magicparlabel-4434'><li class="itemize_item"><span class="flex_cstruct">libbinary_c_stardata_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">libbinary_c_star_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">libbinary_c_preferences_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">libbinary_c_store_t</span></li>
@@ -5339,61 +5677,61 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 <li class="itemize_item"><span class="flex_cstruct">libbinary_c_common_t</span></li>
 <li class="itemize_item"><span class="flex_cstruct">libbinary_c_&hellip;</span></li>
 </ul>
-<div class="standard" id='magicparlabel-4004'>This avoids name clashes with the functions of other libraries.</div>
+<div class="standard" id='magicparlabel-4474'>This avoids name clashes with the functions of other libraries.</div>
 </li></ul>
-<h4 class="subsubsection" id='magicparlabel-4005'><span class="subsubsection_label">6.1.1</span> <i>binary_c</i> macros</h4>
-<div class="standard" id='magicparlabel-4006'><em>Binary_c</em> defines the following:</div>
+<h4 class="subsubsection" id='magicparlabel-4475'><span class="subsubsection_label">7.1.1</span> <i>binary_c</i> macros</h4>
+<div class="standard" id='magicparlabel-4476'><em>Binary_c</em> defines the following:</div>
 
-<dl class='description' id='magicparlabel-4007'><dt class="description_label"><span class="flex_cmacro">RESTRICT</span></dt>
+<dl class='description' id='magicparlabel-4477'><dt class="description_label"><span class="flex_cmacro">RESTRICT</span></dt>
 <dd class="description_item"> This is set to <span class="flex_cmacro">__restrict__</span> or a suitable equivalent when available (this depends on the compiler). </dd>
 <dt class="description_label"><span class="flex_cmacro">binary_c_API_function</span></dt>
 <dd class="description_item"> This is set to <span class="flex_cmacro">__attribute__ ((visibility("default")))</span> which is standard for exporting functions to shared libraries with <span class="flex_software">gcc</span> (and presumably <span class="flex_software">clang</span>). I have not yet investigated the equivalent for other compilers.</dd>
 </dl>
-<h4 class="subsubsection" id='magicparlabel-4033'><span class="subsubsection_label">6.1.2</span> <i>binary_c</i> headers</h4>
-<div class="standard" id='magicparlabel-4034'>Most <em><span class='math'>binary_c</i></span>
+<h4 class="subsubsection" id='magicparlabel-4503'><span class="subsubsection_label">7.1.2</span> <i>binary_c</i> headers</h4>
+<div class="standard" id='magicparlabel-4504'>Most <em><span class='math'>binary_c</i></span>
 </em> headers are loaded through <span class="flex_headerfile"><i>binary_c</i>.h</span>. While it slows compilation to include <em>all</em>&nbsp;the headers, the convenience (and imposed structure) of having just one file to access headers overrides this.</div>
-<h3 class="subsection" id='magicparlabel-4039'><span class="subsection_label">6.2</span> Using the API</h3>
-<div class="standard" id='magicparlabel-4040'>Using the API is simple in languages that can embed <span class="flex_programminglanguage">C</span> directly, e.g.&nbsp;<span class="flex_programminglanguage">C</span>, <span class="flex_programminglanguage">C++</span>, <span class="flex_programminglanguage">Perl</span> and <span class="flex_programminglanguage">Python</span>. Some other languages, e.g. <span class="flex_programminglanguage">FORTRAN</span>, require a special set of functions to be written in order to talk to them. Fortunately for you, I have already done this in <span class="flex_scriptinglanguage">FORTRAN</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-4069'><span class="subsubsection_label">6.2.1</span> In <i>C</i><div id="subsec_In_C"></div>
+<h3 class="subsection" id='magicparlabel-4509'><span class="subsection_label">7.2</span> Using the API</h3>
+<div class="standard" id='magicparlabel-4510'>Using the API is simple in languages that can embed <span class="flex_programminglanguage">C</span> directly, e.g.&nbsp;<span class="flex_programminglanguage">C</span>, <span class="flex_programminglanguage">C++</span>, <span class="flex_programminglanguage">Perl</span> and <span class="flex_programminglanguage">Python</span>. Some other languages, e.g. <span class="flex_programminglanguage">FORTRAN</span>, require a special set of functions to be written in order to talk to them. Fortunately for you, I have already done this in <span class="flex_scriptinglanguage">FORTRAN</span>.</div>
+<h4 class="subsubsection" id='magicparlabel-4539'><span class="subsubsection_label">7.2.1</span> In <i>C</i><div id="subsec_In_C"></div>
 </h4>
-<div class="standard" id='magicparlabel-4070'>To include the API functions, <span class="flex_headerfile"><i>binary_c</i>.h</span> must be included in your code. </div>
-<h4 class="subsubsection" id='magicparlabel-4075'><span class="subsubsection_label">6.2.2</span> Macro clashes</h4>
-<div class="standard" id='magicparlabel-4076'>You may find there is a clash between <em><span class='math'>binary_c</i></span>
-</em>'s <span class="flex_cmacro">MAX</span> and <span class="flex_cmacro">MIN</span> macros and various standard libraries. In which case, use <span class="flex_software">gcc</span>'s <span class="flex_cmacro">push_macro</span>/<span class="flex_cmacro">pop_macro</span> feature to include your functions in the following way:</div>
+<div class="standard" id='magicparlabel-4540'>To include the API functions, <span class="flex_headerfile"><i>binary_c</i>.h</span> must be included in your code. </div>
+<h4 class="subsubsection" id='magicparlabel-4545'><span class="subsubsection_label">7.2.2</span> Macro clashes</h4>
+<div class="standard" id='magicparlabel-4546'>You may find there is a clash between <em><span class='math'>binary_c</i></span>
+</em>'s <span class="flex_cmacro">Max</span> and <span class="flex_cmacro">Min</span> macros (and perhaps others) and various standard libraries. In which case, use <span class="flex_software">gcc</span>'s <span class="flex_cmacro">push_macro</span>/<span class="flex_cmacro">pop_macro</span> feature to include your functions in the following way:</div>
 
-<div class="standard" id='magicparlabel-4097'><br />
+<div class="standard" id='magicparlabel-4567'><br />
 
-<pre class ='listings <i>C</i>'>#pragma push_macro("MAX")
-#pragma push_macro("MIN")
+<pre class ='listings <i>C</i>'>#pragma push_macro("Max")
+#pragma push_macro("Min")
 
-#undef MAX
-#undef MIN
+#undef Max
+#undef Min
 
 #include "<i>binary_c</i>.h"
 
 /* ... your subroutines go here ... */
 
 
-#undef MAX 
-#undef MIN
+#undef Max
+#undef Min
 
-#pragma pop_macro("MIN")
-#pragma pop_macro("MAX")
+#pragma pop_macro("Min")
+#pragma pop_macro("Max")
 </pre><br />
  </div>
-<h4 class="subsubsection" id='magicparlabel-4119'><span class="subsubsection_label">6.2.3</span> In <i>C</i>++</h4>
-<div class="standard" id='magicparlabel-4120'>I have not written a wrapper in <span class="flex_programminglanguage">C++</span> because I figured you'd just use the <span class="flex_programminglanguage">C</span> functions. However, it might make sense to wrap the <span class="flex_programminglanguage">C</span> functions in some<em> </em><span class="flex_programminglanguage">C++</span> objects and indeed given that the <span class="flex_cstruct">stardata</span> struct functions very much like the data parts an object this should be quite trivial. Please let me know if you want to do this.</div>
-<h4 class="subsubsection" id='magicparlabel-4141'><span class="subsubsection_label">6.2.4</span> In <i>FORTRAN</i></h4>
-<div class="standard" id='magicparlabel-4142'>The file <span class="flex_file">binary_c_API_fortran.c</span> contains the API interface callable from <span class="flex_programminglanguage">FORTRAN</span>. The example <span class="flex_file">apitest.f90</span> (in the <em>apitest</em> directory) sets up and evolves a stellar system from <em><span class="flex_programminglanguage">FORTRAN</span></em>. Please take note of the following points:</div>
+<h4 class="subsubsection" id='magicparlabel-4589'><span class="subsubsection_label">7.2.3</span> In <i>C</i>++</h4>
+<div class="standard" id='magicparlabel-4590'>I have not written a wrapper in <span class="flex_programminglanguage">C++</span> because I figured you'd just use the <span class="flex_programminglanguage">C</span> functions. However, it might make sense to wrap the <span class="flex_programminglanguage">C</span> functions in some<em> </em><span class="flex_programminglanguage">C++</span> objects and indeed given that the <span class="flex_cstruct">stardata</span> struct functions very much like the data parts an object this should be quite trivial. Please let me know if you want to do this.</div>
+<h4 class="subsubsection" id='magicparlabel-4611'><span class="subsubsection_label">7.2.4</span> In <i>FORTRAN</i></h4>
+<div class="standard" id='magicparlabel-4612'>The file <span class="flex_file">binary_c_API_fortran.c</span> contains the API interface callable from <span class="flex_programminglanguage">FORTRAN</span>. The example <span class="flex_file">apitest.f90</span> (in the <em>apitest</em> directory) sets up and evolves a stellar system from <em><span class="flex_programminglanguage">FORTRAN</span></em>. Please take note of the following points:</div>
 
-<ul class="itemize" id='magicparlabel-4159'><li class="itemize_item">Only the <span class="flex_cvar">argstring</span> interface works (no <span class="flex_cvar">argc</span> and <span class="flex_cvar">argv</span>)</li>
+<ul class="itemize" id='magicparlabel-4629'><li class="itemize_item">Only the <span class="flex_cvar">argstring</span> interface works (no <span class="flex_cvar">argc</span> and <span class="flex_cvar">argv</span>)</li>
 <li class="itemize_item">Remember to put a <span class="flex_cmacro">NUL</span> character at the end of the <span class="flex_cvar">argstring</span> with <span class="flex_fortranfunction">char(0)</span></li>
 <li class="itemize_item">There is a special function <span class="flex_fortranfunction">binary_c_fortran_api_stardata_info</span> which can extract some data from a <span style='font-family:monospace;font-size: 18px;'>stardata</span> struct. You must write code in <span class="flex_programminglanguage">C</span> to extract the data, because <span class="flex_programminglanguage">FORTRAN</span> knows little about <span class="flex_programminglanguage">C</span> structures. This code is meant as an example: you can always write your own function and export it to your <span class='math'>binary_c</i></span>
  shared library with the <span class="flex_cmacro">binary_c_API_function</span> macro.</li>
 </ul>
-<div class="standard" id='magicparlabel-4206'>The skeleton code below can be used as a basis to do whatever you like.</div>
+<div class="standard" id='magicparlabel-4676'>The skeleton code below can be used as a basis to do whatever you like, see also <span class="flex_file">aptitest.f90</span> in the <span class="flex_file">apitest</span> directory.</div>
 
-<div class="standard" id='magicparlabel-4207'><br />
+<div class="standard" id='magicparlabel-4685'><br />
 
 <pre class ='listings <i>FORTRAN</i>'>program binary_cinfortran
   use iso_c_binding
@@ -5416,16 +5754,16 @@ This will automatically be converted into <span class="flex_perlcode">\&amp;main
 
 end program</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-4232'><span class="subsubsection_label">6.2.5</span> In Perl</h4>
-<div class="standard" id='magicparlabel-4233'>To use the API in <span class="flex_scriptinglanguage">Perl</span>, please use the <span class="flex_perlmodule">Inline::C</span> <span class="flex_scriptinglanguage">Perl</span> module (available on <em>CPAN</em>) and refer to Sec.&nbsp;<a href="#subsec_In_C">6.2.1</a>. It is easier if you copy the examples in the <span class="flex_perlmodule">binary_grid::C.pm</span> <span class="flex_scriptinglanguage">Perl</span> module that is provided with <span class='math'>\binarygrid</span>
+<h4 class="subsubsection" id='magicparlabel-4710'><span class="subsubsection_label">7.2.5</span> In Perl</h4>
+<div class="standard" id='magicparlabel-4711'>To use the API in <span class="flex_scriptinglanguage">Perl</span>, please use the <span class="flex_perlmodule">Inline::C</span> <span class="flex_scriptinglanguage">Perl</span> module (available on <em>CPAN</em>) and refer to Sec.&nbsp;<a href="#subsec_In_C">7.2.1</a>. It is easier if you copy the examples in the <span class="flex_perlmodule">binary_grid::C.pm</span> <span class="flex_scriptinglanguage">Perl</span> module that is provided with <span class='math'>\binarygrid</span>
 2.</div>
-<h4 class="subsubsection" id='magicparlabel-4254'><span class="subsubsection_label">6.2.6</span> In <i><a href="https://www.python.org/">Python</a></i></h4>
-<div class="standard" id='magicparlabel-4255'>There is a functional <span class="flex_scriptinglanguage">Python</span> backend. Please contact Robert Izzard to acquire it.</div>
-<h3 class="subsection" id='magicparlabel-4260'><span class="subsection_label">6.3</span> Standard functions</h3>
-<div class="standard" id='magicparlabel-4261'>The following functions set up, evolve and modify stellar systems which are set up in <span class="flex_cstruct">stardata_t</span> structures.</div>
-<h4 class="subsubsection" id='magicparlabel-4266'><span class="subsubsection_label">6.3.1</span> binary_c_new_system<div id="subsec_binary_c_new_system"></div>
+<h4 class="subsubsection" id='magicparlabel-4732'><span class="subsubsection_label">7.2.6</span> In <i><a href="https://www.python.org/">Python</a></i></h4>
+<div class="standard" id='magicparlabel-4733'>There is a functional <span class="flex_scriptinglanguage">Python</span> currently interface available at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>-python">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>-python</a>.</div>
+<h3 class="subsection" id='magicparlabel-4742'><span class="subsection_label">7.3</span> Standard functions</h3>
+<div class="standard" id='magicparlabel-4743'>The following functions set up, evolve and modify stellar systems which are set up in <span class="flex_cstruct">stardata_t</span> structures.</div>
+<h4 class="subsubsection" id='magicparlabel-4748'><span class="subsubsection_label">7.3.1</span> binary_c_new_system<div id="subsec_binary_c_new_system"></div>
 </h4>
-<div class="standard" id='magicparlabel-4267'><br />
+<div class="standard" id='magicparlabel-4749'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_new_system(
      struct libbinary_c_stardata_t ** stardata,
      struct libbinary_c_stardata_t ** previous_stardata,
@@ -5436,7 +5774,7 @@ end program</pre><br />
 </pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4279'><li class="itemize_item"><span class="flex_cstruct">stardata</span> must be a pointer to a <span class="flex_cstruct">libbinary_c_stardata_t</span> struct pointer. The memory for the <span class="flex_cstruct">stardata</span> is allocated by this function.</li>
+<ul class="itemize" id='magicparlabel-4761'><li class="itemize_item"><span class="flex_cstruct">stardata</span> must be a pointer to a <span class="flex_cstruct">libbinary_c_stardata_t</span> struct pointer. The memory for the <span class="flex_cstruct">stardata</span> is allocated by this function.</li>
 <li class="itemize_item"><span class="flex_cstruct">previous_stardata</span> is usually <span class="flex_cmacro"><span style='font-family:monospace;font-size: 18px;'>NULL</span></span>, in which case space for it is allocated. If non-<span class="flex_cmacro"><span style='font-family:monospace;font-size: 18px;'>NULL</span></span>, it must point to a previously allocated <span class="flex_cstruct">libbinary_c_previous_stardata_t</span> struct.</li>
 <li class="itemize_item"><span class="flex_cstruct">preferences</span> is allocated and set up if <span class="flex_cmacro">NULL</span>, or should be a pointer to a pointer to a previous allocated <span class="flex_cstruct">libbinary_c_preferences_t</span> struct.</li>
 <li class="itemize_item"><span class="flex_cstruct">store</span> must be a pointer to a <span class="flex_cstruct">libbinary_c_store_t</span> struct pointer which is empty and <span class="flex_cmacro">NULL</span>, or a pointer to a pointer to a previously allocated <span class="flex_cstruct">libbinary_c_store_t</span> struct. This feature enables you to make the store only once, but call <span class="flex_cstruct">binary_c_new_system</span> repeatedly with it, thus saving a lot of CPU time.</li>
@@ -5446,9 +5784,9 @@ end program</pre><br />
 Alternatively, set <span class="flex_cvar">argc</span> to -1 then <span class="flex_cvar">argv</span> can be a pointer to a string containing a set of arguments (which must start with the word &ldquo;<i>binary_c</i>&rdquo; as this would be the first argument in the standard <i>C</i> format). These are split in <span class='math'>binary_c</i></span>
  and parsed as usual.</li>
 </ul>
-<div class="standard" id='magicparlabel-4364'>For example, the following makes a new stellar system in <span style='font-family:monospace;font-size: 18px;'>stardata</span> and sets up a new store.</div>
+<div class="standard" id='magicparlabel-4846'>For example, the following makes a new stellar system in <span style='font-family:monospace;font-size: 18px;'>stardata</span> and sets up a new store.</div>
 
-<div class="standard" id='magicparlabel-4365'><br />
+<div class="standard" id='magicparlabel-4847'><br />
 <pre class ='listings <i>C</i>'>    struct libbinary_c_stardata_t * stardata = NULL;
     struct libbinary_c_store_t * store = NULL;
 
@@ -5462,16 +5800,16 @@ Alternatively, set <span class="flex_cvar">argc</span> to -1 then <span class="f
                         -1);
     /* ... */</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-4381'><span class="subsubsection_label">6.3.2</span> binary_c_evolve_for_dt<div id="subsec_binary_c_evolve_for_dt"></div>
+<h4 class="subsubsection" id='magicparlabel-4863'><span class="subsubsection_label">7.3.2</span> binary_c_evolve_for_dt<div id="subsec_binary_c_evolve_for_dt"></div>
 </h4>
-<div class="standard" id='magicparlabel-4382'>This function evolves a stellar system defined in a <span style='font-family:monospace;font-size: 18px;'>stardata</span> struct for a time <span style='font-family:monospace;font-size: 18px;'>dt</span> Myr.</div>
+<div class="standard" id='magicparlabel-4864'>This function evolves a stellar system defined in a <span style='font-family:monospace;font-size: 18px;'>stardata</span> struct for a time <span style='font-family:monospace;font-size: 18px;'>dt</span> Myr.</div>
 
-<div class="standard" id='magicparlabel-4383'><br />
+<div class="standard" id='magicparlabel-4865'><br />
 <pre class ='listings <i>C</i>'>int binary_c_API_function binary_c_evolve_for_dt(struct libbinary_c_stardata_t * stardata,
                                                  double dt);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4389'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-4871'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 <li class="itemize_item"><span class="flex_cstruct">dt</span> is the number of MYr (megayears, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>1</mn>
@@ -5492,74 +5830,74 @@ Alternatively, set <span class="flex_cvar">argc</span> to -1 then <span class="f
   </mrow>
  </mrow></mstyle></math>)</li>
 </ul>
-<div class="standard" id='magicparlabel-4399'>Typically, output is sent to <span class="flex_cvar">stdout</span>, but you can capture it in a buffer. Please see Sec.&nbsp;<a href="#subsec_Capturing_the_buffer">6.5.2</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-4404'><span class="subsubsection_label">6.3.3</span> binary_c_buffer_info<div id="subsec_binary_c_buffer_info"></div>
+<div class="standard" id='magicparlabel-4881'>Typically, output is sent to <span class="flex_cvar">stdout</span>, but you can capture it in a buffer. Please see Sec.&nbsp;<a href="#subsec_Capturing_the_buffer">7.5.2</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-4886'><span class="subsubsection_label">7.3.3</span> binary_c_buffer_info<div id="subsec_binary_c_buffer_info"></div>
 </h4>
-<div class="standard" id='magicparlabel-4405'>This function returns a pointer to the <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-4887'>This function returns a pointer to the <span class='math'>binary_c</i></span>
  output buffer and its size.</div>
 
-<div class="standard" id='magicparlabel-4406'><br />
+<div class="standard" id='magicparlabel-4888'><br />
 <pre class ='listings'>void binary_c_API_function binary_c_buffer_info(struct libbinary_c_stardata_t * RESTRICT stardata,
                                                 char ** buffer,
                                                 int * size);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4413'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-4895'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 <li class="itemize_item"><span class="flex_cvar">buffer</span> is a pointer to a <span class="flex_cvar">char*</span> which points to <span class='math'>binary_c</i></span>
 's internal buffer. Any changes you make to the contents of buffer thus also change <span class='math'>binary_c</i></span>
 's internal buffer.</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-4427'><span class="subsubsection_label">6.3.4</span> binary_c_buffer_empty_buffer<div id="subsec_binary_c_buffer_empty_buffer"></div>
+<h4 class="subsubsection" id='magicparlabel-4909'><span class="subsubsection_label">7.3.4</span> binary_c_buffer_empty_buffer<div id="subsec_binary_c_buffer_empty_buffer"></div>
 </h4>
-<div class="standard" id='magicparlabel-4428'>This function frees the memory used in <span class='math'>binary_c</i></span>
-'s internal buffer. See also Sec.&nbsp;<a href="#subsec_binary_c_buffer_info">6.3.3</a>.</div>
+<div class="standard" id='magicparlabel-4910'>This function frees the memory used in <span class='math'>binary_c</i></span>
+'s internal buffer. See also Sec.&nbsp;<a href="#subsec_binary_c_buffer_info">7.3.3</a>.</div>
 
-<div class="standard" id='magicparlabel-4429'><br />
+<div class="standard" id='magicparlabel-4911'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_buffer_empty_buffer(struct stardata_t * RESTRICT stardata); </pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4434'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>) </li>
+<ul class="itemize" id='magicparlabel-4916'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>) </li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-4439'><span class="subsubsection_label">6.3.5</span> binary_c_free_store_contents<div id="subsec_binary_c_free_store_contents"></div>
+<h4 class="subsubsection" id='magicparlabel-4921'><span class="subsubsection_label">7.3.5</span> binary_c_free_store_contents<div id="subsec_binary_c_free_store_contents"></div>
 </h4>
-<div class="standard" id='magicparlabel-4440'>Once you have finished running (possibly many) stellar systems, you can free the contents of the <span style='font-family:monospace;font-size: 18px;'>store</span> struct with a call to <span class="flex_cfunction">binary_c_free_store_contents</span></div>
+<div class="standard" id='magicparlabel-4922'>Once you have finished running (possibly many) stellar systems, you can free the contents of the <span style='font-family:monospace;font-size: 18px;'>store</span> struct with a call to <span class="flex_cfunction">binary_c_free_store_contents</span></div>
 
-<div class="standard" id='magicparlabel-4445'><br />
+<div class="standard" id='magicparlabel-4927'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_free_store_contents(struct libbinary_c_store_t * RESTRICT store);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4450'><li class="itemize_item">&nbsp;<span class="flex_cstruct">store</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-4932'><li class="itemize_item">&nbsp;<span class="flex_cstruct">store</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-4455'><span class="subsubsection_label">6.3.6</span> binary_c_free_memory<div id="subsec_binary_c_free_memory"></div>
+<h4 class="subsubsection" id='magicparlabel-4937'><span class="subsubsection_label">7.3.6</span> binary_c_free_memory<div id="subsec_binary_c_free_memory"></div>
 </h4>
-<div class="standard" id='magicparlabel-4456'>Once your stellar evolution has finished, a <span class="flex_cstruct">stardata</span> struct needs to have its memory freed. This function enables you to free the <span class="flex_cstruct">stardata</span>, <span class="flex_cstruct">preferences</span> and <span class="flex_cstruct">store</span> structs if required. It is possible that <span style='font-family:monospace;font-size: 18px;'>preferences</span> and <span style='font-family:monospace;font-size: 18px;'>store</span> should <em>not</em> be freed, because these can be reused for future evolutionary runs.</div>
+<div class="standard" id='magicparlabel-4938'>Once your stellar evolution has finished, a <span class="flex_cstruct">stardata</span> struct needs to have its memory freed. This function enables you to free the <span class="flex_cstruct">stardata</span>, <span class="flex_cstruct">preferences</span> and <span class="flex_cstruct">store</span> structs if required. It is possible that <span style='font-family:monospace;font-size: 18px;'>preferences</span> and <span style='font-family:monospace;font-size: 18px;'>store</span> should <em>not</em> be freed, because these can be reused for future evolutionary runs.</div>
 
-<div class="standard" id='magicparlabel-4473'><br />
+<div class="standard" id='magicparlabel-4955'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_free_memory(struct stardata_t ** RESTRICT stardata,
                                                 Boolean free_preferences,
                                                 Boolean free_stardata,
                                                 Boolean free_store);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4481'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-4963'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 <li class="itemize_item"><span class="flex_cvar">free_preferences</span>, <span class="flex_cvar">free_stardata</span> and <span class="flex_cvar">free_store</span> should be either <span class="flex_cmacro">TRUE</span> or <span class="flex_cmacro">FALSE</span>.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-4507'><span class="subsection_label">6.4</span> Extension functions</h3>
-<div class="standard" id='magicparlabel-4508'>A few functions have been defined which provide extensions to the basic API, but are very useful in the <span class="flex_perlmodule">binary_grid::C</span> Perl module. The number of extension functions may increase in the future, so this documentation is always likely to be out of date.</div>
-<h4 class="subsubsection" id='magicparlabel-4513'><span class="subsubsection_label">6.4.1</span> binary_c_version<div id="subsec_binary_c_version"></div>
+<h3 class="subsection" id='magicparlabel-4989'><span class="subsection_label">7.4</span> Extension functions</h3>
+<div class="standard" id='magicparlabel-4990'>A few functions have been defined which provide extensions to the basic API, but are very useful in the <span class="flex_perlmodule">binary_grid::C</span> Perl module. The number of extension functions may increase in the future, so this documentation is always likely to be out of date.</div>
+<h4 class="subsubsection" id='magicparlabel-4995'><span class="subsubsection_label">7.4.1</span> binary_c_version<div id="subsec_binary_c_version"></div>
 </h4>
-<div class="standard" id='magicparlabel-4514'>This function provides access to the (long) version string returned by <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-4996'>This function provides access to the (long) version string returned by <span class='math'>binary_c</i></span>
 </div>
 
-<div class="standard" id='magicparlabel-4515'><br />
+<div class="standard" id='magicparlabel-4997'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_version(struct libbinary_c_stardata_t * RESTRICT stardata);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4520'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-5002'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-4525'><span class="subsubsection_label">6.4.2</span> binary_c_show_instant_RLOF_period_or_separation<div id="subsec_binary_c_show_instant_RLOF_perio"></div>
+<h4 class="subsubsection" id='magicparlabel-5007'><span class="subsubsection_label">7.4.2</span> binary_c_show_instant_RLOF_period_or_separation<div id="subsec_binary_c_show_instant_RLOF_perio"></div>
 </h4>
-<div class="standard" id='magicparlabel-4526'>This function provides access to the <i>binary_c</i> function that determines the minimum orbital period or separation that leads to instantaneous Roche-lobe overflow for a given <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-5008'>This function provides access to the <i>binary_c</i> function that determines the minimum orbital period or separation that leads to instantaneous Roche-lobe overflow for a given <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>M</mi>
@@ -5577,42 +5915,42 @@ Alternatively, set <span class="flex_cvar">argc</span> to -1 then <span class="f
   </msub>
  </mrow></mstyle></math> and metallicity.</div>
 
-<div class="standard" id='magicparlabel-4527'><br />
+<div class="standard" id='magicparlabel-5009'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_show_instant_RLOF_period_or_separation(struct libbinary_c_stardata_t * stardata);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4532'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-5014'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-4537'><span class="subsubsection_label">6.4.3</span> binary_c_initialize_parameters<div id="subsec_binary_c_initialize_parameters"></div>
+<h4 class="subsubsection" id='magicparlabel-5019'><span class="subsubsection_label">7.4.3</span> binary_c_initialize_parameters<div id="subsec_binary_c_initialize_parameters"></div>
 </h4>
-<div class="standard" id='magicparlabel-4538'>This function calls the <em><span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5020'>This function calls the <em><span class='math'>binary_c</i></span>
 </em> <span class="flex_cfunction">initialize_parameters</span> function which in turn is useful for reporting the initial abundance mixture (it is used for this purpose in <span class="flex_perlmodule">binary_grid::C</span>).</div>
 
-<div class="standard" id='magicparlabel-4547'><br />
+<div class="standard" id='magicparlabel-5029'><br />
 <pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_initialize_parameters(struct libbinary_c_stardata_t * RESTRICT stardata);</pre><br />
 </div>
 
-<ul class="itemize" id='magicparlabel-4552'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">6.3.1</a>)</li>
+<ul class="itemize" id='magicparlabel-5034'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-4557'><span class="subsection_label">6.5</span> API Examples<div id="sec_Examples"></div>
+<h3 class="subsection" id='magicparlabel-5039'><span class="subsection_label">7.5</span> API Examples<div id="sec_Examples"></div>
 </h3>
-<div class="standard" id='magicparlabel-4558'>There are several examples of using the API in the <span class="flex_perlmodule">binary_grid::C</span> module.</div>
-<h4 class="subsubsection" id='magicparlabel-4563'><span class="subsubsection_label">6.5.1</span> Arguments and/or the argstring<div id="subsec_Arguments_and_the"></div>
+<div class="standard" id='magicparlabel-5040'>There are several examples of using the API in the <span class="flex_perlmodule">binary_grid::C</span> module.</div>
+<h4 class="subsubsection" id='magicparlabel-5045'><span class="subsubsection_label">7.5.1</span> Arguments and/or the argstring<div id="subsec_Arguments_and_the"></div>
 </h4>
-<div class="standard" id='magicparlabel-4564'>The <span class="flex_cvar">argstring</span>, or a combination of <span class="flex_cvar">argc</span> and <span class="flex_cvar">argv</span>, is used to send commands to <span class='math'>binary_c</i></span>, and this is sent to <span class="flex_cfunction">binary_c_new_system()</span> to specify (say) masses, orbits, metallicity etc. prior to a call to evolve a stellar system. You do not have to send an <span class="flex_cvar">argstring</span>, you could set the system directly, e.g. <br />
+<div class="standard" id='magicparlabel-5046'>The <span class="flex_cvar">argstring</span>, or a combination of <span class="flex_cvar">argc</span> and <span class="flex_cvar">argv</span>, is used to send commands to <span class='math'>binary_c</i></span>, and this is sent to <span class="flex_cfunction">binary_c_new_system()</span> to specify (say) masses, orbits, metallicity etc. prior to a call to evolve a stellar system. You do not have to send an <span class="flex_cvar">argstring</span>, you could set the system directly, e.g. <br />
 <pre class ='listings <i>C</i>'>stardata-&gt;star[1].mass = 10.0;
 stardata-&gt;common.metallicity = 0.02;
 stardata-&gt;model.max_evolution_time = 15000.0;</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-4591'>but there are some functions which are called <em>after</em> the arguments are parsed which would be skipped if you do it manually. You will have to mimic (or copy from <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5073'>but there are some functions which are called <em>after</em> the arguments are parsed which would be skipped if you do it manually. You will have to mimic (or copy from <span class='math'>binary_c</i></span>
 ) this functionality.</div>
-<h4 class="subsubsection" id='magicparlabel-4592'><span class="subsubsection_label">6.5.2</span> Capturing the buffer output<div id="subsec_Capturing_the_buffer"></div>
+<h4 class="subsubsection" id='magicparlabel-5074'><span class="subsubsection_label">7.5.2</span> Capturing the buffer output<div id="subsec_Capturing_the_buffer"></div>
 </h4>
-<div class="standard" id='magicparlabel-4593'>Usually, output is sent to the <span class="flex_cvar">stdout</span> stream. However, it is often more useful to capture the output and process it in an automated way. This is how the<em> <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-5075'>Usually, output is sent to the <span class="flex_cvar">stdout</span> stream. However, it is often more useful to capture the output and process it in an automated way. This is how the<em> <span class='math'>\binarygrid</span>
  </em><span class="flex_programminglanguage">C</span> backend works. You can do this with the following code which sets up a stellar system, suppresses logging to files, sets up the internal buffer, evolves the system, then grabs the buffer into memory. It is up to you to process this buffer (although see the <span class="flex_perlmodule">binary_grid::C</span> module for ways to do this) but it must then be freed before you finish.</div>
 
-<div class="standard" id='magicparlabel-4606'><br />
+<div class="standard" id='magicparlabel-5088'><br />
 <pre class ='listings <i>C</i>'>    struct libbinary_c_stardata_t * stardata = NULL;
     struct libbinary_c_store_t * store = NULL;
 
@@ -5649,16 +5987,16 @@ stardata-&gt;model.max_evolution_time = 15000.0;</pre><br />
     binary_c_buffer_empty_buffer(stardata); 
     buffer = NULL;</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-4645'><span class="subsubsection_label">6.5.3</span> Memory management and maintaining a store<div id="subsec_Maintaining_a_store"></div>
+<h4 class="subsubsection" id='magicparlabel-5127'><span class="subsubsection_label">7.5.3</span> Memory management and maintaining a store<div id="subsec_Maintaining_a_store"></div>
 </h4>
-<div class="standard" id='magicparlabel-4646'>Memory is allocated during a call to <span class="flex_cfunction">binary_c_new_system()</span> which sets up the <span class="flex_cstruct">stardata</span> struct, the <span class="flex_cstruct">preferences</span> struct and the <span class="flex_cstruct">store</span> struct. Both the preferences and the store can be reused once defined, which means you do not have to go through the costly (in CPU cycles) process of setting up a multitude of data for each stellar system. The example below runs a number of systems while preserving the store. (It is based on the <span class="flex_programminglanguage">C</span> backend for <em><span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-5128'>Memory is allocated during a call to <span class="flex_cfunction">binary_c_new_system()</span> which sets up the <span class="flex_cstruct">stardata</span> struct, the <span class="flex_cstruct">preferences</span> struct and the <span class="flex_cstruct">store</span> struct. Both the preferences and the store can be reused once defined, which means you do not have to go through the costly (in CPU cycles) process of setting up a multitude of data for each stellar system. The example below runs a number of systems while preserving the store. (It is based on the <span class="flex_programminglanguage">C</span> backend for <em><span class='math'>\binarygrid</span>
 2</em>.) It is not recommended to preserve the <span class="flex_cstruct">preferences</span> even though it is possible.</div>
 
-<div class="standard" id='magicparlabel-4671'><br />
+<div class="standard" id='magicparlabel-5153'><br />
 <pre class ='listings <i>C</i>'>    struct libbinary_c_stardata_t * stardata = NULL;
     struct libbinary_c_store_t * store = NULL;
 	
-	int n = 0; // loop until n = 10
+	unsigned int n = 0; // loop until n = 10
 	while(n++ &lt; 10)
 	{
 	   char * argstring;
@@ -5687,68 +6025,68 @@ stardata-&gt;model.max_evolution_time = 15000.0;</pre><br />
    /* ... do your data processing ... */</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-4705'>You can also free <em>everything </em>with the following function call:</div>
+<div class="standard" id='magicparlabel-5187'>You can also free <em>everything </em>with the following function call:</div>
 
-<div class="standard" id='magicparlabel-4706'><br />
+<div class="standard" id='magicparlabel-5188'><br />
 <pre class ='listings <i>C</i>'>      binary_c_free_memory(&amp;stardata,TRUE,TRUE,TRUE);   </pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-4711'>but beware that your local <span class="flex_cstruct">store</span> and <span class="flex_cstruct">stardata</span> must also be set to <span class="flex_cmacro">NULL</span> if you require it to be regenerated on a subsequent call to <span class="flex_cfunction">binary_c_new_system</span>, e.g.&nbsp;with </div>
+<div class="standard" id='magicparlabel-5193'>but beware that your local <span class="flex_cstruct">store</span> and <span class="flex_cstruct">stardata</span> must also be set to <span class="flex_cmacro">NULL</span> if you require it to be regenerated on a subsequent call to <span class="flex_cfunction">binary_c_new_system</span>, e.g.&nbsp;with </div>
 
-<div class="standard" id='magicparlabel-4728'><br />
+<div class="standard" id='magicparlabel-5210'><br />
 <pre class ='listings <i>C</i>'>      binary_c_free_memory(&amp;stardata,TRUE,TRUE,TRUE);
       store = NULL;
       stardata = NULL; </pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-4735'>You must not call <span class="flex_cfunction">binary_c_free_memory</span> to free your <span class="flex_cstruct">stardata</span> and <span class="flex_cstruct">store</span> and then immediately use <span class="flex_cmacro">Safe_free</span> on these pointers. They have already been freed, just not set to <span class="flex_cmacro">NULL</span> (because it is impossible to do so in <span class="flex_cfunction">binary_c_free_memory</span>), and freeing them – even with <span class="flex_cmacro">Safe_free</span> – will cause a crash.</div>
+<div class="standard" id='magicparlabel-5217'>You must not call <span class="flex_cfunction">binary_c_free_memory</span> to free your <span class="flex_cstruct">stardata</span> and <span class="flex_cstruct">store</span> and then immediately use <span class="flex_cmacro">Safe_free</span> on these pointers. They have already been freed, just not set to <span class="flex_cmacro">NULL</span> (because it is impossible to do so in <span class="flex_cfunction">binary_c_free_memory</span>), and freeing them – even with <span class="flex_cmacro">Safe_free</span> – will cause a crash.</div>
 
-<div class="standard" id='magicparlabel-4764'>If you are concerned that memory has <em>not</em> been freed, try running <span class='math'>binary_c</i></span>
- through <span class="flex_software">valgrind</span> or enable the <span class="flex_cmacro">USE_MCHECK</span> flag in <span class="flex_headerfile">code_options.h</span>. If you cannot find the problem, or if it's a problem not of your making, please contact Rob about it so that it can be fixed for everyone.</div>
+<div class="standard" id='magicparlabel-5246'>If you are concerned that memory has <em>not</em> been freed, try running <span class='math'>binary_c</i></span>
+ through <span class="flex_software">valgrind</span> or enable the <span class="flex_cmacro">CODESTATS</span> flag in <span class="flex_headerfile">binary_c_code_options.h</span>. If you cannot find the problem, or if it's a problem not of your making, please contact Rob about it so that it can be fixed for everyone.</div>
 
-<h2 class="section" id='magicparlabel-4777'><span class="section_label">7</span> Code description and internals</h2>
-<div class="standard" id='magicparlabel-4778'><div id="sec_Code_description"></div>
+<h2 class="section" id='magicparlabel-5259'><span class="section_label">8</span> Code description and internals</h2>
+<div class="standard" id='magicparlabel-5260'><div id="sec_Code_description"></div>
 </div>
 
-<div class="standard" id='magicparlabel-4779'>This section describes some of the internal details of the <em><i>binary_c</i></em> code.</div>
-<h3 class="subsection" id='magicparlabel-4780'><span class="subsection_label">7.1</span> History</h3>
-<div class="standard" id='magicparlabel-4781'><div id="subsec_History"></div>
+<div class="standard" id='magicparlabel-5261'>This section describes some of the internal details of the <em><i>binary_c</i></em> code.</div>
+<h3 class="subsection" id='magicparlabel-5262'><span class="subsection_label">8.1</span> History</h3>
+<div class="standard" id='magicparlabel-5263'><div id="subsec_History"></div>
 First, a bit of history. The <em><span class="flex_software">BSE</span></em> code was given to me by Chris Tout in October 2000 and some updates were made in May 2001 (from Jarrod Hurley). Jarrod was responsible for the October 2000 version, written as one monolithic block of evil <span class="flex_programminglanguage">Fortran</span>, although past collaborators such as Chris Tout, Sverre Aarseth, Onno Pols etc. (who else have I forgotten?) had input their talent to the code. The <span class="flex_programminglanguage">Fortran</span> version was converted to <em>C</em> (because I hate <em>Fortran</em> and it was <em>my</em> <em>bloody</em> <em>PhD</em>!) and (some of) the bugs worked out of it. This gave me a chance to lay the code out quite differently.</div>
 
-<div class="standard" id='magicparlabel-4794'>One major change is in the organisation of the variables. In the <span class="flex_programminglanguage">Fortran</span> code there are lots of arrays of size 2 (there are two stars) and a load of evil common blocks. These have been replaced by structures, one for each <span style='font-family:monospace;font-size: 18px;'>star</span>, the <span class="flex_cstruct">common</span> and <span class="flex_cstruct">model</span> structures, a <span class="flex_cstruct">preferences</span> structure to contain user-defined options, and a <span class="flex_cstruct">stardata</span> structure which contains pointers to everything else. Pointers are far quicker to use than passing the actual data around. Conceptually it's useful to have all the information about each star in one space, since most functions deal only with one star and can access all the information through a single pointer (and pointers are fast).</div>
+<div class="standard" id='magicparlabel-5276'>One major change is in the organisation of the variables. In the <span class="flex_programminglanguage">Fortran</span> code there are lots of arrays of size 2 (there are two stars) and a load of evil common blocks. These have been replaced by structures, one for each <span style='font-family:monospace;font-size: 18px;'>star</span>, the <span class="flex_cstruct">common</span> and <span class="flex_cstruct">model</span> structures, a <span class="flex_cstruct">preferences</span> structure to contain user-defined options, and a <span class="flex_cstruct">stardata</span> structure which contains pointers to everything else. Pointers are far quicker to use than passing the actual data around. Conceptually it's useful to have all the information about each star in one space, since most functions deal only with one star and can access all the information through a single pointer (and pointers are fast).</div>
 
-<div class="standard" id='magicparlabel-4815'>Throughout the code you'll see lots of <span style='font-family:monospace;font-size: 18px;'>Dprint</span> statements, these are enabled when debugging is turned on. These are very useful when something goes wrong (see section&nbsp;<a href="#sec_debugging">5.23</a>).</div>
+<div class="standard" id='magicparlabel-5297'>Throughout the code you'll see lots of <span style='font-family:monospace;font-size: 18px;'>Dprint</span> statements, these are enabled when debugging is turned on. These are very useful when something goes wrong (see section&nbsp;<a href="#sec_debugging">6.23</a>).</div>
 
-<div class="standard" id='magicparlabel-4816'>If you change anything, and would like me to debug it or you would like to commit it to the master branch, I insist on the following.</div>
+<div class="standard" id='magicparlabel-5298'>If you change anything, and would like me to debug it or you would like to commit it to the master branch, I insist on the following.</div>
 
-<ul class="itemize" id='magicparlabel-4817'><li class="itemize_item">Learn about how to write <span class="flex_programminglanguage">C</span>, e.g. <a href="https://www.maultech.com/chrislott/resources/cstyle/indhill-cstyle.pdf">https://www.maultech.com/chrislott/resources/cstyle/indhill-cstyle.pdf</a> or <a href="https://en.wikipedia.org/wiki/The_C_Programming_Language">https://en.wikipedia.org/wiki/The_C_Programming_Language</a>.</li>
+<ul class="itemize" id='magicparlabel-5299'><li class="itemize_item">Learn about how to write <span class="flex_programminglanguage">C</span>, e.g. <a href="https://www.maultech.com/chrislott/resources/cstyle/indhill-cstyle.pdf">https://www.maultech.com/chrislott/resources/cstyle/indhill-cstyle.pdf</a> or <a href="https://en.wikipedia.org/wiki/The_C_Programming_Language">https://en.wikipedia.org/wiki/The_C_Programming_Language</a>.</li>
 <li class="itemize_item">Learn how to format your <span class="flex_programminglanguage">C</span> code properly. Please use the <a href="https://en.wikipedia.org/wiki/Indentation_style#Allman_style">Allman style</a> and indent with four spaces (<a href="https://www.gnu.org/software/emacs/">emacs</a> indents <span class="flex_programminglanguage">C</span> like this automatically).</li>
 <li class="itemize_item">Include <em>good comments</em> even if these are &ldquo;this is a fudge&rdquo;. Remember that people who do not know how the code works will want to change the code in the future, and I have to check it before it is committed. Descriptions of the physics, paraphrased from a paper if you have to (but remember to give appropriate credit) are encouraged.</li>
 <li class="itemize_item">Include <span class="flex_cmacro">Dprint()</span> statements so that if there is a <span class="flex_cmacro">DEBUG</span> flag set there will be some (useful!) output to the screen during runtime.</li>
 <li class="itemize_item">Make sure the names of your variables <em>describe what they do</em> (in English :-). I do not care if the variable names are long (long is good!) and the computer certainly doesn't either.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-4842'><span class="subsection_label">7.2</span> How the <em><i>binary_c</i></em> code works</h3>
-<div class="standard" id='magicparlabel-4843'><div id="subsec_How_the_code"></div>
+<h3 class="subsection" id='magicparlabel-5324'><span class="subsection_label">8.2</span> How the <em><i>binary_c</i></em> code works</h3>
+<div class="standard" id='magicparlabel-5325'><div id="subsec_How_the_code"></div>
 The <em><i>binary_c</i></em> code, based on <em><span class="flex_software">BSE</span></em>, deals with stellar evolution and binary evolution i.e. the mass, core mass, luminosity, radius of both stars, mass loss and gain, orbital changes, supernovae and novae. Its<em> nucleosynthesis</em> (&ldquo;<em>nucsyn</em>&rdquo;) code deals with the surface abundance of the stars, follows this as mass is lost or gained and also the luminosity and radius on the TPAGB, dredge-ups, HBB, WR stars, supernova and nova yields. This does not sound like much but it's complicated enough! So as the <em><i>binary_c</i></em> code does the stellar (&ldquo;structure&rdquo;)<em> </em>evolution, the <em>nucsyn</em> code identifies when the surface abundances change. </div>
 
-<h3 class="subsection" id='magicparlabel-4850'><span class="subsection_label">7.3</span> Memory management in <span class='math'>binary_c</i></span>
+<h3 class="subsection" id='magicparlabel-5332'><span class="subsection_label">8.3</span> Memory management in <span class='math'>binary_c</i></span>
 </h3>
-<div class="standard" id='magicparlabel-4851'><div id="subsec_Memory_management"></div>
+<div class="standard" id='magicparlabel-5333'><div id="subsec_Memory_management"></div>
 </div>
-<h4 class="subsubsection" id='magicparlabel-4852'><span class="subsubsection_label">7.3.1</span> Memory allocation</h4>
-<div class="standard" id='magicparlabel-4853'>Memory should be allocated using the macros <span class="flex_cmacro">MALLOC</span>, <span class="flex_cmacro">CALLOC</span> and <span class="flex_cmacro">REALLOC</span> which replace the system <span class="flex_cfunction">malloc</span>, <span class="flex_cfunction">calloc</span> and <span class="flex_cfunction">realloc</span>, respectively. These macros allow for automatic error checking, e.g.&nbsp;when an allocation fails (i.e.&nbsp;when <span class="flex_cmacro">ALLOC_CHECKS</span> is defined), as well as the use of aligned memory (which should be faster).</div>
-<h4 class="subsubsection" id='magicparlabel-4882'><span class="subsubsection_label">7.3.2</span> Stack size</h4>
-<div class="standard" id='magicparlabel-4883'>The allocation of big data tables can require a large stack. Please remember to set your stack size, either in your shell e.g.&nbsp;with <em><span class="flex_software">ulimit</span></em> or in <span class="flex_software">Perl</span>'s threads, e.g.<span style='font-family:monospace;font-size: 18px;'>,<br />
+<h4 class="subsubsection" id='magicparlabel-5334'><span class="subsubsection_label">8.3.1</span> Memory allocation</h4>
+<div class="standard" id='magicparlabel-5335'>Memory should be allocated using the macros <span class="flex_cmacro">Malloc</span>, <span class="flex_cmacro">Calloc</span> and <span class="flex_cmacro">Realloc</span> which replace the system <span class="flex_cfunction">malloc</span>, <span class="flex_cfunction">calloc</span> and <span class="flex_cfunction">realloc</span>, respectively. These macros allow for automatic error checking, e.g.&nbsp;when an allocation fails (i.e.&nbsp;when <span class="flex_cmacro">ALLOC_CHECKS</span> is defined), as well as the use of aligned memory (which should be faster).</div>
+<h4 class="subsubsection" id='magicparlabel-5364'><span class="subsubsection_label">8.3.2</span> Stack size</h4>
+<div class="standard" id='magicparlabel-5365'>The allocation of big data tables can require a large stack. Please remember to set your stack size, either in your shell e.g.&nbsp;with <em><span class="flex_software">ulimit</span></em> or in <span class="flex_software">Perl</span>'s threads, e.g.<span style='font-family:monospace;font-size: 18px;'>,<br />
 <pre class ='listings Perl'>use threads 'stack_size'=&gt;4096*10000</pre><br />
-</span>appropriately. If your stack is too small, you will get (possibly random) segmentation faults. See section&nbsp;<a href="#subsec_Segmentation_faults">7.5.5</a> for more information.</div>
-<h4 class="subsubsection" id='magicparlabel-4896'><span class="subsubsection_label">7.3.3</span> Main Memory Structures: stardata<div id="subsec_Memory_Structures"></div>
+</span>appropriately. If your stack is too small, you will get (possibly random) segmentation faults. See section&nbsp;<a href="#subsec_Segmentation_faults">8.5.5</a> for more information.</div>
+<h4 class="subsubsection" id='magicparlabel-5378'><span class="subsubsection_label">8.3.3</span> Main Memory Structures: stardata<div id="subsec_Memory_Structures"></div>
 </h4>
-<div class="standard" id='magicparlabel-4897'>Memory use in <em><span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5379'>Memory use in <em><span class='math'>binary_c</i></span>
 </em> is divided into structures which are allocated appropriately. The main structure, a pointer to which is passed around all over the place, is <em><span class="flex_cstruct">stardata</span></em>. Normally this is all you need. However, there are structures for specific purposes as described below. Memory allocation is mostly done in the <span class="flex_cfunction">main_allocations</span> subroutine.</div>
 
-<div class="standard" id='magicparlabel-4906'>Variables are stored as arrays within, e.g., <span class="flex_cstruct">stardata</span><em>,</em> which is dynamically allocated on the heap, rather than being dynamically allocated themeslves. You should probably not use <span class="flex_cstruct">stardata</span><em> </em>as a local stack variable, because it is liable to be quite large.</div>
+<div class="standard" id='magicparlabel-5388'>Variables are stored as arrays within, e.g., <span class="flex_cstruct">stardata</span><em>,</em> which is dynamically allocated on the heap, rather than being dynamically allocated themeslves. You should probably not use <span class="flex_cstruct">stardata</span><em> </em>as a local stack variable, because it is liable to be quite large.</div>
 
-<dl class='description' id='magicparlabel-4915'><dt class="description_label">stardata_t</dt>
+<dl class='description' id='magicparlabel-5397'><dt class="description_label">stardata_t</dt>
 <dd class="description_item"> The main <span class="flex_cstruct">stardata</span> structure is used to store the information about the stellar system currently being evolved, as well as pointers to all the other memory stores. <span class="flex_cstruct">stardata</span> is set to 0 (the <span style='font-family:monospace;font-size: 18px;'>NULL</span> byte '\0') at the beginning of evolution, so everything inside it is either zero (for floats, doubles, ints etc.), or <span style='font-family:monospace;font-size: 18px;'><span class="flex_cmacro">FALSE</span></span> (for Booleans).</dd>
 <dt class="description_label">previous_stardata_t</dt>
 <dd class="description_item"> A pointer to the top of the <span class="flex_cstruct">previous_stardata</span> stack. This is used at the end of an evolutionary step to calculate derivatives and perform logging (e.g.&nbsp;change of stellar type).</dd>
@@ -5802,12 +6140,12 @@ The <em><i>binary_c</i></em> code, based on <em><span class="flex_software">BSE<
 <dt class="description_label">binary_c_fixed_timestep</dt>
 <dd class="description_item"> Used to make &ldquo;fixed&rdquo; timesteps, e.g.&nbsp;so you can output every <em>n </em>million years, exactly (also works in log time).</dd>
 <dt class="description_label">binary_c_event_t</dt>
-<dd class="description_item"> Used in the events code (see Section&nbsp;<a href="#subsec_Events">7.6</a>). There are various other custom structures which store data for events (see <span class="flex_headerfile">binary_c_structures.h</span>)</dd>
+<dd class="description_item"> Used in the events code (see Section&nbsp;<a href="#subsec_Events">8.6</a>). There are various other custom structures which store data for events (see <span class="flex_headerfile">binary_c_structures.h</span>)</dd>
 </dl>
-<h4 class="subsubsection" id='magicparlabel-5122'><span class="subsubsection_label">7.3.4</span> Supplementary data structures</h4>
-<div class="standard" id='magicparlabel-5123'>There are a number of other data structures used by <em><i>binary_c</i></em>. A few are listed here and most are not of interest to you.</div>
+<h4 class="subsubsection" id='magicparlabel-5604'><span class="subsubsection_label">8.3.4</span> Supplementary data structures</h4>
+<div class="standard" id='magicparlabel-5605'>There are a number of other data structures used by <em><i>binary_c</i></em>. A few are listed here and most are not of interest to you.</div>
 
-<dl class='description' id='magicparlabel-5124'><dt class="description_label">data_table_t</dt>
+<dl class='description' id='magicparlabel-5606'><dt class="description_label">data_table_t</dt>
 <dd class="description_item"> This contains information about a data table. Set up (a pointer to, i.e. data_table_t*) the data table through <span class="flex_cmacro">NewDataTable_from_Array</span> or <span class="flex_cmacro">NewDataTable_from_Pointer</span>. Access the data table through the <span class="flex_cmacro">Interpolate</span> macro (which interfaces with <span class="flex_software">librinterpolate</span>). Delete the table with <span class="flex_cmacro">Delete_data_table</span>. The <span class="flex_cvar">data_table_t.data</span> pointer points to an array of doubles which contains the data: this memory is not allocated for you. If set up in the <span class="flex_cstruct">store</span> or <span class="flex_cstruct">tmpstore</span> this can be dynamically allocated, elsewhere you have to be careful and probably point to a data array inside <span class="flex_cstruct">stardata</span>.
 <br />
 
@@ -5827,119 +6165,119 @@ If you want to set up a <span class="flex_cstruct">data_table_t</span> rather th
 <dt class="description_label">binary_system_t</dt>
 <dd class="description_item"> Used to define the properties of a binary-star system in the disc code.</dd>
 </dl>
-<h4 class="subsubsection" id='magicparlabel-5188'><span class="subsubsection_label">7.3.5</span> Thread safety</h4>
-<div class="standard" id='magicparlabel-5189'><em><span class='math'>binary_c</i></span>
+<h4 class="subsubsection" id='magicparlabel-5670'><span class="subsubsection_label">8.3.5</span> Thread safety</h4>
+<div class="standard" id='magicparlabel-5671'><em><span class='math'>binary_c</i></span>
 </em>, as of version 2.0pre21 and in all subsequent versions, i.e. in the version you are using!, is designed to be thread-safe, i.e.&nbsp;it can be built as a shared library (<span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ make <i>libbinary_c.so</i></pre><br />
 </span>) and deployed in many threads by one process (as in <em><span class='math'>\binarygrid</span>
 </em> with the <span class="flex_programminglanguage">C</span> backend). To this end:</div>
 
-<ul class="itemize" id='magicparlabel-5198'><li class="itemize_item">You <b>may not</b> use static variables. Put your data into <em><span class="flex_cstruct">stardata</span></em>.</li>
+<ul class="itemize" id='magicparlabel-5680'><li class="itemize_item">You <b>may not</b> use static variables. Put your data into <em><span class="flex_cstruct">stardata</span></em>.</li>
 <li class="itemize_item">You <b>may not</b> use global variables (i.e.&nbsp;no <span style='font-family:monospace;font-size: 18px;'>extern</span> statements). Put your data into <em><span class="flex_cstruct">stardata</span></em>.</li>
 <li class="itemize_item">You may not use non-thread-safe <span class="flex_programminglanguage">C</span> library functions (e.g. <span class="flex_cfunction">strtok</span> and hash functions, use the <span style='font-family:monospace;font-size: 18px;'>_r</span> or <span style='font-family:monospace;font-size: 18px;'>_s</span> equivalents). Some of these functions have been redefined as macros in <span class='math'>binary_c</i></span>
  – these macros will deliberately fail the compilation process and hopefully give you a warning.</li>
 <li class="itemize_item">You must follow the conventions given above regarding memory allocation in <em><span class="flex_cstruct">stardata</span></em>.</li>
 </ul>
-<div class="standard" id='magicparlabel-5222'>Please use the memory structures appropriately (see&nbsp;<a href="#subsec_Memory_Structures">7.3.3</a>). </div>
-<h3 class="subsection" id='magicparlabel-5223'><span class="subsection_label">7.4</span> Output</h3>
-<div class="standard" id='magicparlabel-5224'><div id="subsec_Output"></div>
+<div class="standard" id='magicparlabel-5704'>Please use the memory structures appropriately (see&nbsp;<a href="#subsec_Memory_Structures">8.3.3</a>). </div>
+<h3 class="subsection" id='magicparlabel-5705'><span class="subsection_label">8.4</span> Output</h3>
+<div class="standard" id='magicparlabel-5706'><div id="subsec_Output"></div>
 </div>
 
-<div class="standard" id='magicparlabel-5225'><span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5707'><span class='math'>binary_c</i></span>
  must communicate its results to you <em>somehow</em> otherwise what is the point? When running one star, it is sufficient to send output to either the screen (<span class="flex_cvar">stdout</span>) or to a file (with redirection, e.g. <span style='font-family:monospace;font-size: 18px;'>tbse &gt; file</span>). When running millions of stars, output must be sent to, e.g., a function you define (usually <span class="flex_perlcode">parse_bse</span>) when using the <em><span class='math'>\binarygrid</span>
 </em>. In this case, either data is sent through a pipe (using the <span class="flex_scriptinglanguage">Perl</span> backend) or in an array in memory (using the <span class="flex_programminglanguage">C</span> backend). Thus, <span class='math'>binary_c</i></span>
  has to intercept your output and decide where to send it. This is done as follows.</div>
 
-<ol class="enumerate" id='magicparlabel-5242'><li class="enumerate_item">Use <span class="flex_cmacro">Printf</span> instead of <span class="flex_cfunction">printf</span>: <span class="flex_cmacro">Printf</span> sends data to <span class="flex_cfunction">buffered_printf</span>. This stores raw output data in a buffer, and outputs either immediately, at the end of evolution, or not at all, depending on what you want to do with the buffer. It is up to you to clear out the buffer after evolution (or on a switch of <span class="flex_cstruct">stardata</span>) with a call to buffer_empty_buffer. You can get the pointer used to store the buffer from <span class="flex_cfunction">buffer_info</span>.</li>
+<ol class="enumerate" id='magicparlabel-5724'><li class="enumerate_item">Use <span class="flex_cmacro">Printf</span> instead of <span class="flex_cfunction">printf</span>: <span class="flex_cmacro">Printf</span> sends data to <span class="flex_cfunction">buffered_printf</span>. This stores raw output data in a buffer, and outputs either immediately, at the end of evolution, or not at all, depending on what you want to do with the buffer. It is up to you to clear out the buffer after evolution (or on a switch of <span class="flex_cstruct">stardata</span>) with a call to buffer_empty_buffer. You can get the pointer used to store the buffer from <span class="flex_cfunction">buffer_info</span>.</li>
 <li class="enumerate_item">Use _printf to actually output to stdout using the <i>C</i>-library's <span class="flex_cfunction">fprintf</span> function.</li>
 <li class="enumerate_item"><b>warning: experimental </b>If <span class="flex_cmacro">BUFFERED_STACK</span> is defined, you can use <em><span class="flex_cfunction">binary_c_stack_printf</span></em>, which is a more advanced buffer with a full stack API (e.g.&nbsp;push and pop functions), that can include (<span class="flex_software">zlib</span>) compression. However, at present this is not used, and may never be a standard part of <span class='math'>binary_c</i></span>
 .</li>
 </ol>
-<h4 class="subsubsection" id='magicparlabel-5285'><span class="subsubsection_label">7.4.1</span> Interaction with <i>binary_grid</i></h4>
-<div class="standard" id='magicparlabel-5286'>The interaction between <span class='math'>binary_c</i></span>
+<h4 class="subsubsection" id='magicparlabel-5767'><span class="subsubsection_label">8.4.1</span> Interaction with <i>binary_grid</i></h4>
+<div class="standard" id='magicparlabel-5768'>The interaction between <span class='math'>binary_c</i></span>
  and <span class='math'>\binarygrid</span>
  depends very much on how data is output. When using the Perl backend, pipes are used to funnel data from <span class='math'>binary_c</i></span>
  to <span class='math'>\binarygrid</span>
  and vice versa. Output should be sent to <span class="flex_cvar">stdout</span>. When using the <i>C</i> backend, data is sent to the buffer and then the buffer accessed from Perl (via <span class="flex_perlmodule">Inline::C</span>, i.e.&nbsp;using <span class="flex_perlmodule">XS</span>) directly without ever being sent to <span class="flex_cvar">stdout</span>. This <em>should</em> be faster.</div>
-<h3 class="subsection" id='magicparlabel-5303'><span class="subsection_label">7.5</span> Debugging <span class='math'>binary_c</i></span>
+<h3 class="subsection" id='magicparlabel-5785'><span class="subsection_label">8.5</span> Debugging <span class='math'>binary_c</i></span>
 </h3>
-<div class="standard" id='magicparlabel-5304'>I give here some general strategies for debugging <span class='math'>binary_c</i></span>, but of course there are many ways to debug code: you may know better ways, in which case please contribute to this manual!</div>
-<h4 class="subsubsection" id='magicparlabel-5305'><span class="subsubsection_label">7.5.1</span> General strategy: <span class="flex_bashscript">tbse</span>, <span class='math'>\binarygrid</span>
+<div class="standard" id='magicparlabel-5786'>I give here some general strategies for debugging <span class='math'>binary_c</i></span>, but of course there are many ways to debug code: you may know better ways, in which case please contribute to this manual!</div>
+<h4 class="subsubsection" id='magicparlabel-5787'><span class="subsubsection_label">8.5.1</span> General strategy: <span class="flex_bashscript">tbse</span>, <span class='math'>\binarygrid</span>
 </h4>
-<div class="standard" id='magicparlabel-5310'>The usual problem is that you are running a grid of stars and one star causes <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5792'>The usual problem is that you are running a grid of stars and one star causes <span class='math'>binary_c</i></span>
  to crash. If you are lucky, this does not bring down the whole grid, but it might (especially if you are using the <span class="flex_programminglanguage">C</span> backend). It is important to identify precisely which star caused the crash. You will find this very hard to do if you are running a grid with more than one thread, because any thread could have caused the crash. So, the first thing you must do is run your grid with only one thread, and with <span class='math'>\binarygrid</span>
  debugging level at least set to 3 (e.g. run <span style='font-family:monospace;font-size: 18px;'>&lt;script&gt; vb=3</span>). This will tell you the arguments which were sent to <span class='math'>binary_c</i></span>
  that caused the crash. Save these to a file.</div>
 
-<div class="standard" id='magicparlabel-5315'>Next, you should use the <span class="flex_bashscript">tbse</span> (Test Binary Star Evolution) script to run <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5797'>Next, you should use the <span class="flex_bashscript">tbse</span> (Test Binary Star Evolution) script to run <span class='math'>binary_c</i></span>
  with these arguments. This is very easy, just run</div>
 
-<div class="standard" id='magicparlabel-5320'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-5802'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ tbse &lt;filename&gt;</pre><br />
 </span></div>
 
-<div class="standard" id='magicparlabel-5325'>You should see output, and (hopefully) the same failure as caused the grid to crash. Now you can debug <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5807'>You should see output, and (hopefully) the same failure as caused the grid to crash. Now you can debug <span class='math'>binary_c</i></span>
  properly, in an isolated test case.</div>
 
-<div class="standard" id='magicparlabel-5326'>Note that the idea of isolating a test case which causes a failure is good practice in science and engineering in general, so you're doing nothing unusual here. The strategy now is:</div>
+<div class="standard" id='magicparlabel-5808'>Note that the idea of isolating a test case which causes a failure is good practice in science and engineering in general, so you're doing nothing unusual here. The strategy now is:</div>
 
-<ul class="itemize" id='magicparlabel-5327'><li class="itemize_item">If you are seeing a segmentation fault, you probably want to now debug with <span class="flex_software">valgrind</span> or <em><span class="flex_software">gdb</span></em>.</li>
-<li class="itemize_item">If your problem is in your algorithm and is not really a coding error as such, you probably want to use the internal debugging with <span class="flex_cmacro">DEBUG</span>, <span class="flex_cmacro">DEBUG_EXP</span> and <span class="flex_cmacro">Dprint</span>. See Section&nbsp;<a href="#subsec_DEBUG__DEBUG_EXP_and">7.5.3</a> below.</li>
+<ul class="itemize" id='magicparlabel-5809'><li class="itemize_item">If you are seeing a segmentation fault, you probably want to now debug with <span class="flex_software">valgrind</span> or <em><span class="flex_software">gdb</span></em>.</li>
+<li class="itemize_item">If your problem is in your algorithm and is not really a coding error as such, you probably want to use the internal debugging with <span class="flex_cmacro">DEBUG</span>, <span class="flex_cmacro">DEBUG_EXP</span> and <span class="flex_cmacro">Dprint</span>. See Section&nbsp;<a href="#subsec_DEBUG__DEBUG_EXP_and">8.5.3</a> below.</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-5349'><span class="subsubsection_label">7.5.2</span> Configure script and debug builds<div id="subsec_debug_builds"></div>
+<h4 class="subsubsection" id='magicparlabel-5831'><span class="subsubsection_label">8.5.2</span> Configure script and debug builds<div id="subsec_debug_builds"></div>
 </h4>
-<div class="standard" id='magicparlabel-5350'>When debugging, it is important to disable any optimisation the compiler uses and turn on options that allow the code to be debugged with <span class="flex_software">gdb</span> and/or <em><span class="flex_software">valgrind</span></em>, and use the <span class="flex_cmacro">backtrace</span> feature (you must have <span class="flex_software">libbacktrace</span> installed, see Section&nbsp;<a href="#subsec_Backtrace">7.5.4</a>). To do this, run</div>
+<div class="standard" id='magicparlabel-5832'>When debugging, it is important to disable any optimisation the compiler uses and turn on options that allow the code to be debugged with <span class="flex_software">gdb</span> and/or <em><span class="flex_software">valgrind</span></em>, and use the <span class="flex_cmacro">backtrace</span> feature (you must have <span class="flex_software">libbacktrace</span> installed, see Section&nbsp;<a href="#subsec_Backtrace">8.5.4</a>). To do this, run</div>
 
-<div class="standard" id='magicparlabel-5367'><br />
+<div class="standard" id='magicparlabel-5849'><br />
 <pre class\s*='listings bash'>$ ./configure debug
 $ make cleanall
 $ make</pre><br />
 to make a &ldquo;debug build&rdquo;. You should use the <span class="flex_software">gcc</span><em> </em>compiler to debug, e.g., <span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ export CC=gcc</pre><br />
 </span>prior to running <span class="flex_bashscript">configure</span>. While others, e.g.&nbsp;<em><span class="flex_software">clang</span></em>, probably work just fine, these have not been extensively tested. </div>
-<h4 class="subsubsection" id='magicparlabel-5390'><span class="subsubsection_label">7.5.3</span> DEBUG, DEBUG_EXP and Dprint<div id="subsec_DEBUG__DEBUG_EXP_and"></div>
+<h4 class="subsubsection" id='magicparlabel-5872'><span class="subsubsection_label">8.5.3</span> DEBUG, DEBUG_EXP and Dprint<div id="subsec_DEBUG__DEBUG_EXP_and"></div>
 </h4>
-<div class="standard" id='magicparlabel-5391'>Internal debugging in <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-5873'>Internal debugging in <span class='math'>binary_c</i></span>
  is very useful to determine where an algorithm fails. It is not so useful in determining where segmentation faults and memory errors occur, although it is obviously useful in the sense that debugging will continue until a crash. </div>
 
-<div class="standard" id='magicparlabel-5392'>To enable internal debugging, edit code_options.h and set the appropriate line <span style='font-family:monospace;font-size: 18px;'>#define DEBUG 1</span>. You will then need to rebuild the all the code (see&nbsp;<a href="#subsec_debug_builds">7.5.2</a>). </div>
+<div class="standard" id='magicparlabel-5874'>To enable internal debugging, edit code_options.h and set the appropriate line <span style='font-family:monospace;font-size: 18px;'>#define DEBUG 1</span>. You will then need to rebuild the all the code (see&nbsp;<a href="#subsec_debug_builds">8.5.2</a>). </div>
 
-<div class="standard" id='magicparlabel-5393'>When you now run <em>tbse</em> you will see many lines of data. These correspond to <span class="flex_cmacro">Dprint</span> (i.e.&nbsp;&ldquo;debug-print&rdquo;) lines in the code. </div>
+<div class="standard" id='magicparlabel-5875'>When you now run <em>tbse</em> you will see many lines of data. These correspond to <span class="flex_cmacro">Dprint</span> (i.e.&nbsp;&ldquo;debug-print&rdquo;) lines in the code. </div>
 
-<div class="standard" id='magicparlabel-5398'>There are often too many lines of data. You can restrict the data output by defining the <span class="flex_cmacro">DEBUG_EXP</span> macro. There is only output when this is true (in a <span class="flex_programminglanguage">C</span> sense of truth) so it is usually set to 1. However, you can always restrict to, say, outputting between 9 and 10 Gyr:</div>
+<div class="standard" id='magicparlabel-5880'>There are often too many lines of data. You can restrict the data output by defining the <span class="flex_cmacro">DEBUG_EXP</span> macro. There is only output when this is true (in a <span class="flex_programminglanguage">C</span> sense of truth) so it is usually set to 1. However, you can always restrict to, say, outputting between 9 and 10 Gyr:</div>
 
-<div class="standard" id='magicparlabel-5407'><br />
+<div class="standard" id='magicparlabel-5889'><br />
 <pre class ='listings <i>C</i>'>#define DEBUG_EXP (stardata-&gt;model.time &gt; 9000 &amp;&amp; stardata-&gt;model.time &lt; 10000)</pre><br />
 You will almost always have <span class="flex_cstruct">stardata</span><em> </em>available to <span class="flex_cmacro">Dprint</span>. </div>
 
-<div class="standard" id='magicparlabel-5420'>There are many other debugging options listed in debug_macros.h, most of which are not useful to you.</div>
+<div class="standard" id='magicparlabel-5902'>There are many other debugging options listed in debug_macros.h, most of which are not useful to you.</div>
 
-<div class="standard" id='magicparlabel-5421'>You can change the output of <span class="flex_cmacro">Dprint</span> in <span class="flex_cmacro">src/debug/debug_fprintf.c</span></div>
+<div class="standard" id='magicparlabel-5903'>You can change the output of <span class="flex_cmacro">Dprint</span> in <span class="flex_cmacro">src/debug/debug_fprintf.c</span></div>
 
-<div class="standard" id='magicparlabel-5430'>Another macro, <span class="flex_cmacro">Dprint_no_newline</span>, is the same as <span class="flex_cmacro">Dprint</span> but without a &ldquo;<span class="flex_cmacro">\n</span>&rdquo; newline at the end of the string.</div>
-<h4 class="subsubsection" id='magicparlabel-5443'><span class="subsubsection_label">7.5.4</span> Backtrace<div id="subsec_Backtrace"></div>
+<div class="standard" id='magicparlabel-5912'>Another macro, <span class="flex_cmacro">Dprint_no_newline</span>, is the same as <span class="flex_cmacro">Dprint</span> but without a &ldquo;<span class="flex_cmacro">\n</span>&rdquo; newline at the end of the string.</div>
+<h4 class="subsubsection" id='magicparlabel-5925'><span class="subsubsection_label">8.5.4</span> Backtrace<div id="subsec_Backtrace"></div>
 </h4>
-<div class="standard" id='magicparlabel-5444'>If <span class="flex_cmacro">BACKTRACE</span> is defined (in <span class="flex_headerfile">binary_c_code_options.h</span>) you have access to stack tracing features similar to those used in debuggers. Please install <span class="flex_software">libbacktrace</span> before expecting this to work. Calling the <span class="flex_cmacro">Backtrace</span> macro (with no arguments) allows you to see a list of callers of any function, anywhere in <span class='math'>binary_c</i></span>, through the <span class="flex_cfunction">print_trace</span> function. This is a very useful feature if you want to see which function called the function in which you have a problem. Note that it is, however, quite slow, and requires a debug build.</div>
+<div class="standard" id='magicparlabel-5926'>If <span class="flex_cmacro">BACKTRACE</span> is defined (in <span class="flex_headerfile">binary_c_code_options.h</span>) you have access to stack tracing features similar to those used in debuggers. Please install <span class="flex_software">libbacktrace</span> before expecting this to work. Calling the <span class="flex_cmacro">Backtrace</span> macro (with no arguments) allows you to see a list of callers of any function, anywhere in <span class='math'>binary_c</i></span>, through the <span class="flex_cfunction">print_trace</span> function. This is a very useful feature if you want to see which function called the function in which you have a problem. Note that it is, however, quite slow, and requires a debug build.</div>
 
-<div class="standard" id='magicparlabel-5465'>Note that this feature has not been tested on platforms other than Linux.</div>
-<h4 class="subsubsection" id='magicparlabel-5466'><span class="subsubsection_label">7.5.5</span> Segmentation faults<div id="subsec_Segmentation_faults"></div>
+<div class="standard" id='magicparlabel-5947'>Note that this feature has not been tested on platforms other than Linux.</div>
+<h4 class="subsubsection" id='magicparlabel-5948'><span class="subsubsection_label">8.5.5</span> Segmentation faults<div id="subsec_Segmentation_faults"></div>
 </h4>
-<div class="standard" id='magicparlabel-5467'>As with any code with large chunks of data being dynamically allocated, any attempt to access data which is not allocated leads to a segmentation fault. It is often extremely difficult to determine where the cause lies, as it may be somewhere previous in the program, or even on another thread. Should you encounter such a segmentation fault, please try running through <span class="flex_software">gdb</span> and/or <span class="flex_software">valgrind</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-5476'><span class="subsubsection_label">7.5.6</span> gdb</h4>
-<div class="standard" id='magicparlabel-5477'>The <i>GNU</i> debugger, <span class="flex_software">gdb</span>, is a useful option for quickly finding the location of a segmentation fault. Run</div>
+<div class="standard" id='magicparlabel-5949'>As with any code with large chunks of data being dynamically allocated, any attempt to access data which is not allocated leads to a segmentation fault. It is often extremely difficult to determine where the cause lies, as it may be somewhere previous in the program, or even on another thread. Should you encounter such a segmentation fault, please try running through <span class="flex_software">gdb</span> and/or <span class="flex_software">valgrind</span>.</div>
+<h4 class="subsubsection" id='magicparlabel-5958'><span class="subsubsection_label">8.5.6</span> gdb</h4>
+<div class="standard" id='magicparlabel-5959'>The <i>GNU</i> debugger, <span class="flex_software">gdb</span>, is a useful option for quickly finding the location of a segmentation fault. Run</div>
 
-<div class="standard" id='magicparlabel-5482'><br />
+<div class="standard" id='magicparlabel-5964'><br />
 <pre class\s*='listings bash'>$ tbse debug</pre><br />
 to launch<em> <span class='math'>binary_c</i></span>
  </em>with <span class="flex_software">gdb</span>. Once the crash has happened, use the backtrace command <span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>bt</pre><br />
 </span> to run a back trace and locate the cause of the crash.</div>
-<h4 class="subsubsection" id='magicparlabel-5495'><span class="subsubsection_label">7.5.7</span> valgrind and friends</h4>
-<div class="standard" id='magicparlabel-5496'><span class="flex_software">Valgrind</span> is a step up in technology from <em><span class="flex_software">gdb</span></em>. It not only locates segmentation faults, it also determines when (heap) memory is overwritten when it should not be, or unallocated memory is accessed. These are the two main causes of segmentation faults, so valgrind really is your friend.</div>
+<h4 class="subsubsection" id='magicparlabel-5977'><span class="subsubsection_label">8.5.7</span> valgrind and friends</h4>
+<div class="standard" id='magicparlabel-5978'><span class="flex_software">Valgrind</span> is a step up in technology from <em><span class="flex_software">gdb</span></em>. It not only locates segmentation faults, it also determines when (heap) memory is overwritten when it should not be, or unallocated memory is accessed. These are the two main causes of segmentation faults, so valgrind really is your friend.</div>
 
-<div class="standard" id='magicparlabel-5505'>There are many tools associated with <em><span class="flex_software">valgrind</span></em>:</div>
+<div class="standard" id='magicparlabel-5987'>There are many tools associated with <em><span class="flex_software">valgrind</span></em>:</div>
 
-<ul class="itemize" id='magicparlabel-5510'><li class="itemize_item"><em>memcheck</em>: this is the standard <span class="flex_software">valgrind</span><em> </em>tool for finding problems with (heap) memory access issues that lead to segfaults. Because the memory allocated in <em><span class='math'>binary_c</i></span>
+<ul class="itemize" id='magicparlabel-5992'><li class="itemize_item"><em>memcheck</em>: this is the standard <span class="flex_software">valgrind</span><em> </em>tool for finding problems with (heap) memory access issues that lead to segfaults. Because the memory allocated in <em><span class='math'>binary_c</i></span>
 </em> is mostly on the the heap (e.g.&nbsp;<span class="flex_cstruct">stardata</span><em> </em>is allocated with <span class="flex_cmacro">MALLOC</span>) it is the most useful of <span class="flex_software">valgrind</span>'s tools.
 <br />
 
@@ -5989,25 +6327,27 @@ Run this with
 <pre class\s*='listings bash'>$ tbse drd</pre><br />
 </li>
 </ul>
-<div class="standard" id='magicparlabel-5564'>You can override the arguments sent to <span class="flex_software">valgrind</span> by <span class="flex_bashscript">tbse</span> by setting the environment variable <span class="flex_envvar">VALGRIND_ARGS</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-5577'><span class="subsubsection_label">7.5.8</span> Thread safety</h4>
-<h4 class="subsubsection" id='magicparlabel-5578'><span class="subsubsection_label">7.5.9</span> NaN (not a number) checks</h4>
-<div class="standard" id='magicparlabel-5579'>If <span class="flex_cmacro">NANCHECKS</span> is defined, you can use the <span class="flex_cmacro">NANCHECK(X)</span> macro to test whether <span class="flex_cvar">X</span> is NaN. Note that checking for NaNs is computationally expensive, and you normally (once you trust your code) want <span class="flex_cmacro">NANCHECKS</span> to be undefined. If a NaN is detected, <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-6046'>You can override the arguments sent to <span class="flex_software">valgrind</span> by <span class="flex_bashscript">tbse</span> by setting the environment variable <span class="flex_envvar">VALGRIND_ARGS</span>.</div>
+<h4 class="subsubsection" id='magicparlabel-6059'><span class="subsubsection_label">8.5.8</span> Thread safety</h4>
+<h4 class="subsubsection" id='magicparlabel-6060'><span class="subsubsection_label">8.5.9</span> NaN (not a number) checks</h4>
+<div class="standard" id='magicparlabel-6061'>If <span class="flex_cmacro">NANCHECKS</span> is defined, you can use the <span class="flex_cmacro">Nancheck(X)</span> macro to test whether <span class="flex_cvar">X</span> is NaN. Note that checking for NaNs is computationally expensive, and you normally (once you trust your code) want <span class="flex_cmacro">NANCHECKS</span> to be undefined. If a NaN is detected, <span class='math'>binary_c</i></span>
  will segfault itself.</div>
-<h3 class="subsection" id='magicparlabel-5596'><span class="subsection_label">7.6</span> Events<div id="subsec_Events"></div>
+<h3 class="subsection" id='magicparlabel-6078'><span class="subsection_label">8.6</span> Events<div id="subsec_Events"></div>
 </h3>
-<div class="standard" id='magicparlabel-5597'>Starting from 2.0pre33 <i>binary_c</i> has a new events system. It now behaves more like a proper stellar evolution code, in that at each timestep derivatives of variables are calculated, then applied, and events that are set during the calculation (e.g.&nbsp;supernovae, common-envelope evolution, contact) are <em>then</em> applied. This allows the use of more advanced integrators than the standard forward Euler scheme. At the time of writing, RK2, RK4 and a predictor-corrector are alternatives, although the forward Euler is still the standard and fastest<div class="foot"><span class="foot_label">9</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-5601'>Forward Euler is standard except in the tidal calculations, some of which are calculated analytically, then linear derivatives are computed from these assuming everything else (stellar properties, etc.) in a hybrid scheme to avoid numerical instability.</div>
+<div class="standard" id='magicparlabel-6079'>Starting from 2.0pre33 <span class='math'>binary_c</i></span>
+ has a new events system. It now behaves more like a proper stellar evolution code, in that at each timestep derivatives of variables are calculated, then applied, and events that are set during the calculation (e.g.&nbsp;supernovae, common-envelope evolution, contact) are <em>then</em> applied. This allows the use of more advanced integrators than the standard forward Euler scheme. At the time of writing, RK2, RK4 and a predictor-corrector are alternatives, although the forward Euler is still the standard and fastest<div class="foot"><span class="foot_label">9</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-6083'>Forward Euler is standard except in the tidal calculations, some of which are calculated analytically, then linear derivatives are computed from these assuming everything else (stellar properties, etc.) in a hybrid scheme to avoid numerical instability.</div>
 </div></div>.</div>
 
-<div class="standard" id='magicparlabel-5602'>Events are stored on the event stack and then processed from the top to the bottom of the stack at the end of the timestep, if it is a successful timestep.</div>
-<h4 class="subsubsection" id='magicparlabel-5603'><span class="subsubsection_label">7.6.1</span> Queueing an event on the event stack</h4>
-<div class="standard" id='magicparlabel-5604'>Events are added with the <span class="flex_cmacro">Add_new_event</span> macro. This returns an integer which is the event number, if greater than or equal to zero, its index number on the event stack. If the integer is <span class="flex_cmacro">BINARY_C_EVENT_DENIED</span> (which is <span style='font-family:monospace;font-size: 18px;'>-1</span> so can never be an index) then the event has, for some reason, been refused.</div>
+<div class="standard" id='magicparlabel-6084'>Events are stored on the event stack and then processed from the top to the bottom of the stack at the end of the timestep, if it is a successful timestep.</div>
+<h4 class="subsubsection" id='magicparlabel-6085'><span class="subsubsection_label">8.6.1</span> Queueing an event on the event stack</h4>
+<div class="standard" id='magicparlabel-6086'>Events are added with the <span class="flex_cmacro">Add_new_event</span> macro. This returns an integer which is the event number, if greater than or equal to zero, its index number on the event stack. If the integer is <span class="flex_cmacro">BINARY_C_EVENT_DENIED</span> (which is <span style='font-family:monospace;font-size: 18px;'>-1</span> so can never be an index) then the event has, for some reason, been refused.</div>
 
-<div class="standard" id='magicparlabel-5613'>The <span class="flex_cmacro">Add_new_event</span> macro call takes a number of arguments:</div>
+<div class="standard" id='magicparlabel-6095'>The <span class="flex_cmacro">Add_new_event</span> macro call takes a number of arguments:</div>
 
-<ul class="itemize" id='magicparlabel-5618'><li class="itemize_item"><span class="flex_cstruct">stardata</span>: the usual pointer to a <span class="flex_cstruct">stardata</span> struct</li>
+<ul class="itemize" id='magicparlabel-6100'><li class="itemize_item"><span class="flex_cstruct">stardata</span>: the usual pointer to a <span class="flex_cstruct">stardata</span> struct</li>
 <li class="itemize_item"><span class="flex_cvar">event_type</span>: an integer identifying the event type. There are defined in <span class="flex_headerfile">events_macros.h</span></li>
-<li class="itemize_item"><span class="flex_cvar">event_handler_function</span>: this is a pointer to a function to be called when the event is triggered</li>
+<li class="itemize_item"><span class="flex_cvar">event_handler_function</span>: this is a pointer to a function to be called when the event is triggered. This is required to be non-<span class="flex_cmacro">NULL</span>.</li>
+<li class="itemize_item"><span class="flex_cvar">erase_event_handler_function</span>: this is a pointer to a function to be called when the event is erased. Ignored if <span class="flex_cmacro">NULL</span>.</li>
 <li class="itemize_item"><span class="flex_cvar">event_data</span>: this is a <span style='font-family:monospace;font-size: 18px;'><span class="flex_cvar"><span style='font-family:monospace;font-size: 18px;'>void*</span></span></span> pointer, i.e.&nbsp;it is of whatever type you want it to be (your handler function should know), to data to be sent to the handler function. This can be <span class="flex_cmacro">NULL</span>.</li>
 <li class="itemize_item"><span class="flex_cvar">unique</span>: a Boolean specifying whether this event is one of a kind, or not. For example there can only be one common envelope per timestep, so <br />
 <pre class ='listings <i>C</i>'>unique==TRUE</pre><br />
@@ -6015,14 +6355,15 @@ Run this with
 <pre class ='listings <i>C</i>'>unique==FALSE</pre><br />
 .</li>
 </ul>
-<div class="standard" id='magicparlabel-5667'>The calling function should check the return value, and clean up any memory if required after a denial. For example, the following is the code to initiate dynamical common envelope evolution in the RLOF routines.</div>
+<div class="standard" id='magicparlabel-6162'>The calling function should check the return value, and clean up any memory if required after a denial. For example, the following is the code to initiate dynamical common envelope evolution in the RLOF routines.</div>
 
-<div class="standard" id='magicparlabel-5668'><br />
+<div class="standard" id='magicparlabel-6163'><br />
 <pre class ='listings <i>C</i>'>        struct binary_c_new_common_envelope_event_t * event_data =              				MALLOC(sizeof(struct binary_c_new_common_envelope_event_t)); 
 
         if(Add_new_event(stardata,
                          BINARY_C_EVENT_COMMON_ENVELOPE,
                          &amp;common_envelope_event_handler,
+                         NULL,
                          event_data,
                          UNIQUE_EVENT) == BINARY_C_EVENT_DENIED)
         {
@@ -6036,9 +6377,9 @@ Run this with
             Dprint("added event!\n");
         }</pre><br />
 </div>
-<h4 class="subsubsection" id='magicparlabel-5689'><span class="subsubsection_label">7.6.2</span> Testing the event stack</h4>
+<h4 class="subsubsection" id='magicparlabel-6185'><span class="subsubsection_label">8.6.2</span> Testing the event stack</h4>
 
-<ul class="itemize" id='magicparlabel-5690'><li class="itemize_item">Call the <span class="flex_cfunction">events_pending</span> function to return <span class="flex_cmacro">TRUE</span> if there are events pending, <span class="flex_cmacro">FALSE</span> otherwise.<br />
+<ul class="itemize" id='magicparlabel-6186'><li class="itemize_item">Call the <span class="flex_cfunction">events_pending</span> function to return <span class="flex_cmacro">TRUE</span> if there are events pending, <span class="flex_cmacro">FALSE</span> otherwise.<br />
 <pre class ='listings <i>C</i>'>Boolean x = events_pending(stardata);</pre><br />
 </li>
 <li class="itemize_item">Call <span class="flex_cfunction">events_pending_of_type</span> to return <dfn class='lyxnoun'><span class="flex_cmacro"><dfn class='lyxnoun'>TRUE</dfn></span></dfn> if there are events of a given type pending, <span class="flex_cmacro">FALSE</span> otherwise.<br />
@@ -6050,19 +6391,49 @@ printf(&ldquo;Event stack: %s\n&rdquo;,evstring);
 Safe_free(evstring);</pre><br />
 </li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-5743'><span class="subsubsection_label">7.6.3</span> Erase the stack</h4>
-<div class="standard" id='magicparlabel-5744'>The entire stack can be deleted by calling <span class="flex_cfunction">erase_events</span>. The <span style='font-family:monospace;font-size: 18px;'><span class="flex_cvar"><span style='font-family:monospace;font-size: 18px;'>void*</span></span></span> data associated with each event is freed.</div>
+<h4 class="subsubsection" id='magicparlabel-6239'><span class="subsubsection_label">8.6.3</span> Erase the stack</h4>
+<div class="standard" id='magicparlabel-6240'>The entire stack can be deleted by calling <span class="flex_cfunction">erase_events</span>. The <span style='font-family:monospace;font-size: 18px;'><span class="flex_cvar"><span style='font-family:monospace;font-size: 18px;'>void*</span></span></span> data associated with each event is freed.</div>
 
-<div class="standard" id='magicparlabel-5753'><br />
+<div class="standard" id='magicparlabel-6249'><br />
 <pre class ='listings <i>C</i>'>erase_events(stardata);</pre><br />
-</div>
+This function is called automatically when a timestep is rejected from <span class="flex_cfunction">evolution_rejected()</span>.</div>
+
+<div class="standard" id='magicparlabel-6258'>You can also call <span class="flex_cfunction">erase_events_of_type</span><br />
+<pre class ='listings <i>C</i>'>erase_events_of_type(stardata,type,except);</pre><br />
+which will erase all events of given <span class="flex_cvar">type</span> except the event <span class="flex_cvar">except</span>. If the type is <span class="flex_cvar">-1</span> then events of any type are removed, except <span class="flex_cvar">except</span>. If <span class="flex_cvar">except</span> is <span class="flex_cmacro">NULL</span> then all events of the given type are removed.</div>
+
+<div class="standard" id='magicparlabel-6291'>You can erase an event without altering the event stack by calling<br />
+<pre class ='listings <i>C</i>'>erase_event(stardata,&amp;event);</pre><br />
+but beware that this will mess up the stack and <span class='math'>binary_c</i></span>
+ is likely to be very confused.</div>
+
+<div class="standard" id='magicparlabel-6296'>When events are erased, the optional <span class="flex_cfunction">erase_event_handler_function()</span> function is called, with the same arguments as the event handler function. You can use this to clean up any allocated memory.</div>
+<h4 class="subsubsection" id='magicparlabel-6301'><span class="subsubsection_label">8.6.4</span> Catch events</h4>
+<div class="standard" id='magicparlabel-6302'>At the end of each (successful) timestep, <span class="flex_cfunction">catch_events</span> is called. This function loops through the stack, triggering each event by calling the handler function and sending it the event data as well as <span class="flex_cstruct">stardata</span>. Event data is freed automatically after the event is triggered, as is the event itself.</div>
+<h4 class="subsubsection" id='magicparlabel-6311'><span class="subsubsection_label">8.6.5</span> Event handler functions</h4>
+<div class="standard" id='magicparlabel-6312'>The event handler functions should look like the following, again using the common-envelope code as an example.</div>
+
+<div class="standard" id='magicparlabel-6313'><br />
+<pre class ='listings'>Event_handler_function common_envelope_event_handler(void * eventp,
+                                                     struct stardata_t * stardata,
+                                                     void * data)
+{
+	/* a pointer to the event */
+    struct binary_c_event_t * const event = eventp;
+    
+	/* a pointer to the event data */
+    struct binary_c_new_common_envelope_event_t * const event_data =
+        (struct binary_c_new_common_envelope_event_t*) data;
 
-<div class="standard" id='magicparlabel-5758'>This function is called automatically when a timestep is rejected from <span class="flex_cfunction">evolution_rejected()</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-5763'><span class="subsubsection_label">7.6.4</span> Catch events</h4>
-<div class="standard" id='magicparlabel-5764'>At the end of each (successful) timestep, <span class="flex_cfunction">catch_events</span> is called. This function loops through the stack, triggering each event by calling the handler function and sending it the event data as well as <span class="flex_cstruct">stardata</span>. Event data is freed automatically after the event is triggered, as is the event itself.</div>
-<h3 class="subsection" id='magicparlabel-5773'><span class="subsection_label">7.7</span> Timestepping<div id="subsec_Timestepping"></div>
+	/* information stored in the event data */
+    struct star_t * const donor = event_data-&gt;donor;
+    struct star_t * const accretor = event_data-&gt;accretor;
+
+	/* ... now do stuff with donor and accretor ... */</pre><br />
+</div>
+<h3 class="subsection" id='magicparlabel-6333'><span class="subsection_label">8.7</span> Timestepping<div id="subsec_Timestepping"></div>
 </h3>
-<div class="standard" id='magicparlabel-5774'>The <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-6334'>The <span class='math'>binary_c</i></span>
  timestepping algorithm aims to smoothly, but efficiently, evolve your binary-star systems in time while maintaining a reasonable level of accuracy. The subroutine <span class="flex_cfunction">stellar_timestep</span> sets the timestep for each star and/or the binary system as a whole. Usually, timesteps relate a change in variable <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>x</mi>
  </mrow></mstyle></math> to its time derivative <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -6166,11 +6537,11 @@ Safe_free(evstring);</pre><br />
 <pre class ='listings <i>C</i>'>#define DT_LIMIT_TIDES 44</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-5807'>If you want to know what is limiting the timestep, the easiest way is to uncomment the line<br />
+<div class="standard" id='magicparlabel-6367'>If you want to know what is limiting the timestep, the easiest way is to uncomment the line<br />
 <pre class ='listings <i>C</i>'>#define ___LOGGING</pre><br />
 which is near the bottom of the <span class="flex_cfunction">stellar_timestep</span> function. This will output, on every timestep, the timestep for each star and which limiter gave the smallest timestep.</div>
-<h4 class="subsubsection" id='magicparlabel-5816'><span class="subsubsection_label">7.7.1</span> Fixed timesteps</h4>
-<div class="standard" id='magicparlabel-5817'>Often you will want to output at a given fixed timestep, e.g.&nbsp;every <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<h4 class="subsubsection" id='magicparlabel-6376'><span class="subsubsection_label">8.7.1</span> Fixed timesteps</h4>
+<div class="standard" id='magicparlabel-6377'>Often you will want to output at a given fixed timestep, e.g.&nbsp;every <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>1</mn><mspace width="6px" />
    <mstyle mathvariant='normal'>
@@ -6210,76 +6581,76 @@ then in <span class="flex_cfunction">setup_fixed_timesteps</span> define the pro
     t-&gt;previous_trigger = t-&gt;previous_test = t-&gt;begin; // set trigger</pre><br />
 You can also have fixed intervals of logarithmic time by settings <span class="flex_cvar">t-&gt;logarithmic</span> to <span class="flex_cmacro">TRUE</span>.</div>
 
-<h3 class="subsection" id='magicparlabel-5852'><span class="subsection_label">7.8</span> Code layout, header files, flow</h3>
-<div class="standard" id='magicparlabel-5853'><div id="subsec_Code_layout"></div>
-The code is split into a series of directories. Some header file information is in <a href="#subsec_Advanced_Configuration">8</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-5854'><span class="subsubsection_label">7.8.1</span> API</h4>
-<div class="standard" id='magicparlabel-5855'>You can build <i>binary_c</i> as a shared library, and enable the API interface. The functions which do this are in this directory.</div>
-<h4 class="subsubsection" id='magicparlabel-5856'><span class="subsubsection_label">7.8.2</span> batchmode</h4>
-<div class="standard" id='magicparlabel-5857'>The batch mode functions handle the use of <i>binary_c</i> as part of <i>binary_grid</i>. Essentially they are a loop wrapped around the evolution functions which also scans arguments passed from <i>binary_grid</i> as if they were command line arguments.</div>
-<h4 class="subsubsection" id='magicparlabel-5858'><span class="subsubsection_label">7.8.3</span> binary_star_functions</h4>
-<div class="standard" id='magicparlabel-5859'><div id="subsec_binary_star_functions"></div>
+<h3 class="subsection" id='magicparlabel-6412'><span class="subsection_label">8.8</span> Code layout, header files, flow</h3>
+<div class="standard" id='magicparlabel-6413'><div id="subsec_Code_layout"></div>
+The code is split into a series of directories. Some header file information is in <a href="#subsec_Advanced_Configuration">9</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-6414'><span class="subsubsection_label">8.8.1</span> API</h4>
+<div class="standard" id='magicparlabel-6415'>You can build <i>binary_c</i> as a shared library, and enable the API interface. The functions which do this are in this directory.</div>
+<h4 class="subsubsection" id='magicparlabel-6416'><span class="subsubsection_label">8.8.2</span> batchmode</h4>
+<div class="standard" id='magicparlabel-6417'>The batch mode functions handle the use of <i>binary_c</i> as part of <i>binary_grid</i>. Essentially they are a loop wrapped around the evolution functions which also scans arguments passed from <i>binary_grid</i> as if they were command line arguments.</div>
+<h4 class="subsubsection" id='magicparlabel-6418'><span class="subsubsection_label">8.8.3</span> binary_star_functions</h4>
+<div class="standard" id='magicparlabel-6419'><div id="subsec_binary_star_functions"></div>
 This directory contains functions which deal with the binary system such as Roche-Lobe radius calculation, contact systems (<span class="flex_sourcefile">contact_system.c</span>), stellar mergers (<span class="flex_sourcefile">mix.c</span>) and common envelope evolution (<span class="flex_sourcefile">common_envelope_evolution.c</span>). </div>
-<h4 class="subsubsection" id='magicparlabel-5872'><span class="subsubsection_label">7.8.4</span> buffering</h4>
-<div class="standard" id='magicparlabel-5873'>These functions provide an interface with <em><i>binary_grid</i></em> that improves buffering and hence <em><i>binary_grid</i></em>'s performance. When you use the <span class="flex_cmacro">Printf</span> macro, rather than <span class="flex_programminglanguage">C</span>'s native <span class="flex_cfunction">printf</span> routine, you are using the routines in here to put data into a memory buffer which is then sent to <i>binary_grid</i> for processing and statistical analysis.</div>
-<h4 class="subsubsection" id='magicparlabel-5886'><span class="subsubsection_label">7.8.5</span> common_envelope</h4>
-<div class="standard" id='magicparlabel-5887'>Common envelope evolution is dealt with in here. At present there is only the <span class="flex_software">BSE</span> algorithm, but you could put your own in here too.</div>
-<h4 class="subsubsection" id='magicparlabel-5892'><span class="subsubsection_label">7.8.6</span> debug</h4>
-<div class="standard" id='magicparlabel-5893'>This contains various debugging functions, such as <span class="flex_cfunction">debug_fprintf</span> which is called when you put <span class="flex_cmacro">Dprint</span> statements into <i>binary_c</i>. The <span class="flex_cfunction">backtrace</span> functionality is also in this directory, as is the <span class="flex_cfunction">show_stardata</span> function which allows you to output, in a readable way, the contents of a <span class="flex_cstruct">stardata</span> structure. Given this you can compare one structure's contents to another quickly and easily.</div>
-<h4 class="subsubsection" id='magicparlabel-5914'><span class="subsubsection_label">7.8.7</span> disc</h4>
-<div class="standard" id='magicparlabel-5915'>Work in progress, please ask RGI for details.</div>
-<h4 class="subsubsection" id='magicparlabel-5916'><span class="subsubsection_label">7.8.8</span> envelope_intgeration</h4>
-<div class="standard" id='magicparlabel-5917'>Experimental code.</div>
-<h4 class="subsubsection" id='magicparlabel-5918'><span class="subsubsection_label">7.8.9</span> equation_of_state</h4>
-<div class="standard" id='magicparlabel-5919'>Experimental code.</div>
-<h4 class="subsubsection" id='magicparlabel-5920'><span class="subsubsection_label">7.8.10</span> events</h4>
-<div class="standard" id='magicparlabel-5921'>See section&nbsp;<a href="#subsec_Events">7.6</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-5922'><span class="subsubsection_label">7.8.11</span> evolution</h4>
-<div class="standard" id='magicparlabel-5923'><div id="subsec_evolution"></div>
+<h4 class="subsubsection" id='magicparlabel-6432'><span class="subsubsection_label">8.8.4</span> buffering</h4>
+<div class="standard" id='magicparlabel-6433'>These functions provide an interface with <em><i>binary_grid</i></em> that improves buffering and hence <em><i>binary_grid</i></em>'s performance. When you use the <span class="flex_cmacro">Printf</span> macro, rather than <span class="flex_programminglanguage">C</span>'s native <span class="flex_cfunction">printf</span> routine, you are using the routines in here to put data into a memory buffer which is then sent to <i>binary_grid</i> for processing and statistical analysis.</div>
+<h4 class="subsubsection" id='magicparlabel-6446'><span class="subsubsection_label">8.8.5</span> common_envelope</h4>
+<div class="standard" id='magicparlabel-6447'>Common envelope evolution is dealt with in here. At present there is only the <span class="flex_software">BSE</span> algorithm, but you could put your own in here too.</div>
+<h4 class="subsubsection" id='magicparlabel-6452'><span class="subsubsection_label">8.8.6</span> debug</h4>
+<div class="standard" id='magicparlabel-6453'>This contains various debugging functions, such as <span class="flex_cfunction">debug_fprintf</span> which is called when you put <span class="flex_cmacro">Dprint</span> statements into <i>binary_c</i>. The <span class="flex_cfunction">backtrace</span> functionality is also in this directory, as is the <span class="flex_cfunction">show_stardata</span> function which allows you to output, in a readable way, the contents of a <span class="flex_cstruct">stardata</span> structure. Given this you can compare one structure's contents to another quickly and easily.</div>
+<h4 class="subsubsection" id='magicparlabel-6474'><span class="subsubsection_label">8.8.7</span> disc</h4>
+<div class="standard" id='magicparlabel-6475'>Work in progress, please ask RGI for details.</div>
+<h4 class="subsubsection" id='magicparlabel-6476'><span class="subsubsection_label">8.8.8</span> envelope_intgeration</h4>
+<div class="standard" id='magicparlabel-6477'>Experimental code.</div>
+<h4 class="subsubsection" id='magicparlabel-6478'><span class="subsubsection_label">8.8.9</span> equation_of_state</h4>
+<div class="standard" id='magicparlabel-6479'>Experimental code.</div>
+<h4 class="subsubsection" id='magicparlabel-6480'><span class="subsubsection_label">8.8.10</span> events</h4>
+<div class="standard" id='magicparlabel-6481'>See section&nbsp;<a href="#subsec_Events">8.6</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-6482'><span class="subsubsection_label">8.8.11</span> evolution</h4>
+<div class="standard" id='magicparlabel-6483'><div id="subsec_evolution"></div>
 The time integration, i.e. evolution, of the binary system. This contains the logic flow of the <em><i>binary_c</i></em> code. Of interest to the general user are:</div>
 
-<ul class="itemize" id='magicparlabel-5924'><li class="itemize_item"><span class="flex_cfunction">evolve_system_binary_c</span> is the main time loop which sets up the system at its initiation, loops over time (at each timestep calling <span class="flex_cfunction">evolution</span>, see below) and then cleans up when things are all finished.</li>
+<ul class="itemize" id='magicparlabel-6484'><li class="itemize_item"><span class="flex_cfunction">evolve_system_binary_c</span> is the main time loop which sets up the system at its initiation, loops over time (at each timestep calling <span class="flex_cfunction">evolution</span>, see below) and then cleans up when things are all finished.</li>
 <li class="itemize_item"><span class="flex_cfunction">evolution</span> The main time-evolution function. This calls the appropriate integration scheme to further the binary system under investigation in time. The default scheme is forward-Euler, but Runge-Kutta 2nd and 4th order are also available. The function <span class="flex_cfunction">evolution_step</span> in turn, for all the schemes, calls the other parts of <i>binary_c</i> that do all the appropriate physics.</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-5942'><span class="subsubsection_label">7.8.12</span> file</h4>
-<div class="standard" id='magicparlabel-5943'>File input/output code. <i>binary_c</i> provides a custom file output routine which can limit output by size of the file, as well as output filtering routines.</div>
-<h4 class="subsubsection" id='magicparlabel-5944'><span class="subsubsection_label">7.8.13</span> galactic</h4>
-<div class="standard" id='magicparlabel-5945'>Experimental! A set of routines to calculate apparent and bolometric luminosities, and develop a model of galactic coordinates. It's not clear that we should be even doing this in <i>binary_c</i>&hellip;</div>
-<h4 class="subsubsection" id='magicparlabel-5946'><span class="subsubsection_label">7.8.14</span> libmemoize</h4>
-<div class="standard" id='magicparlabel-5947'>This is a copy of RGI's memoizing library <span class="flex_software">libmemoize</span>. The idea is that repeated calls to a function with the same arguments are automatically cached so that the function is actually only called once. Note: if you have <span class="flex_software">libmemoize</span> properly installed on your system, e.g. in <span class="flex_file"><span class="flex_envvar">$HOME</span>/lib</span> or <span class="flex_file">/usr/local/lib</span>, which is what you <em>should</em> do, then the installed version is used. The version in <i>binary_c</i> is a backup version only, and may lack the latest features.</div>
-<h4 class="subsubsection" id='magicparlabel-5968'><span class="subsubsection_label">7.8.15</span> librinterpolate</h4>
-<div class="standard" id='magicparlabel-5969'>This is a copy of RGI's <span class="flex_software">librinterpolate</span> linear interpolation library. If you have <span class="flex_software">librinterpolate</span> installed properly, e.g. in <span class="flex_file"><span class="flex_envvar">$HOME</span>/lib</span> or <span class="flex_file">/usr/local/lib</span>, which is what you should do, then the version in <i>binary_c</i> is ignored.</div>
-<h4 class="subsubsection" id='magicparlabel-5990'><span class="subsubsection_label">7.8.16</span> logging</h4>
-<div class="standard" id='magicparlabel-5991'><div id="subsec_logging"></div>
+<h4 class="subsubsection" id='magicparlabel-6502'><span class="subsubsection_label">8.8.12</span> file</h4>
+<div class="standard" id='magicparlabel-6503'>File input/output code. <i>binary_c</i> provides a custom file output routine which can limit output by size of the file, as well as output filtering routines.</div>
+<h4 class="subsubsection" id='magicparlabel-6504'><span class="subsubsection_label">8.8.13</span> galactic</h4>
+<div class="standard" id='magicparlabel-6505'>Experimental! A set of routines to calculate apparent and bolometric luminosities, and develop a model of galactic coordinates. It's not clear that we should be even doing this in <i>binary_c</i>&hellip;</div>
+<h4 class="subsubsection" id='magicparlabel-6506'><span class="subsubsection_label">8.8.14</span> libmemoize</h4>
+<div class="standard" id='magicparlabel-6507'>This is a copy of RGI's memoizing library <span class="flex_software">libmemoize</span>. The idea is that repeated calls to a function with the same arguments are automatically cached so that the function is actually only called once. Note: if you have <span class="flex_software">libmemoize</span> properly installed on your system, e.g. in <span class="flex_file"><span class="flex_envvar">$HOME</span>/lib</span> or <span class="flex_file">/usr/local/lib</span>, which is what you <em>should</em> do, then the installed version is used. The version in <i>binary_c</i> is a backup version only, and may lack the latest features.</div>
+<h4 class="subsubsection" id='magicparlabel-6528'><span class="subsubsection_label">8.8.15</span> librinterpolate</h4>
+<div class="standard" id='magicparlabel-6529'>This is a copy of RGI's <span class="flex_software">librinterpolate</span> linear interpolation library. If you have <span class="flex_software">librinterpolate</span> installed properly, e.g. in <span class="flex_file"><span class="flex_envvar">$HOME</span>/lib</span> or <span class="flex_file">/usr/local/lib</span>, which is what you should do, then the version in <i>binary_c</i> is ignored.</div>
+<h4 class="subsubsection" id='magicparlabel-6550'><span class="subsubsection_label">8.8.16</span> logging</h4>
+<div class="standard" id='magicparlabel-6551'><div id="subsec_logging"></div>
 Contains some functions used to output either to the screen or a file. Not very interesting but vital if you are to get anything out of <i>binary_c</i>.</div>
 
-<ul class="itemize" id='magicparlabel-5992'><li class="itemize_item"><span class="flex_cfunction">log_every_timestep</span> which is called every (successful) timestep to output the current state of the star. This is where you want to put your logging code! Please remember: when logging use the <span class="flex_cmacro">Printf</span> macro, not <span class="flex_programminglanguage">C</span>'s <span class="flex_cfunction">printf</span>-type function calls.</li>
+<ul class="itemize" id='magicparlabel-6552'><li class="itemize_item"><span class="flex_cfunction">log_every_timestep</span> which is called every (successful) timestep to output the current state of the star. This is where you want to put your logging code! Please remember: when logging use the <span class="flex_cmacro">Printf</span> macro, not <span class="flex_programminglanguage">C</span>'s <span class="flex_cfunction">printf</span>-type function calls.</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-6009'><span class="subsubsection_label">7.8.17</span> maths</h4>
-<div class="standard" id='magicparlabel-6010'>Contains a selection of routines to do some mathematical tasks that are useful to <em><i>binary_c</i></em>, many of these routines are wrappers to <span class="flex_software">GSL</span> functions. There are not-a-number (NaN) checking routines, random number generators, a Kaps-Rentrop solver, a generic Brent minimizer, and the <span class="flex_cfunction">apply_derivative</span> function which is used by <span class="flex_cfunction">evolution</span> to integrate numerical derivatives at each timestep.</div>
+<h4 class="subsubsection" id='magicparlabel-6569'><span class="subsubsection_label">8.8.17</span> maths</h4>
+<div class="standard" id='magicparlabel-6570'>Contains a selection of routines to do some mathematical tasks that are useful to <em><i>binary_c</i></em>, many of these routines are wrappers to <span class="flex_software">GSL</span> functions. There are not-a-number (NaN) checking routines, random number generators, a Kaps-Rentrop solver, a generic Brent minimizer, and the <span class="flex_cfunction">apply_derivative</span> function which is used by <span class="flex_cfunction">evolution</span> to integrate numerical derivatives at each timestep.</div>
 
-<ul class="itemize" id='magicparlabel-6023'><li class="itemize_item">Some of the code is experimental so probably not used.</li>
+<ul class="itemize" id='magicparlabel-6583'><li class="itemize_item">Some of the code is experimental so probably not used.</li>
 <li class="itemize_item">Anything you put in this directory must be free and freely distributable software. There are no routines from <em>Numerical Recipes in <i>C</i></em> because these are not free software.</li>
 </ul>
-<h4 class="subsubsection" id='magicparlabel-6025'><span class="subsubsection_label">7.8.18</span> memory</h4>
-<div class="standard" id='magicparlabel-6026'>In here reside <i>binary_c</i>'s memory allocation and freeing (garbage collection) routines.</div>
-<h4 class="subsubsection" id='magicparlabel-6027'><span class="subsubsection_label">7.8.19</span> misc</h4>
-<div class="standard" id='magicparlabel-6028'>Routines that don't go anywhere else. At the moment this contains nothing.</div>
-<h4 class="subsubsection" id='magicparlabel-6029'><span class="subsubsection_label">7.8.20</span> nucsyn</h4>
-<div class="standard" id='magicparlabel-6030'>See section&nbsp;<a href="#subsec_nucsyn">7.9</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-6031'><span class="subsubsection_label">7.8.21</span> opacity</h4>
-<div class="standard" id='magicparlabel-6032'>Experimental.</div>
-<h4 class="subsubsection" id='magicparlabel-6033'><span class="subsubsection_label">7.8.22</span> orbit</h4>
-<div class="standard" id='magicparlabel-6034'>Routines which calculate orbital properties go in here.</div>
-<h4 class="subsubsection" id='magicparlabel-6035'><span class="subsubsection_label">7.8.23</span> perl</h4>
-<div class="standard" id='magicparlabel-6036'>Not strictly part of the <em><i>binary_c</i></em> <span class="flex_programminglanguage">C</span> source, but contains some useful <span class="flex_scriptinglanguage">Perl</span> modules (e.g.<em>&nbsp;<i>binary_grid</i></em>) and scripts.</div>
-<h4 class="subsubsection" id='magicparlabel-6045'><span class="subsubsection_label">7.8.24</span> python</h4>
-<div class="standard" id='magicparlabel-6046'><span class="flex_scriptinglanguage">Python</span> scripts, e.g. to access the API through <span class="flex_scriptinglanguage">Python</span>, are in here.</div>
-<h4 class="subsubsection" id='magicparlabel-6055'><span class="subsubsection_label">7.8.25</span> RLOF</h4>
-<div class="standard" id='magicparlabel-6056'><div id="subsec_RLOF"></div>
+<h4 class="subsubsection" id='magicparlabel-6585'><span class="subsubsection_label">8.8.18</span> memory</h4>
+<div class="standard" id='magicparlabel-6586'>In here reside <i>binary_c</i>'s memory allocation and freeing (garbage collection) routines.</div>
+<h4 class="subsubsection" id='magicparlabel-6587'><span class="subsubsection_label">8.8.19</span> misc</h4>
+<div class="standard" id='magicparlabel-6588'>Routines that don't go anywhere else. At the moment this contains nothing.</div>
+<h4 class="subsubsection" id='magicparlabel-6589'><span class="subsubsection_label">8.8.20</span> nucsyn</h4>
+<div class="standard" id='magicparlabel-6590'>See section&nbsp;<a href="#subsec_nucsyn">8.9</a>.</div>
+<h4 class="subsubsection" id='magicparlabel-6591'><span class="subsubsection_label">8.8.21</span> opacity</h4>
+<div class="standard" id='magicparlabel-6592'>Experimental.</div>
+<h4 class="subsubsection" id='magicparlabel-6593'><span class="subsubsection_label">8.8.22</span> orbit</h4>
+<div class="standard" id='magicparlabel-6594'>Routines which calculate orbital properties go in here.</div>
+<h4 class="subsubsection" id='magicparlabel-6595'><span class="subsubsection_label">8.8.23</span> perl</h4>
+<div class="standard" id='magicparlabel-6596'>Not strictly part of the <em><i>binary_c</i></em> <span class="flex_programminglanguage">C</span> source, but contains some useful <span class="flex_scriptinglanguage">Perl</span> modules (e.g.<em>&nbsp;<i>binary_grid</i></em>) and scripts.</div>
+<h4 class="subsubsection" id='magicparlabel-6605'><span class="subsubsection_label">8.8.24</span> python</h4>
+<div class="standard" id='magicparlabel-6606'><span class="flex_scriptinglanguage">Python</span> scripts, e.g. to access the API through <span class="flex_scriptinglanguage">Python</span>, are in here.</div>
+<h4 class="subsubsection" id='magicparlabel-6615'><span class="subsubsection_label">8.8.25</span> RLOF</h4>
+<div class="standard" id='magicparlabel-6616'><div id="subsec_RLOF"></div>
 This has functions which deal with dynamical timescale Roche lobe overflow. </div>
 
-<div class="standard" id='magicparlabel-6057'>First, there is the question of when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-6617'>First, there is the question of when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>R</mi><mo>=</mo>
    <msub subscriptshift="0.2ex">
@@ -6321,7 +6692,7 @@ This has functions which deal with dynamical timescale Roche lobe overflow. </di
   </mrow>
  </mrow></mstyle></math> to within some threshold (usually 2%). However, this means taking <em>negative</em> timesteps, which plays havoc with logging and nucleosynthesis algorithms.</div>
 
-<div class="standard" id='magicparlabel-6066'>In the latest <em><i>binary_c</i></em>, a simpler (albeit slower) algorithm is used which rejects the evolution when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-6626'>In the latest <em><i>binary_c</i></em>, a simpler (albeit slower) algorithm is used which rejects the evolution when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>R</mi><mo> &gg; </mo>
    <msub subscriptshift="0.2ex">
@@ -6343,7 +6714,7 @@ This has functions which deal with dynamical timescale Roche lobe overflow. </di
   </mrow>
  </mrow></mstyle></math>, always with a positive timestep.</div>
 
-<div class="standard" id='magicparlabel-6075'>RLOF itself is followed according to one of a number of algorithms. First, the system is tested for the stability of RLOF (<span class="flex_cfunction">RLOF_stability_tests</span>). If RLOF is unstable, a merger or common envelope usually entails. Second, if the RLOF is stable, there are several methods for calculating the mass transfer rate. The formulaic approach assumes that for a given <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-6635'>RLOF itself is followed according to one of a number of algorithms. First, the system is tested for the stability of RLOF (<span class="flex_cfunction">RLOF_stability_tests</span>). If RLOF is unstable, a merger or common envelope usually entails. Second, if the RLOF is stable, there are several methods for calculating the mass transfer rate. The formulaic approach assumes that for a given <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>R</mi><mo> &ge; </mo>
    <msub subscriptshift="0.2ex">
@@ -6383,42 +6754,42 @@ This has functions which deal with dynamical timescale Roche lobe overflow. </di
    </msub>
   </mrow>
  </mrow></mstyle></math>. This is more exact, but requires more calculation steps. Usually, the two methods give similar answers, but if mass transfer is particularly fast, e.g. in massive stars, this may not be the case.</div>
-<h4 class="subsubsection" id='magicparlabel-6080'><span class="subsubsection_label">7.8.26</span> <span style='font-family:monospace;font-size: 18px;'>setup</span></h4>
-<div class="standard" id='magicparlabel-6081'><div id="subsec_setup"></div>
+<h4 class="subsubsection" id='magicparlabel-6640'><span class="subsubsection_label">8.8.26</span> <span style='font-family:monospace;font-size: 18px;'>setup</span></h4>
+<div class="standard" id='magicparlabel-6641'><div id="subsec_setup"></div>
 This sets the code up because <span class="flex_cfunction">set_up_variables</span> is called by the <span class="flex_cfunction">main</span> function. It reads in the command line arguments and sets them to variables.</div>
 
-<div class="standard" id='magicparlabel-6090'>The <span class="flex_cfunction">parse_arguments</span> function takes command line arguments and puts them into (in particular) the <span style='font-family:monospace;font-size: 18px;'>preferences</span> structure. This function is very useful if you want to put in your own arguments, which should go into <span class="flex_headerfile">cmd_line_args.h</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-6099'><span class="subsubsection_label">7.8.27</span> signals</h4>
-<div class="standard" id='magicparlabel-6100'><span class="flex_os">Unix</span>/<span class="flex_os">Linux</span> uses signals to communicate with running programs. Code in here allows you to catch signals, as well as catching (and trapping) segmentation faults which is very useful for debugging (e.g. with <span class="flex_software">gdb</span> and/or <span class="flex_software">valgrind</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6117'><span class="subsubsection_label">7.8.28</span> single_star_functions</h4>
-<div class="standard" id='magicparlabel-6118'>Many functions which only affect single star, or detached binary, evolution are in this directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6119'><span class="subsubsection_label">7.8.29</span> spectra</h4>
-<div class="standard" id='magicparlabel-6120'>Functions in here link stars, through their temperature and luminosity, to spectra. At present only a blackbody spectrum is supported, but the algorithm for calculating the blackbody flux in regions of wavelength parameter space is fast and accurate.</div>
-<h4 class="subsubsection" id='magicparlabel-6121'><span class="subsubsection_label">7.8.30</span> stellar_colours</h4>
-<div class="standard" id='magicparlabel-6122'>This contains some routines to calculate stellar colours, which may or may not be reliable.</div>
-<h4 class="subsubsection" id='magicparlabel-6123'><span class="subsubsection_label">7.8.31</span> stellar_structure</h4>
-<div class="standard" id='magicparlabel-6124'><div id="subsec_stellar_structure"></div>
+<div class="standard" id='magicparlabel-6650'>The <span class="flex_cfunction">parse_arguments</span> function takes command line arguments and puts them into (in particular) the <span style='font-family:monospace;font-size: 18px;'>preferences</span> structure. This function is very useful if you want to put in your own arguments, which should go into <span class="flex_headerfile">cmd_line_args.h</span>.</div>
+<h4 class="subsubsection" id='magicparlabel-6659'><span class="subsubsection_label">8.8.27</span> signals</h4>
+<div class="standard" id='magicparlabel-6660'><span class="flex_os">Unix</span>/<span class="flex_os">Linux</span> uses signals to communicate with running programs. Code in here allows you to catch signals, as well as catching (and trapping) segmentation faults which is very useful for debugging (e.g. with <span class="flex_software">gdb</span> and/or <span class="flex_software">valgrind</span>).</div>
+<h4 class="subsubsection" id='magicparlabel-6677'><span class="subsubsection_label">8.8.28</span> single_star_functions</h4>
+<div class="standard" id='magicparlabel-6678'>Many functions which only affect single star, or detached binary, evolution are in this directory.</div>
+<h4 class="subsubsection" id='magicparlabel-6679'><span class="subsubsection_label">8.8.29</span> spectra</h4>
+<div class="standard" id='magicparlabel-6680'>Functions in here link stars, through their temperature and luminosity, to spectra. At present only a blackbody spectrum is supported, but the algorithm for calculating the blackbody flux in regions of wavelength parameter space is fast and accurate.</div>
+<h4 class="subsubsection" id='magicparlabel-6681'><span class="subsubsection_label">8.8.30</span> stellar_colours</h4>
+<div class="standard" id='magicparlabel-6682'>This contains some routines to calculate stellar colours, which may or may not be reliable.</div>
+<h4 class="subsubsection" id='magicparlabel-6683'><span class="subsubsection_label">8.8.31</span> stellar_structure</h4>
+<div class="standard" id='magicparlabel-6684'><div id="subsec_stellar_structure"></div>
 Sets up a <span class="flex_cstruct">new_structure</span> struct, and passes this to the appropriate stellar structure calculation code. Currently only <span style='font-family:monospace;font-size: 18px;'>stellar_structure_BSE</span> is available, but in future different codes may arise.</div>
 
-<div class="standard" id='magicparlabel-6129'><span class="flex_cfunction">stellar_structure_BSE</span> is based on the <span class="flex_fortranfunction">hrdiag</span> function of <span class="flex_software">SSE/BSE</span>. It computes the stellar structure variables at a given time. In addition, it handles supernova explosions and kicks. Note that this functionality may eventually be removed from the stellar_structure directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6142'><span class="subsubsection_label">7.8.32</span> stellar_timescales</h4>
-<div class="standard" id='magicparlabel-6143'>This set of functions calculates the timescales required by stellar_evolution, as in the <span class="flex_software">SSE/BSE</span> stellar evolution package (in which it is the function <span class="flex_fortranfunction">star.f</span>, and in <em><i>binary_c</i></em> V1.x it is <span class="flex_cfunction">calc_lum_and_evol_time</span> in <span class="flex_file">claet</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6160'><span class="subsubsection_label">7.8.33</span> string</h4>
-<div class="standard" id='magicparlabel-6161'>Functions to manipulate strings go in here, including <span class="flex_cfunction">binary_c_asprintf</span> (to replace asprintf if <span class="flex_software">Gnu</span> or <span class="flex_software">libbsd</span>'s version is not available) and <span class="flex_cfunction">chomp</span> (to remove newlines at the end of a string, identical to <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlcode">chomp</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6186'><span class="subsubsection_label">7.8.34</span> supernovae</h4>
-<div class="standard" id='magicparlabel-6187'>Functions which deal with supernovae, e.g.&nbsp;kicks, NS/BH mass as a function of progentior, etc. Note that supernovae are dealt with at the end of a timestep as an event (see section&nbsp;<a href="#subsec_Events">7.6</a>).</div>
-<h4 class="subsubsection" id='magicparlabel-6188'><span class="subsubsection_label">7.8.35</span> tables</h4>
-<div class="standard" id='magicparlabel-6189'>Various tables of data, used by <span class="flex_software">librinterpolate</span>, are included in <i>binary_c</i>. This directory contains the data for them and the various setup functions. In future, this data may be held elsewhere and its location accessed through an environment variable.</div>
-<h4 class="subsubsection" id='magicparlabel-6194'><span class="subsubsection_label">7.8.36</span> timers</h4>
-<div class="standard" id='magicparlabel-6195'>These are functions which start and stop the ticks counters. They are used to measure CPU time use, i.e.&nbsp;profiling of the code. Note that there are many ways to profile (including e.g.&nbsp;<span class="flex_software">cachegrind</span> and <span class="flex_software">callgrind</span>, functions of <span class="flex_software">valgrind</span>, and the ever reliable <span class="flex_software">gprof</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6212'><span class="subsubsection_label">7.8.37</span> timestep</h4>
-<div class="standard" id='magicparlabel-6213'>Routines for calculating the stellar timestep, see the function <span class="flex_cfunction">stellar_timestep</span> for details.</div>
-<h4 class="subsubsection" id='magicparlabel-6218'><span class="subsubsection_label">7.8.38</span> triple_star_functions</h4>
-<div class="standard" id='magicparlabel-6219'>Experimental! As the name suggests, these are functions to calculate the various physics in triple stars.</div>
-<h4 class="subsubsection" id='magicparlabel-6220'><span class="subsubsection_label">7.8.39</span> wind</h4>
-<div class="standard" id='magicparlabel-6221'>Routines for calculating the stellar wind loss rate. Note that the main function that calculates the wind mass-loss rate is actually in <span class="flex_file">src/single_star_functions/calc_stellar_wind_mass_loss.c</span> but that just calls <span class="flex_cfunction">wind_mass_loss_rate</span> which is in this directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6230'><span class="subsubsection_label">7.8.40</span> zfuncs</h4>
-<div class="standard" id='magicparlabel-6231'><div id="subsec_zfuncs"></div>
+<div class="standard" id='magicparlabel-6689'><span class="flex_cfunction">stellar_structure_BSE</span> is based on the <span class="flex_fortranfunction">hrdiag</span> function of <span class="flex_software">SSE/BSE</span>. It computes the stellar structure variables at a given time. In addition, it handles supernova explosions and kicks. Note that this functionality may eventually be removed from the stellar_structure directory.</div>
+<h4 class="subsubsection" id='magicparlabel-6702'><span class="subsubsection_label">8.8.32</span> stellar_timescales</h4>
+<div class="standard" id='magicparlabel-6703'>This set of functions calculates the timescales required by stellar_evolution, as in the <span class="flex_software">SSE/BSE</span> stellar evolution package (in which it is the function <span class="flex_fortranfunction">star.f</span>, and in <em><i>binary_c</i></em> V1.x it is <span class="flex_cfunction">calc_lum_and_evol_time</span> in <span class="flex_file">claet</span>).</div>
+<h4 class="subsubsection" id='magicparlabel-6720'><span class="subsubsection_label">8.8.33</span> string</h4>
+<div class="standard" id='magicparlabel-6721'>Functions to manipulate strings go in here, including <span class="flex_cfunction">binary_c_asprintf</span> (to replace asprintf if <span class="flex_software">Gnu</span> or <span class="flex_software">libbsd</span>'s version is not available) and <span class="flex_cfunction">chomp</span> (to remove newlines at the end of a string, identical to <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlcode">chomp</span>).</div>
+<h4 class="subsubsection" id='magicparlabel-6746'><span class="subsubsection_label">8.8.34</span> supernovae</h4>
+<div class="standard" id='magicparlabel-6747'>Functions which deal with supernovae, e.g.&nbsp;kicks, NS/BH mass as a function of progentior, etc. Note that supernovae are dealt with at the end of a timestep as an event (see section&nbsp;<a href="#subsec_Events">8.6</a>).</div>
+<h4 class="subsubsection" id='magicparlabel-6748'><span class="subsubsection_label">8.8.35</span> tables</h4>
+<div class="standard" id='magicparlabel-6749'>Various tables of data, used by <span class="flex_software">librinterpolate</span>, are included in <i>binary_c</i>. This directory contains the data for them and the various setup functions. In future, this data may be held elsewhere and its location accessed through an environment variable.</div>
+<h4 class="subsubsection" id='magicparlabel-6754'><span class="subsubsection_label">8.8.36</span> timers</h4>
+<div class="standard" id='magicparlabel-6755'>These are functions which start and stop the ticks counters. They are used to measure CPU time use, i.e.&nbsp;profiling of the code. Note that there are many ways to profile (including e.g.&nbsp;<span class="flex_software">cachegrind</span> and <span class="flex_software">callgrind</span>, functions of <span class="flex_software">valgrind</span>, and the ever reliable <span class="flex_software">gprof</span>).</div>
+<h4 class="subsubsection" id='magicparlabel-6772'><span class="subsubsection_label">8.8.37</span> timestep</h4>
+<div class="standard" id='magicparlabel-6773'>Routines for calculating the stellar timestep, see the function <span class="flex_cfunction">stellar_timestep</span> for details.</div>
+<h4 class="subsubsection" id='magicparlabel-6778'><span class="subsubsection_label">8.8.38</span> triple_star_functions</h4>
+<div class="standard" id='magicparlabel-6779'>Experimental! As the name suggests, these are functions to calculate the various physics in triple stars.</div>
+<h4 class="subsubsection" id='magicparlabel-6780'><span class="subsubsection_label">8.8.39</span> wind</h4>
+<div class="standard" id='magicparlabel-6781'>Routines for calculating the stellar wind loss rate. Note that the main function that calculates the wind mass-loss rate is actually in <span class="flex_file">src/single_star_functions/calc_stellar_wind_mass_loss.c</span> but that just calls <span class="flex_cfunction">wind_mass_loss_rate</span> which is in this directory.</div>
+<h4 class="subsubsection" id='magicparlabel-6790'><span class="subsubsection_label">8.8.40</span> zfuncs</h4>
+<div class="standard" id='magicparlabel-6791'><div id="subsec_zfuncs"></div>
 The so called &ldquo;metallicity functions&rdquo; of <span class="flex_software">BSE</span> i.e.&nbsp;the many fits to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>L</mi>
  </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -6439,42 +6810,42 @@ The so called &ldquo;metallicity functions&rdquo; of <span class="flex_software"
  <mrow><mi>Z</mi>
  </mrow></mstyle></math> (and perhaps other parameters). These are lots of tiny functions which contain fitting formulae.</div>
 
-<div class="standard" id='magicparlabel-6236'>Lately I have added some new functions, such as <span class="flex_cfunction">mc_1DUP</span> (the core mass at which first dredge up occurs), <span class="flex_cfunction">fphase</span> (the fractional age in a given stellar evolution phase), <span class="flex_cfunction">rwd</span> and <span class="flex_cfunction">lwd</span> (radius and luminosity of a white dwarf) etc. This seems a reasonable location for storing small, useful functions.</div>
+<div class="standard" id='magicparlabel-6796'>Lately I have added some new functions, such as <span class="flex_cfunction">mc_1DUP</span> (the core mass at which first dredge up occurs), <span class="flex_cfunction">fphase</span> (the fractional age in a given stellar evolution phase), <span class="flex_cfunction">rwd</span> and <span class="flex_cfunction">lwd</span> (radius and luminosity of a white dwarf) etc. This seems a reasonable location for storing small, useful functions.</div>
 
-<div class="standard" id='magicparlabel-6253'>Please note that I have optimized these functions to the hilt because they are called very often.</div>
-<h3 class="subsection" id='magicparlabel-6254'><span class="subsection_label">7.9</span> nucsyn</h3>
-<div class="standard" id='magicparlabel-6255'><div id="subsec_nucsyn"></div>
+<div class="standard" id='magicparlabel-6813'>Please note that I have optimized these functions to the hilt because they are called very often.</div>
+<h3 class="subsection" id='magicparlabel-6814'><span class="subsection_label">8.9</span> nucsyn</h3>
+<div class="standard" id='magicparlabel-6815'><div id="subsec_nucsyn"></div>
 The nucleosynthesis functions are in a directory of their own. It contains the functions which deal with the nucleosynthesis part of the code which runs in parallel to <span class="flex_software">SSE/BSE</span>. That is <em>not</em> to say that all the nucleosynthesis is done here, but most of it is.</div>
 
-<div class="standard" id='magicparlabel-6260'>To enable nucleosynthesis in the code you must</div>
+<div class="standard" id='magicparlabel-6820'>To enable nucleosynthesis in the code you must</div>
 
-<div class="standard" id='magicparlabel-6261'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-6821'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings <i>C</i>'>#define NUCSYN</pre><br />
 </span></div>
 
-<div class="standard" id='magicparlabel-6266'>somewhere, usually in <span class="flex_headerfile">binary_c_parameters.h</span> (which gets included in <span class="flex_headerfile">binary_c_macros.h</span> so <span class="flex_headerfile">nucsyn.h</span> – you should include <span class="flex_headerfile">nucsyn.h</span> in every nucsyn library file). It is vitally important that if you add anything to the nucleosynthesis code you enclose it in something like</div>
+<div class="standard" id='magicparlabel-6826'>somewhere, usually in <span class="flex_headerfile">binary_c_parameters.h</span> (which gets included in <span class="flex_headerfile">binary_c_macros.h</span> so <span class="flex_headerfile">nucsyn.h</span> – you should include <span class="flex_headerfile">nucsyn.h</span> in every nucsyn library file). It is vitally important that if you add anything to the nucleosynthesis code you enclose it in something like</div>
 
-<div class="standard" id='magicparlabel-6283'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-6843'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings <i>C</i>'>#ifdef NUCSYN
 ...
 #endif /* NUCSYN */</pre><br />
 </span></div>
 
-<div class="standard" id='magicparlabel-6290'>so that if nucleosynthesis is not required it can be turned off.</div>
+<div class="standard" id='magicparlabel-6850'>so that if nucleosynthesis is not required it can be turned off.</div>
 
-<div class="standard" id='magicparlabel-6291'>There are then further options in <span class="flex_headerfile">nucsyn_parameters.h</span> (see section <a href="#subsec_Advanced_Configuration">8</a>).</div>
+<div class="standard" id='magicparlabel-6851'>There are then further options in <span class="flex_headerfile">nucsyn_parameters.h</span> (see section <a href="#subsec_Advanced_Configuration">9</a>).</div>
 
-<div class="standard" id='magicparlabel-6296'>NOTE! <em>Every function in the nucsyn library has</em> <span class="flex_cfunction">nucsyn</span> <em>prepended to the function name - please maintain this convention!</em></div>
-<h4 class="subsubsection" id='magicparlabel-6301'><span class="subsubsection_label">7.9.1</span> Header files and isotope arrays</h4>
-<div class="standard" id='magicparlabel-6302'><div id="subsec_Header_files_and_isotope_arrays"></div>
+<div class="standard" id='magicparlabel-6856'>NOTE! <em>Every function in the nucsyn library has</em> <span class="flex_cfunction">nucsyn</span> <em>prepended to the function name - please maintain this convention!</em></div>
+<h4 class="subsubsection" id='magicparlabel-6861'><span class="subsubsection_label">8.9.1</span> Header files and isotope arrays</h4>
+<div class="standard" id='magicparlabel-6862'><div id="subsec_Header_files_and_isotope_arrays"></div>
 All abundances are stored as mass fractions when the array is called <span style='font-family:monospace;font-size: 18px;'>X&hellip;</span>, number densities are referred to as <span style='font-family:monospace;font-size: 18px;'>N&hellip;</span>. The index for each array ranges from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mn>0</mn>
  </mrow></mstyle></math> to <span class="flex_cmacro">ISOTOPE_ARRAY_SIZE</span> which is defined in <span class="flex_headerfile">nucsyn_isotopes.h</span> however you should <em>NEVER</em> manually access the array by number, e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;<br />
 <pre class ='listings'>X[0]=0.5;</pre><br />
-</span>you should use the predefined macros referring to each isotope in <span class="flex_headerfile">nucsyn_isotopes.h</span> and <span class="flex_headerfile">nucsyn_isotope_list.h</span>. For example, <span class="flex_cmacro">XC12</span> is defined like this<div class="foot"><span class="foot_label">10</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-6330'>Actually, in a modern <i>binary_c</i>, it is defined to be one more than the previous isotope. This is just an integer, of course, and you don't care what that integer is.</div>
+</span>you should use the predefined macros referring to each isotope in <span class="flex_headerfile">nucsyn_isotopes.h</span> and <span class="flex_headerfile">nucsyn_isotope_list.h</span>. For example, <span class="flex_cmacro">XC12</span> is defined like this<div class="foot"><span class="foot_label">10</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-6890'>Actually, in a modern <i>binary_c</i>, it is defined to be one more than the previous isotope. This is just an integer, of course, and you don't care what that integer is.</div>
 </div></div>,</div>
 
-<div class="standard" id='magicparlabel-6331'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-6891'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>#define XC12 2</pre><br />
 </span>so the second isotope in the array is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -6502,7 +6873,7 @@ All abundances are stored as mass fractions when the array is called <span style
 N[XC12]=1e-8;</pre><br />
  Perhaps also useful for you is <span class="flex_cmacro">ISOTOPE_MEMSIZE</span> which is just the size (in bytes) of the abundance array.</div>
 
-<div class="standard" id='magicparlabel-6346'>Why is this an advantage? It is very useful to be able to pull isotopes out which are not of interest (this speeds up the code) without breaking all the others, the historical development of the code (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-6906'>Why is this an advantage? It is very useful to be able to pull isotopes out which are not of interest (this speeds up the code) without breaking all the others, the historical development of the code (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
    <msup><mrow />
@@ -6524,20 +6895,20 @@ N[XC12]=1e-8;</pre><br />
     </mrow>
    </mstyle>
   </mrow>
- </mrow></mstyle></math> and CNO came first) is not a problem and the addition of new nuclei is easy (but remember section <a href="#subsec_Setup_functions">7.9.2</a>). It also makes the code <em>bloody easy to read</em> since it is painfully obvious which isotope you are referring to! This is important late at night after too much coffee (or other drink!).</div>
-<h4 class="subsubsection" id='magicparlabel-6347'><span class="subsubsection_label">7.9.2</span> Setup functions</h4>
-<div class="standard" id='magicparlabel-6348'><div id="subsec_Setup_functions"></div>
-<span class="flex_cfunction">nucsyn_set_nuc_masses</span> sets the nuclear masses (in grams) and atomic numbers. If you add an isotope to <span class="flex_headerfile">nucsyn_isotopes.h</span> (see section <a href="#subsec_Header_files_and_isotope_arrays">7.9.1</a>) you <em>MUST</em> change this function to set the nuclear mass or atomic number. If you do not then the number will be undefined and strange things will happen even though your nice new code looks fine (and <span class="flex_software">valgrind</span> will immediately fail because you'll be reading from undefined memory).</div>
+ </mrow></mstyle></math> and CNO came first) is not a problem and the addition of new nuclei is easy (but remember section <a href="#subsec_Setup_functions">8.9.2</a>). It also makes the code <em>bloody easy to read</em> since it is painfully obvious which isotope you are referring to! This is important late at night after too much coffee (or other drink!).</div>
+<h4 class="subsubsection" id='magicparlabel-6907'><span class="subsubsection_label">8.9.2</span> Setup functions</h4>
+<div class="standard" id='magicparlabel-6908'><div id="subsec_Setup_functions"></div>
+<span class="flex_cfunction">nucsyn_set_nuc_masses</span> sets the nuclear masses (in grams) and atomic numbers. If you add an isotope to <span class="flex_headerfile">nucsyn_isotopes.h</span> (see section <a href="#subsec_Header_files_and_isotope_arrays">8.9.1</a>) you <em>MUST</em> change this function to set the nuclear mass or atomic number. If you do not then the number will be undefined and strange things will happen even though your nice new code looks fine (and <span class="flex_software">valgrind</span> will immediately fail because you'll be reading from undefined memory).</div>
 
-<div class="standard" id='magicparlabel-6361'><span class="flex_cfunction">nucsyn_initial_abundances</span> is obviously important because it defines your initial abundance mix, usually as a function of the metallicity.</div>
-<h4 class="subsubsection" id='magicparlabel-6366'><span class="subsubsection_label">7.9.3</span> First and Second Dredge-up</h4>
-<div class="standard" id='magicparlabel-6367'><div id="subsec_First_and_Second_DUP"></div>
+<div class="standard" id='magicparlabel-6921'><span class="flex_cfunction">nucsyn_initial_abundances</span> is obviously important because it defines your initial abundance mix, usually as a function of the metallicity.</div>
+<h4 class="subsubsection" id='magicparlabel-6926'><span class="subsubsection_label">8.9.3</span> First and Second Dredge-up</h4>
+<div class="standard" id='magicparlabel-6927'><div id="subsec_First_and_Second_DUP"></div>
 First and second dredge-up are handled by the functions <span class="flex_cfunction">nucsyn_set_1st_dup_abunds</span> and <span class="flex_cfunction">nucsyn_set_2nd_dup_abunds</span> which perturb the surface abundances. There may be problems in binaries because the evolution is different to single stars, but I try to take this into account by scaling the CNO abundances to whatever the stellar CNO abundance is. Thanks to Evert Glebbeek and Richard Stancliffe for helping out with this, the results will be published in one of our CEMP papers soon.</div>
-<h4 class="subsubsection" id='magicparlabel-6376'><span class="subsubsection_label">7.9.4</span> TPAGB functions (3rd dredge-up and HBB)</h4>
-<div class="standard" id='magicparlabel-6377'><div id="subsec_TPAGB_functions"></div>
+<h4 class="subsubsection" id='magicparlabel-6936'><span class="subsubsection_label">8.9.4</span> TPAGB functions (3rd dredge-up and HBB)</h4>
+<div class="standard" id='magicparlabel-6937'><div id="subsec_TPAGB_functions"></div>
 The first section of the library to be written was the synthetic TPAGB evolution (see <a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>). This is controlled by the function <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_tpagb</span></span></span>. The function determines whether the next thermal pulse has been reached by the star and if so it does third dredge-up (and perhaps there's some hot-bottom burning [HBB]).</div>
 
-<div class="standard" id='magicparlabel-6382'>On the first pulse (when the function is first called for the star, actually if <br />
+<div class="standard" id='magicparlabel-6942'>On the first pulse (when the function is first called for the star, actually if <br />
 <pre class ='listings <i>C</i>'>num_thermal_pulses &lt; 0</pre><br />
 , which is the case for any stellar type other than TPAGB) the function <span class="flex_cfunction">nucsyn_init_first_pulse</span> is called which sets a few things like the interpulse period and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -6553,7 +6924,7 @@ The first section of the library to be written was the synthetic TPAGB evolution
   </msub>
  </mrow></mstyle></math> for dredge-up.</div>
 
-<div class="standard" id='magicparlabel-6391'>For subsequent timesteps the <span class="flex_cfunction">nucsyn_tpagb function</span> calls <span class="flex_cfunction">nucsyn_tpagb_H_shell_burn</span> to burn the hydrogen shell during the interpulse period and save the amount of core mass growth <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-6951'>For subsequent timesteps the <span class="flex_cfunction">nucsyn_tpagb function</span> calls <span class="flex_cfunction">nucsyn_tpagb_H_shell_burn</span> to burn the hydrogen shell during the interpulse period and save the amount of core mass growth <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mo> &Delta; </mo>
    <msub subscriptshift="0.2ex">
@@ -6567,9 +6938,9 @@ The first section of the library to be written was the synthetic TPAGB evolution
   </mrow>
  </mrow></mstyle></math>. </div>
 
-<div class="standard" id='magicparlabel-6400'>There is then a check to see if the star is hot enough for HBB – this is done by fitting the temperature (see <span class="flex_cfunction">nucsyn_set_hbb_conditions</span>, <span class="flex_cfunction">nucsyn_hbbtmax</span> and <span class="flex_cfunction">nucsyn_tpagb_rhomax</span>) to mass and metallicity. If so the <span class="flex_cfunction">nucsyn_hbb</span> function is called. The free parameters associated with HBB (<a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>) are set in <span class="flex_cfunction">nucsyn_set_tpagb_free_parameters</span> (these are the burn times, mixing fractions etc.).</div>
+<div class="standard" id='magicparlabel-6960'>There is then a check to see if the star is hot enough for HBB – this is done by fitting the temperature (see <span class="flex_cfunction">nucsyn_set_hbb_conditions</span>, <span class="flex_cfunction">nucsyn_hbbtmax</span> and <span class="flex_cfunction">nucsyn_tpagb_rhomax</span>) to mass and metallicity. If so the <span class="flex_cfunction">nucsyn_hbb</span> function is called. The free parameters associated with HBB (<a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>) are set in <span class="flex_cfunction">nucsyn_set_tpagb_free_parameters</span> (these are the burn times, mixing fractions etc.).</div>
 
-<div class="standard" id='magicparlabel-6421'>If the next pulse is reached then <span class="flex_cfunction">nucsyn_third_dredge_up</span> is called to deal with third dredge-up. This dredges up a mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-6981'>If the next pulse is reached then <span class="flex_cfunction">nucsyn_third_dredge_up</span> is called to deal with third dredge-up. This dredges up a mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &lambda; </mi><mo> &times; </mo><mo> &Delta; </mo>
    <msub subscriptshift="0.2ex">
@@ -6583,9 +6954,9 @@ The first section of the library to be written was the synthetic TPAGB evolution
   </mrow>
  </mrow></mstyle></math> and mixes it with the envelope. The abundances of the dredged-up material are set in <span class="flex_cfunction">nucsyn_set_third_dredgeup_abunds</span> (and <span class="flex_cfunction">nucsyn_s_process for s-process</span> elements).</div>
 
-<div class="standard" id='magicparlabel-6434'>Version 1.2 of <i>binary_c</i> included an option to evolve &ldquo;super AGB&rdquo; (STPAGB) stars but this has since been deprecated.</div>
-<h4 class="subsubsection" id='magicparlabel-6435'><span class="subsubsection_label">7.9.5</span> Hot-Bottom Burning</h4>
-<div class="standard" id='magicparlabel-6436'><div id="subsec_Hot_Bottom_Burning"></div>
+<div class="standard" id='magicparlabel-6994'>Version 1.2 of <i>binary_c</i> included an option to evolve &ldquo;super AGB&rdquo; (STPAGB) stars but this has since been deprecated.</div>
+<h4 class="subsubsection" id='magicparlabel-6995'><span class="subsubsection_label">8.9.5</span> Hot-Bottom Burning</h4>
+<div class="standard" id='magicparlabel-6996'><div id="subsec_Hot_Bottom_Burning"></div>
 While this sounds painful, really it's not! HBB is the process where the convective zone in a TPAGB star reaches down into the hydrogen burning shell. This occurs in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mn>4</mn><mo>-</mo><mn>8</mn>
@@ -6606,31 +6977,31 @@ While this sounds painful, really it's not! HBB is the process where the convect
   </mrow>
  </mrow></mstyle></math>, lower masses for lower metallicity). I have two burning routines which can deal with this:</div>
 
-<ol class="enumerate" id='magicparlabel-6437'><li class="enumerate_item">The original analytic routine. This uses analytic solutions to the CN, ON, NeNa and MgAl cycles, together with some approximate fudges to join them into the CNO and NeNaMgAl cycles, to solve for the abundances. This is fast but sometimes, when used outside the range of the approximations, <em>very</em> unstable.</li>
+<ol class="enumerate" id='magicparlabel-6997'><li class="enumerate_item">The original analytic routine. This uses analytic solutions to the CN, ON, NeNa and MgAl cycles, together with some approximate fudges to join them into the CNO and NeNaMgAl cycles, to solve for the abundances. This is fast but sometimes, when used outside the range of the approximations, <em>very</em> unstable.</li>
 <li class="enumerate_item">The new numerical solver. This uses a 4th-order implict (Kaps-Rentrop) scheme to solve for the abundances as a function of time. It does <em>not</em> depend on approximations, and currently burns the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>p</mi><mi>p</mi>
   </mrow>
  </mrow></mstyle></math>-chain, CNO cycles (hot or cold) and the full NeNa/MgAl chains/cycles. In theory it can be extended to any nuclear network (although it is designed for small networks – it will get very slow with larger networks). It turns out that, after much code optimization, the numerical solver is about as fast as the analytic solver! I think this is because to solve numerically requires additions, subtractions, multiplications and divisions, while analytic solutions require lots of exponentials. However, whether the numerical solver quickly converges on a result depends on the initial timestep. Be careful with that, I have a number of schemes which can improve this.</li>
 </ol>
-<h4 class="subsubsection" id='magicparlabel-6439'><span class="subsubsection_label">7.9.6</span> nucsyn_WR</h4>
-<div class="standard" id='magicparlabel-6440'><div id="subsec_nucsyn_WR"></div>
+<h4 class="subsubsection" id='magicparlabel-6999'><span class="subsubsection_label">8.9.6</span> nucsyn_WR</h4>
+<div class="standard" id='magicparlabel-7000'><div id="subsec_nucsyn_WR"></div>
 This is a set of phenomenological fits to Lynnette Dray's models for massive stars and helium star remnants. It is self-contained (see the details above and in the function) and contains useful stuff regarding logging of O/B and WR stars. I recently updated it to use tabular lookups instead of fitting functions. </div>
 
-<div class="standard" id='magicparlabel-6441'>The latest version includes tables from Richard Stancliffe which follow all isotopes, not just elemental CNO and H, He. Thanks Richard!</div>
-<h4 class="subsubsection" id='magicparlabel-6442'><span class="subsubsection_label">7.9.7</span> The <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-7001'>The latest version includes tables from Richard Stancliffe which follow all isotopes, not just elemental CNO and H, He. Thanks Richard!</div>
+<h4 class="subsubsection" id='magicparlabel-7002'><span class="subsubsection_label">8.9.7</span> The <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mi>r</mi>
  </mrow></mstyle></math>-process</h4>
-<div class="standard" id='magicparlabel-6443'><div id="subsec_The_r_process"></div>
+<div class="standard" id='magicparlabel-7003'><div id="subsec_The_r_process"></div>
 I have included some yields from <a href='#LyXCite-1999ApJ___525__886A'><span class="bib-abbrvciteauthor">Arlandini et al.</span></a> (<span class="bib-year">1999</span>) and <a href='#LyXCite-2004ApJ___617_1091S'><span class="bib-abbrvciteauthor">Simmerer et al.</span></a> (<span class="bib-year">2004</span>) which you can activate with the appropriate define in <span class="flex_headerfile">nucsyn_parameters.h</span>. This code has <em>not been well tested</em> so beware!</div>
-<h4 class="subsubsection" id='magicparlabel-6448'><span class="subsubsection_label">7.9.8</span> Winds and Mixing</h4>
-<div class="standard" id='magicparlabel-6449'><div id="subsec_Winds_and_Mixing"></div>
+<h4 class="subsubsection" id='magicparlabel-7008'><span class="subsubsection_label">8.9.8</span> Winds and Mixing</h4>
+<div class="standard" id='magicparlabel-7009'><div id="subsec_Winds_and_Mixing"></div>
 Colliding winds and the like are a complicated business! <span class="flex_cfunction">nucsyn_update_abundances</span> is called when to deal with this. The function is well commented so for details please refer to it but briefly it takes the wind loss from each star and the amount of that accreted by the companion, determines whether the accreted matter should reach the surface (by the factor set in <span class="flex_cfunction">nucsyn_choose_wind_mixing_factor</span>) or not and if so mixes it in or makes a new accretion layer on the surface. It also yields the wind loss by a call to <span class="flex_cfunction">nucsyn_calc_yields</span> and the mass accreted by a similar call but with a negative number. Note: mass is removed from the surface of the star by the function <span class="flex_cfunction">nucsyn_remove_dm_from_surface</span> so that it is preferentially removed from the accretion layer rather than the stellar envelope. Convective stars have no accretion layer, if one is present a call to <span class="flex_cfunction">nucsyn_mix_accretion_layer_and_envelope</span> soon removes it.</div>
-<h4 class="subsubsection" id='magicparlabel-6470'><span class="subsubsection_label">7.9.9</span> Explosions (supernovae and novae)</h4>
-<div class="standard" id='magicparlabel-6471'><div id="subsec_Explosions"></div>
+<h4 class="subsubsection" id='magicparlabel-7030'><span class="subsubsection_label">8.9.9</span> Explosions (supernovae and novae)</h4>
+<div class="standard" id='magicparlabel-7031'><div id="subsec_Explosions"></div>
 Supernova yields are looked up in tables and yielded in <span class="flex_cfunction">nucsyn_sn_yield</span>. Nova ejecta are calculated in <span class="flex_cfunction">nucsyn_set_nova_abunds</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-6480'><span class="subsubsection_label">7.9.10</span> Yield calculations</h4>
-<div class="standard" id='magicparlabel-6481'><div id="subsec_Yield_calculations"></div>
+<h4 class="subsubsection" id='magicparlabel-7040'><span class="subsubsection_label">8.9.10</span> Yield calculations</h4>
+<div class="standard" id='magicparlabel-7041'><div id="subsec_Yield_calculations"></div>
 The calls to <span class="flex_cfunction">nucsyn_calc_yields</span> modify the arrays <span class="flex_cvar">Xyield</span> in the star structures. These contain the mass of material of each isotope lost by the star, so if <span class="flex_cfunction">nucsyn_calc_yields</span> is called for (say) wind loss by an amount <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi> &delta; </mi><mi>m</mi>
@@ -6667,7 +7038,7 @@ The calls to <span class="flex_cfunction">nucsyn_calc_yields</span> modify the a
   </mrow>
  </mrow></mstyle></math> (or perhaps more mass if some is lost from the system). The total mass lost from the system is then just the sum of the <span class="flex_cvar">Xyield</span> for both stars. </div>
 
-<div class="standard" id='magicparlabel-6506'>The array <span class="flex_cvar">mpyield</span> stores the values of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-7066'>The array <span class="flex_cvar">mpyield</span> stores the values of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>p</mi>
@@ -6683,7 +7054,7 @@ The calls to <span class="flex_cfunction">nucsyn_calc_yields</span> modify the a
  <mrow><mi>i</mi>
  </mrow></mstyle></math> relative to the ZAMS abundance and divided by the initial mass (note use <span class="flex_cvar">pms_mass</span> not <span style='font-family:monospace;font-size: 18px;'>ZAMS_mass</span> since the latter is redefined by accretion processes).</div>
 
-<div class="standard" id='magicparlabel-6515'>Binary system yields are easy to calculate because they are just the sum of both stars' yields, this is done in <span class="flex_cfunction">nucsyn_binary_yield</span>. The appropriate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<div class="standard" id='magicparlabel-7075'>Binary system yields are easy to calculate because they are just the sum of both stars' yields, this is done in <span class="flex_cfunction">nucsyn_binary_yield</span>. The appropriate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <msub subscriptshift="0.2ex">
    <mrow><mi>p</mi>
@@ -6694,11 +7065,11 @@ The calls to <span class="flex_cfunction">nucsyn_calc_yields</span> modify the a
    </mrow>
   </msub>
  </mrow></mstyle></math> yields are more difficult to define but there is an attempt. </div>
-<h4 class="subsubsection" id='magicparlabel-6520'><span class="subsubsection_label">7.9.11</span> Logging and minor functions</h4>
-<div class="standard" id='magicparlabel-6521'><div id="subsec_Logging_and_minor_functions"></div>
+<h4 class="subsubsection" id='magicparlabel-7080'><span class="subsubsection_label">8.9.11</span> Logging and minor functions</h4>
+<div class="standard" id='magicparlabel-7081'><div id="subsec_Logging_and_minor_functions"></div>
 There are numerous logging functions for debugging and general pretty-picture-manufacture, e.g. <span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_log</span></span>, <span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_long_log</span></span>, <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_short_log</span></span></span>, <span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_j_log</span></span>. Most of these are activated or deactivated in <span class="flex_headerfile">nucsyn_log.h</span>. Other minor functions: <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_totalX</span></span></span> calculates the total mass fraction (or actually the total sum of array elements), <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_square_bracket</span></span></span> calculates an abundance in &ldquo;square bracket notation&rdquo; by mass fraction (should it be by number?); <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_mix_shells</span></span></span> mixes two isotope arrays together (very useful!) there are the other mixing functions <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_dilute_shell</span></span></span> and <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_dilulte_shell_to</span></span></span> which are similarly useful; <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_radioactive_decay</span></span></span> decays a few isotopes – it is by no means exhaustive, there may be other isotopes you wish to place in here but it's easy to extend; <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_mole_fraction</span></span></span> converts an array of mass fractions to mole fractions, perhaps useful for the square bracket logging?</div>
-<h4 class="subsubsection" id='magicparlabel-6570'><span class="subsubsection_label">7.9.12</span> Other stellar remnants</h4>
-<div class="standard" id='magicparlabel-6571'><div id="subsec_Other_stellar_remnants"></div>
+<h4 class="subsubsection" id='magicparlabel-7130'><span class="subsubsection_label">8.9.12</span> Other stellar remnants</h4>
+<div class="standard" id='magicparlabel-7131'><div id="subsec_Other_stellar_remnants"></div>
 Some stellar types are not dealt with by nucleosynthesis. There include WDs (<span style='font-family:monospace;font-size: 18px;'>nucsyn_set_WD_abunds</span>), which are assumed to: <span class="flex_cmacro">HeWD</span> 100% <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
@@ -6755,33 +7126,61 @@ Some stellar types are not dealt with by nucleosynthesis. There include WDs (<sp
   </mrow>
  </mrow></mstyle></math>. This could be improved (to take into account, say, the heavier metals) but note that any accretion onto the surface from a non-degenerate companion will mask the above abundances (since an accretion layer will form on the surface unless there are novae) and the business of accretion onto WDs is very complicated indeed.</div>
 
-<div class="standard" id='magicparlabel-6584'>NSs and BHs are remnants with their abundances set in <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_set_remnant_abunds</span></span></span> are assumed to be all neutrons with<span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7144'>NSs and BHs are remnants with their abundances set in <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_set_remnant_abunds</span></span></span> are assumed to be all neutrons with<span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings <i>C</i>'>Xsurf[Xn]=1.0;</pre><br />
 </span></div>
-<h3 class="subsection" id='magicparlabel-6593'><span class="subsection_label">7.10</span> Control scripts</h3>
-<div class="standard" id='magicparlabel-6594'><div id="subsec_Control_scripts"></div>
+<h3 class="subsection" id='magicparlabel-7153'><span class="subsection_label">8.10</span> Coding style</h3>
+<div class="standard" id='magicparlabel-7154'><i>binary_c</i> <i>C</i> code follows a particular style to which you should adhere.</div>
+
+<ul class="itemize" id='magicparlabel-7155'><li class="itemize_item">Please use the <a href="https://en.wikipedia.org/wiki/Indentation_style#Allman_style">Allman style</a> </li>
+<li class="itemize_item">Indent with four spaces (<a href="https://www.gnu.org/software/emacs/">emacs</a> indents <span class="flex_programminglanguage">C</span> like this automatically).</li>
+</ul>
+<h4 class="subsubsection" id='magicparlabel-7161'><span class="subsubsection_label">8.10.1</span> Macros</h4>
+<div class="standard" id='magicparlabel-7162'>C preprocessor macros are a very powerful way to make code more readable, or less, depending on their use, hence <i>binary_c</i> has strict rules for their use.</div>
+
+<ul class="itemize" id='magicparlabel-7163'><li class="itemize_item">Macros used as flags should use <span class="flex_cmacro">CAPTIALS</span> and, when used in <span class="flex_cmacro">#ifdef &hellip; #endif</span> pairs, you should include a comment at the end of the pair to say specify the opening macro, for example. <br />
+<pre class ='listings'>#define FLAG_MACRO
+
+
+#ifdef FLAG_MACRO
+
+... do stuff 
+
+#endif // FLAG_MACRO</pre><br />
+</li>
+<li class="itemize_item">Constant macros should use upper case, e.g.,<br />
+<pre class ='listings'>#define CONSTANT_MACRO 3</pre><br />
+</li>
+<li class="itemize_item">Macro functions should be named with the first character in upper case, the rest in lower case, and when you address arguments remember to wrap them in parentheses, e.g.,<br />
+<pre class ='listings'>#define Pow2(X) ((X)*(X))
+#define Other_star(K) ((K)==0 ? 1 : 0) </pre><br />
+exceptions to this are the macros used for stellar types, <span class="flex_cmacro">PRINTF</span> which is just mapped to <span class="flex_cmacro">Printf</span> for backward compatibility, and macros such as <span class="flex_cmacro">likley</span> and <span class="flex_cmacro">unlikley</span> which are kept in lower case to match external code (in this case the <span class="flex_os">Linux</span> kernel).</li>
+<li class="itemize_item">Macros which are used only locally, and variables used in macro expressions, should be prefixed with two underscores</li>
+</ul>
+<h3 class="subsection" id='magicparlabel-7215'><span class="subsection_label">8.11</span> Control scripts</h3>
+<div class="standard" id='magicparlabel-7216'><div id="subsec_Control_scripts"></div>
 I have a number of control scripts written in <span class="flex_scriptinglanguage">Perl</span>  which test the code and output graphs and data for e.g. AGB stars and WR stars (to compare to full evolution models), stellar yields etc. There might be some documentation here eventually&hellip; it all depends on whether you prefer writing your own scripts (that way you'll learn how it all works) or just having a black-box that works (you can always look at the source code).</div>
 
-<div class="standard" id='magicparlabel-6599'>A very useful script is <span class="flex_bashscript">zipup</span> which makes a file <span class="flex_file"><i>binary_c</i>.zip</span> containing this manual and all the source code. See also <span class="flex_perlscript">grid.pl</span>.</div>
+<div class="standard" id='magicparlabel-7221'>A very useful script is <span class="flex_bashscript">zipup</span> which makes a file <span class="flex_file"><i>binary_c</i>.zip</span> containing this manual and all the source code. See also <span class="flex_perlscript">grid.pl</span>.</div>
 
-<div class="standard" id='magicparlabel-6612'><br />
+<div class="standard" id='magicparlabel-7234'><br />
 </div>
-<h2 class="section" id='magicparlabel-6613'><span class="section_label">8</span> Advanced Configuration</h2>
-<div class="standard" id='magicparlabel-6614'><div id="subsec_Advanced_Configuration"></div>
+<h2 class="section" id='magicparlabel-7235'><span class="section_label">9</span> Advanced Configuration</h2>
+<div class="standard" id='magicparlabel-7236'><div id="subsec_Advanced_Configuration"></div>
 </div>
 
-<div class="standard" id='magicparlabel-6615'>There are three main configuration files which affect how the <i>binary_c</i> code is built: <span class="flex_headerfile">binary_c_code_options.h</span>, <span class="flex_headerfile">binary_c_parameters.h</span> and <span class="flex_headerfile">nucsyn/nucsyn_parameters.h</span>.</div>
+<div class="standard" id='magicparlabel-7237'>There are three main configuration files which affect how the <i>binary_c</i> code is built: <span class="flex_headerfile">binary_c_code_options.h</span>, <span class="flex_headerfile">binary_c_parameters.h</span> and <span class="flex_headerfile">nucsyn/nucsyn_parameters.h</span>.</div>
 
-<div class="standard" id='magicparlabel-6628'>Also, some options are enabled via the <span class="flex_file">Makefile</span> (set up by the <em><span class="flex_perlscript">configure</span> </em>script). </div>
-<h3 class="subsection" id='magicparlabel-6637'><span class="subsection_label">8.1</span> configure</h3>
-<div class="standard" id='magicparlabel-6638'>The <span class="flex_perlscript">configure</span><em> </em>script should be run before you do anything else. It makes the <span class="flex_file">Makefile</span> and also makes a source file called <span class="flex_headerfile">nucsyn/nucsyn_unrolled_functions.h</span>. This function contains loop–unrolled versions of a few bottleneck functions which execute more quickly than if they were in loops (yes, even telling the compiler to unroll the loops is not as fast).</div>
+<div class="standard" id='magicparlabel-7250'>Also, some options are enabled via the <span class="flex_file">Makefile</span> (set up by the <em><span class="flex_perlscript">configure</span> </em>script). </div>
+<h3 class="subsection" id='magicparlabel-7259'><span class="subsection_label">9.1</span> configure</h3>
+<div class="standard" id='magicparlabel-7260'>The <span class="flex_perlscript">configure</span><em> </em>script should be run before you do anything else. It makes the <span class="flex_file">Makefile</span> and also makes a source file called <span class="flex_headerfile">nucsyn/nucsyn_unrolled_functions.h</span>. This function contains loop–unrolled versions of a few bottleneck functions which execute more quickly than if they were in loops (yes, even telling the compiler to unroll the loops is not as fast).</div>
 
-<div class="standard" id='magicparlabel-6651'>When you change something in <span class="flex_headerfile">binary_structures.h</span> you may have to rerun configure because this in turn reruns <span class="flex_perlscript">make_showstruct.pl</span> which builds code to show the contents of <span class="flex_cstruct">stardata_t</span> structures.</div>
-<h3 class="subsection" id='magicparlabel-6664'><span class="subsection_label">8.2</span> <i>binary_c</i>-config<div id="subsec_binary_c_config"></div>
+<div class="standard" id='magicparlabel-7273'>When you change something in <span class="flex_headerfile">binary_structures.h</span> you may have to rerun configure because this in turn reruns <span class="flex_perlscript">make_showstruct.pl</span> which builds code to show the contents of <span class="flex_cstruct">stardata_t</span> structures.</div>
+<h3 class="subsection" id='magicparlabel-7286'><span class="subsection_label">9.2</span> <i>binary_c</i>-config<div id="subsec_binary_c_config"></div>
 </h3>
-<div class="standard" id='magicparlabel-6665'>Many <em><span class="flex_os"><em>Unix</em></span>-</em>type commands have an associated <span class="flex_command">*-config</span> command which gives details of their build flags, version, build date etc. As of recently, so does <i>binary_c</i>, so you can run,</div>
+<div class="standard" id='magicparlabel-7287'>Many <em><span class="flex_os"><em>Unix</em></span>-</em>type commands have an associated <span class="flex_command">*-config</span> command which gives details of their build flags, version, build date etc. As of recently, so does <i>binary_c</i>, so you can run,</div>
 
-<div class="standard" id='magicparlabel-6674'><br />
+<div class="standard" id='magicparlabel-7296'><br />
 <pre class\s*='listings bash'>$ <i>binary_c</i>-config help</pre><br />
 to see the available flags, which at the time of writing are<br />
 <pre class ='listings'>--cflags        Show the flags which were used to build <i>binary_c</i> (same as --flags)
@@ -6807,7 +7206,7 @@ to see the available flags, which at the time of writing are<br />
 --undef_macros  Show macros undefined by -U... in the CFLAGS</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-6703'>note that the double minus sign is optional (it can be one minus, or none). For example,<br />
+<div class="standard" id='magicparlabel-7325'>note that the double minus sign is optional (it can be one minus, or none). For example,<br />
 <pre class ='listings'>$ <i>binary_c</i>-config define_macros
 -DALIGNSIZE=16 -DCPUFREQ=3500 -DLINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DGIT_REVISION=4132:20190711:e754a8a7 -DGIT_URL=gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git -DGIT_BRANCH=izzard-discs -D__HAVE_AVX__ -D__HAVE_DRAND48__ -D__HAVE_GSL__ -DUSE_GSL -D__HAVE_LIBBACKTRACE__ -D__HAVE_LIBBFD__ -D__HAVE_LIBBSD__ -D__HAVE_LIBIBERTY__ -D__HAVE_LIBMEMOIZE__ -D__HAVE_MALLOC_H__ -D__HAVE_PKG_CONFIG__ -D__HAVE_VALGRIND__ -D__SHOW_STARDATA__  
 
@@ -6818,22 +7217,22 @@ $ <i>binary_c</i>-config cflags
 -DALIGNSIZE=16   -fPIC -Wall -Wstrict-prototypes -O3   -mtune=native -march=native  -DCPUFREQ=3500  -DLINUX  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -frounding-math -fsignaling-nans -fno-finite-math-only -fno-stack-protector -ffloat-store -fno-fast-math  -DGIT_REVISION=4132:20190711:e754a8a7 -DGIT_URL=gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git -DGIT_BRANCH=izzard-discs  -D__HAVE_AVX__  -mavx  -D__HAVE_DRAND48__  -D__HAVE_GSL__  -DUSE_GSL  -I/home/izzard/include  -D__HAVE_LIBBACKTRACE__  -D__HAVE_LIBBFD__  -D__HAVE_LIBBSD__  -D__HAVE_LIBIBERTY__  -D__HAVE_LIBMEMOIZE__  -D__HAVE_MALLOC_H__  -D__HAVE_PKG_CONFIG__  -D__HAVE_VALGRIND__  -D__SHOW_STARDATA__     -mtune=native  -ffunction-sections  -mtune=native -march=native  -fsignaling-nans -fno-finite-math-only  -fsignaling-nans -fno-finite-math-only</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-6715'>The <i>binary_grid</i> <span class="flex_scriptinglanguage">Perl</span> module makes extensive use of <span class="flex_bashscript"><i>binary_c</i>-config</span> to determine which flags it should use to build its <span class="flex_programminglanguage">C</span> interface to <i>libbinary_c</i>.</div>
+<div class="standard" id='magicparlabel-7337'>The <i>binary_grid</i> <span class="flex_scriptinglanguage">Perl</span> module makes extensive use of <span class="flex_bashscript"><i>binary_c</i>-config</span> to determine which flags it should use to build its <span class="flex_programminglanguage">C</span> interface to <i>libbinary_c</i>.</div>
 
-<div class="standard" id='magicparlabel-6728'>Note that the <span class="flex_command"><i>binary_c</i>-config</span> tool is actually a <span class="flex_scriptinglanguage">bash</span> script that requires <i>binary_c</i> to be built, and working tools such as <span class="flex_command">grep</span>, <span class="flex_command">tr</span>, <span class="flex_command">sed</span> and <span class="flex_command">ldd</span>. These are standard tools on most <span class="flex_os">Unix</span> systems.</div>
-<h3 class="subsection" id='magicparlabel-6757'><span class="subsection_label">8.3</span> Makefile -D&hellip;</h3>
-<div class="standard" id='magicparlabel-6758'>Some options are set up by <span class="flex_command">configure</span><em> </em>and passed into the <span class="flex_file">Makefile</span><em> </em>as <span class="flex_args">-D&hellip;</span> arguments to the compiler:</div>
+<div class="standard" id='magicparlabel-7350'>Note that the <span class="flex_command"><i>binary_c</i>-config</span> tool is actually a <span class="flex_scriptinglanguage">bash</span> script that requires <i>binary_c</i> to be built, and working tools such as <span class="flex_command">grep</span>, <span class="flex_command">tr</span>, <span class="flex_command">sed</span> and <span class="flex_command">ldd</span>. These are standard tools on most <span class="flex_os">Unix</span> systems.</div>
+<h3 class="subsection" id='magicparlabel-7379'><span class="subsection_label">9.3</span> Makefile -D&hellip;</h3>
+<div class="standard" id='magicparlabel-7380'>Some options are set up by <span class="flex_command">configure</span><em> </em>and passed into the <span class="flex_file">Makefile</span><em> </em>as <span class="flex_args">-D&hellip;</span> arguments to the compiler:</div>
 
-<ul class="itemize" id='magicparlabel-6771'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LINUX</span> is defined if you're running <span class="flex_os">Linux</span>. This is useful for some timers and segfault catchers which only work with the <span class="flex_os">Linux</span> libraries.</li>
+<ul class="itemize" id='magicparlabel-7393'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LINUX</span> is defined if you're running <span class="flex_os">Linux</span>. This is useful for some timers and segfault catchers which only work with the <span class="flex_os">Linux</span> libraries.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LARGEFILE_SOURCE</span> and <span style='font-family:monospace;font-size: 18px;'>FILE_OFFSET_BITS</span> were once useful for large output files on 64-bit machines (&gt;2GB). This may no longer be a problem but they do not hurt.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CPUFREQ</span> is the frequency of your CPU (in Mhz) – this is very useful for timing information. (Taken from <span class="flex_file">/proc/cpuinfo</span> if available, <span class="flex_command">sysctl -a</span> on MacOS/Darwin) </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>GIT_REVISION</span> and <span style='font-family:monospace;font-size: 18px;'>GIT_URL</span> provide <em><i>binary_c</i></em> with information about the version of the code you are using. This can prove essential when debugging. See section&nbsp;<a href="#subsec_git_revision">10.17</a> for more details.</li>
+<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>GIT_REVISION</span> and <span style='font-family:monospace;font-size: 18px;'>GIT_URL</span> provide <em><i>binary_c</i></em> with information about the version of the code you are using. This can prove essential when debugging. See section&nbsp;<a href="#subsec_git_revision">11.17</a> for more details.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-6791'><span class="subsection_label">8.4</span> binary_c_code_options.h</h3>
-<div class="standard" id='magicparlabel-6792'><div id="subsec_binary_c_code_options_h"></div>
+<h3 class="subsection" id='magicparlabel-7413'><span class="subsection_label">9.4</span> binary_c_code_options.h</h3>
+<div class="standard" id='magicparlabel-7414'><div id="subsec_binary_c_code_options_h"></div>
 This contains <em>non-physics</em> options. You probably do not want to change this file unless you have compilation problems or you want to optimize the code (even more!). The options are the following (in the order given in the file)</div>
 
-<ul class="itemize" id='magicparlabel-6793'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SEGFAULTS</span> This should be set if want segfaults on a code failure. This is useful if you are debugging with gdb.</li>
+<ul class="itemize" id='magicparlabel-7415'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SEGFAULTS</span> This should be set if want segfaults on a code failure. This is useful if you are debugging with gdb.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACML</span> should be set if you wish to use the AMD math (sic) library. This should not be set here, but with in the <em>Makefile</em> with the <em>configure</em> script.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DUMA</span> should be set if you wish to use the DUMA memory checking library. This should not be set here, but with in the <em>Makefile</em> with the <em>configure</em> script.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEBUG</span> is either zero (<span style='font-family:monospace;font-size: 18px;'>0</span>) or one (<span style='font-family:monospace;font-size: 18px;'>1</span>). All debugging statements should use the <span style='font-family:monospace;font-size: 18px;'>Dprint</span> function instead of the standard <i>C</i>-library function <span style='font-family:monospace;font-size: 18px;'>printf</span>. If <span style='font-family:monospace;font-size: 18px;'>DEBUG</span> is zero, then the compiler should never build the debug statements into the code (modern compilers will behave in this way). However, if in doubt enable the <span style='font-family:monospace;font-size: 18px;'>DISABLE_DPRINT</span> option.</li>
@@ -6865,11 +7264,11 @@ This contains <em>non-physics</em> options. You probably do not want to change t
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RANDOM_SYSTEMS </span>is used in conjunction with <span style='font-family:monospace;font-size: 18px;'>--repeat </span>to run randomly chosen systems to check for bugs. This is deprecated and will be removed in future. Instead you should use the <span style='font-family:monospace;font-size: 18px;'>random_systems.pl</span> script to generate random binaries. </li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MULTISTAR</span> is an experimental attempt to run many stars in parallel. It does not work and is highly experimental.</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-6830'><span class="subsection_label">8.5</span> binary_c_parameters.h</h3>
-<div class="standard" id='magicparlabel-6831'><div id="subsec_binary_c_parameters_h"></div>
+<h3 class="subsection" id='magicparlabel-7452'><span class="subsection_label">9.5</span> binary_c_parameters.h</h3>
+<div class="standard" id='magicparlabel-7453'><div id="subsec_binary_c_parameters_h"></div>
 The options in this file are non-nucleosynthesis, (single or) binary stellar evolution options. This file also automatically includes many header files, <span class="flex_headerfile">binary_c_code_options.h</span> and <span class="flex_headerfile">nucsyn_parameters.h</span> so is very useful as a &ldquo;catch-all&rdquo; at the top of each source code file. </div>
 
-<ul class="itemize" id='magicparlabel-6840'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>AXEL</span> if this is defined then Axel Bonacic's changes to the code are applied (but <em>NOT necessarily</em> <span style='font-family:monospace;font-size: 18px;'>AXEL_RGB_FIX</span>). <em><b>WARNING!</b></em> This is often broken and subject to development. Axel's code is not usually that well tested&hellip;</li>
+<ul class="itemize" id='magicparlabel-7462'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>AXEL</span> if this is defined then Axel Bonacic's changes to the code are applied (but <em>NOT necessarily</em> <span style='font-family:monospace;font-size: 18px;'>AXEL_RGB_FIX</span>). <em><b>WARNING!</b></em> This is often broken and subject to development. Axel's code is not usually that well tested&hellip;</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SMOOTH_AGB</span> enables code to smooth the HR-diagram through the transition between the original overshooting models and Amanda's TPAGB models. May not be reliable – you may want to use <span style='font-family:monospace;font-size: 18px;'>ROBSMOOTH</span> instead.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ROBSMOOTH</span> does the same as <span style='font-family:monospace;font-size: 18px;'>SMOOTH_AGB</span> but is simpler and more reliable.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUMBER_OF_STARS</span> This should always be defined as 2, it is a binary star code&hellip;</li>
@@ -7194,7 +7593,7 @@ The options in this file are non-nucleosynthesis, (single or) binary stellar evo
   </mrow>
  </mrow></mstyle></math>) which when set very high (like the default) has no effect. This code has not been well tested.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BINARY_STARS_ONLY</span> When defined the evolution code does not evolve through phases involving just one star.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN</span> When defined then the nucleosynthesis code is built (and nucsyn/nucsyn_parameters.h is included, see <a href="#subsec_nucsyn_nucsyn_parameters_h">8.6</a>). When not defined you are just building my <i>C</i> version of BSE.</li>
+<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN</span> When defined then the nucleosynthesis code is built (and nucsyn/nucsyn_parameters.h is included, see <a href="#subsec_nucsyn_nucsyn_parameters_h">9.6</a>). When not defined you are just building my <i>C</i> version of BSE.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ANG_MOM_CHECKS</span> is used to log angular momenta just prior to a SN.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DELIBERATE_BUG1</span> enables a bug which you don't want enabled.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BINARY_COLOURS</span> builds some code which includes UBV colour calculations based on Kurucz atmospheres (thanks to Jarrod).</li>
@@ -7222,7 +7621,7 @@ The options in this file are non-nucleosynthesis, (single or) binary stellar evo
 
 
 
-<ul class="itemize" id='magicparlabel-6933'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NO_MERGER_NUCLEOSYNTHESIS</span> Stops ignition of helium cores when they merge (<a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span>, <span class="bib-year">2002</span></a> did this but I do not believe it is correct)</li>
+<ul class="itemize" id='magicparlabel-7555'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NO_MERGER_NUCLEOSYNTHESIS</span> Stops ignition of helium cores when they merge (<a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span>, <span class="bib-year">2002</span></a> did this but I do not believe it is correct)</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HeWD_HeCORE_MERGER_IGNITION</span> Forces HeWD+GB to form a new GB star, and HeWD+CHeB to form a new CHeB star (a little thought tells you that the latter cannot happen)</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_COMENV_RSTARS</span> Logs R star mergers resulting from common envelope evolution</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_RSTARS</span> Logs R stars during the CHeB stage</li>
@@ -7396,16 +7795,16 @@ The options in this file are non-nucleosynthesis, (single or) binary stellar evo
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>PN_PROJECT</span> is a catchall for Rob's PN+nucleosynthesis project.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>WRLOF_MASS_TRANSFER</span> is Carlo Abate's wind-RLOF prescription (see Abate et al 2013, MNRAS accepted).</li>
 </ul>
-<h3 class="subsection" id='magicparlabel-6994'><span class="subsection_label">8.6</span> nucsyn/nucsyn_parameters.h</h3>
-<div class="standard" id='magicparlabel-6995'><div id="subsec_nucsyn_nucsyn_parameters_h"></div>
-While many important options are set on the command line the options governing which nucleosynthesis algorithms to use and what to output are set in the file <span class="flex_headerfile">nucsyn/nucsyn_parameters.h</span>. More detailed descriptions of the variables used in the code are given in section <a href="#sec_Code_description">7</a>.</div>
+<h3 class="subsection" id='magicparlabel-7616'><span class="subsection_label">9.6</span> nucsyn/nucsyn_parameters.h</h3>
+<div class="standard" id='magicparlabel-7617'><div id="subsec_nucsyn_nucsyn_parameters_h"></div>
+While many important options are set on the command line the options governing which nucleosynthesis algorithms to use and what to output are set in the file <span class="flex_headerfile">nucsyn/nucsyn_parameters.h</span>. More detailed descriptions of the variables used in the code are given in section <a href="#sec_Code_description">8</a>.</div>
 
-<ul class="itemize" id='magicparlabel-7000'><li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP</span> to make first dredge-up happen on the GB. 
+<ul class="itemize" id='magicparlabel-7622'><li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP</span> to make first dredge-up happen on the GB. 
 <br />
 
 
 
-<ul class="itemize" id='magicparlabel-7001'><li class="itemize_item">You want this, and probably you want to enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_AMANDAS_TABLE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION</span>. These enable tabular lookups of the abundance changes (better than fitting formulae) and a simple prescription to deal with abundance changes due to accretion.</li>
+<ul class="itemize" id='magicparlabel-7623'><li class="itemize_item">You want this, and probably you want to enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_AMANDAS_TABLE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION</span>. These enable tabular lookups of the abundance changes (better than fitting formulae) and a simple prescription to deal with abundance changes due to accretion.</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION_FROM_TAMS</span> is similar but bases changes on the <em>terminal-age main sequence</em> abundances – this is better in the case of accretion of e.g. carbon (i.e. for CEMPs). </li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_PHASE_IN</span> enables a phased change of the abundance to better match detailed models (the default model assumes that 1st DUP happens instantaneously). </li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_RICHARDS_TABLE</span> should be enabled in addition to <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_AMANDAS_TABLE</span> to use Richard Stancliffe's models in place of Amanda's when in the appropriate mass/metallicity range (down to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -7440,7 +7839,7 @@ While many important options are set on the command line the options governing w
 
 
 
-<ul class="itemize" id='magicparlabel-7007'><li class="itemize_item">You probably also want <span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_AMANDA</span> to get the intershell abundances from a table based on Amanda's models.</li>
+<ul class="itemize" id='magicparlabel-7629'><li class="itemize_item">You probably also want <span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_AMANDA</span> to get the intershell abundances from a table based on Amanda's models.</li>
 <li class="itemize_item">You can choose whether to get these numbers from either the old data <span style='font-family:monospace;font-size: 18px;'>USE_TABULAR_INTERSHELL_ABUNDANCES_KARAKAS_2002</span> (no s-process; use only for testing!) or the new table <span style='font-family:monospace;font-size: 18px;'>USE_TABULAR_INTERSHELL_ABUNDANCES_KARAKAS_2012</span> (with s-process, deprecates the Busso/Gallino tables which have been removed).</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_ENVELOPE_MASS_FOR_THIRD_DREDGEUP</span> is the minimum mass for third dredge up, set on the command line with <span style='font-family:monospace;font-size: 18px;'>--minimum_envelope_mass_for_third_dredgeup</span> or <span style='font-family:monospace;font-size: 18px;'>MINIMUM_ENVELOPE_MASS_FOR_THIRD_DREDGEUP_DEFAULT</span> by default (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
@@ -7562,7 +7961,7 @@ While many important options are set on the command line the options governing w
 
 
 
-<ul class="itemize" id='magicparlabel-7024'><li class="itemize_item">If you choose <span style='font-family:monospace;font-size: 18px;'>NUCSYN_ANAL_BURN</span> you can specify which nuclear reactions to include: <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_CN_CYCLE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_ON_CYCLE</span> are the CN and ON parts of the CNO cycling in HBB, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_NeNa_CYCLE</span> activates the approximate NeNa cycling, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_MgAl_CYCLE</span> activates the approximate MgAl cycling. Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CNO_ASSUME_STABLE</span> to assume solutions of the CNO quadratic are always real (i.e. a stable solution, neglect the oscillating parts), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NENA_LEAK</span> will allow leakage from NeNa to MgAl (do this), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_Na22_EQUILIBRIUM</span> will force Na22 into equilibrium (otherwise it is not calculated because it is unstable and you probably do not care), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_Al26m</span> follows the metastable state of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
+<ul class="itemize" id='magicparlabel-7646'><li class="itemize_item">If you choose <span style='font-family:monospace;font-size: 18px;'>NUCSYN_ANAL_BURN</span> you can specify which nuclear reactions to include: <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_CN_CYCLE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_ON_CYCLE</span> are the CN and ON parts of the CNO cycling in HBB, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_NeNa_CYCLE</span> activates the approximate NeNa cycling, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_MgAl_CYCLE</span> activates the approximate MgAl cycling. Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CNO_ASSUME_STABLE</span> to assume solutions of the CNO quadratic are always real (i.e. a stable solution, neglect the oscillating parts), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NENA_LEAK</span> will allow leakage from NeNa to MgAl (do this), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_Na22_EQUILIBRIUM</span> will force Na22 into equilibrium (otherwise it is not calculated because it is unstable and you probably do not care), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_Al26m</span> follows the metastable state of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow>
    <msup><mrow />
@@ -7673,7 +8072,7 @@ While many important options are set on the command line the options governing w
 
 
 
-<ul class="itemize" id='magicparlabel-7035'><li class="itemize_item">In the case of <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_WOOSLEY_WEAVER_1995</span> you can choose to use their <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SUPERNOVAE_CC_WW95_A</span> or <span style='font-family:monospace;font-size: 18px;'>B</span> or <span style='font-family:monospace;font-size: 18px;'>C</span> models.</li>
+<ul class="itemize" id='magicparlabel-7657'><li class="itemize_item">In the case of <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_WOOSLEY_WEAVER_1995</span> you can choose to use their <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SUPERNOVAE_CC_WW95_A</span> or <span style='font-family:monospace;font-size: 18px;'>B</span> or <span style='font-family:monospace;font-size: 18px;'>C</span> models.</li>
 <li class="itemize_item">In the case of <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004</span> you can either use their yields directly (best to do this as then the yields really are a function of mass cut) or use the Portinari-corrected versions which are less accurate (<span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004_PORTINARI</span>). Define <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004_EXTRAPOLATE</span> to extrapolate beyond the end of their table at the high metallicity (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow>
   <mrow><mi>Z</mi><mo>&gt;</mo><mn>0.02</mn>
@@ -7852,79 +8251,79 @@ While many important options are set on the command line the options governing w
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MATTSSON_MASS_LOSS</span> experimental mass-loss rates from Lars Mattsson (based on carbon abundances).</li>
 <li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LITHIUM_TAB</span>LES experiments to introduce lithium as a function of mass and pulse number in HBBing stars.</li>
 </ul>
-<div class="standard" id='magicparlabel-7081'>Now you have edited this file to your specifications you need to rebuild the code. The simplest way is </div>
+<div class="standard" id='magicparlabel-7703'>Now you have edited this file to your specifications you need to rebuild the code. The simplest way is </div>
 
-<div class="standard" id='magicparlabel-7082'><br />
+<div class="standard" id='magicparlabel-7704'><br />
 <pre class\s*='listings bash'>$ make</pre><br />
 but if the compile fails, try</div>
 
-<div class="standard" id='magicparlabel-7087'><br />
+<div class="standard" id='magicparlabel-7709'><br />
 <pre class\s*='listings bash'>$ make clean
 $ make</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-7093'><span class="flex_command">configure</span> is supposed to detect your CPU but I have limited machines on which to test this feature. Please add your machine to the list in <span class="flex_file">configure</span> if it fails, or as a last resort try,</div>
+<div class="standard" id='magicparlabel-7715'><span class="flex_command">configure</span> is supposed to detect your CPU but I have limited machines on which to test this feature. Please add your machine to the list in <span class="flex_file">configure</span> if it fails, or as a last resort try,</div>
 
-<div class="standard" id='magicparlabel-7102'><br />
+<div class="standard" id='magicparlabel-7724'><br />
 <pre class\s*='listings bash'>$ ./configure generic</pre><br />
 </div>
 
-<div class="standard" id='magicparlabel-7107'>There are further options in the file <span class="flex_file">binary_c_parameters.h</span> (details below) although it's unlikely you'll want to change any of them.</div>
+<div class="standard" id='magicparlabel-7729'>There are further options in the file <span class="flex_file">binary_c_parameters.h</span> (details below) although it's unlikely you'll want to change any of them.</div>
 
-<div class="standard" id='magicparlabel-7112'><br />
+<div class="standard" id='magicparlabel-7734'><br />
 </div>
-<h2 class="section" id='magicparlabel-7113'><span class="section_label">9</span> <em><i>binary_c</i> </em>software development cycle</h2>
-<div class="standard" id='magicparlabel-7116'>This section describes the <span class='math'>binary_c</i></span>
+<h2 class="section" id='magicparlabel-7735'><span class="section_label">10</span> <em><i>binary_c</i> </em>software development cycle</h2>
+<div class="standard" id='magicparlabel-7738'>This section describes the <span class='math'>binary_c</i></span>
  software development cycle.</div>
-<h3 class="subsection" id='magicparlabel-7117'><span class="subsection_label">9.1</span> The git revolution</h3>
-<div class="standard" id='magicparlabel-7118'>In its earliest days, I was the only person using <span class='math'>binary_c</i></span>
+<h3 class="subsection" id='magicparlabel-7739'><span class="subsection_label">10.1</span> The git revolution</h3>
+<div class="standard" id='magicparlabel-7740'>In its earliest days, I was the only person using <span class='math'>binary_c</i></span>
 . It didn't really work properly, so this was not surprising. As time went on, I aged and other, younger people started using <span class='math'>binary_c</i></span>
 . While this is great, it puts some burden on me as the maintainer. However, there is a better way! The decision was made to put <span class='math'>binary_c</i></span>
- into subversion (<span class="flex_software">SVN</span>) and all<div class="foot"><span class="foot_label">11</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-7126'>Well, <em>some</em>&hellip;</div>
+ into subversion (<span class="flex_software">SVN</span>) and all<div class="foot"><span class="foot_label">11</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-7748'>Well, <em>some</em>&hellip;</div>
 </div></div> was solved. Unfortunately, the University of Surrey has no <span class="flex_software">SVN</span> support, so I had to move everything to git which is apparently more modern (although I cannot really tell the difference).</div>
 
-<div class="standard" id='magicparlabel-7131'>You could use a graphical interface, such as <span class="flex_software">Gitkraken</span>, to work with <span class="flex_software">git</span><em> – </em>this may save you a lot of time and effort!</div>
-<h3 class="subsection" id='magicparlabel-7140'><span class="subsection_label">9.2</span> The master(trunk)–branch model<div id="sec_The_trunk_branch_model"></div>
+<div class="standard" id='magicparlabel-7753'>You could use a graphical interface, such as <span class="flex_software">Gitkraken</span>, to work with <span class="flex_software">git</span><em> – </em>this may save you a lot of time and effort!</div>
+<h3 class="subsection" id='magicparlabel-7762'><span class="subsection_label">10.2</span> The master(trunk)–branch model<div id="sec_The_trunk_branch_model"></div>
 </h3>
-<div class="standard" id='magicparlabel-7141'>Code on <span class="flex_software">git</span> is like a tree. The main version of <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-7763'>Code on <span class="flex_software">git</span> is like a tree. The main version of <span class='math'>binary_c</i></span>
  resides in the <em>master</em> version (like <span class="flex_software">SVN</span>'s <em>trunk</em>). When you first requested access to<em> </em><span class='math'>binary_c</i></span>, Rob will have made you a copy of the latest master version. This copy is called your <em>branch</em>. You could, in theory, have more than one <em>branch</em>, like a real (healthy) tree, but most people have just one branch.</div>
 
-<div class="standard" id='magicparlabel-7150'>To get <span class='math'>binary_c</i></span>, run</div>
+<div class="standard" id='magicparlabel-7772'>To get <span class='math'>binary_c</i></span>, run</div>
 
-<div class="standard" id='magicparlabel-7151'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7773'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git</pre><br />
 </span>and you can make a new branch with <span class="flex_software">git</span> branch. </div>
 
-<div class="standard" id='magicparlabel-7160'>In your branch you can do <em>whatever you like</em>! Change the code, delete things, make new things, whatever. It's your branch. But, beware. You will want bug fixes to merge easily, so don't change your branch too radically, and make sure you update with trunk changes regularly (see Section&nbsp;<a href="#subsec_Updating_with_the">9.2.1</a> below).</div>
-<h4 class="subsubsection" id='magicparlabel-7161'><span class="subsubsection_label">9.2.1</span> Updating with the latest fixes<div id="subsec_Updating_with_the"></div>
+<div class="standard" id='magicparlabel-7782'>In your branch you can do <em>whatever you like</em>! Change the code, delete things, make new things, whatever. It's your branch. But, beware. You will want bug fixes to merge easily, so don't change your branch too radically, and make sure you update with trunk changes regularly (see Section&nbsp;<a href="#subsec_Updating_with_the">10.2.1</a> below).</div>
+<h4 class="subsubsection" id='magicparlabel-7783'><span class="subsubsection_label">10.2.1</span> Updating with the latest fixes<div id="subsec_Updating_with_the"></div>
 </h4>
-<div class="standard" id='magicparlabel-7162'>The <em>master</em> is periodically updated with fixes. Only Rob can do this. However, he posts to the <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-7784'>The <em>master</em> is periodically updated with fixes. Only Rob can do this. However, he posts to the <span class='math'>binary_c</i></span>
  mailing list to describe what he has done. Now, let's say you want to merge these fixes with your branch. You have to do </div>
 
-<div class="standard" id='magicparlabel-7163'><br />
+<div class="standard" id='magicparlabel-7785'><br />
 <pre class ='listings'>git merge</pre><br />
 and you're done.</div>
 
-<div class="standard" id='magicparlabel-7168'>Beware: there may be conflicts with your code (you will be informed). <em>git</em> tries very hard to merge code automatically, but sometimes this just is not possible. You have to fix these files and then tell git they are fixed.</div>
+<div class="standard" id='magicparlabel-7790'>Beware: there may be conflicts with your code (you will be informed). <em>git</em> tries very hard to merge code automatically, but sometimes this just is not possible. You have to fix these files and then tell git they are fixed.</div>
 
-<div class="standard" id='magicparlabel-7169'>Rob <em>assumes</em> you merge the trunk regularly and often. If you leave a long time between merging you will have problems, often because something in the code <em>on which you rely</em> has been changed (hopefully for the better). Do not let this happen! Merge regularly and often.</div>
-<h4 class="subsubsection" id='magicparlabel-7170'><span class="subsubsection_label">9.2.2</span> Committing your changes</h4>
-<div class="standard" id='magicparlabel-7171'>When you make changes in your branch, you should <em>commit</em> your code. Do this with</div>
+<div class="standard" id='magicparlabel-7791'>Rob <em>assumes</em> you merge the trunk regularly and often. If you leave a long time between merging you will have problems, often because something in the code <em>on which you rely</em> has been changed (hopefully for the better). Do not let this happen! Merge regularly and often.</div>
+<h4 class="subsubsection" id='magicparlabel-7792'><span class="subsubsection_label">10.2.2</span> Committing your changes</h4>
+<div class="standard" id='magicparlabel-7793'>When you make changes in your branch, you should <em>commit</em> your code. Do this with</div>
 
-<div class="standard" id='magicparlabel-7172'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7794'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>git commit </pre><br />
 </span>or possibly</div>
 
-<div class="standard" id='magicparlabel-7177'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7799'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>git commit -a</pre><br />
 </span>which then will ask you to write a comment describing your changes. Please use your brain – one word comments are not (usually) of much use either to you or anyone else.</div>
 
-<div class="standard" id='magicparlabel-7182'>You should commit regularly and often. I do it every night. You then have a backup of your code for free!</div>
-<h4 class="subsubsection" id='magicparlabel-7183'><span class="subsubsection_label">9.2.3</span> Submitting changes to the <em>master</em></h4>
-<div class="standard" id='magicparlabel-7184'>Only Rob can/should make changes to the <em>master</em>. If you are ready to have your changes incorporated into the main version of <span class='math'>binary_c</i></span>
+<div class="standard" id='magicparlabel-7804'>You should commit regularly and often. I do it every night. You then have a backup of your code for free!</div>
+<h4 class="subsubsection" id='magicparlabel-7805'><span class="subsubsection_label">10.2.3</span> Submitting changes to the <em>master</em></h4>
+<div class="standard" id='magicparlabel-7806'>Only Rob can/should make changes to the <em>master</em>. If you are ready to have your changes incorporated into the main version of <span class='math'>binary_c</i></span>
  which, need I remind you, you are obliged to do by the terms of the licence agreement, you should do the following:</div>
 
-<ul class="itemize" id='magicparlabel-7185'><li class="itemize_item">Run <span style='font-family:monospace;font-size: 18px;'><br />
+<ul class="itemize" id='magicparlabel-7807'><li class="itemize_item">Run <span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>git pull</pre><br />
 </span> to make sure you have the latest version of your code.</li>
 <li class="itemize_item">Test your code to make sure it works as you expect.</li>
@@ -7940,38 +8339,38 @@ and you're done.</div>
  </span>to send code to the server.</li>
 <li class="itemize_item">Email Rob, tell him your branch is ready to commit, and tell him the <span class="flex_software">git</span> revision number of your last commit. You can also submit merge requests via the <span class="flex_software">gitlab</span> interface.</li>
 </ul>
-<div class="standard" id='magicparlabel-7216'>The rest is Rob's job. If you want another branch to work on while you wait, just do it.</div>
-<h4 class="subsubsection" id='magicparlabel-7217'><span class="subsubsection_label">9.2.4</span> Getting your old code back</h4>
-<div class="standard" id='magicparlabel-7218'>If you make a mistake, you can always get your old code back.</div>
+<div class="standard" id='magicparlabel-7838'>The rest is Rob's job. If you want another branch to work on while you wait, just do it.</div>
+<h4 class="subsubsection" id='magicparlabel-7839'><span class="subsubsection_label">10.2.4</span> Getting your old code back</h4>
+<div class="standard" id='magicparlabel-7840'>If you make a mistake, you can always get your old code back.</div>
 
-<div class="standard" id='magicparlabel-7219'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7841'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings'>git revert </pre><br />
 </span> will change a file back to the version currently on the server.</div>
 
 
-<div class="standard" id='magicparlabel-7224'><br />
+<div class="standard" id='magicparlabel-7846'><br />
 </div>
-<h2 class="section" id='magicparlabel-7225'><span class="section_label">10</span> Cookbook</h2>
-<h3 class="subsection" id='magicparlabel-7226'><span class="subsection_label">10.1</span> How to log output</h3>
-<div class="standard" id='magicparlabel-7227'>Put your logging statement into <span class="flex_file">log_every_timestep.c</span> using the <span class="flex_cmacro">Printf</span> macro, e.g.,<br />
+<h2 class="section" id='magicparlabel-7847'><span class="section_label">11</span> Cookbook</h2>
+<h3 class="subsection" id='magicparlabel-7848'><span class="subsection_label">11.1</span> How to log output</h3>
+<div class="standard" id='magicparlabel-7849'>Put your logging statement into <span class="flex_file">log_every_timestep.c</span> using the <span class="flex_cmacro">Printf</span> macro, e.g.,<br />
 <pre class ='listings <i>C</i>'>Printf();</pre><br />
 </div>
-<h3 class="subsection" id='magicparlabel-7240'><span class="subsection_label">10.2</span> How to find which source files contain a string</h3>
-<div class="standard" id='magicparlabel-7241'>Run</div>
+<h3 class="subsection" id='magicparlabel-7862'><span class="subsection_label">11.2</span> How to find which source files contain a string</h3>
+<div class="standard" id='magicparlabel-7863'>Run</div>
 
-<div class="standard" id='magicparlabel-7242'><br />
+<div class="standard" id='magicparlabel-7864'><br />
 <pre class\s*='listings bash'>$ ./rgrep &lt;string&gt; {opts}</pre><br />
 The options (<span class="flex_args">{opts}</span>) are passed to <span class="flex_command">grep -r</span>, see <span class="flex_command">man grep</span> for details, and these are not required. Binary (object, executable, shared library) files are automatically skipped. Most often you will want to ignore case, e.g.,</div>
 
-<div class="standard" id='magicparlabel-7259'><b><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7881'><b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ ./rgrep &lt;string&gt; -i</pre><br />
 </span></b></div>
-<h3 class="subsection" id='magicparlabel-7264'><span class="subsection_label">10.3</span> How to build with debugging output</h3>
-<div class="standard" id='magicparlabel-7265'><em>Binary_c</em> provides the <span style='font-family:monospace;font-size: 18px;'><br />
+<h3 class="subsection" id='magicparlabel-7886'><span class="subsection_label">11.3</span> How to build with debugging output</h3>
+<div class="standard" id='magicparlabel-7887'><em>Binary_c</em> provides the <span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings <i>C</i>'>Dprint(...)</pre><br />
 </span> macro to allow you to output what is going on to the screen (<span style='font-family:monospace;font-size: 18px;'>stdout</span>). To turn this on, change the line in <em>binary_c_code_options.h</em> to</div>
 
-<div class="standard" id='magicparlabel-7270'><br />
+<div class="standard" id='magicparlabel-7892'><br />
 <pre class ='listings <i>C</i>'>#define DEBUG 1</pre><br />
 Then rebuild with <br />
 <pre class\s*='listings bash'>$ ./configure
@@ -7979,19 +8378,19 @@ $ make cleanall
 $ make</pre><br />
 You can provide an expression which must return true for debugging to be output. This is <span class="flex_cmacro">DEBUG_EXP</span> in <span class="flex_headerfile">binary_c_debug.h</span>. E.g.&nbsp;to only have output after 10Myr, use:</div>
 
-<div class="standard" id='magicparlabel-7289'><b><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7911'><b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings <i>C</i>'>#define DEBUG_EXP (stardata-&gt;model.time &gt; 10.0)</pre><br />
 </span></b>Again, you will need to do a complete rebuild to make this work. You can use<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_cmacro">Dprint_no_newline()</span><span style='font-family:monospace;font-size: 18px;'> </span>macro to prevent the newline after a debugging statement.</div>
-<h3 class="subsection" id='magicparlabel-7298'><span class="subsection_label">10.4</span> How to check for NaNs (not a numbers)</h3>
-<div class="standard" id='magicparlabel-7299'>If <span class="flex_cmacro">NANCHECKS</span> is enabled in<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_headerfile">binary_c_code_options.h</span> you can use the <span class="flex_cmacro">NANCHECK(A)</span> macro, which checks whether <span class="flex_cmacro">A</span> is not a number, exiting with an error if this is the case. This is rather compiler dependent but should work fine with <span class="flex_software">gcc</span>.</div>
-<h3 class="subsection" id='magicparlabel-7320'><span class="subsection_label">10.5</span> How to exit <em><i>binary_c</i></em></h3>
-<div class="standard" id='magicparlabel-7321'>Do <em>not</em> use <span class="flex_programminglanguage">C</span>'s <span class="flex_cfunction">exit</span> function. Instead use the <span class="flex_cmacro">Exit_binary_c(&hellip;)</span> macro, with an error code from <span class="flex_headerfile">binary_c_error_codes.h</span>, e.g.</div>
+<h3 class="subsection" id='magicparlabel-7920'><span class="subsection_label">11.4</span> How to check for NaNs (not a numbers)</h3>
+<div class="standard" id='magicparlabel-7921'>If <span class="flex_cmacro">NANCHECKS</span> is enabled in<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_headerfile">binary_c_code_options.h</span> you can use the <span class="flex_cmacro">NANCHECK(A)</span> macro, which checks whether <span class="flex_cmacro">A</span> is not a number, exiting with an error if this is the case. This is rather compiler dependent but should work fine with <span class="flex_software">gcc</span>.</div>
+<h3 class="subsection" id='magicparlabel-7942'><span class="subsection_label">11.5</span> How to exit <em><i>binary_c</i></em></h3>
+<div class="standard" id='magicparlabel-7943'>Do <em>not</em> use <span class="flex_programminglanguage">C</span>'s <span class="flex_cfunction">exit</span> function. Instead use the <span class="flex_cmacro">Exit_binary_c(&hellip;)</span> macro, with an error code from <span class="flex_headerfile">binary_c_error_codes.h</span>, e.g.</div>
 
-<div class="standard" id='magicparlabel-7338'><span style='font-family:monospace;font-size: 18px;'><br />
+<div class="standard" id='magicparlabel-7960'><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class ='listings <i>C</i>'>Exit_binary_c(PIPE_FAILURE, &ldquo;My pipe failed! ARGH!&rdquo;);</pre><br />
 </span></div>
-<h3 class="subsection" id='magicparlabel-7343'><span class="subsection_label">10.6</span> How to debug segfaults</h3>
-<div class="standard" id='magicparlabel-7344'>Install <span class="flex_software">gdb</span>. Build <i>binary_c</i> with debugging:
+<h3 class="subsection" id='magicparlabel-7965'><span class="subsection_label">11.6</span> How to debug segfaults</h3>
+<div class="standard" id='magicparlabel-7966'>Install <span class="flex_software">gdb</span>. Build <i>binary_c</i> with debugging:
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
@@ -8000,20 +8399,20 @@ $ make clean
 $ make</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7355'>Then run your test star with
+<div class="standard" id='magicparlabel-7977'>Then run your test star with
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ tbse debug </pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7360'>which will run <span class="flex_software">gdb</span> for you with the appropriate arguments to run the star. To find out where the bug is, use &ldquo;<span class="flex_args">bt</span>&rdquo; (backtrace) in <span class="flex_software">gdb</span>.</div>
+<div class="standard" id='magicparlabel-7982'>which will run <span class="flex_software">gdb</span> for you with the appropriate arguments to run the star. To find out where the bug is, use &ldquo;<span class="flex_args">bt</span>&rdquo; (backtrace) in <span class="flex_software">gdb</span>.</div>
 
-<div class="standard" id='magicparlabel-7373'>See also <a href="https://en.wikipedia.org/wiki/GNU_Debugger">https://en.wikipedia.org/wiki/GNU_Debugger</a></div>
+<div class="standard" id='magicparlabel-7995'>See also <a href="https://en.wikipedia.org/wiki/GNU_Debugger">https://en.wikipedia.org/wiki/GNU_Debugger</a></div>
 
-<div class="standard" id='magicparlabel-7378'>You may find that <span class="flex_software">valgrind</span> provides more information, especially when your segfault is caused by a memory leak.</div>
-<h3 class="subsection" id='magicparlabel-7383'><span class="subsection_label">10.7</span> How to debug memory leaks</h3>
-<div class="standard" id='magicparlabel-7384'>Build with debugging:
+<div class="standard" id='magicparlabel-8000'>You may find that <span class="flex_software">valgrind</span> provides more information, especially when your segfault is caused by a memory leak.</div>
+<h3 class="subsection" id='magicparlabel-8005'><span class="subsection_label">11.7</span> How to debug memory leaks</h3>
+<div class="standard" id='magicparlabel-8006'>Build with debugging:
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
@@ -8022,14 +8421,14 @@ $ make clean
 $ make</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7391'>Then run 
+<div class="standard" id='magicparlabel-8013'>Then run 
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ tbse valgrind</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7396'>Find out how to use <em><span class="flex_software"><em>valgrind</em></span></em> at <a href="http://valgrind.org/">http://valgrind.org/</a>
+<div class="standard" id='magicparlabel-8018'>Find out how to use <em><span class="flex_software"><em>valgrind</em></span></em> at <a href="http://valgrind.org/">http://valgrind.org/</a>
 <br />
 
 You can also run <br />
@@ -8041,65 +8440,65 @@ You can also run <br />
 <br />
 <pre class\s*='listings bash'>$ tbse sgcheck</pre><br />
 </div>
-<h3 class="subsection" id='magicparlabel-7421'><span class="subsection_label">10.8</span> How to show the arguments that <em>tbse</em> would use, but do not evolve a star</h3>
-<div class="standard" id='magicparlabel-7422'>Run
+<h3 class="subsection" id='magicparlabel-8043'><span class="subsection_label">11.8</span> How to show the arguments that <em>tbse</em> would use, but do not evolve a star</h3>
+<div class="standard" id='magicparlabel-8044'>Run
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ tbse echo</pre><br />
 </span></b></div>
-<h3 class="subsection" id='magicparlabel-7427'><span class="subsection_label">10.9</span> How to run a star which has the arguments in a file</h3>
-<div class="standard" id='magicparlabel-7428'>This is handy when you have a fail case (e.g. from a population synthesis run). Just run
+<h3 class="subsection" id='magicparlabel-8049'><span class="subsection_label">11.9</span> How to run a star which has the arguments in a file</h3>
+<div class="standard" id='magicparlabel-8050'>This is handy when you have a fail case (e.g. from a population synthesis run). Just run
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ tbse &lt;filename&gt;</pre><br />
 </span></b></div>
-<h3 class="subsection" id='magicparlabel-7433'><span class="subsection_label">10.10</span> How to use profile guided optimization (PGO)</h3>
-<div class="standard" id='magicparlabel-7434'>When compiling with <span class="flex_software">gcc</span>, just run
+<h3 class="subsection" id='magicparlabel-8055'><span class="subsection_label">11.10</span> How to use profile guided optimization (PGO)</h3>
+<div class="standard" id='magicparlabel-8056'>When compiling with <span class="flex_software">gcc</span>, just run
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ tbse pgo</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7443'>You may want to change the <span class="flex_args">REPEAT</span> variable as defined in <span class="flex_bashscript">tbse</span>. It is set to 10000, but if your code is running too slowly, set it to less.</div>
+<div class="standard" id='magicparlabel-8065'>You may want to change the <span class="flex_args">REPEAT</span> variable as defined in <span class="flex_bashscript">tbse</span>. It is set to 10000, but if your code is running too slowly, set it to less.</div>
 
-<div class="standard" id='magicparlabel-7452'>For details see <a href="https://en.wikipedia.org/wiki/Profile-guided_optimization">https://en.wikipedia.org/wiki/Profile-guided_optimization</a></div>
+<div class="standard" id='magicparlabel-8074'>For details see <a href="https://en.wikipedia.org/wiki/Profile-guided_optimization">https://en.wikipedia.org/wiki/Profile-guided_optimization</a></div>
 
-<div class="standard" id='magicparlabel-7457'>Generally, I find a 5-10% speedup from PGO.</div>
-<h3 class="subsection" id='magicparlabel-7458'><span class="subsection_label">10.11</span> How to get help</h3>
-<h4 class="subsubsection" id='magicparlabel-7459'><span class="subsubsection_label">10.11.1</span> How to know what a parameter does</h4>
-<div class="standard" id='magicparlabel-7460'>Run 
+<div class="standard" id='magicparlabel-8079'>Generally, I find a 5-10% speedup from PGO.</div>
+<h3 class="subsection" id='magicparlabel-8080'><span class="subsection_label">11.11</span> How to get help</h3>
+<h4 class="subsubsection" id='magicparlabel-8081'><span class="subsubsection_label">11.11.1</span> How to know what a parameter does</h4>
+<div class="standard" id='magicparlabel-8082'>Run 
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ <i>binary_c</i> help &lt;parameter_name&gt;</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7465'>or
+<div class="standard" id='magicparlabel-8087'>or
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ <i>binary_c</i> help_all</pre><br />
 </span></b></div>
 
-<div class="standard" id='magicparlabel-7470'>You can even just give <em><i>binary_c</i></em> part of a parameter name and it will try to find the best match.</div>
-<h4 class="subsubsection" id='magicparlabel-7471'><span class="subsubsection_label">10.11.2</span> The mailing lists</h4>
-<div class="standard" id='magicparlabel-7472'>There is a development mailing list for <i>binary_c</i>, for details see section&nbsp;<a href="#subsec_mailing_lists">1.3</a>. </div>
-<h3 class="subsection" id='magicparlabel-7473'><span class="subsection_label">10.12</span> How to add a parameter</h3>
-<div class="standard" id='magicparlabel-7474'>Look at <span class="flex_headerfile">src/setup/cmd_line_args.h</span> . You will need to add a structure to <span class="flex_cmacro">CMD_LINE_ARGS</span>. Please read the comments in that file for instructions.</div>
-
-<div class="standard" id='magicparlabel-7483'>The storage space for the new parameter goes in the <span class="flex_cstruct">preferences_t</span> structure (see <span class="flex_headerfile">binary_c_structures.h</span>).</div>
-<h3 class="subsection" id='magicparlabel-7492'><span class="subsection_label">10.13</span> How to build on a Mac</h3>
-<div class="standard" id='magicparlabel-7493'>I hear it is possible! Please ask the mailing list.</div>
-<h3 class="subsection" id='magicparlabel-7494'><span class="subsection_label">10.14</span> How to build as a shared library</h3>
-<div class="standard" id='magicparlabel-7495'>Easy, just execute<b><span style='font-family:monospace;font-size: 18px;'> <br />
+<div class="standard" id='magicparlabel-8092'>You can even just give <em><i>binary_c</i></em> part of a parameter name and it will try to find the best match.</div>
+<h4 class="subsubsection" id='magicparlabel-8093'><span class="subsubsection_label">11.11.2</span> The mailing lists</h4>
+<div class="standard" id='magicparlabel-8094'>There is a development mailing list for <i>binary_c</i>, for details see section&nbsp;<a href="#subsec_mailing_lists">1.3</a>. </div>
+<h3 class="subsection" id='magicparlabel-8095'><span class="subsection_label">11.12</span> How to add a parameter</h3>
+<div class="standard" id='magicparlabel-8096'>Look at <span class="flex_headerfile">src/setup/cmd_line_args.h</span> . You will need to add a structure to <span class="flex_cmacro">CMD_LINE_ARGS</span>. Please read the comments in that file for instructions.</div>
+
+<div class="standard" id='magicparlabel-8105'>The storage space for the new parameter goes in the <span class="flex_cstruct">preferences_t</span> structure (see <span class="flex_headerfile">binary_c_structures.h</span>).</div>
+<h3 class="subsection" id='magicparlabel-8114'><span class="subsection_label">11.13</span> How to build on a Mac</h3>
+<div class="standard" id='magicparlabel-8115'>I hear it is possible! Please ask the mailing list.</div>
+<h3 class="subsection" id='magicparlabel-8116'><span class="subsection_label">11.14</span> How to build as a shared library</h3>
+<div class="standard" id='magicparlabel-8117'>Easy, just execute<b><span style='font-family:monospace;font-size: 18px;'> <br />
 <pre class\s*='listings bash'>$ ./make <i>libbinary_c.so</i></pre><br />
 </span></b> The API uses this shared library.</div>
-<h3 class="subsection" id='magicparlabel-7500'><span class="subsection_label">10.15</span> How to calculate stellar yields or population statistics</h3>
+<h3 class="subsection" id='magicparlabel-8122'><span class="subsection_label">11.15</span> How to calculate stellar yields or population statistics</h3>
 
-<ol class="enumerate" id='magicparlabel-7501'><li class="enumerate_item">You have to build <em><i>binary_c</i></em> with <span class="flex_cmacro">NUCSYN</span> and <span class="flex_cmacro">NUCSYN_GCE</span> enabled, as well as the required physics</li>
+<ol class="enumerate" id='magicparlabel-8123'><li class="enumerate_item">You have to build <em><i>binary_c</i></em> with <span class="flex_cmacro">NUCSYN</span> and <span class="flex_cmacro">NUCSYN_GCE</span> enabled, as well as the required physics</li>
 <li class="enumerate_item">You have to (re)build the shared library with <b><span style='font-family:monospace;font-size: 18px;'><br />
 <pre class\s*='listings bash'>$ make <i>libbinary_c.so</i></pre><br />
 </span></b></li>
@@ -8109,8 +8508,8 @@ You can also run <br />
 <pre class\s*='listings bash'>$ ./src/perl/scripts2/yield_vs_time.pl dt=10 max_evolution_time=13700 vb=1</pre><br />
  </span></b>Note that, depending on the options you choose in <span class="flex_perlscript">yield_vs_time.pl</span>, this may take a long time!</li>
 </ol>
-<h3 class="subsection" id='magicparlabel-7546'><span class="subsection_label">10.16</span> <em>bash</em> autocompletion of <i>binary_c</i> arguments</h3>
-<div class="standard" id='magicparlabel-7547'>You can make <span class="flex_software">bash</span> autocomplete arguments to <i>binary_c</i> by putting the following in your <span class="flex_file">.bashrc</span> file (assuming you have <em><i>binary_c</i></em> in the directory specified by the environment variable <span class="flex_envvar">BINARY_C</span>) and restart <em>bash</em>.<br />
+<h3 class="subsection" id='magicparlabel-8168'><span class="subsection_label">11.16</span> <em>bash</em> autocompletion of <i>binary_c</i> arguments</h3>
+<div class="standard" id='magicparlabel-8169'>You can make <span class="flex_software">bash</span> autocomplete arguments to <i>binary_c</i> by putting the following in your <span class="flex_file">.bashrc</span> file (assuming you have <em><i>binary_c</i></em> in the directory specified by the environment variable <span class="flex_envvar">BINARY_C</span>) and restart <em>bash</em>.<br />
 
 <pre class ='listings Perl'># completion of <i>binary_c</i> arguments 
 _binary_c() 
@@ -8125,9 +8524,9 @@ _binary_c()
 complete -F _binary_c <i>binary_c</i>
 </pre><br />
 </div>
-<h3 class="subsection" id='magicparlabel-7576'><span class="subsection_label">10.17</span> <div id="subsec_git_revision"></div>
+<h3 class="subsection" id='magicparlabel-8198'><span class="subsection_label">11.17</span> <div id="subsec_git_revision"></div>
 How to find the <em>git</em> revision and <em>git</em> URL</h3>
-<div class="standard" id='magicparlabel-7577'>Put the following into your <span class="flex_bashscript">.bashrc</span> file, restart <em>bash</em> and use the command <span class="flex_command">git_rev</span> to find a suitable <span class="flex_software">git</span> revision string and <span class="flex_command">git_url</span> to find the repository URL.<br />
+<div class="standard" id='magicparlabel-8199'>Put the following into your <span class="flex_bashscript">.bashrc</span> file, restart <em>bash</em> and use the command <span class="flex_command">git_rev</span> to find a suitable <span class="flex_software">git</span> revision string and <span class="flex_command">git_url</span> to find the repository URL.<br />
 <pre class ='listings'># git function for review number
 git_rev ()
 {
@@ -8144,10 +8543,12 @@ git_url ()
 }
 </pre><br />
 </div>
-<h2 class="section" id='magicparlabel-7612'><span class="section_label">11</span> Changelog</h2>
-<div class="standard" id='magicparlabel-7613'>Note this is always an incomplete list!</div>
+<h2 class="section" id='magicparlabel-8234'><span class="section_label">12</span> Changelog</h2>
+<div class="standard" id='magicparlabel-8235'>Note this is always an incomplete list!</div>
 
-<dl class='description' id='magicparlabel-7614'><dt class="description_label">Version&nbsp;2.0</dt>
+<dl class='description' id='magicparlabel-8236'><dt class="description_label">Version&nbsp;2.1</dt>
+<dd class="description_item"> Time integration is now forward-Euler, RK2 or RK4, rationalised the time evolution loop, events subsystem introduced, fixed timesteps now standard, command line macros, update mass transfer rates, many bug fixes.</dd>
+<dt class="description_label">Version&nbsp;2.0</dt>
 <dd class="description_item"> Finally, RGI had some time to sit down and redesign the guts of <em><i>binary_c</i></em>. Version 2.0 is a cleaned up, sensible version of the old code. It has better logic, naming, time resolution, setup, etc.</dd>
 <dt class="description_label">Version&nbsp;1.2prexx</dt>
 <dd class="description_item"> Lots of updates! CEMPs project (Utrecht), experimental stuff to better model rotation, tables replace many fits (e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_cfunction">nucsyn_WR</span>), interaction with <span style='font-family:monospace;font-size: 18px;'><i>binary_grid</i></span> <span class="flex_scriptinglanguage">Perl</span>  module for population synthesis, external users (Selma, Joke, Carlo).</dd>
@@ -8158,13 +8559,13 @@ git_url ()
 <dt class="description_label">Version&nbsp;1.0</dt>
 <dd class="description_item"> The original version.</dd>
 </dl>
-<h2 class="section" id='magicparlabel-7639'><span class="section_label">12</span> Acknowledgements</h2>
-<div class="standard" id='magicparlabel-7640'>This document was prepared using the wonderful <a href="https://www.lyx.org/">LyX</a>.</div>
+<h2 class="section" id='magicparlabel-8262'><span class="section_label">13</span> Acknowledgements</h2>
+<div class="standard" id='magicparlabel-8263'>This document was prepared using the wonderful <a href="https://www.lyx.org/">LyX</a>.</div>
 
-<div class="standard" id='magicparlabel-7641'><br />
+<div class="standard" id='magicparlabel-8264'><br />
 </div>
 
-<div class="standard" id='magicparlabel-7642'><h2 class='bibtex'>References</h2><div class='bibtex'><div class='bibtexentry' id='LyXCite-1999ApJ___525__886A'><span class='bibtexlabel'>Arlandini et al. 1999</span><span class='bibtexinfo'><span class="bib-fullnames:author">Arlandini, <i>C</i>., Käppeler, F., Wisshak, K., Gallino, R., Lugaro, M., Busso, M., and Straniero, O.</span>, "<span class="bib-title">Neutron Capture in Low-Mass Asymptotic Giant Branch Stars: Cross Sections and Abundance Signatures</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">525</span> (<span class="bib-year">1999</span>), pp. <span class="bib-pages">886-900</span>.</span></div>
+<div class="standard" id='magicparlabel-8265'><h2 class='bibtex'>References</h2><div class='bibtex'><div class='bibtexentry' id='LyXCite-1999ApJ___525__886A'><span class='bibtexlabel'>Arlandini et al. 1999</span><span class='bibtexinfo'><span class="bib-fullnames:author">Arlandini, <i>C</i>., Käppeler, F., Wisshak, K., Gallino, R., Lugaro, M., Busso, M., and Straniero, O.</span>, "<span class="bib-title">Neutron Capture in Low-Mass Asymptotic Giant Branch Stars: Cross Sections and Abundance Signatures</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">525</span> (<span class="bib-year">1999</span>), pp. <span class="bib-pages">886-900</span>.</span></div>
 <div class='bibtexentry' id='LyXCite-2007A_A___469_1013B'><span class='bibtexlabel'>Bonačić Marinović et al. 2007</span><span class='bibtexinfo'><span class="bib-fullnames:author">Bonačić Marinović, A., Izzard, R.~G., Lugaro, M., and Pols, O.~R.</span>, "<span class="bib-title">The s-process in stellar population synthesis: a new approach to understanding AGB stars</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">469</span> (<span class="bib-year">2007</span>), pp. <span class="bib-pages">1013-1025</span>.</span></div>
 <div class='bibtexentry' id='LyXCite-2004ApJ___608__405C'><span class='bibtexlabel'>Chieffi and Limongi 2004</span><span class='bibtexinfo'><span class="bib-fullnames:author">Chieffi, A. and Limongi, M.</span>, "<span class="bib-title">Explosive Yields of Massive Stars from $Z=0$ to $Z = Z_{\odot}$</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">608</span> (<span class="bib-year">2004</span>), pp. <span class="bib-pages">405-410</span>.</span></div>
 <div class='bibtexentry' id='LyXCite-2002NewA____7___55D'><span class='bibtexlabel'>De Donder and Vanbeveren 2002</span><span class='bibtexinfo'><span class="bib-fullnames:author">De Donder, E. and Vanbeveren, D.</span>, "<span class="bib-title">The chemical evolution of the solar neighbourhood: the effect of binaries</span>", <i><span class="bib-journal">New Astronomy</span></i>  <span class="bib-volume">7</span> (<span class="bib-year">2002</span>), pp. <span class="bib-pages">55-84</span>.</span></div>
@@ -8197,19 +8598,19 @@ git_url ()
 <div class='bibtexentry' id='LyXCite-1986ApJ___301__601W'><span class='bibtexlabel'>Woosley et al. 1986</span><span class='bibtexinfo'><span class="bib-fullnames:author">Woosley, S.~E., Taam, R.~E., and Weaver, T.~A.</span>, "<span class="bib-title">Models for Type I supernova. I - Detonations in white dwarfs</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">301</span> (<span class="bib-year">1986</span>), pp. <span class="bib-pages">601-623</span>.</span></div>
 </div></div>
 
-<div class="standard" id='magicparlabel-7643'><br />
+<div class="standard" id='magicparlabel-8266'><br />
 </div>
 
 
 <HR><H1>Appendix</H1>
-<h2 class="section" id='magicparlabel-7646'><span class="section_label">A</span> Grid options (<em>grid_options</em> hash)</h2>
-<div class="standard" id='magicparlabel-7647'><div id="sec_grid_options"></div>
+<h2 class="section" id='magicparlabel-8269'><span class="section_label">A</span> Grid options (<em>grid_options</em> hash)</h2>
+<div class="standard" id='magicparlabel-8270'><div id="sec_grid_options"></div>
 The following summarises the <span style='font-family:monospace;font-size: 18px;'>grid_options</span> hash elements as stored in
 <br />
 
  <span style='font-family:monospace;font-size: 18px;'>$binary_grid2_object-&gt;{_hash_options}</span>. Please note that some options are (perhaps) no longer used and are left in this manual as a reference guide only. </div>
 
-<dl class='description' id='magicparlabel-7648'><dt class="description_label">alarm_procedure</dt>
+<dl class='description' id='magicparlabel-8271'><dt class="description_label">alarm_procedure</dt>
 <dd class="description_item"> When a signal is captured (usually on a timeout) the alarm_procedure tells us what to do. If <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
  <mrow><mn>0</mn>
  </mrow></mstyle></math> then the grid exits. If <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
@@ -8236,7 +8637,7 @@ The following summarises the <span style='font-family:monospace;font-size: 18px;
 <dt class="description_label">force_local_hdd_use</dt>
 <dd class="description_item"> Checks to see if the disks to which you are outputting data are local or remotely mounted. If the latter, <i>binary_grid</i> refuses to work. You should (of course) always use local disks for your output – it is much faster. (Defaults to 1 on Unix systems.)</dd>
 <dt class="description_label">flexigrid</dt>
-<dd class="description_item"> Hash used to set up the flexigrid, see Section&nbsp;<a href="#sec_flexigrid">5.11</a>.</dd>
+<dd class="description_item"> Hash used to set up the flexigrid, see Section&nbsp;<a href="#sec_flexigrid">6.11</a>.</dd>
 <dt class="description_label">grid_defaults_set</dt>
 <dd class="description_item"> Logic control variable, set to 1 if grid_defaults has been called.</dd>
 <dt class="description_label">lastargs</dt>
@@ -8258,9 +8659,9 @@ The following summarises the <span style='font-family:monospace;font-size: 18px;
 <dt class="description_label">operating_system</dt>
 <dd class="description_item"> Saves details of the current operating system (from <em>rob_misc.pm</em>)</dd>
 <dt class="description_label">parse_bse_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>parse_bse_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>).</dd>
+<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>parse_bse_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
 <dt class="description_label">parse_bse_function_pointer</dt>
-<dd class="description_item"> In your grid script you need to define a subroutine (also known as a function) to be used for data parsing. Usually this is called <span style='font-family:monospace;font-size: 18px;'>parse_bse </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>).</dd>
+<dd class="description_item"> In your grid script you need to define a subroutine (also known as a function) to be used for data parsing. Usually this is called <span style='font-family:monospace;font-size: 18px;'>parse_bse </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
 <dt class="description_label">prog</dt>
 <dd class="description_item"> The <em><i>binary_c</i>/nucsyn</em> executable name, usually '<span style='font-family:monospace;font-size: 18px;'><i>binary_c</i></span>'. See also <span style='font-family:monospace;font-size: 18px;'>rootpath</span>.</dd>
 <dt class="description_label">progenitor</dt>
@@ -8326,33 +8727,33 @@ The following summarises the <span style='font-family:monospace;font-size: 18px;
 <dt class="description_label">thread_max_freeze_time_before_warning</dt>
 <dd class="description_item"> The maximum time a thread loops its calls to <span style='font-family:monospace;font-size: 18px;'>tbse()</span> before a warning is issued (seconds, default 10).</dd>
 <dt class="description_label">thread_precreate_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_precreate_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>).</dd>
+<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_precreate_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
 <dt class="description_label">thread_precreate_function_pointer</dt>
 <dd class="description_item"> A pointer to a function to be called just before <span style='font-family:monospace;font-size: 18px;'>threads-&gt;create</span> is used to start a thread. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">thread_prejoin_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_prejoin_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>).</dd>
+<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_prejoin_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
 <dt class="description_label">thread_prejoin_function_pointer</dt>
 <dd class="description_item"> A pointer to a function called just before a thread is <span style='font-family:monospace;font-size: 18px;'>join</span>ed. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">thread_presleep</dt>
 <dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>A thread waits for this length of time (in seconds) before it starts in order that all other threads have time to start before any output is logged to the screen. As such this is just to keep output pretty and should be small (default 1 second).</dd>
 <dt class="description_label">thread_postjoin_function</dt>
-<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_postjoin_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
+<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_postjoin_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">thread_postjoin_function_pointer</dt>
 <dd class="description_item"> A pointer to a function called just after a thread is <span style='font-family:monospace;font-size: 18px;'>join</span>ed. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">thread_postrun_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_postrun_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
+<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_postrun_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">thread_postrun_function_pointer</dt>
 <dd class="description_item"> A pointer to a function to be called just after a <span style='font-family:monospace;font-size: 18px;'>thread-&gt;create</span> call (and just after <span style='font-family:monospace;font-size: 18px;'>$@</span> is checked for a thread-creation error). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">threads_entry_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_entry_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
+<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_entry_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">threads_entry_function_pointer</dt>
 <dd class="description_item"> A pointer to a function called from inside a thread just before flexigrid() is called. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">threads_flush_function</dt>
-<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_flush_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
+<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_flush_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">threads_flush_function_pointer</dt>
 <dd class="description_item"> A pointer to a function called from inside a thread just after flexigrid() returns. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">threads_join_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_join_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">5.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
+<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_join_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
 <dt class="description_label">threads_join_function_pointer</dt>
 <dd class="description_item"> When using a threaded grid you have to define a subroutine (also known as a function) pointer which points to the function to be called after each thread have finished. This function is responsible for &ldquo;joining&rdquo; the threads, which means it collects the results from the thread and adds them to the global results. This is usually a function called <span style='font-family:monospace;font-size: 18px;'>join_thread</span> and is set with a line in grid-xxx.pl similar to:
 <br />
@@ -8387,13 +8788,13 @@ The following summarises the <span style='font-family:monospace;font-size: 18px;
 <dt class="description_label">weight</dt>
 <dd class="description_item"> The probability is weighted by this value. </dd>
 </dl>
-<div class="standard" id='magicparlabel-7702'><br />
+<div class="standard" id='magicparlabel-8325'><br />
 </div>
-<h2 class="section" id='magicparlabel-7703'><span class="section_label">B</span> Binary_c/nucsyn options (<em>bse_options</em> hash)</h2>
-<div class="standard" id='magicparlabel-7704'><div id="sec_bse_options"></div>
+<h2 class="section" id='magicparlabel-8326'><span class="section_label">B</span> Binary_c/nucsyn options (<em>bse_options</em> hash)</h2>
+<div class="standard" id='magicparlabel-8327'><div id="sec_bse_options"></div>
  The following options correspond to variables in the <span style='font-family:monospace;font-size: 18px;'>$binary_grid2_object-&gt;{_bse_options}</span> hash. These correspond to options of <em><i>binary_c</i></em>.</div>
 
-<div class="standard" id='magicparlabel-7705'>The most important options are listed here, however you should consult <em><i>binary_c</i></em> for the main options list because these options are (mostly) just passed to <em><i>binary_c</i></em>. The full list of options is given in <span style='font-family:monospace;font-size: 18px;'>src/setup/cmd_line_args.h</span>. You can access a full list of arguments by running 
+<div class="standard" id='magicparlabel-8328'>The most important options are listed here, however you should consult <em><i>binary_c</i></em> for the main options list because these options are (mostly) just passed to <em><i>binary_c</i></em>. The full list of options is given in <span style='font-family:monospace;font-size: 18px;'>src/setup/cmd_line_args.h</span>. You can access a full list of arguments by running 
 <br />
 
 <b><span style='font-family:monospace;font-size: 18px;'><i>binary_c</i> --help</span></b>
@@ -8401,7 +8802,7 @@ The following summarises the <span style='font-family:monospace;font-size: 18px;
 
  <em>BSE</em> refers to <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>).</div>
 
-<dl class='description' id='magicparlabel-7706'><dt class="description_label">acc2</dt>
+<dl class='description' id='magicparlabel-8329'><dt class="description_label">acc2</dt>
 <dd class="description_item"> Bondi-Hoyle accretion rate parameter (default 1.5). Deprecated in <i>binary_c</i> V2.0, please use Bondi_Hoyle_accretion_factor instead."</dd>
 <dt class="description_label">alpha_ce</dt>
 <dd class="description_item"> Common envelope ejection efficiency, default 1.0.</dd>
diff --git a/doc/binary_c2.lyx b/doc/binary_c2.lyx
index 2c8af155341cccce263787765319f7c9bf80db98..24bb2e4c8318de9e2da672265052e0bed8b92750 100644
--- a/doc/binary_c2.lyx
+++ b/doc/binary_c2.lyx
@@ -539,7 +539,7 @@ An introduction to the
 \align center
 
 \series bold
-Version 2.1 (GIT revision )
+Version 2.1
 \begin_inset Newline newline
 \end_inset
 
@@ -550,7 +550,7 @@ Version 2.1 (GIT revision )
 \align center
 
 \series bold
-Warning: Version 2 of 
+Warning: 
 \emph on
 
 \begin_inset Formula $\binaryc$
@@ -558,8 +558,7 @@ Warning: Version 2 of
 
 
 \emph default
- is currently under development.
- Details are likely to change.
+ is always under development, so details are likely to change.
  
 \end_layout
 
@@ -619,7 +618,19 @@ it is up to you to make sure you get things right! You can check every line
 there are certainly bugs and omissions
 \series default
 .
- Please, if you find one, can you let him know.
+ Please, if you find one, can you let him know, preferably through the gitlab
+ bug reporting interface 
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/issues
+\end_layout
+
+\end_inset
+
+ or by email.
 \end_layout
 
 \begin_layout Subsection
@@ -1574,19 +1585,17 @@ perlbrew -v install perl-5.31.3 --thread --multi --64bitall --notest -Dusethread
 \end_inset
 
 If you have problems with 
-\emph on
-
 \begin_inset Flex Software
 status open
 
 \begin_layout Plain Layout
+
+\emph off
 wget
 \end_layout
 
 \end_inset
 
-
-\emph default
 , try removing the 
 \begin_inset Flex Args
 status open
diff --git a/slow b/slow
index 5a217399c93443a3a833ae1fae78dccfd7b29cb4..6bc08adcf0bafb4884228f52d092d1424e7d122f 100644
--- a/slow
+++ b/slow
@@ -113,3 +113,9 @@ Stuck for a very long time!
 
 --M_1     9.24688156469970223839e+00 --M_2     1.49769210001943919863e+00 --orbital_period     1.63172188367223930072e+03 --eccentricity     4.68248473238791262929e-01 --metallicity     2.99422180101886828
 418e-02 --random_seed 12115
+
+
+---
+
+binary_c  --M_1 1.34304321449805 --M_2 0.193228241087354 --eccentricity 0 --orbital_period 80.3526122185615 --metallicity 0.02 --max_evolution_time 15000 --probability 1.93621799679849e-07 --AGB_3dup_algorithm 1 --AGB_core_algorithm 1 --AGB_luminosity_algorithm 1 --AGB_radius_algorithm 1 --BH_prescription 0 --Bondi_Hoyle_accretion_factor 1.5 --CRAP_parameter 0 --E2_prescription 0 --RLOF_angular_momentum_transfer_model 0 --RLOF_interpolation_method 0 --RLOF_mdot_factor 1 --RLOF_method 0 --RLOF_timestep_modulator 1 --WDWD_merger_algorithm 0 --WD_accretion_rate_new_giant_envelope_lower_limit_helium_donor -1 --WD_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor -1 --WD_accretion_rate_new_giant_envelope_lower_limit_other_donor -1 --WD_accretion_rate_novae_upper_limit_helium_donor -1 --WD_accretion_rate_novae_upper_limit_hydrogen_donor -1 --WD_accretion_rate_novae_upper_limit_other_donor -1 --WRLOF_method 1 --accretion_end_time -1 --accretion_limit_dynamical_multiplier 1 --accretion_limit_eddington_multiplier 1 --accretion_limit_thermal_multiplier 1 --accretion_start_time -1 --agbwindfac 1 --alpha_ce 1 --angular_momentum_accretion_rate1 0 --angular_momentum_accretion_rate2 0 --angular_momentum_accretion_rate_orbit 0 --beta_reverse_nova 0 --chandrasekhar_mass 1.44 --comenv_ejection_spin_method 0 --comenv_merger_spin_method 0 --comenv_ms_accretion_mass 0 --comenv_ns_accretion_fraction 0 --comenv_ns_accretion_mass 0 --comenv_post_eccentricity 0 --comenv_prescription 0 --comenv_splitmass 1.01 --delta_mcmin 0 --disable_events False --donor_limit_dynamical_multiplier 1 --donor_limit_envelope_multiplier 0 --donor_limit_thermal_multiplier 1 --dtfac 1 --effective_metallicity -1 --escape_fraction 0 --escape_velocity 1000000000 --evolution_algorithm 0 --evolution_splitting False --evolution_splitting_maxdepth 2 --evolution_splitting_sn_n 10 --force_corotation_on_RLOF True --gb_reimers_eta 0.4 --gbwind 0 --gbwindfac 1 --gravitational_radiation_model 0 --gravitational_radiation_modulator_J 1 --gravitational_radiation_modulator_e 1 --hachisu_disk_wind False --hachisu_qcrit 1.15 --idum 0 --individual_novae 0 --internal_buffering 2 --internal_buffering_compression 0 --lambda_ce -1 --lambda_enthalpy 0 --lambda_ionisation 0.5 --lambda_min 0 --lithium_GB_post_1DUP 0 --lithium_GB_post_Heflash 0 --lithium_hbb_multiplier 1 --log_filename /tmp/c_log.dat --lw 1 --magnetic_braking_algorithm 0 --magnetic_braking_factor 1 --magnetic_braking_gamma 3 --mass_accretion_for_eld 0.15 --mass_accretion_rate1 0 --mass_accretion_rate2 0 --mass_for_Hestar_Ia_lower 0 --mass_for_Hestar_Ia_upper 0 --max_HeWD_mass 0.7 --max_model_number 0 --max_neutron_star_mass 1.8 --max_stellar_angmom_change 0.05 --max_tpagb_core_mass 1.38 --maximum_nuclear_burning_timestep 1e+20 --maximum_timestep 1e+20 --maximum_timestep_factor 0 --merger_angular_momentum_factor 1 --minimum_donor_menv_for_comenv 0 --minimum_envelope_mass_for_third_dredgeup 0.5 --minimum_helium_ignition_core_mass 0 --minimum_mass_for_carbon_ignition 1.6 --minimum_mass_for_neon_ignition 2.85 --minimum_orbital_period_for_instant_RLOF False --minimum_separation_for_instant_RLOF False --minimum_timestep 1e-08 --monte_carlo_kicks  --nelemans_gamma 1.75 --nelemans_max_frac_j_change 1 --nelemans_minq 0.2 --nelemans_n_comenvs 1 --nelemans_recalc_eccentricity False --nonconservative_angmom_gamma -1 --nova_faml_multiplier 0 --nova_irradiation_multiplier 0 --nova_retention_fraction 0.001 --nova_retention_method 0 --phasevol 2.34425372112272e-05 --post_SN_orbit_method 0 --pre_main_sequence False --pre_main_sequence_fit_lobes False --qcrit_BH 3 --qcrit_CHeB 3 --qcrit_COWD 3 --qcrit_EAGB -1 --qcrit_GB -1 --qcrit_HG 4 --qcrit_HeGB 0.78125 --qcrit_HeHG 4 --qcrit_HeMS 3 --qcrit_HeWD 3 --qcrit_LMMS 0.6944 --qcrit_MS 1.6 --qcrit_NS 3 --qcrit_ONeWD 3 --qcrit_TPAGB -1 --qcrit_degenerate_BH 0.625 --qcrit_degenerate_CHeB 3 --qcrit_degenerate_COWD 0.625 --qcrit_degenerate_EAGB 1.15 --qcrit_degenerate_GB 1.15 --qcrit_degenerate_HG 4.7619 --qcrit_degenerate_HeGB 1.15 --qcrit_degenerate_HeHG 4.7619 --qcrit_degenerate_HeMS 3 --qcrit_degenerate_HeWD 0.625 --qcrit_degenerate_LMMS 1 --qcrit_degenerate_MS 1 --qcrit_degenerate_NS 0.625 --qcrit_degenerate_ONeWD 0.625 --qcrit_degenerate_TPAGB 1.15 --random_seed 0 --random_skip 0 --random_systems 0 --repeat 1 --rlperi False --rotationally_enhanced_exponent 1 --rotationally_enhanced_mass_loss 0 --small_envelope_method 0 --sn_kick_companion_AIC 0 --sn_kick_companion_AIC_BH 0 --sn_kick_companion_BH_BH 0 --sn_kick_companion_BH_NS 0 --sn_kick_companion_ECAP 0 --sn_kick_companion_GRB_COLLAPSAR 0 --sn_kick_companion_HeStarIa 0 --sn_kick_companion_IA_CHAND 0 --sn_kick_companion_IA_CHAND_Coal 0 --sn_kick_companion_IA_ELD 0 --sn_kick_companion_IA_He 0 --sn_kick_companion_IA_He_Coal 0 --sn_kick_companion_IA_Hybrid_HeCOWD 0 --sn_kick_companion_IA_Hybrid_HeCOWD_subluminous 0 --sn_kick_companion_IBC 0 --sn_kick_companion_II 0 --sn_kick_companion_IIa 0 --sn_kick_companion_NS_NS 0 --sn_kick_companion_TZ 0 --sn_kick_companion_WDKICK 0 --sn_kick_dispersion_AIC_BH 0 --sn_kick_dispersion_BH_BH 0 --sn_kick_dispersion_BH_NS 0 --sn_kick_dispersion_ECAP 0 --sn_kick_dispersion_GRB_COLLAPSAR 190 --sn_kick_dispersion_IA_Hybrid_HeCOWD 0 --sn_kick_dispersion_IA_Hybrid_HeCOWD_subluminous 0 --sn_kick_dispersion_IBC 190 --sn_kick_dispersion_II 190 --sn_kick_dispersion_NS_NS 0 --sn_kick_dispersion_TZ 0 --sn_kick_distribution_AIC_BH 0 --sn_kick_distribution_BH_BH 0 --sn_kick_distribution_BH_NS 0 --sn_kick_distribution_ECAP 0 --sn_kick_distribution_GRB_COLLAPSAR 1 --sn_kick_distribution_IA_Hybrid_HeCOWD 0 --sn_kick_distribution_IA_Hybrid_HeCOWD_subluminous 0 --sn_kick_distribution_IBC 1 --sn_kick_distribution_II 1 --sn_kick_distribution_NS_NS 0 --sn_kick_distribution_TZ 0 --solver 0 --speedtests False --start_time 0 --stellar_structure_algorithm 0 --superwind_mira_switchon 500 --third_dup True --tidal_strength_factor 1 --timestep_modulator 1 --timestep_solver_factor 1 --tpagb_reimers_eta 1 --tpagbwind 0 --vrot1 0 --vrot2 0 --vw93_mira_shift 0 --vw93_multiplier 1 --vwind_multiplier 0.125 --wd_kick_direction 0 --wd_kick_pulse_number 0 --wd_kick_when 0 --wd_sigma 0 --wind_angular_momentum_loss 0 --wind_djorb_fac 1 --wind_mass_loss 1 --wr_wind 0 --wr_wind_fac 1 --wrwindfac 1 --yields_dt 100000 --zoomfac_multiplier_decrease 0.5 --zoomfac_multiplier_increase 1.2 --internal_buffering 2 --internal_buffering_compression 0
+
diff --git a/src/API/binary_c_list_args.c b/src/API/binary_c_list_args.c
index 7cf411b821c502a7efaa8783620eba74fe83597a..1e718ce92781f53764cc9f6d37fee18de1a5c985 100644
--- a/src/API/binary_c_list_args.c
+++ b/src/API/binary_c_list_args.c
@@ -16,7 +16,7 @@ void binary_c_API_function binary_c_list_args(
         { CMD_LINE_ARGS };
 
     Save_buffering_state;
-    reset_preferences(stardata->preferences);
+    set_default_preferences(stardata->preferences);
     Restore_buffering_state;
     
     /* dummy variables */
diff --git a/src/RLOF/RLOF_adaptive_mass_transfer_rate.c b/src/RLOF/RLOF_adaptive_mass_transfer_rate.c
index f9f8ccfbf8c9e61bcf2e695bfd9d77d5462d90bc..8b06ee298678b9fa14b7c3b9e63d89bbe40f5a83 100644
--- a/src/RLOF/RLOF_adaptive_mass_transfer_rate.c
+++ b/src/RLOF/RLOF_adaptive_mass_transfer_rate.c
@@ -290,7 +290,7 @@ double RLOF_adaptive_mass_transfer_rate(const double r,
 
                 double radius_error = fabs(dr_rol);
                         
-                Dprint("Post HRD DR i=%d m=%8.8e r=%8.8e = %2.2f %% of Rol (=%8.8e), radius_error=%g, dm now %g\n",
+                Dprint("Post HRD DR i=%u m=%8.8e r=%8.8e = %2.2f %% of Rol (=%8.8e), radius_error=%g, dm now %g\n",
                        i,pstar->mass,pstar->radius,100.0*pstar->radius/roche_radius,roche_radius,radius_error,dm);
                         
                 if(i>=ADAPTIVE_RLOF_IMIN)
@@ -399,7 +399,7 @@ double RLOF_adaptive_mass_transfer_rate(const double r,
 
         stardata->common.mdot_RLOF_adaptive=mdot; // save for logging
 
-        Dprint("Final mass in Roche lobe = %g (dm %g) mdot = %g after %d iterations (dt=%g)\n\n",
+        Dprint("Final mass in Roche lobe = %g (dm %g) mdot = %g after %u iterations (dt=%g)\n\n",
                pstar->mass,
                dm,
                mdot,
diff --git a/src/binary_c.h b/src/binary_c.h
index 74090ed67a5101fa89243abb433fbb3cb3b1e5f6..b10406eaa6b3c71fa9d58128d3b6f8089a9ec859 100644
--- a/src/binary_c.h
+++ b/src/binary_c.h
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
+#include <strings.h>
 #include <setjmp.h>
 #include <ctype.h>
 #include <limits.h>
@@ -52,6 +53,7 @@
 #endif
 
 /* binary_c's headers */
+#include "binary_c_version_macros.h"
 #include "binary_c_code_options.h"
 #include "binary_c_types.h"
 #include "binary_c_debug.h"
diff --git a/src/binary_c_debug.h b/src/binary_c_debug.h
index 71a1068ed2386c1f44e4cf357f18eaed44cc7350..9a0afcbb587a2a6f4bf8ed770f70ead32bd565f2 100644
--- a/src/binary_c_debug.h
+++ b/src/binary_c_debug.h
@@ -100,7 +100,7 @@
  * this is not shown.
  */
 
-#define Debug_show_expression " "
+#define Debug_show_expression " stardata=%p ",stardata
 
 //#undef Debug_show_expression
 
diff --git a/src/binary_c_function_macros.h b/src/binary_c_function_macros.h
index e70e4f2f5a7c755cae1d0fd7f9251b5386c2022a..19e384ec2b49b772c573d48b122087e7295ffb36 100644
--- a/src/binary_c_function_macros.h
+++ b/src/binary_c_function_macros.h
@@ -1375,16 +1375,29 @@
  * either star has a radial velocity above 
  * the threshold, and that System_is_binary is TRUE.
  */
-#define Observable_binary (System_is_binary && \
-                           ((radial_velocity_K(stardata,90,1)>(stardata->preferences->observable_radial_velocity_minimum)) || \
-                            (radial_velocity_K(stardata,90,2)>(stardata->preferences->observable_radial_velocity_minimum))))
+#define Observable_binary                                               \
+    (                                                                   \
+    System_is_binary &&                                                 \
+    (                                                                   \
+        (                                                               \
+            radial_velocity_K(stardata,90,1)>                           \
+            stardata->preferences->observable_radial_velocity_minimum   \
+            )                                                           \
+        ||                                                              \
+        (                                                               \
+            radial_velocity_K(stardata,90,2)>                           \
+            stardata->preferences->observable_radial_velocity_minimum   \
+            )                                                           \
+        )                                                               \
+        )
 
 
-#define Angular_momentum_from_stardata (Pow2(stardata->common.orbit.separation) *                 \
-              sqrt(Max(1.0-Pow2(stardata->common.orbit.eccentricity),0.0)) * \
-              stardata->common.orbit.angular_frequency *                \
-              stardata->star[0].mass * stardata->star[1].mass /         \
-              (stardata->star[0].mass + stardata->star[1].mass))
+#define Angular_momentum_from_stardata \
+    (Pow2(stardata->common.orbit.separation) *                          \
+     sqrt(Max(1.0-Pow2(stardata->common.orbit.eccentricity),0.0)) *     \
+     stardata->common.orbit.angular_frequency *                         \
+     stardata->star[0].mass * stardata->star[1].mass /                  \
+     (stardata->star[0].mass + stardata->star[1].mass))
 
 #define Bisector_string(N) (                                            \
         (abs(N)) == BISECTOR_DISC_TVISC ? "Tvisc0" :                    \
@@ -1401,9 +1414,9 @@
         "Unknown")
 
 
-#define Bisector_error_string(N) (                              \
-        (N) == BINARY_C_BISECT_ERROR_NONE ? "None" :                     \
-        (N) == BINARY_C_BISECT_ERROR_MAXED_OUT ? "Maxed out" :           \
+#define Bisector_error_string(N) (                                      \
+        (N) == BINARY_C_BISECT_ERROR_NONE ? "None" :                    \
+        (N) == BINARY_C_BISECT_ERROR_MAXED_OUT ? "Maxed out" :          \
         (N) == BINARY_C_BISECT_ERROR_BRACKET_FAILED ? "Bracket failed" : \
         "Unknown")
 
@@ -1485,10 +1498,9 @@
 #define Batchmode_is_off(N) ((N)<=(BATCHMODE_OFF))
 
 /*
- * Macro to prevent us using strcmp/memcmp and associatedly forgetting
+ * Macro to prevent us using memcmp and associatedly forgetting
  * the ==0
  */
-#define Strings_equal(A,B) (strcmp((A),(B))==0)
 #define Memory_equal(A,B,C) (memcmp((A),(B),(C))==0)
 
 
diff --git a/src/binary_c_parameters.h b/src/binary_c_parameters.h
index 249066cee07b5d758dc9c3f62e0c7f89e7579b1e..1281c9647e654728f8faa50adce36499eba6ba3e 100644
--- a/src/binary_c_parameters.h
+++ b/src/binary_c_parameters.h
@@ -1093,9 +1093,14 @@
 
 /*
  * Lambda is the envelope binding energy parameter:
- * Ebind = -G M Menv / (R lambda) 
+ * Ebind = -G M Menv / (R lambda)
+ *
+ * Note: much as we'd like to set this to one of the 
+ *       three LAMBDA_* macros (for the Dewi/Tauris, 
+ *       Wang or Polytrope) these are not reliable over
+ *       the whole parameter space. Instead, use 0.5.
  */
-#define DEFAULT_LAMBDA_CE -1.0
+#define DEFAULT_LAMBDA_CE 0.5
 
 /* use Hurley et al. (2002) energy balance prescription by default */
 #define DEFAULT_COMENV_PRESCRIPTION COMENV_BSE
@@ -1394,9 +1399,7 @@
  * see nucsyn/nucsyn.h for details of parts you can switch on 
  * off.
  ************************************************************/
-#ifndef BINT
 #define NUCSYN
-#endif
 
 /************************************************************
  * Stellar colour library
@@ -1936,10 +1939,20 @@
 #Error: you should not define BOTH BSE and BINT
 #endif
 
+#if defined BINT && defined NUCSYN
+#Error: you should not define BOTH BINT and NUCSYN
+#endif
+
 /*
  * Use new version of difflog that requires fewer memcpys 
  */
 #define NEW_DIFFLOG
 
+
+/*
+ * Zhengwei's SNIa systems
+ */
+#define ZW2019_SNIA_LOG
+
 #endif //BINARY_PARAMETERS_H
 
diff --git a/src/binary_c_stellar_types.h b/src/binary_c_stellar_types.h
index bcc9007c6615381c41d39aff727495fcbc200972..b8d6d90a29f0656478c4b1bb715f76140c4e0d4a 100644
--- a/src/binary_c_stellar_types.h
+++ b/src/binary_c_stellar_types.h
@@ -88,7 +88,9 @@
         "Black Hole",                           \
         "Massless"
 
-/* String macro */
+/* 
+ * Stellar type string from stellar type S
+ */
 #define Stellar_type_string(S)                                          \
     (                                                                   \
         (S)==LOW_MASS_MAIN_SEQUENCE ? "Convective low mass MS" :        \
@@ -110,89 +112,209 @@
         "Unknown"                                                       \
         )
 
-/* Short string macro */
-#define Short_stellar_type_string(S)            \
-    (                                           \
-        (S)==LOW_MASS_MAIN_SEQUENCE ? "LMMS" :  \
-        (S)==MAIN_SEQUENCE ? "MS" :             \
-        (S)==HERTZSPRUNG_GAP ? "HG" :           \
-        (S)==GIANT_BRANCH ? "GB" :              \
-        (S)==CORE_HELIUM_BURNING ? "CHeB" :     \
-        (S)==EAGB ? "EAGB" :                    \
-        (S)==TPAGB ? "TPAGB" :                  \
-        (S)==HeMS ? "HeMS" :                    \
-        (S)==HeHG ? "HeHG" :                    \
-        (S)==HeGB ? "HeGB" :                    \
-        (S)==HeWD ? "HeWD" :                    \
-        (S)==COWD ? "COWD" :                    \
-        (S)==ONeWD ? "ONeWD" :                  \
-        (S)==NEUTRON_STAR ? "NS":               \
-        (S)==BLACK_HOLE ? "BH" :                \
-        (S)==MASSLESS_REMNANT ? "REM" :         \
-        "Unknown"                               \
+/*
+ * Stellar type string from star struct.
+ *
+ * Using the star struct means we can include
+ * hybrid types.
+ */
+#define Stellar_type_string_from_star(STAR)                             \
+    (                                                                   \
+        (STAR)->stellar_type==LOW_MASS_MAIN_SEQUENCE ? "Convective low mass MS" : \
+        (STAR)->stellar_type==MAIN_SEQUENCE ? "Main Sequence" :         \
+        (STAR)->stellar_type==HERTZSPRUNG_GAP ? "Hertzsprung Gap" :     \
+        (STAR)->stellar_type==GIANT_BRANCH ? "First Giant Branch" :     \
+        (STAR)->stellar_type==CORE_HELIUM_BURNING ? "Core Helium Burning" : \
+        (STAR)->stellar_type==EAGB ? "Early Asymptotic Giant Branch" :  \
+        (STAR)->stellar_type==TPAGB ? "Thermally-Pulsing Asymptotic Giant Branch" : \
+        (STAR)->stellar_type==HeMS ? "Main Sequence Naked Helium" :     \
+        (STAR)->stellar_type==HeHG ? "Hertzsprung Gap Naked Helium" :   \
+        (STAR)->stellar_type==HeGB ? "Giant Branch Naked Helium" :      \
+        (STAR)->stellar_type==HeWD ? "Helium White Dwarf" :             \
+        ((STAR)->stellar_type==COWD && (STAR)->hybrid_HeCOWD==TRUE) ? "Carbon/Oxygen/Helium Hybrid White Dwarf" : \
+        (STAR)->stellar_type==COWD ? "Carbon/Oxygen White Dwarf" :      \
+        (STAR)->stellar_type==ONeWD ? "Oxygen/Neon White Dwarf" :       \
+        (STAR)->stellar_type==NEUTRON_STAR ? "Neutron star":            \
+        (STAR)->stellar_type==BLACK_HOLE ? "Black Hole" :               \
+        (STAR)->stellar_type==MASSLESS_REMNANT ? "Massless Remnant" :   \
+        "Unknown"                                                       \
         )
 
+/*
+ * Short stellar type string from the stellar type.
+ *
+ * Note that this means hybrid types are not labelled as 
+ * such.
+ */
+#define Short_stellar_type_string(S)                    \
+    (                                                   \
+        (S) == LOW_MASS_MAIN_SEQUENCE ? "LMMS" :        \
+        (S) == MAIN_SEQUENCE ? "MS" :                   \
+        (S) == HERTZSPRUNG_GAP ? "HG" :                 \
+        (S) == GIANT_BRANCH ? "GB" :                    \
+        (S) == CORE_HELIUM_BURNING ? "CHeB" :           \
+        (S) == EAGB ? "EAGB" :                          \
+        (S) == TPAGB ? "TPAGB" :                        \
+        (S) == HeMS ? "HeMS" :                          \
+        (S) == HeHG ? "HeHG" :                          \
+        (S) == HeGB ? "HeGB" :                          \
+        (S) == HeWD ? "HeWD" :                          \
+        (S) == COWD ? "COWD" :                          \
+        (S) == ONeWD ? "ONeWD" :                        \
+        (S) == NEUTRON_STAR ? "NS":                     \
+        (S) == BLACK_HOLE ? "BH" :                      \
+        (S) == MASSLESS_REMNANT ? "REM" :               \
+        "Unknown"                                       \
+        )
+
+/*
+ * Short stellar type string from star struct.
+ *
+ * Use of the star struct means we can include hybrid 
+ * types.
+ */
+#define Short_stellar_type_string_from_star(STAR)                       \
+    (                                                                   \
+        (STAR)->stellar_type == LOW_MASS_MAIN_SEQUENCE ? "LMMS" :       \
+        (STAR)->stellar_type == MAIN_SEQUENCE ? "MS" :                  \
+        (STAR)->stellar_type == HERTZSPRUNG_GAP ? "HG" :                \
+        (STAR)->stellar_type == GIANT_BRANCH ? "GB" :                   \
+        (STAR)->stellar_type == CORE_HELIUM_BURNING ? "CHeB" :          \
+        (STAR)->stellar_type == EAGB ? "EAGB" :                         \
+        (STAR)->stellar_type == TPAGB ? "TPAGB" :                       \
+        (STAR)->stellar_type == HeMS ? "HeMS" :                         \
+        (STAR)->stellar_type == HeHG ? "HeHG" :                         \
+        (STAR)->stellar_type == HeGB ? "HeGB" :                         \
+        (STAR)->stellar_type == HeWD ? "HeWD" :                         \
+        ((STAR)->stellar_type == COWD && (STAR)->hybrid_HeCOWD == TRUE) ? "COWDhybrid" : \
+        (STAR)->stellar_type == COWD ? "COWD" :                         \
+        (STAR)->stellar_type == ONeWD ? "ONeWD" :                       \
+        (STAR)->stellar_type == NEUTRON_STAR ? "NS":                    \
+        (STAR)->stellar_type == BLACK_HOLE ? "BH" :                     \
+        (STAR)->stellar_type == MASSLESS_REMNANT ? "REM" :              \
+        "Unknown"                                                       \
+        )
+
+
 /* White dwarf 10,11,12 */
 #define WHITE_DWARF(A) (((A)>HeGB)&&((A)<NEUTRON_STAR))
 
 /* White dwarf CO or ONe */
-#define CONeWD(A) (((A)==ONeWD)||((A)==COWD))
+#define CONeWD(A)                               \
+    ((A) == ONeWD ||                            \
+     (A) == COWD)
+
 /* Later than a white dwarf */
 #define LATER_THAN_WHITE_DWARF(A) ((A)>HeGB)
 
 /* stars with "cores" according to the BSE definition */ 
-#define HAS_BSE_CORE(A) ((A) >= HG &&        \
-                         (A) <  NEUTRON_STAR &&      \
-                         (A) != HeMS)
+#define HAS_BSE_CORE(A)                         \
+    ((A) >= HG &&                               \
+     (A) <  NEUTRON_STAR &&                     \
+     (A) != HeMS)
 
 /* Naked He Star 7,8,9 */
-#define NAKED_HELIUM_STAR(A) (((A)>TPAGB)&&((A)<HeWD))
+#define NAKED_HELIUM_STAR(A)                    \
+    ((A)>TPAGB &&                               \
+     (A)<HeWD)
 
 /* carbon-core stars */
-#define CARBON_CORE_STAR(A) ((A)>=CHeB && (A)<HeWD && (A)!=HeMS) 
+#define CARBON_CORE_STAR(A)                     \
+    ((A)>=CHeB &&                               \
+     (A)<HeWD &&                                \
+     (A)!=HeMS) 
 
 /* dammit! I wish we could call two things "MAIN_SEQENCE" but we can't! */
 /* NB Helium main sequence is separate from the hydrogen main sequence */
 /* Main sequence 0,1 */
-#define ON_MAIN_SEQUENCE(A) (((A)==LOW_MASS_MS)||((A)==MAIN_SEQUENCE))
+#define ON_MAIN_SEQUENCE(A)                     \
+    ((A) == LOW_MASS_MS ||                      \
+     (A) == MAIN_SEQUENCE)
+
 /* Either MS 0,1,7 */
-#define ON_EITHER_MAIN_SEQUENCE(A) (((A)==LOW_MASS_MS)||((A)==MAIN_SEQUENCE)||((A)==HeMS))
+#define ON_EITHER_MAIN_SEQUENCE(A)              \
+    ((A) == LOW_MASS_MS ||                      \
+     (A) == MAIN_SEQUENCE ||                    \
+     (A) == HeMS)
+
 /* Post MS He star 8,9 */
-#define POST_MS_NAKED_He_STAR(A) (((A)==HeHG)||((A)==HeGB))
+#define POST_MS_NAKED_He_STAR(A)                \
+    ((A) == HeHG ||                             \
+     (A) == HeGB)
+
 /* Giant 2,3,4,5,6,8,9 (cf. Hurley+2002 Eq.61) */
-#define GIANT_LIKE_STAR(A) (((A)>MAIN_SEQUENCE)&&((A)<HeWD)&&((A)!=HeMS))
+#define GIANT_LIKE_STAR(A)                      \
+    ((A) > MAIN_SEQUENCE &&                     \
+     (A) < HeWD &&                              \
+     (A) != HeMS)
+
 /* Asymptotic Giant Branch 5,6 */
-#define AGB(A) (((A)==EAGB)||((A)==TPAGB))
+#define AGB(A)                                  \
+    ((A) == EAGB ||                             \
+     (A) == TPAGB)
+
 /* Giant branch 3,5,6 */
-#define ON_GIANT_BRANCH(A) (((A)==FIRST_GIANT_BRANCH)||(AGB(A)))
+#define ON_GIANT_BRANCH(A)                      \
+    ((A) == FIRST_GIANT_BRANCH ||               \
+     AGB(A))
+
 /* either giant branch 3,5,6,9 */
-#define ON_EITHER_GIANT_BRANCH(A) ((ON_GIANT_BRANCH(A))||((A)==HeGB))
+#define ON_EITHER_GIANT_BRANCH(A)               \
+    (ON_GIANT_BRANCH(A) ||                      \
+     (A) == HeGB)
 
-#define HELIUM_CORED(A) ((A==CHeB)||(NAKED_HELIUM_STAR(A))||(A==HeWD))
+#define HELIUM_CORED(A)                         \
+    (A == CHeB ||                               \
+     NAKED_HELIUM_STAR(A) ||                    \
+     A == HeWD)
 
 #define COMENV_OFFSET (+100)
 
-#define COMPACT_OBJECT(A) (((A)>HeGB)&&((A)<MASSLESS_REMNANT))
+#define COMPACT_OBJECT(A)                       \
+    ((A)>HeGB &&                                \
+     (A)<MASSLESS_REMNANT)
 
 #define NUCLEAR_BURNING(A) ((A)<HeWD)
+
 #define POST_NUCLEAR_BURNING(A) ((A)>HeGB)
-#define MASSIVE_REMNANT(A) (((A)>HeGB)&&((A)<MASSLESS_REMNANT))
-#define GRB_PROGENITOR(A) (((A)==NS)||((A)==BH))
-#define POST_SN_OBJECT(A) (((A)==NS)||((A)==BH))
-#define IS_A_PLANET(A) (stardata->star[(A)].stellar_type==LMMS && stardata->star[(A)].mass<MAXIMUM_PLANET_MASS))
-#define WAS_A_STAR(A) (stardata->star[(A)].pms_mass>MAXIMUM_PLANET_MASS)
-#define MASSLESS(A) (stardata->star[(A)].stellar_type == MASSLESS_REMNANT)
+
+#define MASSIVE_REMNANT(A)                      \
+    ((A)>HeGB &&                                \
+     (A)<MASSLESS_REMNANT)
+
+#define GRB_PROGENITOR(A)                       \
+    ((A) == NS ||                               \
+     (A) == BH)
+
+#define POST_SN_OBJECT(A)                       \
+    ((A) == NS ||                               \
+     (A) == BH)
+
+#define IS_A_PLANET(A)                                  \
+    (stardata->star[(A)].stellar_type == LMMS &&        \
+     stardata->star[(A)].mass<MAXIMUM_PLANET_MASS))
+
+#define WAS_A_STAR(A)                                           \
+    (stardata->star[(A)].pms_mass > MAXIMUM_PLANET_MASS)
+
+#define MASSLESS(A)                                             \
+    (stardata->star[(A)].stellar_type  ==  MASSLESS_REMNANT)
+
 #define EVOLVING(A) (!(MASSLESS(A)))
-#define IS_A_STAR(A) ((EVOLVING(A))\
-                      && (stardata->star[(A)].mass>MAXIMUM_PLANET_MASS))
 
+#define IS_A_STAR(A) (EVOLVING(A) &&                                    \
+                      stardata->star[(A)].mass>MAXIMUM_PLANET_MASS)
 
-#define NUCLEAR_BURNING_BINARY ((NUCLEAR_BURNING(stardata->star[0].stellar_type)) || (NUCLEAR_BURNING(stardata->star[1].stellar_type<HeWD)))
+#define NUCLEAR_BURNING_BINARY                          \
+    (NUCLEAR_BURNING(stardata->star[0].stellar_type) || \
+     NUCLEAR_BURNING(stardata->star[1].stellar_type))
 
 
 /* Filter for convective envelopes */
-#define CONVECTIVE_ENVELOPE(A) \
-    ((ON_EITHER_GIANT_BRANCH(A))||((A)==HG)||((A)==HeHG))
+#define CONVECTIVE_ENVELOPE(A)                  \
+    (ON_EITHER_GIANT_BRANCH(A) ||               \
+     (A) == HG ||                               \
+     (A) == HeHG)
 
 /**************************************************/
 
@@ -205,14 +327,15 @@
 /* These are the ways to define the systems */
 
 /* Extended stellar types string array */
-#define EXT_STELLAR_TYPES STELLAR_TYPES,"Blue Straggler"
+#define EXT_STELLAR_TYPES                       \
+    STELLAR_TYPES,"Blue Straggler"
 
 /************************************************************/
 /* These are the types for the individual stars */
 #define SINGLE_UNDEF 666
-#define CHECK_BLUE_STRAGGLER(k)            \
-    (stardata->common.tm<stardata->model.time                           \
-     &&                                                                 \
+#define CHECK_BLUE_STRAGGLER(k)                                 \
+    (stardata->common.tm<stardata->model.time                   \
+     &&                                                         \
      ON_MAIN_SEQUENCE(stardata->star[(k)].stellar_type))
 #define BLUE_STRAGGLER 16
 
@@ -228,13 +351,22 @@
 #define SINGLE_STAR_SYSTEM -1
 /************************************************************/
 
-#define EITHER_STAR_EVOLVING (EVOLVING(0) || EVOLVING(1))
-#define EITHER_STAR_MASSLESS (MASSLESS(0) || MASSLESS(1))
-#define NEITHER_STAR_MASSLESS ((!MASSLESS(0))&&(!MASSLESS(1)))
+#define EITHER_STAR_EVOLVING                    \
+    (EVOLVING(0) ||                             \
+     EVOLVING(1))
+
+#define EITHER_STAR_MASSLESS                    \
+    (MASSLESS(0) ||                             \
+     MASSLESS(1))
+
+#define NEITHER_STAR_MASSLESS                   \
+    ( (!MASSLESS(0)) &&                         \
+      (!MASSLESS(1)) )
+
 #define NOTHING_LEFT (MASSLESS(0) && MASSLESS(1))
 
 #define OSTAR(A)                                                \
-    ((spectral_type(&(stardata->star[(A)]))==SPECTRAL_TYPE_O)   \
+    ((spectral_type(&(stardata->star[(A)])) == SPECTRAL_TYPE_O) \
      &&                                                         \
      (stardata->star[(A)].stellar_type<TPAGB))
 
diff --git a/src/binary_c_string_macros.h b/src/binary_c_string_macros.h
index 70dd50e0548594f490656f61a14de830e7e64f60..1998db5ea68ec7ded6b9106db5068f67ffb17a07 100644
--- a/src/binary_c_string_macros.h
+++ b/src/binary_c_string_macros.h
@@ -32,5 +32,105 @@
 #define Stringof(x) Stringize(x)
 
 #define Yesno(B) ((B)==TRUE ? "Yes" : "No")
+#define YESNO(B) ((B)==TRUE ? "YES" : "NO")
+#define Truefalse(B) ((B)==TRUE ? "True" : "False")
+#define TRUEFALSE(B) ((B)==TRUE ? "TRUE" : "FALSE")
+
+/*
+ * Macros to prevent us using strcmp and strcasecmp while 
+ * associatedly forgetting the ==0
+ */
+#define Strings_equal(A,B)                      \
+    (strcmp((A),(B))==0)
+#define Strings_equal_case_insensitive(A,B)     \
+    (strcasecmp((A),(B))==0)
+
+/*
+ * Macro to match a string S to true.
+ *
+ * An empty string is FALSE.
+ */
+#define String_is_true(S)                                               \
+    (                                                                   \
+        (                                                               \
+            (S)[0] != '\0' &&                                           \
+            (                                                           \
+                ((S)[0]=='1' && (S)[1]=='\0')                           \
+                ||                                                      \
+                (                                                       \
+                    ((S)[0] == 'T' ||                                   \
+                     (S)[0] == 't') &&                                  \
+                    (                                                   \
+                        Strings_equal_case_insensitive((S),"T") ||      \
+                        Strings_equal_case_insensitive((S),"TRUE")      \
+                        )                                               \
+                    )                                                   \
+                ||                                                      \
+                (                                                       \
+                    ((S)[0] == 'Y' ||                                   \
+                     (S)[0] == 'y') && (                                \
+                         Strings_equal_case_insensitive((S),"Y") ||     \
+                         Strings_equal_case_insensitive((S),"YES")      \
+                         )                                              \
+                    )                                                   \
+                ||                                                      \
+                (                                                       \
+                    ((S)[0] == 'O' || (S)[0] == 'o') &&                 \
+                    (                                                   \
+                        Strings_equal_case_insensitive((S),"ON")        \
+                        )                                               \
+                    )                                                   \
+                )                                                       \
+            )                                                           \
+        ? TRUE : FALSE)
+
+/*
+ * Macro to match a string S to FALSE.
+ *
+ * An empty string is FALSE.
+ */
+#define String_is_false(S)                                              \
+    (                                                                   \
+        (                                                               \
+            (S)[0] == '\0' ||                                           \
+            (                                                           \
+                ((S)[0] == '0' && (S)[0] == '\0')                       \
+                ||                                                      \
+                (                                                       \
+                    ((S)[0] == 'F' ||                                   \
+                     (S)[0] == 'f') &&                                  \
+                    (                                                   \
+                        Strings_equal_case_insensitive((S),"F") ||      \
+                        Strings_equal_case_insensitive((S),"FALSE")     \
+                        )                                               \
+                    )                                                   \
+                ||                                                      \
+                (                                                       \
+                    ((S)[0] == 'N' ||                                   \
+                     (S)[0] == 'n') &&                                  \
+                    (                                                   \
+                        Strings_equal_case_insensitive((S),"N") ||      \
+                        Strings_equal_case_insensitive((S),"NO")        \
+                        )                                               \
+                    )                                                   \
+                ||                                                      \
+                (                                                       \
+                    ((S)[0] == 'O' ||                                   \
+                     (S)[0] == 'o') &&                                  \
+                    (                                                   \
+                        Strings_equal_case_insensitive((S),"Off")       \
+                        )                                               \
+                    )                                                   \
+                )                                                       \
+            )                                                           \
+        ? TRUE : FALSE)
+
+#define String_is_boolean(S)                    \
+    (                                           \
+        (                                       \
+            Arg_is_true(S) ||                   \
+            Arg_is_false(S)                     \
+            )                                   \
+        ? TRUE: FALSE)
 
 #endif // STRING_MACROS_H
diff --git a/src/binary_c_structures.h b/src/binary_c_structures.h
index 31b34c436a470d26f86de580dfd6c924bae470c7..fe665acbe715a01fcd59bb4cb852eaa99494db03 100644
--- a/src/binary_c_structures.h
+++ b/src/binary_c_structures.h
@@ -98,7 +98,7 @@ struct binary_c_random_buffer_t {
  * This enables you to specify your own
  * maximum file lengths and monitor file size. 
  */
-struct binary_c_file {
+struct binary_c_file_t {
 #ifdef MEMOIZE
     struct memoize_hash_t * memo;
 #endif//MEMOIZE
@@ -300,8 +300,8 @@ struct tmpstore_t {
     struct rinterpolate_data_t * rinterpolate_data;
     struct data_table_t * comenv_lambda_table;
 #ifdef DISCS
-    struct binary_c_file * disc_logfile;
-    struct binary_c_file * disc_logfile2d;
+    struct binary_c_file_t * disc_logfile;
+    struct binary_c_file_t * disc_logfile2d;
 #endif//DISCS
     struct difflogstack_t * logstack;
     struct star_t * stellar_structure_newstar;
@@ -405,10 +405,22 @@ struct preferences_t {
 #ifdef EVOLUTION_SPLITTING
     struct splitinfo_t * splitinfo[EVOLUTION_SPLITTING_HARD_MAX_DEPTH];   
 #endif//EVOLUTION_SPLITTING
-
-
+    
     /* double parameters */
 
+    double initial_M1;
+    double initial_M2;
+    double initial_orbital_separation;
+    double initial_orbital_period;
+    double initial_orbital_eccentricity;
+    double initial_probability;
+    Abundance metallicity;
+    Abundance effective_metallicity;
+#ifdef NUCSYN
+    Abundance nucsyn_metallicity;
+#endif
+    double max_evolution_time;
+    
     double timestep_multipliers[DT_NUMBER_OF_TIMESTEP_LIMITERS];    
     /* critical mass ratios per stellar type */
     double qcrit[NUMBER_OF_STELLAR_TYPES];
@@ -778,6 +790,9 @@ struct preferences_t {
     /* random number seed */
     long int cmd_line_random_seed;
     long int random_skip;
+
+    Stellar_type initial_stellar_type1;
+    Stellar_type initial_stellar_type2;
     
 #ifdef BUFFERED_STACK
     int output_type;
@@ -862,7 +877,7 @@ struct preferences_t {
     int solver;
     
     /* evolution algorithm : currently have only BSE */
-     unsigned int evolution_algorithm;    
+    unsigned int evolution_algorithm;    
     
     /* Wind-RLOF parameter */
 #ifdef WRLOF_MASS_TRANSFER
@@ -947,6 +962,8 @@ struct preferences_t {
 #ifdef HRDIAG
     Boolean hrdiag_output;
 #endif//HRDIAG
+
+    Boolean use_fixed_timestep[NUMBER_OF_FIXED_TIMESTEPS];
     
     /* when events are better tested, this will be removed */
     Boolean disable_events; 
@@ -1591,9 +1608,9 @@ struct star_t {
 /* from a config file                                 */
 struct model_t {
 
-    /* fixed timestep algorithm */
+    /* fixed timestep algorithm settings */
     struct binary_c_fixed_timestep_t fixed_timesteps[NUMBER_OF_FIXED_TIMESTEPS];
-
+    
 #ifdef NUCSYN
 
 #if defined NUCSYN_YIELD_COMPRESSION || defined NUCSYN_LOG_BINARY_DX_YIELDS
@@ -1709,6 +1726,10 @@ struct model_t {
     int rlof_type,rlof_stability,rlof_count;
 #endif //RLOF_ABC
     Star_number ndonor,naccretor;
+#ifdef ZW2019_SNIA_LOG
+    Star_number ZW2019_Hestar;
+    Star_number ZW2019_COWD;
+#endif// ZW2019_SNIA_LOG    
 
     Boolean RLOF_start,RLOF_end;
     Boolean supernova,merged,inttry;
@@ -1723,7 +1744,6 @@ struct model_t {
     Boolean intermediate_step;
     Boolean deny_new_events;
     Boolean fixed_timestep_triggered;
-    Boolean bflag;//,disk,novae;
     Boolean logflags[NLOGFLAGS];
 
 #ifdef SYSTEM_LOGGING
@@ -1743,7 +1763,7 @@ struct model_t {
     Boolean doingsplit;
     Boolean split_last_time;
 #endif // EVOLUTION_SPLITTING
-    
+
 };
 
 struct orbit_t {
diff --git a/src/binary_c_types.h b/src/binary_c_types.h
index 7432b74c9edc3521160d619f649ee03c9805c466..a0cdbecac0d4c03de9b9971b55e0e60cfae9a735 100644
--- a/src/binary_c_types.h
+++ b/src/binary_c_types.h
@@ -57,7 +57,6 @@ typedef unsigned int Boolean;
 #endif //_C99
 
 
-
 /* 
  * You can choose whether to use short int types rather than int
  * 
@@ -99,15 +98,18 @@ typedef unsigned int Boolean;
 #define staticIsotope __unsigned__ __short__ __int__
 #define Nuclear_mass __double__
 #define Atomic_number __short__ __int__
+#define Nucleon_number __short__ __int__
 #define Reaction_rate __double__
 #define Yield_source __short__ __int__
-#define Moles __double__ 
+#define Moles __double__
+#define Molecular_weight __double__ 
 #define Abundance_ratio __double__
 #define WR_type __short__ __int__
 #define PNtrigger __unsigned__ __short__ __int__
 #define Abundance_mix __unsigned__ __short__ __int__
 #define Source_number __unsigned__ __short__ __int__
 #define Ensemble_index __unsigned__ __short__ __int__
+#define Stellar_magnitude_index __unsigned__ __short__ __int__
 #define Shell_index __short__ __int__
 #define Supernova_type __short__ __int__
 #define Caller_id __short__ __int__
@@ -121,6 +123,7 @@ typedef unsigned int Boolean;
 #define Spectral_type __int__
 #define Long_spectral_type __double__
 #define Nova_type __unsigned__ __int__
+#define Reaction_network __unsigned__ __int__
 
 #ifdef CODESTATS
 #define Codestats_counter __unsigned__ __long__ __int__
diff --git a/src/binary_c_version.h b/src/binary_c_version.h
index 27b161abd6062a1f227591f85e70ff99b7bb284f..234703700f79787d6c7810abcb15f2c869750cc2 100644
--- a/src/binary_c_version.h
+++ b/src/binary_c_version.h
@@ -21,9 +21,16 @@
  *
  * This file holds the version number for binary_c/nucsyn.
  *
- * Note: BINARY_C_VERSION should have no spaces in it 
+ * Note: BINARY_C_VERSION should have no spaces in it and
+ *       should be in the format:
+ *
+ *       <major>.<minor>.<patch>
+ * 
+ * where major, minor and patch are integers.
+ * 
+ * Patch is zero for a major release.  
  */
-#define BINARY_C_VERSION "2.1"
+#define BINARY_C_VERSION "2.1.1"
 
 /* and a CEMP run version */
 #define CEMP_VERSION "prelim10-O1-noCNEMPs"
diff --git a/src/binary_star_functions/adjust_radius_derivative.c b/src/binary_star_functions/adjust_radius_derivative.c
index 4cf6afec20889228b4610afa4b03768808426fa3..5023c7ed6612b3a1f51eeee02b0408551344ae23 100644
--- a/src/binary_star_functions/adjust_radius_derivative.c
+++ b/src/binary_star_functions/adjust_radius_derivative.c
@@ -10,7 +10,7 @@ void adjust_radius_derivative(struct stardata_t * RESTRICT const stardata)
 	Starloop(k)
         {       
 	    SETstar(k);
-            Dprint("adjust_radius_derivative%d: rdot=%g roche_radius=%g rol0=%g (diff=%g)  dtm=%g -> ",
+            Dprint("adjust_radius_derivative%u: rdot=%g roche_radius=%g rol0=%g (diff=%g)  dtm=%g -> ",
                    k,
                    star->rdot,
                    star->roche_radius,
diff --git a/src/binary_star_functions/mix_stars_BSE.c b/src/binary_star_functions/mix_stars_BSE.c
index 4940d0bf3683ceb4a33e9863d2d7b571cc39fcea..00cee30a1bc7648e795fdf156fc46f8c8813243c 100644
--- a/src/binary_star_functions/mix_stars_BSE.c
+++ b/src/binary_star_functions/mix_stars_BSE.c
@@ -37,7 +37,8 @@ void mix_stars_BSE(struct star_t * const stars,
      * Nucleosynthesis added, 2002/3 Rob Izzard
      */
     int merged_stellar_type;
-    double m01,m02,m03,m1,m2,m3,age1,age2,age3,mc1,mc2,mc3;
+    double m01,m02,m03,m1,m2,m3,age1,age2,age3;
+    double MAYBE_UNUSED mc1,mc2,mc3;
     double tms1,tms2,tms3,tn,mcconv1,mcconv2,mcconv3,mcCO1,mcCO2,mcCO3;
 #ifdef NUCSYN
     Abundance *X1,*X2;
@@ -386,7 +387,7 @@ void mix_stars_BSE(struct star_t * const stars,
     Dprint("merged_stellar_type = %d with total mass %g\n",
            merged_stellar_type,
            m3);
-
+    
     /*
      * Evaluate apparent age and other parameters
      * depending on stellar type.
diff --git a/src/common_envelope/common_envelope_evolution.h b/src/common_envelope/common_envelope_evolution.h
index d53b969af3cc4ce8e973774334ab6d3a11f9c96d..b9d47922379bd1ffe316eacad9cd606b610786d7 100644
--- a/src/common_envelope/common_envelope_evolution.h
+++ b/src/common_envelope/common_envelope_evolution.h
@@ -260,11 +260,11 @@
 	Roche_separation = Is_zero(final_separation) ? (R2) : final_separation * (R2)/rl2; \
         Dprint("SETSEPL2 %g\n",Roche_separation);                       \
     }                                                                   \
-    Dprint("Merger? %d\n",stardata->model.coalesce);                    \
+    Dprint("Merger? %u\n",stardata->model.coalesce);                    \
     if(stardata->model.coalesce>0)                                      \
     {                                                                   \
         Append_logstring(LOG_COMENV_PRE,                                \
-                         "Merge%d [rc1=%g%crl1=%g] [R2=%g%crl2=%g] ",   \
+                         "Merge%u [rc1=%g%crl1=%g] [R2=%g%crl2=%g] ",   \
                          stardata->model.coalesce,                      \
                          rc1,                                           \
                          (stardata->model.coalesce==1 ? '>' : '<'),     \
diff --git a/src/common_envelope/common_envelope_evolution_BSE.c b/src/common_envelope/common_envelope_evolution_BSE.c
index ef8ed6df3bf78235e131d295f7e02394cdbc51c9..0333ab15fdbf80e4ccb2f0026f3b6dd6f0a47bc8 100644
--- a/src/common_envelope/common_envelope_evolution_BSE.c
+++ b/src/common_envelope/common_envelope_evolution_BSE.c
@@ -1552,7 +1552,7 @@ end_section:
      * masses, assume this is totaly mixed to give the envelope abundances
      */
     
-    Dprint("coalesce boolean %d ",stardata->model.coalesce);
+    Dprint("coalesce boolean %s ",Truefalse(stardata->model.coalesce));
 
     /* Consider sources for yields and possibly remaining envelope. */
     Dprint("pre-source stellar types %d %d\n",donor->stellar_type,accretor->stellar_type);
@@ -2119,6 +2119,13 @@ end_section:
                  */
                 cbdisc->first = FALSE;
                 cbdisc->append = TRUE;
+                if(cbdisc->memo)
+                {
+                    Dprint("call memoize_free on appended cbdisc\n");
+                    printf("comenv double disc memoize free %p\n",cbdisc->memo); fflush(NULL);
+                    memoize_free(&cbdisc->memo);
+                    printf("comenv double disc now %p\n",cbdisc->memo);fflush(NULL);
+                }
                 Set_logstring(LOG_DISC,
                               "0Append CB disc: age=%g y, M+=%g=%g, Msun, J+=%g=%g (+=%g and +=%g %% of CE) ",
                               cbdisc->lifetime/YEAR_LENGTH_IN_SECONDS,
diff --git a/src/debug/backtrace-symbols.c b/src/debug/backtrace-symbols.c
index 383ae159aa6488cef518a33ba066de07c4f8968b..b6bfce7cb22d8dbe0c05e1b7b0e5db49b7106619 100644
--- a/src/debug/backtrace-symbols.c
+++ b/src/debug/backtrace-symbols.c
@@ -502,7 +502,7 @@ char ** backtrace_symbols_local(void *const *buffer, int size)
     {
         if(left > 1)
         {
-            printf("strlcpy : left = %ld, want %ld, copy %s to %p\n",
+            printf("strlcpy : left = %zu, want %zu, copy %s to %p\n",
                    left,
                    strlen(locations[x][0]),
                    locations[x][0],
diff --git a/src/disc/disc_bisection_rooter.c b/src/disc/disc_bisection_rooter.c
index c7e73d391ac4b210276343ae4cbac89128fa3ca6..673f671aaf932349a4c0fe42d37b85e1cdd1297a 100644
--- a/src/disc/disc_bisection_rooter.c
+++ b/src/disc/disc_bisection_rooter.c
@@ -27,7 +27,8 @@ int disc_bisection_rooter(const int n,
     unsigned long int maxcount = DISC_BISECTION_MAX_ATTEMPTS;
     Boolean converged = FALSE;
     Boolean failed = FALSE;
-    int error,i,j;
+    int error;
+    unsigned int i,j;
     
     while(converged == FALSE && failed == FALSE)
     {
@@ -37,7 +38,7 @@ int disc_bisection_rooter(const int n,
         i = bisection_count % n;
 
         Discdebug(1,
-                  "BISECT %ld param %d/%d %d %s : constraint %d %s\n",
+                  "BISECT %lu param %u/%d %u %s : constraint %u %s\n",
                   bisection_count,
                   i,
                   n,
@@ -139,14 +140,14 @@ int disc_bisection_rooter(const int n,
            converged==FALSE)
         {
             Discdebug(1,
-                      "   >>>>>>> Failed to converge in %ld attempts\n",
+                      "   >>>>>>> Failed to converge in %lu attempts\n",
                       maxcount);
             failed = 7;
         }
         
         if(DEBUG_BISECTION_LOOP)
         {
-            printf("Bisection loop %ld : converged? %d : failed %d\n",
+            printf("Bisection loop %lu : converged? %d : failed %d\n",
                    bisection_count,
                    converged,
                    failed);
@@ -161,7 +162,7 @@ int disc_bisection_rooter(const int n,
         {
             if(DEBUG_BISECTION_LOOP)
             {
-                printf("Check constraint %d : conv? %d : residual %g\n",
+                printf("Check constraint %u : conv? %d : residual %g\n",
                        j,
                        Disc_constraint_converged(disc,binary,constraints[j]),
                        Disc_residual(disc,binary,constraints[j]));
@@ -169,7 +170,7 @@ int disc_bisection_rooter(const int n,
             else
             {
                 Discdebug(1,
-                          "Check constraint %d : %g vs %g : conv? %d : residual %g\n",
+                          "Check constraint %u : %g vs %g : conv? %d : residual %g\n",
                           j,
                           Disc_constraint_constant(disc,binary,constraints[j]),
                           Disc_constraint_value(disc,binary,constraints[j]),
@@ -187,7 +188,7 @@ int disc_bisection_rooter(const int n,
         }
 
         Discdebug(1,
-                  "Convd %ld : converged = %d, failed = %d, eps(MJF)=[%g,%g,%g] MJF=[%g,%g,%g] Tvisc0=%g Rin=%g (%g Rsun) Rout=%g (%g Rsun)\n",
+                  "Convd %lu : converged = %d, failed = %d, eps(MJF)=[%g,%g,%g] MJF=[%g,%g,%g] Tvisc0=%g Rin=%g (%g Rsun) Rout=%g (%g Rsun)\n",
                   bisection_count,
                   converged,
                   failed,
@@ -304,7 +305,7 @@ static void disc_nsector_wrapper2(const int n,
     disc_nsector(n,
                  parameter_value,
                  residual,
-                 args);
+                 &args);
     va_end(args);                 
 }
 
diff --git a/src/disc/disc_calc_disc_structure.c b/src/disc/disc_calc_disc_structure.c
index 53f9c1b98e401b50719b4ef4d30e781e4edfd76b..d129da2bfb799fd0bdbea936d8d554474049e92c 100644
--- a/src/disc/disc_calc_disc_structure.c
+++ b/src/disc/disc_calc_disc_structure.c
@@ -730,8 +730,8 @@ static double converge_with_torque(const int n,
                 disc->converged = FALSE;
 
                 Discdebug(1,
-                          "calc_disc_structure : need to bisect, this is bad (converged? %d)\n",
-                          disc->converged);
+                          "calc_disc_structure : need to bisect, this is bad (converged? %s)\n",
+                          Yesno(disc->converged));
 
                 disc->converged = disc_bisection_rooter(n,
                                                         parameter_types,
diff --git a/src/disc/disc_determine_zone_radii.c b/src/disc/disc_determine_zone_radii.c
index 6b52ffa8f4bb66debed84524d70544c5661f5b46..7e438c4c6993ef61ee54fcefc54cab062763136f 100644
--- a/src/disc/disc_determine_zone_radii.c
+++ b/src/disc/disc_determine_zone_radii.c
@@ -156,7 +156,7 @@ Boolean disc_determine_zone_radii(struct disc_t * const disc)
     
         if(DEBUG_ZONE_RADII)
         {
-            printf("Final disc setup (%d zones)\n",disc->n_thermal_zones);
+            printf("Final disc setup (%u zones)\n",disc->n_thermal_zones);
             disc_show_thermal_zones(disc,disc->thermal_zones,disc->n_thermal_zones);
         }
     }    
diff --git a/src/disc/disc_evolve_disc_structure.c b/src/disc/disc_evolve_disc_structure.c
index 7badd58a40a17b4791c26a9f8dbefc32f4b50b55..d2f5c737b63a7b34d7dbcb332b655b50ed12a96b 100644
--- a/src/disc/disc_evolve_disc_structure.c
+++ b/src/disc/disc_evolve_disc_structure.c
@@ -319,8 +319,8 @@ double disc_evolve_disc_structure(struct stardata_t * const stardata,
                             ); 
                     }
                     Discdebug(1,
-                              "trying again with disc->converged = %d, can_evolve = %d\n",
-                              disc->converged,
+                              "trying again with disc->converged = %s, can_evolve = %d\n",
+                              Truefalse(disc->converged),
                               can_evolve);
                     continue;
                 }
diff --git a/src/disc/disc_initialize_disc.c b/src/disc/disc_initialize_disc.c
index ffa918939e7c396a9d59c714eff61ab229a7e6f0..b8db91fdee634f32614068af9685ff5650ead3a9 100644
--- a/src/disc/disc_initialize_disc.c
+++ b/src/disc/disc_initialize_disc.c
@@ -70,8 +70,10 @@ void disc_initialize_disc(struct stardata_t * const stardata,
     disc->prevzone = DISC_NO_PREVZONE_YET;
 #endif
 #ifdef MEMOIZE
+    printf("disc memoize init was %p\n",disc->memo);
     disc->memo = NULL;
     memoize_initialize(&disc->memo);
+    printf("disc memoize init %p\n",disc->memo);
 #endif
 
     /*
diff --git a/src/disc/disc_logging.c b/src/disc/disc_logging.c
index 8a13d0997eca530946cb707498c6f9f47cab63b3..5be91e1c052820dd634eec15ac5612f5d92809ec 100644
--- a/src/disc/disc_logging.c
+++ b/src/disc/disc_logging.c
@@ -190,7 +190,7 @@ void disc_logging(struct stardata_t * const stardata,
                     double Revap_in = disc->Revap_in;
 
                     /* output */
-                    Printf("DISC_EV %20.10e %20.10e %d %d %d %d %d %d %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g\n",
+                    Printf("DISC_EV %20.10e %20.10e %d %d %u %d %d %d %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g\n",
                            dtp, // 1
                            disc->lifetime/YEAR_LENGTH_IN_SECONDS,
                            stardata->star[0].stellar_type,
@@ -680,7 +680,7 @@ void disc_logging(struct stardata_t * const stardata,
                     binary_c_filter_fprintf(
                         Disc_log_filepointer,
                         FILE_FILTER_STRIP_ARGUMENTS,
-                        "t=%.20e st1=%d st2=%d nzones=%d zone0=%d zone1=%d zone2=%d Rin=%20.12g Rout=%20.12g RMhalf=%20.12g RJhalf=%20.12g a=%20.12g a1=%20.12g a2=%20.12g aL1=%20.12g aL2=%20.12g aL3=%20.12g Revapin=%20.12g Revapout=%20.12g RISM=%20.12g R0=%20.12g R1=%20.12g RL0=%20.12g RL1=%20.12g RZ0=%20.12g RZ1=%20.12g torqueF=%20.12g Ldisc=%20.12g Idisc=%20.12g Fdisc=%20.12g Jdisc=%20.12g Jbinary=%20.12g hdisc=%20.12g Mdisc=%20.12g Mbinary=%20.12g Mc0=%20.12g Mc1=%20.12g Menv1=%20.12g Menv2=%20.12g Mdotvisc=%20.12g Mdoscglobal=%20.12g MdotL2=%20.12g MdotISM=%20.12g MdotFUV=%20.12g MdotX=%20.12g Mdotin=%20.12g Mdotout=%20.12g Jdotvisc=%20.12g Jdotglobal=%20.12g JdotL2=%20.12g JdotISM=%20.12g JdotFUV=%20.12g JdotX=%20.12g Jdotin=%20.12g Jdotout=%20.12g Jdottorque=%20.12g hwind=%20.12g e=%20.12g edot=%20.12g Tin=%20.12g Tout=%20.12g densityin=%20.12g densityout=%20.12g sigmain=%20.12g sigmaout=%20.12g Pgravin=%20.12g Pgravout=%20.12g PISM=%20.12g HRin=%20.12g HRout=%20.12g Teffmaxstar=%20.12g Tratio=%20.12g Lstar=%20.12g LstarX=%20.12g Ldisc=%20.12g tviscin=%20.12g tviscout=%20.12g PEdisc=%20.12g KEdisc=%20.12g sigma0=%20.12g Tvisc0=%20.12g epsM=%20.12g epsJ=%20.12g epsF=%20.12g epstorqueF=%20.12g solver=%d guess=%d fRing=%20.12g ToomreQ=%20.12g Terrorpc=%20.12g Mdoterrorpc=%20.12g Mc0dot=%20.12g Mc1dot=%20.12g\n",
+                        "t=%.20e st1=%d st2=%d nzones=%u zone0=%d zone1=%d zone2=%d Rin=%20.12g Rout=%20.12g RMhalf=%20.12g RJhalf=%20.12g a=%20.12g a1=%20.12g a2=%20.12g aL1=%20.12g aL2=%20.12g aL3=%20.12g Revapin=%20.12g Revapout=%20.12g RISM=%20.12g R0=%20.12g R1=%20.12g RL0=%20.12g RL1=%20.12g RZ0=%20.12g RZ1=%20.12g torqueF=%20.12g Ldisc=%20.12g Idisc=%20.12g Fdisc=%20.12g Jdisc=%20.12g Jbinary=%20.12g hdisc=%20.12g Mdisc=%20.12g Mbinary=%20.12g Mc0=%20.12g Mc1=%20.12g Menv1=%20.12g Menv2=%20.12g Mdotvisc=%20.12g Mdoscglobal=%20.12g MdotL2=%20.12g MdotISM=%20.12g MdotFUV=%20.12g MdotX=%20.12g Mdotin=%20.12g Mdotout=%20.12g Jdotvisc=%20.12g Jdotglobal=%20.12g JdotL2=%20.12g JdotISM=%20.12g JdotFUV=%20.12g JdotX=%20.12g Jdotin=%20.12g Jdotout=%20.12g Jdottorque=%20.12g hwind=%20.12g e=%20.12g edot=%20.12g Tin=%20.12g Tout=%20.12g densityin=%20.12g densityout=%20.12g sigmain=%20.12g sigmaout=%20.12g Pgravin=%20.12g Pgravout=%20.12g PISM=%20.12g HRin=%20.12g HRout=%20.12g Teffmaxstar=%20.12g Tratio=%20.12g Lstar=%20.12g LstarX=%20.12g Ldisc=%20.12g tviscin=%20.12g tviscout=%20.12g PEdisc=%20.12g KEdisc=%20.12g sigma0=%20.12g Tvisc0=%20.12g epsM=%20.12g epsJ=%20.12g epsF=%20.12g epstorqueF=%20.12g solver=%d guess=%d fRing=%20.12g ToomreQ=%20.12g Terrorpc=%20.12g Mdoterrorpc=%20.12g Mc0dot=%20.12g Mc1dot=%20.12g\n",
                         disc->lifetime/YEAR_LENGTH_IN_SECONDS,
 
                         // stellar types
diff --git a/src/disc/disc_make_derived_power_laws.c b/src/disc/disc_make_derived_power_laws.c
index c30c689a391bbb626336b880c818694284f3218d..0e008f6d12beb08260aba35eec36bcc36b022c53 100644
--- a/src/disc/disc_make_derived_power_laws.c
+++ b/src/disc/disc_make_derived_power_laws.c
@@ -155,12 +155,14 @@ void disc_make_derived_powerlaws(struct disc_t * const disc,
             struct disc_thermal_zone_t * z = disc->thermal_zones+i;
             struct disc_thermal_zone_t * prevz = i==0 ? NULL : disc->thermal_zones+i-1;
             const int vb=0;
-            int j = POWER_LAW_MASS_INTEGRAND;
+            unsigned int j;
             for(j=0;j<DISCS_NUMBER_OF_POWER_LAWS;j++)
                 //for(j=0;j<2;j++) // TODO check other power laws when they are repaired
             {
-                if(vb)printf("test matching of power law %d (%s) in zone %d, R0=%g R1=%g\n",
-                             j,pls[j],i,
+                if(vb)printf("test matching of power law %u (%s) in zone %u, R0=%g R1=%g\n",
+                             j,
+                             pls[j],
+                             i,
                              z->power_laws[j].R0,
                              z->power_laws[j].R1
                     );
@@ -173,7 +175,7 @@ void disc_make_derived_powerlaws(struct disc_t * const disc,
                         const static char * pls[30] = POWER_LAW_STRINGS;
                         Exit_binary_c_no_stardata(
                             2,
-                            "Power law %d (%s) integrand boundary matching failed :(\n",
+                            "Power law %u (%s) integrand boundary matching failed :(\n",
                             j,pls[j]);
                     }
                 }
diff --git a/src/disc/disc_nsector.c b/src/disc/disc_nsector.c
index f564089512c74c456142d45c5683959c9c9a76a9..2bd91720803abaf0b3939b72263713d22593f72e 100644
--- a/src/disc/disc_nsector.c
+++ b/src/disc/disc_nsector.c
@@ -30,7 +30,7 @@
  * The constraints and parameter_types are defined in disc_constraints.h
  */
 
-void disc_nsector(const int n,
+void disc_nsector(const unsigned int n,
                   const double * parameter_value,
                   double * residual,
                   void * p)
@@ -49,7 +49,7 @@ void disc_nsector(const int n,
     va_end(args);
     double unknown MAYBE_UNUSED;
     struct disc_t * discwas;
-    int i,j;
+    unsigned int i,j;
     
     /*
      * Back up disc
@@ -62,7 +62,7 @@ void disc_nsector(const int n,
     for(i=0;i<n;i++)
     {
         Discdebug(2,
-                  "Nsector parameter %3d/%3d type %3d %40s value = %30.20g\n", 
+                  "Nsector parameter %3u/%3u type %3u %40s value = %30.20g\n", 
                   i,
                   n,
                   parameter_types[i],
@@ -102,7 +102,7 @@ void disc_nsector(const int n,
             {
                 residual[j] = DISC_CONSTRAINT_FAILED;
             }
-            Discdebug(2,"nsector : parameter %d type %d %s failed validity check, tried to set value = %g (Rin %g Rout %g)\n",
+            Discdebug(2,"nsector : parameter %u type %u %s failed validity check, tried to set value = %g (Rin %g Rout %g)\n",
                       i,
                       parameter_types[i],
                       Disc_parameter_string(parameter_types[i]),
@@ -126,7 +126,7 @@ void disc_nsector(const int n,
             Disc_parameter(disc,parameter_types[i]) = 
                 parameter_value[i];
 
-            Discdebug(2,"Nsector: set parameter %d (type %d %s) to %g (now disc : Tvisc0 = %g, Rin = %g, Rout = %g) \n",
+            Discdebug(2,"Nsector: set parameter %u (type %u %s) to %g (now disc : Tvisc0 = %g, Rin = %g, Rout = %g) \n",
                       i,
                       parameter_types[i],
                       Disc_parameter_string(parameter_types[i]),
@@ -168,7 +168,7 @@ void disc_nsector(const int n,
 void disc_nsector2(struct stardata_t * stardata,
                    struct disc_t * disc,
                    struct binary_system_t * binary,
-                   const int n,
+                   const unsigned int n,
                    const disc_constraint * constraints,
                    double * residual,
                    int * failed)
diff --git a/src/disc/disc_prototypes.h b/src/disc/disc_prototypes.h
index bb7777e4d6e8fb0ee3f8d4d050f5de50627d96f4..580e72a8d739af6110bbbfbb9685f02e8e7124b2 100644
--- a/src/disc/disc_prototypes.h
+++ b/src/disc/disc_prototypes.h
@@ -304,12 +304,12 @@ void disc_quadsector(double Tvisc0,
 void disc_nsector2(struct stardata_t * stardata,
                    struct disc_t * disc,
                    struct binary_system_t * binary,
-                   const int n,
+                   const unsigned int n,
                    const disc_constraint * constraints,
                    double * residual,
                    int * failed);
 
-void disc_nsector(const int n,
+void disc_nsector(const unsigned int n,
                   const double * parameter_value,
                   double * residual,
                   void * p);
diff --git a/src/disc/disc_set_disc_initial_guesses.c b/src/disc/disc_set_disc_initial_guesses.c
index 8fd6e2246eb541870351f23059f25c4e911c5a4f..4b3af96b85fb63318ae3c376d43ae4720ef81385 100644
--- a/src/disc/disc_set_disc_initial_guesses.c
+++ b/src/disc/disc_set_disc_initial_guesses.c
@@ -25,8 +25,8 @@ void disc_set_disc_initial_guesses(const int n,
     Boolean have_previous_disc = Is_not_zero(discwas->Rin);
     memset(initial_guesses, 0, 
            DISC_SOLVER_NINITIAL_GUESSES * n * sizeof(double));
-
-    int i;
+    
+    unsigned int i;
 #define Set_guess(N,TVISC,RIN,ROUT,TORQUEF)                             \
     if(0)printf("Set_guess : N=%d TVISC=%g RIN=%g ROUT=%g TORQUEF=%g\n", \
                 N,TVISC,RIN,ROUT,TORQUEF);                              \
@@ -38,7 +38,7 @@ void disc_set_disc_initial_guesses(const int n,
             parameter_types[i] == DISC_PARAMETER_ROUT ? (ROUT) :        \
             parameter_types[i] == DISC_PARAMETER_TORQUEF ? (TORQUEF) :  \
             -1.0;                                                       \
-        if(0)printf("Set guess element %d : parameter type %d %s : %g\n", \
+        if(0)printf("Set guess element %u : parameter type %u %s : %g\n", \
                     i,                                                  \
                     parameter_types[i],                                 \
                     Disc_parameter_string(parameter_types[i]),          \
diff --git a/src/disc/evolve_disc.c b/src/disc/evolve_disc.c
index 305879a9f6e9cb7f9f69be50a3103d5530023e62..49d0d602357159c5d6b1f03bb43544a617f7fb27 100644
--- a/src/disc/evolve_disc.c
+++ b/src/disc/evolve_disc.c
@@ -46,15 +46,15 @@ void evolve_disc(struct stardata_t * const stardata,
                   "No RLOF : evolve disc for %g years\n",
                   dtsecs/YEAR_LENGTH_IN_SECONDS);
 
-        Discdebug(3,"Conv precall converged? %d  Tvisc0 = %g M = %g Msun\n",
-                  disc->converged,
+        Discdebug(3,"Conv precall converged? %s Tvisc0 = %g M = %g Msun\n",
+                  Yesno(disc->converged),
                   disc->Tvisc0,
                   disc->M/M_SUN);
         double ret = disc_evolve_disc_structure(stardata,
                                                 disc,
                                                 dtsecs);
-        Discdebug(3,"Conv postcall converged? %d Tvisc0 = %g M = %g\n",
-                  disc->converged,
+        Discdebug(3,"Conv postcall converged? %s Tvisc0 = %g M = %g\n",
+                  Yesno(disc->converged),
                   disc->Tvisc0,
                   disc->M/M_SUN);
         
diff --git a/src/disc/remove_disc.c b/src/disc/remove_disc.c
index f09ed9161a3355621111394254df59a12f21cecd..b64bf660125808fb19434b4490c9ecfee5b18e0e 100644
--- a/src/disc/remove_disc.c
+++ b/src/disc/remove_disc.c
@@ -31,7 +31,9 @@ void remove_disc(
         }
         int n = DISC_POS_TO_N(star,pos);
 #ifdef MEMOIZE
+        printf("remove_disc memoize_free %p\n",star->discs[n]->memo);fflush(NULL);
         memoize_free(&star->discs[n]->memo);
+        printf("remove_disc now %p\n",star->discs[n]->memo);fflush(NULL);
 #endif // MEMOIZE
         Safe_free(star->discs[n]);
         int i;
@@ -98,12 +100,19 @@ void remove_disc(
                 struct disc_t * disc = &common->discs[n];
 #ifdef MEMOIZE
                 if(stardata->previous_stardata->common.discs[n].memo ==
-                   stardata->common.discs[n].memo)
+                   stardata->common.discs[n].memo &&
+                    stardata != stardata->previous_stardata)
                 {
                     /* the memo will be freed, so remove the reference to it */
                     stardata->previous_stardata->common.discs[n].memo = NULL;
                 }
-                if(disc->memo) memoize_free(&disc->memo);
+                if(disc->memo != NULL)
+                {
+                    Dprint("call memoize_free\n");
+                    printf("remove_disc memoize_free %p\n",disc->memo);fflush(NULL);
+                    memoize_free(&disc->memo);
+                    printf("remove_disc now %p\n",disc->memo);fflush(NULL);
+                }
 #endif//MEMOIZE
                 memset(disc,0,sizeof(struct disc_t));
                 common->ndiscs--;
diff --git a/src/evolution/evolution_prototypes.h b/src/evolution/evolution_prototypes.h
index 5d0499b46fe78e072ea296d5fcdff50a2c5b4198..9a92c5e89cbdb3cdaa92553a8c0ef1a8cd4d22eb 100644
--- a/src/evolution/evolution_prototypes.h
+++ b/src/evolution/evolution_prototypes.h
@@ -9,7 +9,9 @@
 
 int evolution(struct stardata_t * RESTRICT const stardata,
               Evolution_system_type system_type);
+void evolution_time_zero_setup(struct stardata_t * RESTRICT const stardata);
 int evolve_system(struct stardata_t * RESTRICT const stardata);
+int evolve_system_binary_c(struct stardata_t * RESTRICT const stardata);
 int evolve_detached_system(struct stardata_t * RESTRICT const stardata,
                            Boolean * RESTRICT initialize);
 int evolve_RLOFing_system(struct stardata_t * RESTRICT const stardata);
@@ -66,7 +68,8 @@ Boolean Pure_function check_reject_flags(struct stardata_t * RESTRICT const star
 void initialize_RLOFing_system_every_timestep(struct stardata_t * RESTRICT const stardata);
 void zero_stellar_mass_and_angmom_derivatives(struct stardata_t * RESTRICT const stardata);
 
-int evolve_system_binary_c(struct stardata_t * RESTRICT const stardata);
+
+
 
 Boolean Pure_function_if_no_debug can_reject(struct stardata_t * RESTRICT const stardata);
 void pre_evolution(struct stardata_t * RESTRICT const stardata);
@@ -75,5 +78,8 @@ void evolution_time_explicit(struct stardata_t * RESTRICT const stardata);
 void evolution_forward_Euler(struct stardata_t * RESTRICT const stardata);
 void evolution_rejection_tests(struct stardata_t * RESTRICT const stardata);
 void free_difflogstack(struct difflogstack_t * RESTRICT const logstack);
+
+
+
 #endif /* EVOLUTION_PROTOTYPES_H */
 
diff --git a/src/evolution/evolution_rejected.c b/src/evolution/evolution_rejected.c
index fc196010f3dc9d095c7127a6e070a0a09acc8a80..a763a27a2475a5988b7c3aaaf1daa0422924f56e 100644
--- a/src/evolution/evolution_rejected.c
+++ b/src/evolution/evolution_rejected.c
@@ -68,8 +68,7 @@ int evolution_rejected(struct stardata_t * RESTRICT const stardata)
         evolution_restore_and_reduce_timestep(stardata);
 
         const Boolean ov = RLOF_overflowing(stardata,1.0);
-        Dprint("reject restored with retval %d (%s) to t=%20.12g with dt_zoomfac = %g (R1 %g, RL1 %g, R2 %g, RL2 %g) : prev overflow? %d : events pending? %d model.reject = %d, recommended next dt %g\n",
-               
+        Dprint("reject restored with retval %d (%s) to t=%20.12g with dt_zoomfac = %g (R1 %g, RL1 %g, R2 %g, RL2 %g) : prev overflow? %s : events pending? %d model.reject = %u, recommended next dt %g\n",
                retval,
                Evolution_status_string(retval),
                stardata->model.time,
@@ -78,7 +77,7 @@ int evolution_rejected(struct stardata_t * RESTRICT const stardata)
                stardata->star[0].roche_radius,
                stardata->star[1].radius,
                stardata->star[1].roche_radius,
-               ov,
+               Yesno(ov),
                events_pending(stardata),
                stardata->model.reject,
                stardata->model.RLOF_recommended_timestep
diff --git a/src/evolution/evolution_rejection_tests.c b/src/evolution/evolution_rejection_tests.c
index ccb94025f689bdc0cd41da70f76500cb0399e6c1..fe001b255be115f34e05bb9eb942341b395ef0b4 100644
--- a/src/evolution/evolution_rejection_tests.c
+++ b/src/evolution/evolution_rejection_tests.c
@@ -31,7 +31,7 @@ void evolution_rejection_tests(struct stardata_t * RESTRICT const stardata)
          */
         const unsigned int RLOF_state = test_for_roche_lobe_overflow(stardata);
         const unsigned int prev_RLOF_state = test_for_roche_lobe_overflow(stardata->previous_stardata);
-        Dprint("test for RLOF rejection prev = %d, now = %d -> %s\n",
+        Dprint("test for RLOF rejection prev = %u, now = %u -> %s\n",
                prev_RLOF_state,
                RLOF_state,
                Evolution_loop_string(RLOF_state)
diff --git a/src/evolution/evolution_restore_and_reduce_timestep.c b/src/evolution/evolution_restore_and_reduce_timestep.c
index 0a023bccc022e639740b02b6ed49c19f9ae6b82b..4fb9b9b920876a810b1f12eee5cc59d46b99061e 100644
--- a/src/evolution/evolution_restore_and_reduce_timestep.c
+++ b/src/evolution/evolution_restore_and_reduce_timestep.c
@@ -42,7 +42,7 @@ void evolution_restore_and_reduce_timestep(struct stardata_t * RESTRICT const st
 
     evolution_restore_from_previous(stardata);
 
-    Dprint("ZOOM : Restored to (stardata %p, prefs = %p, prev %p, prev->prefs %p) at t=%30.16g with dtm = %g (reject = %d, dt_RLOF = %g, zoom = %g) [R0=%g RL0=%g -> RLOF %d] [R1=%g RL1=%g -> RLOF %d] \n",
+    Dprint("ZOOM : Restored to (stardata %p, prefs = %p, prev %p, prev->prefs %p) at t=%30.16g with dtm = %g (reject = %u, dt_RLOF = %g, zoom = %g) [R0=%g RL0=%g -> RLOF %s] [R1=%g RL1=%g -> RLOF %s] \n",
            stardata,
            stardata->preferences,
            stardata->previous_stardata,
@@ -54,10 +54,10 @@ void evolution_restore_and_reduce_timestep(struct stardata_t * RESTRICT const st
            stardata->model.dt_zoomfac,
            stardata->star[0].radius,
            stardata->star[0].roche_radius,
-           stardata->star[0].radius > stardata->star[0].roche_radius,
+           Yesno(stardata->star[0].radius > stardata->star[0].roche_radius),
            stardata->star[1].radius,
            stardata->star[1].roche_radius,
-           stardata->star[1].radius > stardata->star[1].roche_radius
+           Yesno(stardata->star[1].radius > stardata->star[1].roche_radius)
         );
 
     /*
diff --git a/src/evolution/evolution_save_to_previous.c b/src/evolution/evolution_save_to_previous.c
index c7844032731e41a6dab698c87047b9db773be480..5abbb9217f48dc3ae24a9c7aecbc2a2e8b245faa 100644
--- a/src/evolution/evolution_save_to_previous.c
+++ b/src/evolution/evolution_save_to_previous.c
@@ -34,7 +34,7 @@ void evolution_save_to_previous(struct stardata_t * RESTRICT const stardata)
         /*
          * Max number of previous stardatas
          */
-        const int n = Solver_n_previous_stardatas(stardata->preferences->solver);
+        const unsigned int n = Solver_n_previous_stardatas(stardata->preferences->solver);
 
         /*
          * We have stardata->n_previous_stardata previous stardatas
@@ -46,7 +46,7 @@ void evolution_save_to_previous(struct stardata_t * RESTRICT const stardata)
             /*
              * Allocate memory for new previous_stardata
              */
-            Dprint("New previous_stardata[%d] : want %d\n",
+            Dprint("New previous_stardata[%u] : want %u\n",
                    stardata->n_previous_stardatas,
                    n);
 
@@ -65,7 +65,7 @@ void evolution_save_to_previous(struct stardata_t * RESTRICT const stardata)
                     stardata->previous_stardatas[i] = New_stardata;
                 }
             }
-            Dprint("previous_stardatas[%d] = %p\n",
+            Dprint("previous_stardatas[%u] = %p\n",
                    stardata->n_previous_stardatas,
                    stardata->previous_stardatas);
             stardata->n_previous_stardatas++;
@@ -125,7 +125,7 @@ void evolution_save_to_previous(struct stardata_t * RESTRICT const stardata)
             unsigned int i;
             for(i=n-1; i>0; i--)
             {
-                Dprint("Copy stardata previous[%d] (%p) to previous[%d] (%p %p)\n",
+                Dprint("Copy stardata previous[%u] (%p) to previous[%u] (%p %p)\n",
                        i-1,
                        stardata->previous_stardatas[i-1],
                        i,
@@ -140,9 +140,9 @@ void evolution_save_to_previous(struct stardata_t * RESTRICT const stardata)
                     COPY_STARDATA_PREVIOUS_NONE
                     );
             }
-            Dprint("Copy stardata (%p) to previous[%d] (%p)\n",
+            Dprint("Copy stardata (%p) to previous[%u] (%p)\n",
                    stardata,
-                   0,
+                   (unsigned int)0,
                    stardata->previous_stardatas[0]
                 );
             copy_stardata(
diff --git a/src/evolution/evolution_time_zero_setup.c b/src/evolution/evolution_time_zero_setup.c
new file mode 100644
index 0000000000000000000000000000000000000000..b74a82ca69195af1fb78e79c715c6a53e7412593
--- /dev/null
+++ b/src/evolution/evolution_time_zero_setup.c
@@ -0,0 +1,123 @@
+#include "../binary_c.h"
+
+/*
+ * Subroutine to set things up at time zero, which is 
+ * usually the first time a star is evolved (although, when
+ * using the API, this may not be true : a star can then be 
+ * restarted).
+ */
+
+void evolution_time_zero_setup(struct stardata_t * RESTRICT const stardata)
+{
+    Dprint("time zero setup\n");
+#if defined BINT || defined NUCSYN
+    Star_number k;
+#endif // BINT || NUCSYN
+    struct common_t * const common =  &stardata->common;
+    common->init_random_seed = common->random_seed;
+
+    Dprint("set orbital parameters\n");
+    if(Is_not_zero(stardata->star[0].mass)
+       &&
+       Is_not_zero(stardata->star[1].mass))
+    {
+    
+        /* 
+         * if the period is zero, use the provided
+         * separation, otherwise use the provided period
+         */
+        if(Is_zero(common->orbit.period))
+        {
+            common->orbit.period = calculate_orbital_period(stardata);
+        }
+
+        common->zams_period = common->orbit.period;
+
+        /*
+         * convert orbital period to years
+         **/
+        common->orbit.period /= YEAR_LENGTH_IN_DAYS;
+
+        /*
+         * calculate the separation 
+         */
+        common->orbit.separation =
+            common->zams_separation = calculate_orbital_separation(stardata);
+    }
+    common->zams_eccentricity = common->orbit.eccentricity;
+
+#ifdef BINT
+    Starloop(k)
+    {
+        SETstar(k);
+        /*
+         * Set up parameters for the BINT interpolation
+         * scheme
+         */
+        star->bint.XHc = 0.760 - 3.0 * stardata->common.nucsyn_metallicity;
+        //0.7381; // Asplund 2009 (solar)
+        star->bint.XHec = 0.240 + 2.0 * stardata->common.nucsyn_metallicity;
+        //0.2485; // Asplund 2009 (solar)
+    }
+#endif
+
+
+#ifdef NUCSYN
+    Dprint("Set initial abundances (XZAMS, Xsolar)\n");
+    
+    /*
+     * copy initial abundances into the XZAMS array
+     */
+    Clear_isotope_array(common->XZAMS);
+    Clear_isotope_array(common->Xsolar);
+       
+    /* 
+     * set the initial abundance mixture using the nucsyn_metallicity 
+     */
+    nucsyn_initial_abundances(stardata->star[0].Xenv,
+                              common->nucsyn_metallicity,
+                              stardata,
+                              stardata->preferences->initial_abundance_mix);
+      
+    
+    /* initial nuclear burning timesteps */
+    Reaction_network i;
+    for(i=0;i<NUMBER_OF_REACTION_NETWORKS;i++)
+    {
+        stardata->common.dtguess[i] = LONG_TIMESTEP;
+    }
+    
+    /*
+     * copy the initial abundances where they are required
+     */
+    Starloop(k)
+    {
+        SETstar(k);
+        if(k!=0) Copy_abundances(stardata->star[0].Xenv,star->Xenv);
+        Copy_abundances(stardata->star[0].Xenv,star->Xinit);
+        Copy_abundances(stardata->star[0].Xenv,star->Xacc);
+    }
+    Copy_abundances(stardata->star[0].Xenv,common->XZAMS);
+
+   
+    /*
+     * Pure solar, Z=0.02 abundances
+     */
+    nucsyn_initial_abundances(common->Xsolar,
+                              0.02,
+                              NULL,
+                              stardata->preferences->initial_abundance_mix);
+
+    /*
+     * overwrite the initial abundance array to be 
+     * the true initial abundances
+     */
+    Copy_abundances(stardata->star[0].Xenv,
+                    stardata->preferences->the_initial_abundances);
+
+#ifdef NANCHECKS
+    nancheck("Xsolar in initialize_parameters",common->Xsolar,ISOTOPE_ARRAY_SIZE);
+    nancheck("XZAMS in initialize_parameters",common->XZAMS,ISOTOPE_ARRAY_SIZE);
+#endif //NANCHECKS
+#endif // NUCSYN
+}
diff --git a/src/evolution/evolve_system.c b/src/evolution/evolve_system.c
index c9301ae9f8ad1bc9cee1b743c3236696380f95c1..c5e307e95927de021aad222e0b6881a2a9948558 100644
--- a/src/evolution/evolve_system.c
+++ b/src/evolution/evolve_system.c
@@ -24,7 +24,8 @@ int evolve_system(struct stardata_t * RESTRICT const stardata)
     int retval;
     pre_evolution(stardata);
     
-    if(stardata->preferences->evolution_algorithm == EVOLUTION_ALGORITHM_BINARY_C)
+    if(stardata->preferences->evolution_algorithm ==
+       EVOLUTION_ALGORITHM_BINARY_C)
     {
         /*
          * new evolution loop for binary_c : leaner, meaner,
@@ -117,7 +118,7 @@ int evolve_system(struct stardata_t * RESTRICT const stardata)
 
         retval = 0;
     }
-
+    
     post_evolution(stardata);
 
     return retval;
diff --git a/src/evolution/evolve_system_binary_c.c b/src/evolution/evolve_system_binary_c.c
index e61578b713037e6244f46cfa2ea661363b502103..419fded43b181af0cb9ae30ff36b3cd9435b72d8 100644
--- a/src/evolution/evolve_system_binary_c.c
+++ b/src/evolution/evolve_system_binary_c.c
@@ -18,7 +18,6 @@
 #undef eprint
 #define eprint(...) /* do nothing */
 
-
 int evolve_system_binary_c(struct stardata_t * RESTRICT const stardata)
 {
     eprint("EVOLVE SYSTEM stardata=%p previous_stardata=%p stardata = %p store = %p (buffer = %p, size %d) model_time = %30.20e\n",
@@ -36,10 +35,13 @@ int evolve_system_binary_c(struct stardata_t * RESTRICT const stardata)
      */
     reset_binary_c_timeout();
     Start_evolution_timer;
-    if(Is_zero(stardata->model.time)) 
-    {
-        start_of_evolution(stardata);
-    }
+
+    /*
+     * Call start_of_evolution to set things up, 
+     * this is required also for restarts
+     */
+    start_of_evolution(stardata);
+    
     eprint("Save to previous\n"); 
 
     /*
diff --git a/src/evolution/init_model.c b/src/evolution/init_model.c
index 8ca56befc8bf17debaacf82e41cf381cbf99a0f3..fa88d0d0b23bb5861b474f0dac85bbcc9234777a 100644
--- a/src/evolution/init_model.c
+++ b/src/evolution/init_model.c
@@ -34,6 +34,11 @@ void init_model(struct model_t * RESTRICT const model)
         model->logflagstrings[i][0] = '\0';
     }
     model->dt_zoomfac = 1.0;
+
+#ifdef ZW2019_SNIA_LOG
+    model->ZW2019_Hestar = -1;
+    model->ZW2019_COWD = -1;
+#endif // ZW2019_SNIA_LOG    
 }
 
 
diff --git a/src/evolution/init_star.c b/src/evolution/init_star.c
index e2ab4d1542ddcf4a537a8ceeb3edee534f1c708f..47f185f036372cf455aee29202d3b06717005588 100644
--- a/src/evolution/init_star.c
+++ b/src/evolution/init_star.c
@@ -35,6 +35,6 @@ void init_star(struct stardata_t * const stardata,
     
 #endif /* NUCSYN */
     star->stellar_type=MAIN_SEQUENCE;
-
+    
     Dprint("Done for this star\n");
 }
diff --git a/src/evolution/initialize_parameters.c b/src/evolution/initialize_parameters.c
index e60428d26c7113d9b7bf4f6fa5c25324d2437f1c..3a69d91d46b4aa895ec459135ba75973394f529d 100644
--- a/src/evolution/initialize_parameters.c
+++ b/src/evolution/initialize_parameters.c
@@ -5,20 +5,15 @@
 
 void initialize_parameters(struct stardata_t * RESTRICT const stardata)
 {
-    struct model_t * model = &stardata->model;
-    struct common_t * common = &stardata->common;
-    struct star_t * star1 = &stardata->star[0];
-    struct star_t * star2 = &stardata->star[1];
-
-    
+    struct model_t * const model = &stardata->model;
+    struct common_t * const common = &stardata->common;
+    struct star_t * const star1 = &stardata->star[0];
+    struct star_t * const star2 = &stardata->star[1];
 #ifdef PRE_MAIN_SEQUENCE
     double aperi;
 #endif
-    double rc=0.0,lum=0.0,rm=0.0,mc=0.0,age=0.0;
-    Star_number k=0; /* counter */    
-#ifdef NUCSYN
-    Isotope i;
-#endif
+    double rc = 0.0,lum = 0.0,rm = 0.0,mc = 0.0,age = 0.0;
+    Star_number k = 0;
     /************************************************************/
 
 #ifdef BINT
@@ -27,112 +22,17 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
     
     check_nans_are_signalled();
     model->time = stardata->preferences->start_time;    
-    model->dt = 0.0;
-   
+    model->dtm = model->dt = 0.0;
+        
     Dprint("Initializing the parameters\n");
 
-#ifdef BINT
-    Starloop(k)
-    {
-        SETstar(k);
-        /*
-         * Set up parameters for the BINT interpolation
-         * scheme
-         */
-        star->bint.XHc = 0.760 - 3.0 * stardata->common.nucsyn_metallicity;
-        //0.7381; // Asplund 2009 (solar)
-        star->bint.XHec = 0.240 + 2.0 * stardata->common.nucsyn_metallicity;
-        //0.2485; // Asplund 2009 (solar)
-    }
-#endif
-    
-#ifdef NUCSYN
-    /*
-     * copy initial abundances into the XZAMS array
-     */
-    Clear_isotope_array(common->XZAMS);
-    Clear_isotope_array(common->Xsolar);
-
-#ifdef NUCSYN
-    /* initial nuclear burning timesteps */
-    for(i=0;i<NUMBER_OF_REACTION_NETWORKS;i++)
-    {
-        stardata->common.dtguess[i]=1e8;
-    }
-#endif
-
-    /* 
-     * set the initial abundance mixture using the nucsyn_metallicity 
-     */
-    nucsyn_initial_abundances(star1->Xenv,
-                              common->nucsyn_metallicity,
-                              stardata,
-                              stardata->preferences->initial_abundance_mix);
-    
-    /*
-     * copy the initial abundances where they are required
-     */
-    Starloop(k)
-    {
-        SETstar(k);
-        if(k!=0) Copy_abundances(star1->Xenv,star->Xenv);
-        Copy_abundances(star1->Xenv,star->Xinit);
-        Copy_abundances(star1->Xenv,star->Xacc);
-    }
-    Copy_abundances(star1->Xenv,common->XZAMS);
-         
-    /*
-     * Pure solar, Z=0.02 abundances
-     */
-    nucsyn_initial_abundances(common->Xsolar,
-                              0.02,
-                              NULL,
-                              stardata->preferences->initial_abundance_mix);
-
-    /*
-     * overwrite the initial abundance array to be 
-     * the true initial abundances
-     */
-    Copy_abundances(star1->Xenv,
-                    stardata->preferences->the_initial_abundances);
-
-#ifdef NANCHECKS
-    nancheck("Xsolar in initialize_parameters",common->Xsolar,ISOTOPE_ARRAY_SIZE);
-    nancheck("XZAMS in initialize_parameters",common->XZAMS,ISOTOPE_ARRAY_SIZE);
-#endif //NANCHECKS
-#endif // NUCSYN
-
-    Dprint("Memcopied XZAMS ok\n");
-
-    if(Is_not_zero(stardata->star[0].mass)
-       &&
-       Is_not_zero(stardata->star[1].mass))
-    {
-    
-        /* if the period is zero, use the provided separation, otherwise use the provided period */
-        if(Is_zero(common->orbit.period))
-        {
-            common->orbit.period = calculate_orbital_period(stardata);
-        }
-
-        common->zams_period = common->orbit.period;
-
-        /** convert orbital period to years **/
-        common->orbit.period /= YEAR_LENGTH_IN_DAYS;
-
-        /** calculate the separation (pass in pointer) **/
-        common->zams_separation = common->orbit.separation = calculate_orbital_separation(stardata);
-    }
-    common->zams_eccentricity = common->orbit.eccentricity;
-
-#ifdef PRE_MAIN_SEQUENCE
-    aperi = stardata->common.orbit.separation*(1.0-stardata->common.orbit.eccentricity);
-#endif 
 
     Dprint("random_seed\n");
 
     /*
-     * The random number seed is to be specified on the command line
+     * The random number seed can be specified as a preference, 
+     * or - if the seed is not yet set - it is set by the random_seed()
+     * function
      */
     if(stardata->preferences->cmd_line_random_seed!=0)
     {
@@ -144,7 +44,6 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
         common->random_seed = random_seed();
         Dprint("random_seed from random_seed() %ld\n",common->random_seed);
     }
-    common->init_random_seed = common->random_seed;
 
 #ifdef RANDOM_SEED_LOG
     printf("random_seed=%ld\n",common->random_seed);
@@ -153,13 +52,29 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
     {
         fprintf(model->log_fp,"random_seed=%ld\n",common->random_seed);
     }
-#endif
+#endif //FILE_LOG
 
 #ifdef RANDOM_SEED_LOG_STREAM
     if(RANDOM_SEED_LOG_STREAM!=NULL) fprintf(RANDOM_SEED_LOG_STREAM,"random_seed=%ld\n",common->random_seed);
-#endif
+#endif//RANDOM_SEED_LOG_STREAM
+
+#endif//RANDOM_SEED_LOG
+
+
+    
+    /*
+     * If the time really is zero, we require some further setup.
+     */
+    if(Is_zero(model->time))
+    {
+        evolution_time_zero_setup(stardata);
+    }
+    Dprint("Memcopied XZAMS ok\n");
+
+#ifdef PRE_MAIN_SEQUENCE
+    aperi = stardata->common.orbit.separation*(1.0-stardata->common.orbit.eccentricity);
+#endif 
 
-#endif
 
     model->sgl = FALSE; /* true for single star evolution ? */
 
@@ -191,7 +106,7 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
         if(star2->omega<0.0) star2->omega = common->orbit.angular_frequency;
     }
 
-    Boolean init_sgl=model->sgl;
+    const Boolean init_sgl = model->sgl;
 
     /**** per star setup ****/
     Starloop(k)
@@ -205,8 +120,7 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
                stardata->star[Other_star(k)].phase_start_mass);
 
         /*
-         * This function can be called with mass == 0,
-         * in which case skip most of the per-star setup.
+         * If mass == 0 skip most of the per-star setup.
          * 
          * This happens, e.g., when inital abundances
          * are required but nothing else.
@@ -218,7 +132,6 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
                    age,model->time,star->epoch);
         
             Dprint("Calling stellar_timescales...");
-
             if(init_sgl && k==1)
             {
                 star->phase_start_mass=0.0;
@@ -310,21 +223,21 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
 
             Dprint("Set initial epoch = %g - %g = %g\n",model->time,age,star->epoch);
 
-            star->radius=rm;
-            star->core_mass=mc;
-            star->core_radius=rc;
-            star->tms=tm;
-            star->tbgb=tscls[T_BGB];
-            star->luminosity=lum;
+            star->radius = rm;
+            star->core_mass = mc;
+            star->core_radius = rc;
+            star->tms = tm;
+            star->tbgb = tscls[T_BGB];
+            star->luminosity = lum;
 #else
             stellar_structure(star,
                               stardata,
                               FALSE,
                               STELLAR_STRUCTURE_CALLER_initialize_parameters);
 #endif//BSE
-            star->q=Q(k);
+            star->q = Q(k);
             determine_roche_lobe_radius(stardata,&stardata->common.orbit,star);
-            star->rol0=star->roche_radius;
+            star->rol0 = star->roche_radius;
         
             Dprint("setting lum to %12.12e\n",lum);
 
@@ -341,7 +254,8 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
 
             Boolean pms_fit_failed = FALSE; 
 	
-            if(stardata->preferences->pre_main_sequence==TRUE &&
+            if(ON_MAIN_SEQUENCE(star->stellar_type) &&
+               stardata->preferences->pre_main_sequence==TRUE &&
                stardata->preferences->pre_main_sequence_fit_lobes==TRUE &&
                star->radius > star->roche_radius_at_periastron)
             {
@@ -349,26 +263,26 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
 
 
                 /* find the R/RZAMS factor now */ 
-                double f=preMS_radius_factor(star->mass,0.0);
+                const double f = preMS_radius_factor(star->mass,0.0);
 
                 /* hence RZAMS */
-                double RZAMS = star->radius / f;
+                const double RZAMS = star->radius / f;
 
                 /*
                  * hence target factor = R/RZAMS = ROLperi/RZAMS 
                  * but this must be >1
                  */
-                double targetf = Max(1.0, 0.999 * star->roche_radius_at_periastron / RZAMS);
+                const double targetf = Max(1.0, 0.999 * star->roche_radius_at_periastron / RZAMS);
 
             
                 /* 
                  * hence get the corresponding age 
                  * NB on failure will put the star on the ZAMS
                  */
-                age = 1e-6*time_from_preMS_radius_factor(stardata,
-                                                         star->mass,
-                                                         targetf);
-
+                age = 1e-6 * time_from_preMS_radius_factor(stardata,
+                                                           star->mass,
+                                                           targetf);
+                
                 PMSprint("star %d : R_PMS=%g > RLperi=%g : R_ZAMS = %g : ",
                          star->starnum,star->radius,star->roche_radius_at_periastron,RZAMS);
                 PMSprint("target radius factor f = %g : ",targetf);
@@ -429,7 +343,6 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
                                       STELLAR_STRUCTURE_CALLER_initialize_parameters);
 #endif//BINT
                     Dprint("Set epoch = - age = %g, age = %g\n",star->epoch, star->age);
-      
                 }
 
                 PMSprint("R=%g : RLperi=%g ",
@@ -459,10 +372,11 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
             {
                 printf(">>> WARNING <<< : Pre-MS Roche lobe fitting failed, expect immediate RLOF from star %d\n",k);
             }
-#endif
+#endif // PRE_MAIN_SEQUENEC
            
             /*
-             * If t=0 (first timestep) then set the spin
+             * If t=0 (first timestep) then set the spin,
+             * otherwise we assume whatever is passed in.
              */
             if(Is_zero(model->time) && star->omega<1e-3)
             {
@@ -553,14 +467,14 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
         }
     } /** end loop over stars **/
     
-    model->dtm = 0.0;
-    model->bflag = 0;
-    
-#if (defined PRE_MAIN_SEQUENCE && defined FILE_LOG)
+#if defined PRE_MAIN_SEQUENCE && defined FILE_LOG
     /*
      * Logging for the Pre-MS
      */
-    if(stardata->preferences->pre_main_sequence==TRUE)
+    if(Is_zero(model->dt) &&
+       (ON_MAIN_SEQUENCE(stardata->star[0].stellar_type) ||
+        ON_MAIN_SEQUENCE(stardata->star[1].stellar_type)) &&
+       stardata->preferences->pre_main_sequence==TRUE)
     {
         Set_logstring(LOG_PREMAINSEQUENCE,
                       "PreMS aperi=%g t1=%g f1=%g R1=%g R1/RLperi1=%g R1/a(1-e)=%g t2=%g f2=%g R2=%g R2/RLperi2=%g R2/a(1-e)=%g R1+2/aperi=%g",
@@ -578,29 +492,30 @@ void initialize_parameters(struct stardata_t * RESTRICT const stardata)
                       (stardata->star[0].radius + stardata->star[1].radius)/aperi
             );
     }
-#endif
+#endif // PRE_MAIN_SEQUENCE && FILE_LOG
 
 
 #ifdef NUCSYN
     if(stardata->preferences->initial_abunds_only==TRUE)
     {
         /* output initial abundances then exit */
-        Printf("Initial abundances from mixture %d metallicity %g\n",
+        Printf("Initial abundances from mixture %u metallicity %g\n",
                stardata->preferences->initial_abundance_mix,
                stardata->common.metallicity
             );
         const static char element_strings[][4] = NUCSYN_SHORT_ELEMENT_STRINGS; 
-    
+        Isotope i;
         Ordered_isotope_loop(i)
         {
-            Printf("%s%d=>%12.12e, # %d\n",
+            Printf("%s%d=>%12.12e, # %u\n",
                    element_strings[stardata->store->atomic_number[i]],
                    stardata->store->nucleon_number[i],
-                   star1->Xenv[i],i);
+                   star1->Xenv[i],
+                   i);
         }
         Exit_or_return_void(BINARY_C_SPECIAL_EXIT,"exit init parameters: init abunds only");
     }
-#endif
+#endif //NUCSYN
 
     Dprint("Entering first timestep\n");
 }
diff --git a/src/evolution/post_evolution.c b/src/evolution/post_evolution.c
index 715c03b344078c818950cce28a33da5a72f3ef98..108e97a8a1a2a0decffd45509cd2a231d2539a93 100644
--- a/src/evolution/post_evolution.c
+++ b/src/evolution/post_evolution.c
@@ -11,9 +11,6 @@ void post_evolution(struct stardata_t * RESTRICT const stardata)
     /*
      * Perhaps perform a stardata_dump
      */
-    Dprint("dump stardata? %s %d\n",
-           stardata->preferences->stardata_dump_filename,
-           strlen(stardata->preferences->stardata_dump_filename)?1:0);
     if(strlen(stardata->preferences->stardata_dump_filename))
     {
         dump_stardata(stardata,
diff --git a/src/evolution/start_of_evolution.c b/src/evolution/start_of_evolution.c
index bb7416a078750d258740e85aebe5b26422162031..a57434bc4578686a0319d770bba2c2446438b104 100644
--- a/src/evolution/start_of_evolution.c
+++ b/src/evolution/start_of_evolution.c
@@ -2,7 +2,10 @@
 
 /*
  * A function to collect together all the stuff that should happen
- * at the start of evolving a system.
+ * when we start evolving a system.
+ *
+ * Note that the system does not have to have time == zero, 
+ * it could start evolving half way through its lifetime.
  */
 
 void start_of_evolution(struct stardata_t *stardata)
@@ -14,13 +17,18 @@ void start_of_evolution(struct stardata_t *stardata)
     /** set up variables and parameters **/
     /*************************************/
     set_metallicities(stardata);
+    
+    
 #ifdef BSE
     /* set metallicity parameters */
     Dprint("Setting up local variables, calling set_metallicity_parameters\n");
     set_metallicity_parameters(stardata);
-#endif //BSE    
-    /* Initialize stardata parameters */
-    Dprint("Settings up local variables, calling initialize_parameters\n");
+#endif //BSE
+    
+    /* 
+     * Initialize stardata parameters
+     */
+    Dprint("calling initialize_parameters\n");
     initialize_parameters(stardata);
 
 #ifdef NELEMANS_MASS_PLOT
@@ -28,7 +36,7 @@ void start_of_evolution(struct stardata_t *stardata)
 #endif
    
 #ifdef NO_IMMEDIATE_MERGERS
-    stardata->model.evolution_number=0;
+    stardata->model.evolution_number = 0;
 #endif
 
     setup_fixed_timesteps(stardata);
diff --git a/src/file/binary_c_fclose.c b/src/file/binary_c_fclose.c
index 83783b0a58cca5899335946a67482e2a0e97de36..195cf20843e082323ba936661338acf3b166e6fe 100644
--- a/src/file/binary_c_fclose.c
+++ b/src/file/binary_c_fclose.c
@@ -1,10 +1,10 @@
 
 #include "../binary_c.h"
 
-int binary_c_fclose(struct binary_c_file ** fp)
+int binary_c_fclose(struct binary_c_file_t ** fp)
 {
     /*
-     * Given a pointer fp to a binary_c_file structure pointer, close
+     * Given a pointer fp to a binary_c_file_t structure pointer, close
      * the file and free the memory, and set the file structrure pointer
      * to NULL.
      *
@@ -16,7 +16,7 @@ int binary_c_fclose(struct binary_c_file ** fp)
 
     if(fp!=NULL)
     {
-        struct binary_c_file * file = *fp;
+        struct binary_c_file_t * file = *fp;
 
         if(likely(file != NULL))
         {
diff --git a/src/file/binary_c_fflush.c b/src/file/binary_c_fflush.c
index 773503b121f9ee016178c317f71c91062d4d3c1e..2df1e0ab5e768c0d8c20dcca099ddd2e5d734e6f 100644
--- a/src/file/binary_c_fflush.c
+++ b/src/file/binary_c_fflush.c
@@ -1,10 +1,10 @@
 
 #include "../binary_c.h"
 
-int binary_c_fflush(const struct binary_c_file * const file)
+int binary_c_fflush(const struct binary_c_file_t * const file)
 {
     /*
-     * Flush a binary_c_file pointer.
+     * Flush a binary_c_file_t pointer.
      *
      * Return what is returned from fflush,
      * or -1 if file or file->fp is NULL
diff --git a/src/file/binary_c_filter_fprintf.c b/src/file/binary_c_filter_fprintf.c
index 813a4e18b5f1616cf13ec99d9bac1936685df4b4..6c831f6e1095a2cc040789d0f4a90b5ebc41942e 100644
--- a/src/file/binary_c_filter_fprintf.c
+++ b/src/file/binary_c_filter_fprintf.c
@@ -7,7 +7,7 @@
  * the input format string according to some required algorithm,
  * then sends the new format string to binary_c_fprintf.
  */
-int binary_c_filter_fprintf(struct binary_c_file * const file,
+int binary_c_filter_fprintf(struct binary_c_file_t * const file,
                             const int algorithm,
                             const char * const format,
                             ...)
diff --git a/src/file/binary_c_filter_vprintf.c b/src/file/binary_c_filter_vprintf.c
index 4206cca6e78d9cdd322e12ad6bca73573ee2b82a..3528a81bdd9fc52a7cd455ace265d3d2f90505f2 100644
--- a/src/file/binary_c_filter_vprintf.c
+++ b/src/file/binary_c_filter_vprintf.c
@@ -7,7 +7,7 @@
  * then sends the new format string to binary_c_fprintf.
  */
 
-int Gnu_format_args(3,0) binary_c_filter_vprintf(struct binary_c_file * const file,
+int Gnu_format_args(3,0) binary_c_filter_vprintf(struct binary_c_file_t * const file,
                                                  const int algorithm,
                                                  const char * const format,
                                                  va_list args)
diff --git a/src/file/binary_c_fopen.c b/src/file/binary_c_fopen.c
index 28cc45f8bb2aa2c71e7a231ec35bf7137718fa6b..9088e28f9658b8c2ff6e30b8687343b228d3f91d 100644
--- a/src/file/binary_c_fopen.c
+++ b/src/file/binary_c_fopen.c
@@ -1,7 +1,7 @@
 
 #include "../binary_c.h"
 
-struct binary_c_file * binary_c_fopen(const char * RESTRICT const path,
+struct binary_c_file_t * binary_c_fopen(const char * RESTRICT const path,
                                       const char * RESTRICT const mode,
                                       const size_t maxsize)
 {
@@ -18,7 +18,7 @@ struct binary_c_file * binary_c_fopen(const char * RESTRICT const path,
      * On failure, returns NULL and frees all 
      * associated memory.
      */
-    struct binary_c_file * file = Malloc(sizeof(struct binary_c_file));
+    struct binary_c_file_t * file = Malloc(sizeof(struct binary_c_file_t));
     if(file != NULL)
     {
         file->fp = fopen(path,mode);        
diff --git a/src/file/binary_c_fprintf.c b/src/file/binary_c_fprintf.c
index 8db0f0f7e8121f99fbb927cbe91c5312e2fca10e..5b05d67c14c2f49d94d309bbf0f1270edefb4aa6 100644
--- a/src/file/binary_c_fprintf.c
+++ b/src/file/binary_c_fprintf.c
@@ -2,7 +2,7 @@
 #include "../binary_c.h"
 
 
-int Gnu_format_args(2,3) binary_c_fprintf(struct binary_c_file * const file,
+int Gnu_format_args(2,3) binary_c_fprintf(struct binary_c_file_t * const file,
                                           const char * const format,
                                           ...)
 {
diff --git a/src/file/binary_c_vprintf.c b/src/file/binary_c_vprintf.c
index 01f178e44d205fbeb6fff79cf82f9da087c6bf8e..b92494cfa570331a755239f7a4bb06c1ff6e4ea1 100644
--- a/src/file/binary_c_vprintf.c
+++ b/src/file/binary_c_vprintf.c
@@ -1,7 +1,7 @@
 
 #include "../binary_c.h"
 
-int Gnu_format_args(2,0) binary_c_vprintf(struct binary_c_file * const file,
+int Gnu_format_args(2,0) binary_c_vprintf(struct binary_c_file_t * const file,
                                           const char * const format,
                                           va_list args)
 {
diff --git a/src/file/file_prototypes.h b/src/file/file_prototypes.h
index df754cbea246c1d5a6309ba473da9081ddba39bb..703f06a28c412a2523107e03e7815baf1a0bb456 100644
--- a/src/file/file_prototypes.h
+++ b/src/file/file_prototypes.h
@@ -2,22 +2,22 @@
 #ifndef FILE_H
 #define FILE_H
 
-struct binary_c_file * binary_c_fopen(const char * RESTRICT const path,
+struct binary_c_file_t * binary_c_fopen(const char * RESTRICT const path,
                                       const char * RESTRICT const mode,
                                       const size_t maxsize);
-int binary_c_fprintf(struct binary_c_file * const file,
+int binary_c_fprintf(struct binary_c_file_t * const file,
                      const char * const format,
                      ...) Gnu_format_args(2,3);
-int binary_c_fclose(struct binary_c_file ** file);
-int binary_c_fflush(const struct binary_c_file * const file);
-int binary_c_filter_fprintf(struct binary_c_file * const file,
+int binary_c_fclose(struct binary_c_file_t ** file);
+int binary_c_fflush(const struct binary_c_file_t * const file);
+int binary_c_filter_fprintf(struct binary_c_file_t * const file,
                             const int filter_algorithm,
                             const char * const format,
                             ...) Gnu_format_args(3,4);
-int binary_c_vprintf(struct binary_c_file * file,
+int binary_c_vprintf(struct binary_c_file_t * file,
                      const char * const format,
                      va_list args) Gnu_format_args(2,0);
-int binary_c_filter_vprintf(struct binary_c_file * const file,
+int binary_c_filter_vprintf(struct binary_c_file_t * const file,
                             const int algorithm,
                             const char * const format,
                             va_list args) Gnu_format_args(3,0);
diff --git a/src/libmemoize/memoize.c b/src/libmemoize/memoize.c
index 867bb34a025464d740f44a533b00d5cf5e1edaf6..18d14575cc7b6cc2dcfeaab15a12eed826b7402b 100644
--- a/src/libmemoize/memoize.c
+++ b/src/libmemoize/memoize.c
@@ -216,7 +216,7 @@ void * memoize_store_result(struct memoize_hash_t * RESTRICT const memo,
      *
      * Returns a pointer to the stored result, and cannot fail to do so.
      */
-    vb("store_result: memo=%p funcname=\"%s\" nmax=%ld parameter=%p result=%p\n",
+    vb("store_result: memo=%p funcname=\"%s\" nmax=%zu parameter=%p result=%p\n",
        memo,
        funcname,
        nmax,
@@ -270,7 +270,7 @@ void * memoize_store_result(struct memoize_hash_t * RESTRICT const memo,
          */
         h->parameter = Malloc(nmax * h->parameter_memsize);
         h->result    = Malloc(nmax * h->result_memsize);
-        
+
         /*
          * We don't have any parameters or results stored yet
          */
@@ -461,7 +461,7 @@ void memoize_clear_hash_contents(struct memoize_hash_t * RESTRICT const memo)
      * Do not free memory, just "clear" the hash contents
      * by settings n = 0 to ignore the function lists.
      */
-    int i;
+    size_t i;
     for(i=0;i<memo->n;i++)
     {
        memo->item[i].n=0;
@@ -474,12 +474,13 @@ void memoize_free(struct memoize_hash_t ** RESTRICT m)
      * Free memo 
      */
     struct memoize_hash_t * memo = *m;
-    int i;
+    size_t i;
     for(i=0;i<memo->n;i++)
     {
         struct memoize_hash_item_t * h = &memo->item[i];
+        
 #ifdef MEMOIZE_STATS
-        printf("Memoize: function \"%s\" : %zu hits (%g s), %zu misses (%g s)\n",
+        printf("Memoize: function \"%s\" : %ld hits (%g s), %ld misses (%g s)\n",
                h->funcname,
                h->nhits,
                (double)h->thits,
@@ -502,7 +503,6 @@ void memoize_free(struct memoize_hash_t ** RESTRICT m)
         Safe_free(h->parameter);
         Safe_free(h->result);
         Safe_free(h->funcname);
-
     }
 #ifdef MEMOIZE_STATS
     /*
@@ -595,7 +595,7 @@ void * Pure_function memoize_search_result(
                 printf("CMP pointers %p %p\n",x,y);
                 for(k=0;k<ncmp;k++)
                 {
-                    printf("CMP byte %5ld/%5ld : input = %5hhu vs item = %5hhu : %s\n",
+                    printf("CMP byte %5zu/%5zu : input = %5hhu vs item = %5hhu : %s\n",
                            k,
                            ncmp,
                            *(x+k),
@@ -658,11 +658,11 @@ void memoize_status(const struct memoize_hash_t * const memo)
         printf("   memo = %p and contains %zu items\n",
                memo,
                memo->n);
-        int i;
+        size_t i;
         for(i=0;i<memo->n;i++)
         {
             struct memoize_hash_item_t * h = &memo->item[i];
-            printf("   % 5d at %p contains %zu parameter/result pairs for function %s : { ",
+            printf("   %5zu at %p contains %zu parameter/result pairs for function %s : { ",
                    i,
                    h,
                    h->n,
@@ -695,7 +695,7 @@ size_t Pure_function memoize_sizeof(struct memoize_hash_t * const memo)
      * Return the size of the memo hash and all its contents
      */
     size_t s=0;
-    int i;
+    size_t i;
     for(i=0;i<memo->n;i++)
     {
         struct memoize_hash_item_t * h = &memo->item[i];
@@ -710,4 +710,4 @@ size_t Pure_function memoize_sizeof(struct memoize_hash_t * const memo)
 #endif // MEMOIZE
 
 #endif // __HAVE_LIBMEMOIZE__
-        
+        
\ No newline at end of file
diff --git a/src/libmemoize/memoize_internal.h b/src/libmemoize/memoize_internal.h
index db9688fcf4f6d9d03002cd11802f44bee6718eb8..9c1367781c49e4c115307d3e1c2886eb4f0ca1ad 100644
--- a/src/libmemoize/memoize_internal.h
+++ b/src/libmemoize/memoize_internal.h
@@ -17,8 +17,6 @@
  * result RESULT.
  */
 
-
-
 /*
  * Autotype(X) should use __auto_type if available,
  * but typeof if not.
@@ -26,11 +24,12 @@
 #if defined __GNUC__ && !defined Autotype
 #if (__GNUC__ ==4 && __GNU_MINOR__>9) || __GNUC__ > 4
 #define Autotype(X) __auto_type
-#else
-#define Autotype(X) typeof(X)
 #endif
 #endif
 
+#ifndef Autotype
+#define Autotype(X) typeof(X)
+#endif
 
 /*
  * Branch prediction: use "likely" and "unlikely"
@@ -51,6 +50,13 @@
 #endif
 #endif // __GNUC__
 
+#ifndef likely
+#define likely(x)
+#endif
+#ifndef unlikely
+#define unlikely(x)
+#endif
+
 /* macros to define less and more than operations */
 #ifndef Less_than
 #define Less_than(A,B) ((A)<(B))
@@ -89,11 +95,13 @@
     {                                                                   \
         Exit_binary_c_no_stardata(BINARY_C_ALLOC_FAILED,"libmemoize memory allocation failed");                                                        \
     }
-#else
-#define _Alloc_check(P) /* _Alloc_check(P) do nothing */
 #endif // ALLOC_CHECKS
 #endif //_Alloc_check
 
+#ifndef _Alloc_check
+#define _Alloc_check(P) /* _Alloc_check(P) do nothing */
+#endif
+
 /*
  * Memory allocation and freeing
  */
diff --git a/src/librinterpolate/rinterpolate_alloc_hypertable.c b/src/librinterpolate/rinterpolate_alloc_hypertable.c
index 16579e5861d90ff79736a8d0e2913085ab97a56d..c70c767655caec19a1578c27fde57402339403a3 100644
--- a/src/librinterpolate/rinterpolate_alloc_hypertable.c
+++ b/src/librinterpolate/rinterpolate_alloc_hypertable.c
@@ -54,4 +54,4 @@ void rinterpolate_alloc_hypertable(struct rinterpolate_table_t * RESTRICT const
 }
 
 #endif // __HAVE_LIBRINTERPOLATE__
-        
+        
\ No newline at end of file
diff --git a/src/librinterpolate/rinterpolate_alloc_varcount.c b/src/librinterpolate/rinterpolate_alloc_varcount.c
index 5ddacf730c7d506e80399939b973018a7da93b3b..211fe694ada35527c3e57e2d4ba0bf8a3ce73398 100644
--- a/src/librinterpolate/rinterpolate_alloc_varcount.c
+++ b/src/librinterpolate/rinterpolate_alloc_varcount.c
@@ -16,7 +16,7 @@ void rinterpolate_alloc_varcount(struct rinterpolate_table_t * RESTRICT const ta
     if(unlikely(table->varcount==NULL))
     {
         rinterpolate_error(RINTERPOLATE_CALLOC_FAILED,
-                           "Error allocating varcount %d in interpolate\n",
+                           "Error allocating varcount %u in interpolate\n",
                            table->parent,
                            table->table_number);
     }
diff --git a/src/librinterpolate/rinterpolate_compiler.h b/src/librinterpolate/rinterpolate_compiler.h
index ba51cf87145aab43bff0dc92f451870cac5e25d3..5f395c9f36f57cd5caecf13b337a1731596da61b 100644
--- a/src/librinterpolate/rinterpolate_compiler.h
+++ b/src/librinterpolate/rinterpolate_compiler.h
@@ -8,11 +8,12 @@
 #ifndef Autotype
 #if defined __GNUC__ && __GNUC__ > 4 && __GNUC_MINOR__ > 9
 #define Autotype(X) __auto_type
-#else
-#define Autotype(X) typeof(X)
 #endif // __GNUC__
 #endif
 
+#ifndef Autotype
+#define Autotype(X) typeof(X)
+#endif
 
 /* 
  * "safe" freeing of memory via the Safe_free macro,
@@ -45,10 +46,11 @@
 #   define RESTRICT __restrict
 #elif defined(_MSC_VER) && _MSC_VER >= 1400
 #   define RESTRICT __restrict
-#else
-#   define RESTRICT
 #endif
 #endif
+#ifndef RESTRICT
+#   define RESTRICT
+#endif
 
 
 #ifdef __GNUC__
diff --git a/src/librinterpolate/rinterpolate_error.c b/src/librinterpolate/rinterpolate_error.c
index 15a00b5b8c66c98f3b43d429e8aec33fc6ff9d36..e045f922a42abcc014fabcce88609177bf42c2c2 100644
--- a/src/librinterpolate/rinterpolate_error.c
+++ b/src/librinterpolate/rinterpolate_error.c
@@ -21,7 +21,7 @@ void No_return Gnu_format_args(2,4) rinterpolate_error(rinterpolate_counter_t er
     va_list ap;
     va_start(ap,rinterpolate_data);
     fprintf(stderr,
-            "librinterpolate error %d: ",
+            "librinterpolate error %u: ",
             errnum);
     fprintf(stderr,format,ap);
     va_end(ap);
diff --git a/src/logging/dump_stardata.c b/src/logging/dump_stardata.c
index 93fb5631af700d1d56a3f7c195535f929cf8d504..a16c5f47e5fa8cfe2d334c3fef869827577dc9fb 100644
--- a/src/logging/dump_stardata.c
+++ b/src/logging/dump_stardata.c
@@ -108,7 +108,7 @@ void No_return dump_stardata(struct stardata_t * const stardata,
         /*
          * Write previous_stardatas stack
          */
-        int i;
+        unsigned int i;
         for(i=0;i<stardata->n_previous_stardatas;i++)
         {
             if(fwrite(stardata->previous_stardatas[i],
@@ -117,7 +117,7 @@ void No_return dump_stardata(struct stardata_t * const stardata,
                       dumpfile) < sizeof(struct stardata_t))
             {
                 Exit_binary_c(BINARY_C_FILE_CLOSE_ERROR,
-                              "Error when writing stardata dump file (previous_stardata stack %d/%d) to %s", 
+                              "Error when writing stardata dump file (previous_stardata stack %u/%u) to %s", 
                               i,
                               stardata->n_previous_stardatas,
                               filename);
diff --git a/src/logging/load_stardata.c b/src/logging/load_stardata.c
index 6b670fd70780547ea28f9eff383f50c4dc14264d..19f68f9f1fa9f1ad33360952591a7685ec4ffba9 100644
--- a/src/logging/load_stardata.c
+++ b/src/logging/load_stardata.c
@@ -76,7 +76,7 @@ void load_stardata(struct stardata_t * const stardata,
                       have_read_bytes);
     }
 
-    printf("n_previous = %d %d\n",
+    printf("n_previous = %u %u\n",
            stardata_dump->stardata.n_previous_stardatas,
            stardata->n_previous_stardatas);
 
@@ -170,43 +170,43 @@ void load_stardata(struct stardata_t * const stardata,
     /*
      * Read in previous_stardatas stack
      */
-    int i;
+    unsigned int i;
     stardata->previous_stardatas =
         Malloc(stardata->n_previous_stardatas*sizeof(struct stardata_t *));
-    printf("PREVIOUS STARDATAS EXPECT %d\n",stardata->n_previous_stardatas);
+    printf("PREVIOUS STARDATAS EXPECT %u\n",stardata->n_previous_stardatas);
 
     if(stardata->n_previous_stardatas)
     {
-    for(i=0;i<stardata->n_previous_stardatas;i++)
-    {
-        stardata->previous_stardatas[i] = New_stardata;
+        for(i=0;i<stardata->n_previous_stardatas;i++)
+        {
+            stardata->previous_stardatas[i] = New_stardata;
 
-        printf("Read into %p\n",stardata->previous_stardatas[i]);
+            printf("Read into %p\n",stardata->previous_stardatas[i]);
         
-        size_t have_read_bytes = fread(stardata->previous_stardatas[i],
-                                       1,
-                                       sizeof(struct stardata_t),
-                                       dumpfile);
-        printf("read %zu bytes into %p\n",
-               have_read_bytes,
-               stardata->previous_stardatas[i]);
+            size_t have_read_bytes = fread(stardata->previous_stardatas[i],
+                                           1,
+                                           sizeof(struct stardata_t),
+                                           dumpfile);
+            printf("read %zu bytes into %p\n",
+                   have_read_bytes,
+                   stardata->previous_stardatas[i]);
         
-        if(have_read_bytes != sizeof(struct stardata_t))
-        {
-            Exit_binary_c(BINARY_C_FILE_READ_ERROR,
-                          "Error when reading from stardata dump file (previous stardata %d/%d) at %s: expected %zu bytes of data, but only read %zu.\n",
-                          i,
-                          stardata->n_previous_stardatas,
-                          filename,
-                          sizeof(struct stardata_dump_t),
-                      have_read_bytes);
+            if(have_read_bytes != sizeof(struct stardata_t))
+            {
+                Exit_binary_c(BINARY_C_FILE_READ_ERROR,
+                              "Error when reading from stardata dump file (previous stardata %u/%u) at %s: expected %zu bytes of data, but only read %zu.\n",
+                              i,
+                              stardata->n_previous_stardatas,
+                              filename,
+                              sizeof(struct stardata_dump_t),
+                              have_read_bytes);
+            }
+
+            Replace_pointers(stardata->previous_stardatas[i]);
         }
-
-        Replace_pointers(stardata->previous_stardatas[i]);
-    }
     
-    stardata->previous_stardata = stardata->previous_stardatas[0]; 
-    printf("PREVIOUS STARDATA %p\n",stardata->previous_stardata);
+        stardata->previous_stardata = stardata->previous_stardatas[0]; 
+        printf("PREVIOUS STARDATA %p\n",stardata->previous_stardata);
     }
     /*
      * Close the file
diff --git a/src/logging/log_every_timestep.c b/src/logging/log_every_timestep.c
index 8c397c6db8d698fc6723434deb89afb0c4d71519..6ee11204f6934d5fd64459cf95908938ed70442f 100644
--- a/src/logging/log_every_timestep.c
+++ b/src/logging/log_every_timestep.c
@@ -170,7 +170,7 @@ void log_every_timestep(struct stardata_t * RESTRICT const stardata)
     Reset_num_thermal_pulses(1);
 #ifdef NUCSYN_GCE
     /* GCE populations every timestep */
-    nucsyn_gce_log(stardata);
+    nucsyn_ensemble_log(stardata);
 #endif
 
 #endif // NUCSYN
@@ -2528,5 +2528,74 @@ void log_every_timestep(struct stardata_t * RESTRICT const stardata)
                stardata->preferences->custom_output_function);
         stardata->preferences->custom_output_function(stardata);
     }
-    
+
+      if(timestep_fixed_trigger(stardata,FIXED_TIMESTEP_TEST))
+      {
+          if(NUCLEAR_BURNING_BINARY)
+          {
+              Printf("test %g %d %d\n",
+                     stardata->model.time,
+                     stardata->star[0].stellar_type,
+                     stardata->star[1].stellar_type
+                  );
+          }
+      }
+
+#ifdef ZW2019_SNIA_LOG
+
+      /*
+       * SNIa progenitor logging for Zhengwei Liu
+       * 19/09/2019
+       */
+      Boolean ZWlog =  FALSE;
+      Star_number k = -1;
+      
+      if(stardata->model.ZW2019_Hestar == -1 &&
+         (NAKED_HELIUM_STAR(stardata->star[0].stellar_type) ||
+          NAKED_HELIUM_STAR(stardata->star[1].stellar_type)) &&
+         System_is_binary
+          )
+      {
+          k = NAKED_HELIUM_STAR(stardata->star[0].stellar_type) ? 0 :
+              NAKED_HELIUM_STAR(stardata->star[1].stellar_type) ? 1 :
+              -1;
+          stardata->model.ZW2019_Hestar = k;
+          ZWlog = TRUE;
+      }
+
+      if(stardata->model.ZW2019_Hestar > 0 &&
+         stardata->model.ZW2019_COWD == -1 &&
+         (stardata->star[stardata->model.ZW2019_Hestar].stellar_type == COWD) &&
+         System_is_binary)
+      {
+          k = stardata->model.ZW2019_Hestar;
+          stardata->model.ZW2019_COWD = k;
+          ZWlog = TRUE;
+      }
+      
+      if(ZWlog == TRUE && k > 0)
+      {
+          Printf("ZW2019 %s %d t=%g prob=%g st1=%s st2=%s M1=%g M2=%g R1=%g R2=%g RL1=%g RL2=%g a=%g P=%g e=%g J=%g Z=%g\n",
+                 stardata->model.ZW2019_COWD == TRUE ? "COWD" : "Hestar",
+                 k,
+                 stardata->model.time,
+                 stardata->model.probability,
+                 Short_stellar_type_string_from_star(&stardata->star[0]),
+                 Short_stellar_type_string_from_star(&stardata->star[1]),
+                 stardata->star[0].mass,
+                 stardata->star[1].mass,
+                 stardata->star[0].radius,
+                 stardata->star[1].radius,
+                 stardata->star[0].roche_radius,
+                 stardata->star[1].roche_radius,
+                 stardata->common.orbit.separation,
+                 stardata->common.orbit.period,
+                 stardata->common.orbit.eccentricity,
+                 stardata->common.orbit.angular_momentum,
+                 stardata->common.metallicity
+              );
+      }      
+#endif// ZW2019_SNIA_LOG
+
+      
 }
diff --git a/src/main.c b/src/main.c
index 03b28c8326914244b015306f30aefe9f5b3c34a3..8fd082f366fb214e88494682a9899bfc6dfa2e51 100644
--- a/src/main.c
+++ b/src/main.c
@@ -146,7 +146,7 @@ static int binary_c_main(int argc,
         /* if we're repeating we need to reset and reload vars */
         if(repeat_reset && repeat)
         {
-            reset_preferences(preferences); 
+            set_default_preferences(preferences); 
             set_up_variables(argc,argv,NULL,stardata);
 #ifdef LOG_REPEAT_NUMBER
             stardata->model.repeat_number = repeat;
diff --git a/src/maths/apply_derivative.c b/src/maths/apply_derivative.c
index bc5fa9a999cc8eda8fcbb125c45aceda095b8dac..a8d2d849a00dfb19a4f8ea47f9a46df04fba7690 100644
--- a/src/maths/apply_derivative.c
+++ b/src/maths/apply_derivative.c
@@ -113,7 +113,7 @@ void apply_derivative(struct stardata_t * const stardata,
          * Use an exponential solver if we can, otherwise 
          * the (faster) linear solution.
          */
-        double was = *value;
+        const double was = * value;
         Boolean is_exp;
         if(0 &&
            Is_not_zero(*value) &&
@@ -136,7 +136,7 @@ void apply_derivative(struct stardata_t * const stardata,
             *value += d[nd] * dt;
             is_exp = FALSE;
         }
-        Dprint("APPLY d[%d] = %g (exp %s) : was %g now %g\n",
+        Dprint("APPLY d[%u] = %g (exp %s) : was %g now %g\n",
                nd,
                d[nd],
                Yesno(is_exp),
diff --git a/src/memory/main_allocations.c b/src/memory/main_allocations.c
index 59f7b45b4bbc4be3edc04468de09e84d0957a2be..c071defada6be99b4eda5d5e071b0a9fe8cb0604 100644
--- a/src/memory/main_allocations.c
+++ b/src/memory/main_allocations.c
@@ -140,7 +140,7 @@ void main_allocations(struct stardata_t ** const new_stardata,
     (*new_stardata)->preferences->stream_buffer = NULL;
     (*new_stardata)->preferences->stream_buffer_stacksize = 0;
 #endif
-    reset_preferences((*new_stardata)->preferences);
+    set_default_preferences((*new_stardata)->preferences);
 
     if(1)
     {
diff --git a/src/nucsyn/nucsyn_binary_yield.c b/src/nucsyn/nucsyn_binary_yield.c
index d5727b22da354d8cb30f1adac822ea2d081c6e33..ebbb1b698da2350bb387f1086636ae2359e9b6f2 100644
--- a/src/nucsyn/nucsyn_binary_yield.c
+++ b/src/nucsyn/nucsyn_binary_yield.c
@@ -69,7 +69,7 @@ void nucsyn_binary_yield(struct stardata_t * RESTRICT const stardata,
     
 #ifdef NUCSYN_GCE
     /* GCE populations every timestep */
-    //if(final==TRUE) nucsyn_gce_log(stardata,final);
+    //if(final==TRUE) nucsyn_ensemble_log(stardata,final);
 #endif
 
     if(unlikely(
diff --git a/src/nucsyn/nucsyn_burning_cycles.c b/src/nucsyn/nucsyn_burning_cycles.c
index e25b5640fb250f3b31cf70a763aa58d3b2e340eb..1e5bbaad4f48b3861b1521d0a9ce62d0021f760a 100644
--- a/src/nucsyn/nucsyn_burning_cycles.c
+++ b/src/nucsyn/nucsyn_burning_cycles.c
@@ -35,7 +35,7 @@ void nucsyn_burning_cycles(Abundance * RESTRICT const N,
 
 #if (DEBUG==1)
     {
-        int i;
+        Reaction_network i;
         for(i=0;i<5;i++)
         {
             Dprint("dtguess[%d]=%g\n",i,dtguess[i]);
diff --git a/src/nucsyn/nucsyn_check_abundance_array.c b/src/nucsyn/nucsyn_check_abundance_array.c
index a142d120d0ecb6570ba64d02ddb777599b3a9421..9eacdb0b79799a0b33265490edfd598d941c8c60 100644
--- a/src/nucsyn/nucsyn_check_abundance_array.c
+++ b/src/nucsyn/nucsyn_check_abundance_array.c
@@ -10,12 +10,12 @@
 static void nucsyn_check_abundance_array_oops(struct stardata_t * RESTRICT const stardata,
                                               const Abundance * const RESTRICT X,
                                               const Isotope i,
-                                              const char *s) ;
-#endif
+                                              const char *const s) ;
+#endif//UNROLL_NUCSYN_LOOPS
 
 void nucsyn_check_abundance_array(struct stardata_t * RESTRICT const stardata,
                                   const Abundance * RESTRICT const X,
-                                  const char * RESTRICT s)
+                                  const char * RESTRICT const s)
 {
 
     /*
@@ -58,10 +58,10 @@ void nucsyn_check_abundance_array(struct stardata_t * RESTRICT const stardata,
 static void nucsyn_check_abundance_array_oops(struct stardata_t * RESTRICT const stardata,
                                               const Abundance * RESTRICT const X,
                                               const Isotope i,
-                                              const char *s) 
+                                              const char * const s) 
 {
     Exit_binary_c(BINARY_C_OUT_OF_RANGE,
-                  "X[%d] = %g : error : %s\nX : H1=%g He4=%g C12=%g N14=%g O16=%g Fe56=%g\n",
+                  "X[%u] = %g : error : %s\nX : H1=%g He4=%g C12=%g N14=%g O16=%g Fe56=%g\n",
                   i,X[i],s,X[XH1],X[XHe4],X[XC12],X[XN14],X[XO16],X[XFe56]);
 }
 #endif // UNROLL_NUCSYN_LOOPS
diff --git a/src/nucsyn/nucsyn_ensemble.h b/src/nucsyn/nucsyn_ensemble.h
index c12806ead1e7b279514baa7517c1bdde29e47ff6..a3606d0e0c1b6965a8e13484671e3c24437994f6 100644
--- a/src/nucsyn/nucsyn_ensemble.h
+++ b/src/nucsyn/nucsyn_ensemble.h
@@ -4,7 +4,7 @@
 /*
  * The GCE/nucsyn ensemble types.
  *
- * See nucsyn_gce_log.c for details
+ * See nucsyn_ensemble_log.c for details
  */
 
 #define NUCSYN_ENSEMBLE_WNL 0
@@ -431,6 +431,34 @@
 #define NUCSYN_ENSEMBLE_MERGER_BH_Hybrid_HeCOWD 383
 #define NUCSYN_ENSEMBLE_MERGER_Hybrid_HeCOWD_Hybrid_HeCOWD 384
 #define NUCSYN_ENSEMBLE_SN_IA_Hybrid_HeCOWD_subluminous 385
+#define NUCSYN_ENSEMBLE_TZ_M1_LT8 386
+#define NUCSYN_ENSEMBLE_TZ_M1_8_9 387
+#define NUCSYN_ENSEMBLE_TZ_M1_9_10 388
+#define NUCSYN_ENSEMBLE_TZ_M1_10_11 389
+#define NUCSYN_ENSEMBLE_TZ_M1_11_12 390
+#define NUCSYN_ENSEMBLE_TZ_M1_12_13 391
+#define NUCSYN_ENSEMBLE_TZ_M1_13_14 392
+#define NUCSYN_ENSEMBLE_TZ_M1_14_15 393
+#define NUCSYN_ENSEMBLE_TZ_M1_15_16 394
+#define NUCSYN_ENSEMBLE_TZ_M1_16_17 395
+#define NUCSYN_ENSEMBLE_TZ_M1_17_18 396
+#define NUCSYN_ENSEMBLE_TZ_M1_18_19 397
+#define NUCSYN_ENSEMBLE_TZ_M1_19_20 398
+#define NUCSYN_ENSEMBLE_TZ_M1_20_21 399
+#define NUCSYN_ENSEMBLE_TZ_M1_21_22 400
+#define NUCSYN_ENSEMBLE_TZ_M1_22_23 401
+#define NUCSYN_ENSEMBLE_TZ_M1_23_24 402
+#define NUCSYN_ENSEMBLE_TZ_M1_24_25 403
+#define NUCSYN_ENSEMBLE_TZ_M1_25_26 404
+#define NUCSYN_ENSEMBLE_TZ_M1_26_27 405
+#define NUCSYN_ENSEMBLE_TZ_M1_27_28 406
+#define NUCSYN_ENSEMBLE_TZ_M1_28_29 407
+#define NUCSYN_ENSEMBLE_TZ_M1_29_30 408
+#define NUCSYN_ENSEMBLE_TZ_M1_GT30 409
+
+
+
+
 
 #define NUCSYN_ENSEMBLE_MERGER_MATRIX {                                 \
         {196,197,198,199,200,201,202,203,204,205,206,207,208,209,210},  \
@@ -837,11 +865,38 @@
         "NUCSYN_ENSEMBLE_MERGER_NS_Hybrid_HeCOWD", /* 382 */            \
         "NUCSYN_ENSEMBLE_MERGER_BH_Hybrid_HeCOWD", /* 383 */            \
         "NUCSYN_ENSEMBLE_MERGER_Hybrid_HeCOWD_Hybrid_HeCOWD", /* 384 */ \
-        "NUCSYN_ENSEMBLE_SN_IA_Hybrid_HeCOWD_subluminous" /* 385 */ 
+        "NUCSYN_ENSEMBLE_SN_IA_Hybrid_HeCOWD_subluminous", /* 385 */    \
+        "NUCSYN_ENSEMBLE_TZ_M1_LT8", /* 386 */                          \
+        "NUCSYN_ENSEMBLE_TZ_M1_8_9", /* 387 */                          \
+        "NUCSYN_ENSEMBLE_TZ_M1_9_10", /* 388 */                         \
+        "NUCSYN_ENSEMBLE_TZ_M1_10_11", /* 389 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_11_12", /* 390 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_12_13", /* 391 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_13_14", /* 392 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_14_15", /* 393 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_15_16", /* 394 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_16_17", /* 395 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_17_18", /* 396 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_18_19", /* 397 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_19_20", /* 398 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_20_21", /* 399 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_21_22", /* 400 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_22_23", /* 401 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_23_24", /* 402 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_24_25", /* 403 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_25_26", /* 404 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_26_27", /* 405 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_27_28", /* 406 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_28_29", /* 407 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_29_30", /* 408 */                        \
+        "NUCSYN_ENSEMBLE_TZ_M1_GT30" /* 409 */
 
 
-// number of observables
-#define NUCSYN_ENSEMBLE_N 386
+/*
+ * number of observables : this should be one more
+ * than your final ensemble item index
+ */
+#define NUCSYN_ENSEMBLE_N 410
 
 
 #endif // NUCSYN_ENSEMBLE_H
diff --git a/src/nucsyn/nucsyn_gce_log.c b/src/nucsyn/nucsyn_ensemble_log.c
similarity index 93%
rename from src/nucsyn/nucsyn_gce_log.c
rename to src/nucsyn/nucsyn_ensemble_log.c
index 77865e90c4567ff334733a7cea50301eac4783c4..8abc50fe96973f40f9ff37eb65df04c29e765d4e 100644
--- a/src/nucsyn/nucsyn_gce_log.c
+++ b/src/nucsyn/nucsyn_ensemble_log.c
@@ -4,7 +4,7 @@
 
 #include "nucsyn_yield_macros.h"
 
-void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
+void nucsyn_ensemble_log(struct stardata_t * RESTRICT const stardata)
 {
     /* 
      * "Ensemble" stellar population data output.
@@ -27,7 +27,7 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
 
     Ensemble_index k;
     Star_number i;
-    const static int merger_matrix[NUMBER_OF_STELLAR_TYPES-1][NUMBER_OF_STELLAR_TYPES-1] = 
+    const static Ensemble_index merger_matrix[NUMBER_OF_STELLAR_TYPES-1][NUMBER_OF_STELLAR_TYPES-1] = 
         NUCSYN_ENSEMBLE_MERGER_MATRIX;
     Boolean reset_time=FALSE;
 
@@ -83,6 +83,8 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
         }
         
         /* some ensemble variables are rates : treat these differently */
+
+        /* supernovae */
         ensemble_type[NUCSYN_ENSEMBLE_SN_IA_He] = ENSEMBLE_TYPE_RATE;
         ensemble_type[NUCSYN_ENSEMBLE_SN_IA_ELD] = ENSEMBLE_TYPE_RATE;
         ensemble_type[NUCSYN_ENSEMBLE_SN_IA_CHAND] = ENSEMBLE_TYPE_RATE;
@@ -100,21 +102,26 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
         ensemble_type[NUCSYN_ENSEMBLE_SN_AIC_BH] = ENSEMBLE_TYPE_RATE;
         ensemble_type[NUCSYN_ENSEMBLE_SN_BH_NS] = ENSEMBLE_TYPE_RATE;
         ensemble_type[NUCSYN_ENSEMBLE_SN_BH_BH] = ENSEMBLE_TYPE_RATE;
+
+        /* test rate */
         ensemble_type[NUCSYN_ENSEMBLE_TEST_RATE] = ENSEMBLE_TYPE_RATE;
-        
+
+        /* common envelope rates */
         for(i=NUCSYN_ENSEMBLE_COMENV_HG_MERGER;
             i<NUCSYN_ENSEMBLE_COMENV_DETACHED+1;
             i++)
         {
             ensemble_type[i] = ENSEMBLE_TYPE_RATE;
         }
-        
+
+        /* merger rates */
         for(i=NUCSYN_ENSEMBLE_MERGER_INTO_LMMS;
             i<NUCSYN_ENSEMBLE_MERGER_BH_BH+1;
             i++)
         {
             ensemble_type[i] = ENSEMBLE_TYPE_RATE;
         }
+
         /* special case : hybrid COWD mergers */
         for(i=NUCSYN_ENSEMBLE_MERGER_LMMS_Hybrid_HeCOWD;
             i<NUCSYN_ENSEMBLE_MERGER_Hybrid_HeCOWD_Hybrid_HeCOWD+1;
@@ -160,10 +167,18 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
         ensemble_type[NUCSYN_ENSEMBLE_SUPERNOVA_IA_MOMENTUM] = ENSEMBLE_TYPE_RATE;
         ensemble_type[NUCSYN_ENSEMBLE_NOVA_MOMENTUM] = ENSEMBLE_TYPE_RATE;
 
-        int m;
+        /* Thorne-Zytkow formation rates as a function of binary mass */
+        for(i=NUCSYN_ENSEMBLE_TZ_M1_LT8;
+            i<NUCSYN_ENSEMBLE_TZ_M1_GT30+1;
+            i++)
+        {
+            ensemble_type[i] = ENSEMBLE_TYPE_RATE;
+        }
+
+        Stellar_magnitude_index m;
         for(m=0; m<NUMBER_OF_STELLAR_MAGNITUDES; m++)
         {
-            int n = NUCSYN_ENSEMBLE_MAGNITUDE_U+m;      
+            Ensemble_index n = NUCSYN_ENSEMBLE_MAGNITUDE_U + (Ensemble_index)m;      
             ensemble_type[n] = ENSEMBLE_TYPE_MAGNITUDE;
         }
     }
@@ -220,9 +235,9 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
             Dprint("Star %d",i);
             SETstar(i);
             int other = Other_star(i);
-            struct star_t * otherstar = &stardata->star[other];
-            struct star_t * previousstar = &previous_stardata->star[i];
-            struct star_t * previousotherstar = &previous_stardata->star[other];
+            struct star_t * other_star = &stardata->star[other];
+            struct star_t * previous_star = &previous_stardata->star[i];
+            struct star_t * previous_other_star = &previous_stardata->star[other];
         
             /*
              * First set all detections to false.
@@ -605,7 +620,33 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                             supernova_luminous_energy(star);
                         break;
                     case SN_TZ:
+                        /* 
+                         * Thorne-Zytkow object
+                         */
                         ensemble_weight[NUCSYN_ENSEMBLE_SN_TZ]=1.0;
+
+                        /*
+                         * TZ mass distribution
+                         * 
+                         * We use the previous timestep's mass as the TZO mass.
+                         * This neglects mass that is lost in the common envelope 
+                         * merger, so is likely only accurate to ~10%
+                         */
+                        const double MTZ = previous_star->mass + previous_other_star->mass;
+                        const Ensemble_index tzi =
+                            MTZ < 8.0 ? NUCSYN_ENSEMBLE_TZ_M1_LT8 :
+                            MTZ > 30.0 ? NUCSYN_ENSEMBLE_TZ_M1_GT30 :
+                            (NUCSYN_ENSEMBLE_TZ_M1_8_9 +
+                             (Ensemble_index)( Max(0.0, Min(30.0 - 8.0,MTZ - 8.0 ))));
+                        
+                        Dprint("TZ MASSES : PREV %g %g : NOW %g %g : MTZ = %g -> tz index %u\n",
+                               previous_star->mass,
+                               previous_other_star->mass,
+                               star->mass,
+                               other_star->mass,
+                               MTZ,
+                               tzi);
+                        ensemble_weight[tzi] = 1.0;
                         break;
                     case SN_AIC_BH:
                         ensemble_weight[NUCSYN_ENSEMBLE_SN_AIC_BH]=1.0;
@@ -628,8 +669,8 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                  */
                 if(star->Xray_luminosity > TINY)
                 {
-                    if(ON_MAIN_SEQUENCE(otherstar->stellar_type)&&
-                       (otherstar->mass<=2.0))
+                    if(ON_MAIN_SEQUENCE(other_star->stellar_type)&&
+                       (other_star->mass<=2.0))
                     {
                         /*
                          * LMXB
@@ -637,7 +678,7 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                         ensemble_weight[NUCSYN_ENSEMBLE_XRAY_LMXB]=1.0;
                         ensemble_weight[NUCSYN_ENSEMBLE_XRAY_LMXB_LUM]=star->Xray_luminosity;
                     }
-                    else if(WHITE_DWARF(otherstar->stellar_type))
+                    else if(WHITE_DWARF(other_star->stellar_type))
                     {
                         /*
                          * WDXB
@@ -673,7 +714,7 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                      */
                     double magnitudes[NUMBER_OF_STELLAR_MAGNITUDES];
                     stellar_colours(stardata,star,magnitudes);
-                    int m;
+                    Stellar_magnitude_index m;
                     for(m=0; m<NUMBER_OF_STELLAR_MAGNITUDES; m++)
                     {
                         /* 
@@ -920,7 +961,7 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                  */
                 if((star->stellar_type<=TPAGB) &&
                    (C_over_O>1.0) &&
-                   (WHITE_DWARF(otherstar->stellar_type)))
+                   (WHITE_DWARF(other_star->stellar_type)))
                 {
                     if(ON_MAIN_SEQUENCE(star->stellar_type))
                     {
@@ -1006,36 +1047,36 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                         /*
                          * Primary is a white dwarf
                          */
-                        if(WHITE_DWARF(otherstar->stellar_type))
+                        if(WHITE_DWARF(other_star->stellar_type))
                         {
                             /*
                              * WD WD system
                              */
                             ensemble_weight[NUCSYN_ENSEMBLE_WDWD_DD]=1.0;
                         }
-                        else if(otherstar->stellar_type==NS)
+                        else if(other_star->stellar_type==NS)
                         {
                             ensemble_weight[NUCSYN_ENSEMBLE_WDNS_DD]=1.0;
                         }
-                        else if(otherstar->stellar_type==BH)
+                        else if(other_star->stellar_type==BH)
                         {
                             ensemble_weight[NUCSYN_ENSEMBLE_WDBH_DD]=1.0;
                         }
                     }
                     else if(star->stellar_type==NS)
                     {
-                        if(otherstar->stellar_type==NS)
+                        if(other_star->stellar_type==NS)
                         {
                             ensemble_weight[NUCSYN_ENSEMBLE_NSNS_DD]=1.0;
                         }
-                        else if(otherstar->stellar_type==BH)
+                        else if(other_star->stellar_type==BH)
                         {
                             ensemble_weight[NUCSYN_ENSEMBLE_NSBH_DD]=1.0;
                         }
                     }
                     else if(star->stellar_type==BH)
                     {
-                        if(otherstar->stellar_type==BH)
+                        if(other_star->stellar_type==BH)
                         {
                             ensemble_weight[NUCSYN_ENSEMBLE_BHBH_DD]=1.0;
                         }
@@ -1047,35 +1088,35 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                  */
                 Dprint("Cataclysmic variables");
                 if(WHITE_DWARF(star->stellar_type)&&
-                   (otherstar->radius > otherstar->roche_radius)&&
-                   (otherstar->stellar_type<COWD))
+                   (other_star->radius > other_star->roche_radius)&&
+                   (other_star->stellar_type<COWD))
                 {
                     /*
                      * CV
                      */
-                    if(otherstar->stellar_type<=MAIN_SEQUENCE)
+                    if(other_star->stellar_type<=MAIN_SEQUENCE)
                     {
                         /*
                          * Donor on MS: classical CV
                          */
                         ensemble_weight[NUCSYN_ENSEMBLE_CLASSICAL_CV]=1.0;
                     }
-                    else if(otherstar->stellar_type==HERTZSPRUNG_GAP)
+                    else if(other_star->stellar_type==HERTZSPRUNG_GAP)
                     {
                         /*
                          * Donor is HG star: GK Per CV
                          */
                         ensemble_weight[NUCSYN_ENSEMBLE_GK_PER_CV]=1.0;
                     }
-                    else if((otherstar->stellar_type>=GIANT_BRANCH)&&
-                            (otherstar->stellar_type<=TPAGB))
+                    else if((other_star->stellar_type>=GIANT_BRANCH)&&
+                            (other_star->stellar_type<=TPAGB))
                     {
                         /*
                          * Donor is helium-burning: Symbiotic star
                          */
                         ensemble_weight[NUCSYN_ENSEMBLE_SYMBIOTIC_CV]=1.0;
                     }
-                    else if(NAKED_HELIUM_STAR(otherstar->stellar_type))
+                    else if(NAKED_HELIUM_STAR(other_star->stellar_type))
                     {
                         /*
                          * AM CVn systems
@@ -1118,15 +1159,15 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                  */
                 Dprint("Algols");
                 if(ON_MAIN_SEQUENCE(star->stellar_type)&& 
-                   (otherstar->radius > otherstar->roche_radius))
+                   (other_star->radius > other_star->roche_radius))
                 {
-                    if(otherstar->mass/star->mass > 1.0)
+                    if(other_star->mass/star->mass > 1.0)
                     {
                         ensemble_weight[NUCSYN_ENSEMBLE_PRE_ALGOL]=1.0;
                     }
                     else
                     {
-                        if(ON_MAIN_SEQUENCE(otherstar->stellar_type))
+                        if(ON_MAIN_SEQUENCE(other_star->stellar_type))
                         {
                             ensemble_weight[NUCSYN_ENSEMBLE_MS_ALGOL]=1.0;
                         }
@@ -1188,16 +1229,16 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                 {
             
                     if((star->accretion_luminosity>10.0)||
-                       (star->accretion_luminosity>0.01*otherstar->luminosity))
+                       (star->accretion_luminosity>0.01*other_star->luminosity))
                     {
-                        if(otherstar->stellar_type==TPAGB)
+                        if(other_star->stellar_type==TPAGB)
                         {
                             /*
                              * D-type symbiotic
                              */
                             ensemble_weight[NUCSYN_ENSEMBLE_D_TYPE_SYMBIOTIC]=1.0;
                         }
-                        else if(otherstar->stellar_type<TPAGB)
+                        else if(other_star->stellar_type<TPAGB)
                         {
                             /*
                              * S-type symbiotic
@@ -1251,12 +1292,12 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                     previous_stardata->model.sgl==FALSE &&
                 
                     /* companion must be a massless remnant and wasn't last time */
-                    otherstar->stellar_type==MASSLESS_REMNANT &&
-                    previousotherstar->stellar_type!=MASSLESS_REMNANT &&
-                    Is_zero(otherstar->mass) &&
-                    Is_not_zero(previousotherstar->mass);
+                    other_star->stellar_type==MASSLESS_REMNANT &&
+                    previous_other_star->stellar_type!=MASSLESS_REMNANT &&
+                    Is_zero(other_star->mass) &&
+                    Is_not_zero(previous_other_star->mass);
                 
-                if(merged)
+                if(merged && stardata->star[i].stellar_type>=0)
                 {
                     /* 
                      * The stars merged into star i and 
@@ -1264,32 +1305,32 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                      * timestep, so if you want to check 
                      * symmetric mergers, use a and b below.
                      */
-                    Ensemble_index merge_index = NUCSYN_ENSEMBLE_MERGER_INTO_LMMS +
-                        stardata->star[i].stellar_type;
+                    const Ensemble_index merge_index = NUCSYN_ENSEMBLE_MERGER_INTO_LMMS +
+                        (Ensemble_index)stardata->star[i].stellar_type;
 
-                    Dprint("merge index %d from %d,%d -> matrix %d\n",
+                    Dprint("merge index %u from %d,%d -> matrix %u\n",
                            merge_index,
-                           previousstar->stellar_type,
-                           previousotherstar->stellar_type,
-                           merger_matrix[previousstar->stellar_type][previousotherstar->stellar_type] 
+                           previous_star->stellar_type,
+                           previous_other_star->stellar_type,
+                           merger_matrix[previous_star->stellar_type][previous_other_star->stellar_type] 
                         );
                     
                     /* log the merged star's stellar type */
                     ensemble_weight[merge_index] = 1.0;
                 
                     /* log the merging stars' types */
-                    ensemble_weight[merger_matrix[previousstar->stellar_type][previousotherstar->stellar_type]] = 1.0;
+                    ensemble_weight[merger_matrix[previous_star->stellar_type][previous_other_star->stellar_type]] = 1.0;
 
                     /*
                      * Special case : Hybrid COWD mergers
                      */
-                    if(previousstar->hybrid_HeCOWD == TRUE ||
-                       previousotherstar->hybrid_HeCOWD == TRUE)
+                    if(previous_star->hybrid_HeCOWD == TRUE ||
+                       previous_other_star->hybrid_HeCOWD == TRUE)
                     {
                         Ensemble_index hybrid_merge_index;
                         
-                        if(previousstar->hybrid_HeCOWD == TRUE &&
-                           previousotherstar->hybrid_HeCOWD == TRUE)
+                        if(previous_star->hybrid_HeCOWD == TRUE &&
+                           previous_other_star->hybrid_HeCOWD == TRUE)
                         {
                             /*
                              * Both stars are hybrids
@@ -1302,7 +1343,7 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                              * Identify the non-hybrid
                              */
                             struct star_t * non_hybrid =
-                                previousstar->hybrid_HeCOWD == FALSE ? previousstar : previousotherstar;
+                                previous_star->hybrid_HeCOWD == FALSE ? previous_star : previous_other_star;
 
                             /*
                              * Hence the merge index
@@ -1326,8 +1367,8 @@ void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata)
                         /*
                          * Set stars a and b, note that kk is 0 or 1
                          */
-                        a = kk == 0 ? previousstar : previousotherstar;
-                        b = kk == 0 ? previousotherstar : previousstar;
+                        a = kk == 0 ? previous_star : previous_other_star;
+                        b = kk == 0 ? previous_other_star : previous_star;
                                         
                         /*
                          * Special case for Simon Jeffery 
diff --git a/src/nucsyn/nucsyn_initial_abundances.c b/src/nucsyn/nucsyn_initial_abundances.c
index 1cfaa0dd1d28125bc164e2a13ef2f00667cd2376..f4cc257a1981ddc7f3ad824c5b52ddf9536cf936 100644
--- a/src/nucsyn/nucsyn_initial_abundances.c
+++ b/src/nucsyn/nucsyn_initial_abundances.c
@@ -48,7 +48,7 @@ void nucsyn_initial_abundances(Abundance * const X,
      */
     Isotope i;
 
-    Dprint("Set init abunds Z=%g, mix=%d, stardata=%p, X=%p\n",
+    Dprint("Set init abunds Z=%g, mix=%u, stardata=%p, X=%p\n",
            Z,
            mix,
            stardata,
@@ -126,7 +126,7 @@ void nucsyn_initial_abundances(Abundance * const X,
         {
             if(stardata->preferences->the_initial_abundances[i]>-0.5)
             {
-                Dprint("Override (by command line argument) initial abundance of isotope %d to %g\n",
+                Dprint("Override (by command line argument) initial abundance of isotope %u to %g\n",
                        i,
                        stardata->preferences->the_initial_abundances[i]);
                 X[i] = stardata->preferences->the_initial_abundances[i];
@@ -134,7 +134,7 @@ void nucsyn_initial_abundances(Abundance * const X,
 
             if(stardata->preferences->initial_abundance_multiplier[i]>-0.5)
             {
-                fprintf(stderr,"Override (by command line argument multiplier x %g) initial abundance of isotope %d from %g to %g\n",
+                fprintf(stderr,"Override (by command line argument multiplier x %g) initial abundance of isotope %u from %g to %g\n",
                        stardata->preferences->initial_abundance_multiplier[i],
                        i,
                        X[i],
diff --git a/src/nucsyn/nucsyn_macros.h b/src/nucsyn/nucsyn_macros.h
index 254c5ea53f05a9d14aaa2fa39da3dc43ec1607a9..3d024659675085ac10ecf40d3d3b018f14cb3cc6 100644
--- a/src/nucsyn/nucsyn_macros.h
+++ b/src/nucsyn/nucsyn_macros.h
@@ -93,7 +93,7 @@
 
 
 /*
- * Ensemble types (see nucsyn_gce_log.c)
+ * Ensemble types (see nucsyn_ensemble_log.c)
  *
  * These should be unsigned ints
  */
diff --git a/src/nucsyn/nucsyn_network_burn.c b/src/nucsyn/nucsyn_network_burn.c
index 7730e748afa206511aa25265fd009964c49ba7b6..5f1a5a62d9db0306036d06800a148e255e94c080 100644
--- a/src/nucsyn/nucsyn_network_burn.c
+++ b/src/nucsyn/nucsyn_network_burn.c
@@ -153,8 +153,9 @@ double nucsyn_network_burn(double * RESTRICT const Nin,
   
     if(failure_count>NUCSYN_NETWORK_BURN_MAX_FAILURE_COUNT)
     {
-        fprintf(stderr,"warning: failure count %d > recommended max %d in nucsyn_network_burn\n",failure_count,
-                NUCSYN_NETWORK_BURN_MAX_FAILURE_COUNT);
+        fprintf(stderr,"warning: failure count %u > recommended max %u in nucsyn_network_burn\n",
+                failure_count,
+                (unsigned int)NUCSYN_NETWORK_BURN_MAX_FAILURE_COUNT);
     }
 
     return(return_dt);
diff --git a/src/nucsyn/nucsyn_prototypes.h b/src/nucsyn/nucsyn_prototypes.h
index 9786d826dddfe12ac8c3a7856cfef696a5a0d17d..a1c6b888f550d93c422bae72ebab142d8de2d171 100644
--- a/src/nucsyn/nucsyn_prototypes.h
+++ b/src/nucsyn/nucsyn_prototypes.h
@@ -60,10 +60,10 @@ void nucsyn_set_nuc_masses(Nuclear_mass * RESTRICT mnuc,
 			   Nuclear_mass * RESTRICT imnuc,
 			   Nuclear_mass * RESTRICT mnuc_anu,
                            Nuclear_mass * RESTRICT imnuc_anu,
-			   double * RESTRICT molweight,
+			   Molecular_weight * RESTRICT molweight,
                            double * RESTRICT ZonA,
                            Atomic_number * RESTRICT atomic_number,
-			   int * RESTRICT nucleon_number);
+			   Nucleon_number * RESTRICT nucleon_number);
 
 double Pure_function nucsyn_molecular_weight(const Abundance * RESTRICT X,
                                              const struct stardata_t * RESTRICT const stardata,
@@ -363,7 +363,7 @@ void nucsyn_planetary_nebulae(const struct stardata_t * RESTRICT const stardata,
 void nucsyn_set_abunds_array(Abundance * RESTRICT const array,
 			     const Abundance c);
 
-void nucsyn_gce_log(struct stardata_t * RESTRICT const stardata);
+void nucsyn_ensemble_log(struct stardata_t * RESTRICT const stardata);
 		   
 
 #ifdef NUCSYN_CEMP_LOGGING
@@ -540,7 +540,7 @@ void nucsyn_huge_pulse(struct star_t * RESTRICT const star,
 
 void nucsyn_check_abundance_array(struct stardata_t * RESTRICT const stardata,
                                   const Abundance * RESTRICT const X,
-                                  const char * RESTRICT s);
+                                  const char * RESTRICT const s);
 #ifdef LITHIUM_TABLES
 void nucsyn_lithium(struct star_t * RESTRICT const star,
 		    struct stardata_t * RESTRICT const stardata);
diff --git a/src/nucsyn/nucsyn_set_1st_dup_abunds.c b/src/nucsyn/nucsyn_set_1st_dup_abunds.c
index 1293f42825fc4aeda690effe950f300a1d65a1db..9b3a0b590c233fb622a26cd353e128720824f9de 100644
--- a/src/nucsyn/nucsyn_set_1st_dup_abunds.c
+++ b/src/nucsyn/nucsyn_set_1st_dup_abunds.c
@@ -159,14 +159,14 @@ void nucsyn_set_1st_dup_abunds(Abundance * RESTRICT const X,
      * Correct CNO changes due to accretion by scaling everything 
      * to current total CNO (relative to initial CNO) 
      */
-    double cno_zams=FDUP_CNOTOT(stardata->common.XZAMS);
+    Abundance cno_zams=FDUP_CNOTOT(stardata->common.XZAMS);
   
 #ifdef NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION_FROM_TAMS
     /*
      * Use the TAMS abundances as the correction: this is more
      * correct, and works well if the accretion layer is small.
      */
-    double cno_now=FDUP_CNOTOT(star->XTAMS);
+    Abundance cno_now=FDUP_CNOTOT(star->XTAMS);
     double fc=cno_now/cno_zams;
     Dprint("# First DUP CNO enhancement factors fc=%g (CNO ZAMS=%g envelope=%g TAMS=%g: we are using %g)\n",fc,cno_zams,FDUP_CNOTOT(star->Xenv),FDUP_CNOTOT(star->XTAMS),cno_now);
 #else
@@ -174,7 +174,7 @@ void nucsyn_set_1st_dup_abunds(Abundance * RESTRICT const X,
      * Otherwise, assume the abundances now are ~ those which were at the
      * TAMS, which is true if thermohaline mixing is efficient.
      */
-    double cno_now=FDUP_CNOTOT(star->Xenv);
+    Abundance cno_now=FDUP_CNOTOT(star->Xenv);
     double fc=cno_now/cno_zams;
     Dprint("# First DUP CNO enhancement factors fc=%g (CNO ZAMS=%g envelope=%g : we are using %g)\n",fc,cno_zams,FDUP_CNOTOT(star->Xenv),cno_now);
 #endif // NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION_FROM_TAMS
diff --git a/src/nucsyn/nucsyn_set_nuc_masses.c b/src/nucsyn/nucsyn_set_nuc_masses.c
index c2b189b6bdbbecacd283644b65256821e1c5a2be..303d0a281f72be77c2948b242b19a8ad7f5dced3 100644
--- a/src/nucsyn/nucsyn_set_nuc_masses.c
+++ b/src/nucsyn/nucsyn_set_nuc_masses.c
@@ -7,10 +7,10 @@ void nucsyn_set_nuc_masses(Nuclear_mass * RESTRICT mnuc,
                            Nuclear_mass * RESTRICT imnuc,
                            Nuclear_mass * RESTRICT mnuc_amu, // (as mnuc /= AMU_GRAMS)
                            Nuclear_mass * RESTRICT imnuc_amu, 
-                           double * RESTRICT  molweight,
+                           Molecular_weight * RESTRICT  molweight,
                            double * RESTRICT ZonA,
                            Atomic_number * RESTRICT atomic_number,
-                           int * RESTRICT nucleon_number)
+                           Nucleon_number * RESTRICT nucleon_number)
 {
     static const char s[][10]=NUCSYN_SHORT_ELEMENT_STRINGS;
     Isotope i;
@@ -31,10 +31,10 @@ void nucsyn_set_nuc_masses(Nuclear_mass * RESTRICT mnuc,
             {
                 Isotope j = i==0 ? 0 : i-1;
                 fprintf(stderr,
-                        "Nuclear mass of isotope %d is zero : everything will fail :( ... previous isotope is %d which is %s%d\n",
+                        "Nuclear mass of isotope %u is zero : everything will fail :( ... previous isotope is %u which is %s%d\n",
                         i,j,s[atomic_number[j]],nucleon_number[j]);
             }
-            const double temp = 1.0 / mnuc[i];
+            const Nuclear_mass temp = 1.0 / mnuc[i];
             const double Z = (double) atomic_number[i];
 
             imnuc[i] = temp;
diff --git a/src/perl/modules_targz/Binning-0.03.tar.gz b/src/perl/modules_targz/Binning-0.03.tar.gz
index f37166fd574d07d9517914dcacbbae1387141b10..b96d57ae42e0522d024c243caa35d7568780478f 100644
Binary files a/src/perl/modules_targz/Binning-0.03.tar.gz and b/src/perl/modules_targz/Binning-0.03.tar.gz differ
diff --git a/src/perl/modules_targz/Data-Serializer-RobJSON-0.05.tar.gz b/src/perl/modules_targz/Data-Serializer-RobJSON-0.05.tar.gz
index 318da5f6ae590ebfe09072fb3362d796aa1872b1..808feaab48d1f00464e88662f1960cd10567584d 100644
Binary files a/src/perl/modules_targz/Data-Serializer-RobJSON-0.05.tar.gz and b/src/perl/modules_targz/Data-Serializer-RobJSON-0.05.tar.gz differ
diff --git a/src/perl/modules_targz/Hash-RobMerge-0.14.tar.gz b/src/perl/modules_targz/Hash-RobMerge-0.14.tar.gz
index 977f1d8fa0fe27a80a42bfff13db8b556be47470..c0d013695d95423c4e3a82e03191229883c0ac33 100644
Binary files a/src/perl/modules_targz/Hash-RobMerge-0.14.tar.gz and b/src/perl/modules_targz/Hash-RobMerge-0.14.tar.gz differ
diff --git a/src/perl/modules_targz/Histogram-0.01.tar.gz b/src/perl/modules_targz/Histogram-0.01.tar.gz
index f27f12195efb1d860ff62582f353f82945a5a377..69578444a40d8c607c050eb6b3d6bdab8f3abb13 100644
Binary files a/src/perl/modules_targz/Histogram-0.01.tar.gz and b/src/perl/modules_targz/Histogram-0.01.tar.gz differ
diff --git a/src/perl/modules_targz/IMF-0.05.tar.gz b/src/perl/modules_targz/IMF-0.05.tar.gz
index 090588039b9cfbd1c2eb23989698b14ec8760f1e..e9f0fa98f8742fa098f6a01b8f12552d2f12b9cd 100644
Binary files a/src/perl/modules_targz/IMF-0.05.tar.gz and b/src/perl/modules_targz/IMF-0.05.tar.gz differ
diff --git a/src/perl/modules_targz/Maths_Double-0.01.tar.gz b/src/perl/modules_targz/Maths_Double-0.01.tar.gz
index f83ffa8a1e8250dfee1f99ec8bda6121b4bf5721..0f1b21f719c923b901dbde585160ef4edcaa5d56 100644
Binary files a/src/perl/modules_targz/Maths_Double-0.01.tar.gz and b/src/perl/modules_targz/Maths_Double-0.01.tar.gz differ
diff --git a/src/perl/modules_targz/RobInterpolation-0.04.tar.gz b/src/perl/modules_targz/RobInterpolation-0.04.tar.gz
index d54bde03485137bbe8bf1811f08aaac9392c4965..50bba03fc43ef5ca92ff27942b0fdcbacab88f94 100644
Binary files a/src/perl/modules_targz/RobInterpolation-0.04.tar.gz and b/src/perl/modules_targz/RobInterpolation-0.04.tar.gz differ
diff --git a/src/perl/modules_targz/binary_grid-v2.1.1.tar.gz b/src/perl/modules_targz/binary_grid-v2.1.1.tar.gz
index 89b6af93b34919819a83e7fc01fc53bfb3698a07..aa112c2b78aeeb53655e0a48a34788fae41405ae 100644
Binary files a/src/perl/modules_targz/binary_grid-v2.1.1.tar.gz and b/src/perl/modules_targz/binary_grid-v2.1.1.tar.gz differ
diff --git a/src/perl/modules_targz/binary_stars-0.05.tar.gz b/src/perl/modules_targz/binary_stars-0.05.tar.gz
index 7687056197f311c5a37dfd3e9884ade13e5bc4bb..696207911b71bf1be16b753cd24a71ce4ceecce7 100644
Binary files a/src/perl/modules_targz/binary_stars-0.05.tar.gz and b/src/perl/modules_targz/binary_stars-0.05.tar.gz differ
diff --git a/src/perl/modules_targz/cosmology-0.01.tar.gz b/src/perl/modules_targz/cosmology-0.01.tar.gz
index 2f5386f6e0efaf2a9ac795c4a0f72d0e04f027ea..40bee5119900bad05cdeebf9fe8bebefa99b4021 100644
Binary files a/src/perl/modules_targz/cosmology-0.01.tar.gz and b/src/perl/modules_targz/cosmology-0.01.tar.gz differ
diff --git a/src/perl/modules_targz/distribution_functions-0.05.tar.gz b/src/perl/modules_targz/distribution_functions-0.05.tar.gz
index a36d9d5e00bb17d552c5812d328731d98e47b25c..b329ce29f634222ba7e6018efe09a3aa61f8f250 100644
Binary files a/src/perl/modules_targz/distribution_functions-0.05.tar.gz and b/src/perl/modules_targz/distribution_functions-0.05.tar.gz differ
diff --git a/src/perl/modules_targz/rob_misc-0.15.tar.gz b/src/perl/modules_targz/rob_misc-0.15.tar.gz
index b2819f3355b0cfa4fc374f250d9f26a449187cf5..3cd1092333c1e4ba10746479ffd5449f2ebd779c 100644
Binary files a/src/perl/modules_targz/rob_misc-0.15.tar.gz and b/src/perl/modules_targz/rob_misc-0.15.tar.gz differ
diff --git a/src/perl/modules_targz/robqueue-0.05.tar.gz b/src/perl/modules_targz/robqueue-0.05.tar.gz
index 0c0a4f1d7e3e8d7f9c6e6d6ad1562ab0decf2ee7..64e5f0bdb54899fdc6bbb41038ef669c70a13992 100644
Binary files a/src/perl/modules_targz/robqueue-0.05.tar.gz and b/src/perl/modules_targz/robqueue-0.05.tar.gz differ
diff --git a/src/perl/modules_targz/spacing_functions-0.02.tar.gz b/src/perl/modules_targz/spacing_functions-0.02.tar.gz
index 89d3c8723a69d2b731d40c3f33b59aa49dbbaf9e..09ce952e80403273bb11543d01b3c3944745ffdd 100644
Binary files a/src/perl/modules_targz/spacing_functions-0.02.tar.gz and b/src/perl/modules_targz/spacing_functions-0.02.tar.gz differ
diff --git a/src/perl/scripts2/ZW2019.pl b/src/perl/scripts2/ZW2019.pl
new file mode 100755
index 0000000000000000000000000000000000000000..6abf7e2b5eee2d11a3a98cdbc0914a8f808c0d50
--- /dev/null
+++ b/src/perl/scripts2/ZW2019.pl
@@ -0,0 +1,366 @@
+#!/usr/bin/env perl
+use strict; # recommended
+use 5.16.0; # recommended
+use binary_grid2; # required
+use binary_grid::C; # backend : C or Perl
+use rob_misc qw/ncpus/;
+use IO::Handle;
+############################################################
+#
+# Example script to demonstrate how to use the
+# binary_grid2 module.
+#
+# For full documentation, please see binary_grid2.pdf
+# in the doc/ directory of binary_c
+#
+############################################################
+
+# number of computational threads to launch, usually one 
+# per CPU
+my $nthreads = rob_misc::ncpus();
+############################################################
+# Binary_c should output data that we can understand. There
+# are two ways to do this:
+#
+# 1) Put output statements, using PRINTF, in binary_c's
+#    log_every_timestep() function.
+#
+# 2) Put output statements, using PRINTF, into the C_logging_code
+#    grid option
+#
+#  $population->set( C_logging_code => ' PRINTF("...\n"); ');
+#
+#    You have access to the stardata variable, so you can
+#    output everything that is available to log_every_timestep();
+#
+############################################################
+# make a new stellar population
+my $population = binary_grid2->new(
+    # options can be given now ... 
+    metallicity => 0.02, # mass fraction of "metals"
+    max_evolution_time => 15000, # Myr
+
+    # gamma :
+    # -1 = RLOF_NONCONSERVATIVE_GAMMA_DONOR
+    # -2 = RLOF_NONCONSERVATIVE_GAMMA_ISOTROPIC
+    #nonconservative_angmom_gamma => 'RLOF_NONCONSERVATIVE_GAMMA_DONOR',
+
+    nthreads=>$nthreads, # number of threads
+    );
+
+# ... or options can be set manually later.
+$population->set(
+    vb=>1, # turn on verbose logging (can be 0,1,2...)
+    return_array_refs=>1, # quicker data parsing mode
+    log_args=>1,
+    sort_args=>1,
+    save_args=>1,
+    log_args_dir=>'/tmp',
+    threads_entry_function_pointer => \&thread_entry,
+    threads_flush_function_pointer => \&thread_flush,
+#    log_filename => '/dev/stdout',
+#    api_log_filename_prefix => '/dev/null',
+    
+## or enter more complicated code yourself:
+#       
+#    C_logging_code => '
+#             PRINTF("MY_STELLAR_DATA %g %g %g %g\n",
+#                 stardata->model.time,
+#                 stardata->star[0].mass,
+#                 stardata->model.probability,
+#                 stardata->model.dt);
+#                       '
+    );
+
+$population->require_on(
+    'ZW2019_SNIA_LOG'
+    );
+
+
+############################################################
+# scan command line arguments for extra options
+$population->parse_args();     
+
+############################################################
+#
+# Now we set up the physics of the stellar evolution and
+# population runs
+#
+#
+# duplicity is 0 for single stars, 1 for binary stars
+# and 2 for a mixed population sampled at equal times
+my $duplicity = 1;
+
+my $mmin = 0.8; # 0.8 for the run, 0.1 for the whole population
+my $mmax = 8.0; # 8 for the run, 80 for the whole population
+
+if($duplicity == 0)
+{
+    # make a grid of $nstars single binary stars, log-spaced,
+    # with masses between $mmin and $mmax
+    my $nstars = 100;
+    $population->add_grid_variable(
+        'name'       => 'lnm1', 
+        'longname'   =>'Primary mass', 
+        'range'      =>[log($mmin),log($mmax)],
+        'resolution' => $nstars, # just a counter for the grid
+        'spacingfunc'=>"const(log($mmin),log($mmax),$nstars)",
+        'precode'    =>'$m1=exp($lnm1);',
+        'probdist'   =>'Kroupa2001($m1)*$m1',
+        'dphasevol'  =>'$dlnm1',
+        );
+}
+elsif($duplicity == 1)
+{
+    # make a population of binary stars
+    my $res = 100;
+    my $resolution = {
+        m1 => $res,
+        q => $res,
+        P => $res
+    };
+    $population->{_grid_options}{binary} = 1;
+    
+    $population->add_grid_variable
+        (
+        'name'       => 'lnm1', 
+        'longname'   =>'Primary mass', 
+        'range'      =>[log($mmin),log($mmax)],
+        'resolution' => $resolution->{m1},
+        'spacingfunc'=>"const(log($mmin),log($mmax),$resolution->{m1})",
+        'precode'    =>'$m1=exp($lnm1);',
+        'probdist'   =>'Kroupa2001($m1)*$m1',
+        'dphasevol'  =>'$dlnm1',
+        );
+    # q=M1/M2 distribution flat in q between 0.1/M1 and 1.0
+    $population->add_grid_variable
+        (
+        'condition'  =>'$self->{_grid_options}{binary}==1',
+        'name'       =>'q',
+        'longname'   =>'Mass ratio',
+        'range'      =>['0.1/$m1',1.0],
+         'resolution'=>$resolution->{q},
+        'spacingfunc'=>"const(0.1/\$m1,1.0,$resolution->{q})",
+        'probdist'   =>"flatsections\(\$q,\[
+\{min=>0.1/\$m1,max=>0.8,height=>1.0\},
+\{min=>0.8,max=>1.0,height=>1.0\},
+\]\)",
+        precode     =>'$m2=$q*$m1;',
+        dphasevol   =>'$dq',
+        );
+     # orbital period Duquennoy and Mayor 1991 distribution
+     $population->add_grid_variable
+         (
+          'name'       =>'logper',
+          'longname'   =>'log(Orbital_Period)',
+          'range'      =>[-2.0,12.0],
+          'resolution' =>$resolution->{P},
+          'spacingfunc'=>"const(-1.0,10.0,$resolution->{P})",
+          'precode'=>"\$per = 10.0 ** \$logper;
+my \$eccentricity = 0.0;
+\$sep=calc_sep_from_period(\$m1,\$m2,\$per) if(defined \$m1 && defined \$m2);
+",
+          'probdist'=>"gaussian(\$logper,4.8,2.3,-2.0,12.0)",
+          'dphasevol'=>'$dln10per'
+         );
+}
+else
+{
+    # Make a mixed population of single and binary stars
+    # with equal sampling in equal times.
+    my $dt = 100.0;
+    $population->set(
+        time_adaptive_mass_grid_step => $dt,
+        );
+    my $sampling_factor = 0.5; # deliberate oversampling (<0.5)
+    my $time_adaptive_options = {
+        max_evolution_time =>
+            $population->{_bse_options}{max_evolution_time},
+        stellar_lifetime_table_nm=>1000,
+        time_adaptive_mass_grid_log10_time=>0,
+        time_adaptive_mass_grid_step=>$dt,
+        time_adaptive_mass_grid_nlow_mass_stars=>10,
+        nthreads           =>$nthreads,
+        thread_sleep       =>1,
+        mmin               =>0.1,
+        mmax               =>80.0,
+        mass_grid_log10_time=>0,
+        mass_grid_step      =>$dt*$sampling_factor,
+        extra_flash_resolution=>0, # 1 = broken?
+        mass_grid_nlow_mass_stars=>10,
+        debugging_output_directory=>'/tmp',
+        max_delta_m         =>1.0,
+        savegrid            =>1,
+        vb                  =>0,
+        metallicity=>$population->{_bse_options}{metallicity},
+        agbzoom             =>0,
+    };
+    distribution_functions::bastard_distribution(
+        $population, {
+            mmin         =>0.1,
+            mmax         =>80.0,
+            m2min        =>0.1,
+            nm2          =>10,
+            nper         =>10,
+            qmin         =>0.0,
+            qmax         =>1.0,
+            necc         =>undef,
+            useecc       =>undef,
+            agbzoom      =>0,
+            time_adaptive=>$time_adaptive_options,
+        });
+}
+
+############################################################
+# link population to custom data parser function
+$population->set(
+    parse_bse_function_pointer => \&main::parse_data
+    );
+
+my %init = $population->initial_abundance_hash('Karakas2002',0.02);
+my %isotope_hash = $population->isotope_hash();
+my @isotope_list = $population->isotope_list();
+my %nuclear_mass_hash = $population->nuclear_mass_hash();
+my @nuclear_mass_list = $population->nuclear_mass_list();
+my @sources = $population->source_list();
+my @ensemble = $population->ensemble_list();
+
+# you can use Data::Dumper to see the contents
+# of the above lists and hashes
+if(0){
+    print Data::Dumper->Dump([
+        #\%init,
+        #\%isotope_hash,
+        #\@isotope_list,
+        #\%nuclear_mass_hash,
+        \@nuclear_mass_list,
+        #\@sources,
+        #\@ensemble
+                         ]);
+}
+
+if(0)
+{
+    my $h = 
+        $population->run_gridcode_fast(
+            {
+                keep_probabilities=>1,
+                keep_phasevol=>1,
+                system_code=>'$h->{mass_into_stars} += ($m1+$m2)*$prob;',
+            }
+        );
+    print "Mass into $h->{starcount} stars $h->{mass_into_stars}\n";
+    exit;
+}
+
+# uncomment this to show version information
+#print $population->evcode_version_string();
+
+# uncomment this to show the evcode's args list
+#print join("\n",@{$population->evcode_args_list()});
+
+# evolution the stellar population (this takes some time)
+$population->evolve();
+
+# output the data
+output($population);
+
+# done : exit
+exit;
+
+############################################################
+# subroutines 
+############################################################
+
+sub parse_data
+{
+    my ($population, $results) = @_;
+
+    my $ZW_data;
+    while(1)
+    {
+        # subsequent calls to tbse_line contain
+        # (references to) arrays of data 
+        my $la = $population->tbse_line();
+        
+        # first element is the "header" line
+        my $header = shift @$la;
+        
+        # break out of the look if this is 'fin'
+        last if ($header eq 'fin');
+
+        # check if $header matches one of your
+        # expected data lines, if so, act
+        if($header eq 'ZW2019')
+        {
+            if(defined $ZW_data)
+            {
+                $ZW_data .= "@$la\n";
+            }
+            else
+            {
+                $ZW_data = "@$la\n";
+            }
+        }
+    }
+
+    if(defined $ZW_data)
+    {
+        #print {$population->{_ZW_file}} "\n",$population->{_grid_options}->{args},"\n";
+        print {$population->{_ZW_file}} $ZW_data,"\n";
+    }
+}
+
+
+
+
+sub thread_entry
+{
+    my ($population) = @_;
+    print "Thread entry $population\n";
+    my $fname = '/tmp/ZW_data.'.$population->flexigrid_thread_number(); 
+    open($population->{_ZW_file}, '>', $fname) || die("cannot open $fname");
+    $population->{_ZW_file}->autoflush(1);
+    print "opened $fname\n";
+    $population->{_ZW_fname} = $fname;
+}
+
+sub thread_flush
+{
+    my ($population) = @_;
+    # close ZW_data file
+    print "close $population->{_ZW_fname}\n";
+    close($population->{_ZW_file});
+}
+
+############################################################
+
+sub output
+{
+    my ($population) = @_;
+
+    # $results is a hash reference containing
+    # the results that were added up in parse_data()
+    my $results = $population->results;
+
+    my $version_string = $population->commented_evcode_version_string();
+    my $info_string = $population->commented_infostring();
+    my $outfile = ("@ARGV"=~/datafile=(\S+)/)[0] // '/tmp/ZW_data';
+    
+    # prepend with run and version information
+    open(my $ZWout,'>',$outfile)||die("cannot open $outfile for writing");
+    print {$ZWout} $version_string,"\n#\n#\n#\n",$info_string,"\n\n\n";
+    close $ZWout;
+
+    # join the data from each thread
+    my $cat = 'cat ';
+    foreach my $n (0..$nthreads)
+    {
+        $cat .= '/tmp/ZW_data.'.$n.' ';
+    }
+    $cat .= ' >> '.$outfile;
+    print "Running $cat\n";
+    `$cat`;
+    print "See $outfile\n";
+    
+}
diff --git a/src/perl/scripts2/template.pl b/src/perl/scripts2/template.pl
index afcccfe40b2a3861344bfe0306c42b84855f0672..dfb9c923ecb446191b7954164b266d9483cd95a4 100755
--- a/src/perl/scripts2/template.pl
+++ b/src/perl/scripts2/template.pl
@@ -24,9 +24,34 @@ my $nthreads = rob_misc::ncpus();
 # are two ways to do this:
 #
 # 1) Put output statements, using PRINTF, in binary_c's
-#    log_every_timestep() function.
+#    log_every_timestep() function. This requires a rebuild
+#    of libbinary_c.so and a reinstall of the binary_grid module
+#    every time you change the PRINTF statement.
 #
-# 2) Put output statements, using PRINTF, into the C_logging_code
+#
+# 2) Put a list of hashes in the C_auto_logging grid option
+#
+#  $population->set(
+#    C_auto_logging => {
+#        'MY_STELLAR_DATA' =>
+#            [
+#             'model.time',
+#             'star[0].mass',
+#             'model.probability',
+#             'model.dt'
+#            ]
+#    });
+#
+#  where MY_STELLAR_DATA is the key of the hash {...} and is also 
+#  the header matched in the parse_data function (below). The list [...] 
+#  contains the names of the variables to be output, which are all
+#  assumed to be in stardata.
+#
+#  This option does not require a rebuild of libbinary_c.so or a
+#  reinstall of binary_grid.
+#
+#
+# 3) Put output statements, using PRINTF, into the C_logging_code
 #    grid option
 #
 #  $population->set( C_logging_code => ' PRINTF("...\n"); ');
@@ -34,6 +59,9 @@ my $nthreads = rob_misc::ncpus();
 #    You have access to the stardata variable, so you can
 #    output everything that is available to log_every_timestep();
 #
+#  This option does not require a rebuild of libbinary_c.so or a
+#  reinstall of binary_grid.
+#
 ############################################################
 # make a new stellar population
 my $population = binary_grid2->new(
@@ -51,6 +79,7 @@ $population->set(
     sort_args=>1,
     save_args=>1,
     log_args_dir=>'/tmp',
+    #log_dt_secs=>1,
     C_auto_logging => {
         'MY_STELLAR_DATA' =>
             [
@@ -84,13 +113,13 @@ $population->parse_args();
 #
 # duplicity is 0 for single stars, 1 for binary stars
 # and 2 for a mixed population sampled at equal times
-my $duplicity = 0;
+my $duplicity = 1;
 
 if($duplicity == 0)
 {
     # make a grid of $nstars single binary stars, log-spaced,
     # with masses between $mmin and $mmax
-    my $nstars = 100;
+    my $nstars = 1000000;
     my $mmin = 0.1;
     my $mmax = 80.0;
     $population->add_grid_variable(
@@ -144,18 +173,19 @@ elsif($duplicity == 1)
         dphasevol   =>'$dq',
         );
      # orbital period Duquennoy and Mayor 1991 distribution
-     $population->add_grid_variable
+    my $Prange = [-2.0,12.0];
+    $population->add_grid_variable
          (
           'name'       =>'logper',
           'longname'   =>'log(Orbital_Period)',
-          'range'      =>[-2.0,12.0],
+          'range'      =>$Prange,
           'resolution' =>$resolution->{P},
-          'spacingfunc'=>"const(-1.0,10.0,$resolution->{P})",
+          'spacingfunc'=>"const($Prange->[0],$Prange->[1],$resolution->{P})",
           'precode'=>"\$per = 10.0 ** \$logper;
 my \$eccentricity = 0.0;
 \$sep=calc_sep_from_period(\$m1,\$m2,\$per) if(defined \$m1 && defined \$m2);
 ",
-          'probdist'=>"gaussian(\$logper,4.8,2.3,-2.0,12.0)",
+          'probdist'=>"gaussian(\$logper,4.8,2.3,$Prange->[0],$Prange->[1])",
           'dphasevol'=>'$dln10per'
          );
 }
@@ -244,7 +274,7 @@ if(0){
 $population->evolve();
 
 # output the data
-output($population);
+#output($population);
 
 # done : exit
 exit;
diff --git a/src/setup/argument_setting_functions.c b/src/setup/argument_setting_functions.c
index 41a674d030ebd9c629211c809885cc1814706ad8..52f385eb808c6876ff7c0c07901bd17b234bd403 100644
--- a/src/setup/argument_setting_functions.c
+++ b/src/setup/argument_setting_functions.c
@@ -3,7 +3,8 @@
 /*
  * Functions to set non-standard arguments
  */
-
+static char * arg_variable_default_string(
+    const struct cmd_line_arg_t * RESTRICT const arg);
 
 
 void binary_c_warmup_cpu(ARG_SUBROUTINE_DECLARATION)
@@ -50,6 +51,102 @@ void No_return binary_c_speedtests(ARG_SUBROUTINE_DECLARATION)
 }
 
 
+
+static char * arg_variable_default_string(
+    const struct cmd_line_arg_t * RESTRICT const a)
+{
+    /*
+     * Return a string of the default value.
+     *
+     * Returns "subroutine" for ARG_SUBROUTINE* types.
+     */
+    char * c;
+    if(a->pointer != NULL)
+    {
+        if(Arg_is_subroutine(a->type))
+        {
+            if(asprintf(&c,
+                        "%s",
+                        "Subroutine")<=0)
+            {
+                c = NULL;
+            }
+        }
+        else if(a->type == ARG_INTEGER)
+        {
+            if(asprintf(&c,
+                        "%d",
+                        *((int*)a->pointer))<=0)
+            {
+                c = NULL;
+            }
+        }
+        else if(a->type == ARG_UNSIGNED_INTEGER)
+        {
+            if(asprintf(&c,
+                        "%u",
+                        *((unsigned int*)a->pointer))<=0)
+            {
+                c = NULL;
+            }
+        }
+        else if(a->type == ARG_LONG_INTEGER)
+        {
+            if(asprintf(&c,
+                        "%ld",
+                        *((long int*)a->pointer))<=0)
+            {
+                c = NULL;
+            }
+        }        
+        else if(a->type == ARG_FLOAT)
+        {
+            if(asprintf(&c,
+                        "%g",
+                        *((double*)a->pointer))<=0)
+            {
+                c = NULL;
+            }
+        }
+        else if(a->type == ARG_BOOLEAN ||
+                a->type == ARG_NOT_BOOLEAN)
+        {
+            if(asprintf(&c,
+                        "%s",
+                        Truefalse(*((Boolean*)a->pointer)))<=0)
+            {
+                c = NULL;
+            }
+        }
+        else if(a->type == ARG_STRING)
+        {
+            if(asprintf(&c,
+                        "%s",
+                        ((char*)a->pointer))<=0)
+            {
+                c = NULL;
+            }
+        }
+        else
+        {
+            c = NULL;
+        }
+    }
+
+    /*
+     * NULL pointer should give string "NULL"
+     */
+    if(c == NULL)
+    {
+        if(asprintf(&c,"NULL") <=0)
+        {
+            c = NULL;
+        }
+    }
+        
+    return c;
+}
+
 void No_return binary_c_help(ARG_SUBROUTINE_DECLARATION)
 {
 
@@ -89,11 +186,15 @@ void No_return binary_c_help(ARG_SUBROUTINE_DECLARATION)
 		{
                     /*
                      * Found matching help exactly
-                     */                    
-		    Printf("binary_c help for variable : %s <%s>\n\n%s\n\n",
-			   next,
+                     */
+                    char * default_string = arg_variable_default_string(a);
+                    Printf("binary_c help for variable : %s <%s>\n\n%s\n\nDefault : %s\n",
+                           next,
                            Argtypestring(a->type),
-                           a->help);
+                           a->help,
+                           default_string
+                        );
+                    Safe_free(default_string);
                     if(a->npairs > 0)
                     {
                         unsigned int j;
@@ -153,7 +254,7 @@ void No_return binary_c_help_all(ARG_SUBROUTINE_DECLARATION)
 		Printf("%s : %s : %s\n",
 		       cmd_line_args[i].name,
 		       cmd_line_args[i].help,
-		       cmd_line_args[i].default_value);
+		       cmd_line_args[i].wtts_string);
 	    }
 	}
     }
@@ -211,42 +312,35 @@ void list_available_args(ARG_SUBROUTINE_DECLARATION)
     *c=-1;
     int xint;
     double xdouble;
+    char * cc;
     for(i=0;i<arg_count;i++)
     {
-        if(! Arg_is_batch(cmd_line_args[i].type))
+        struct cmd_line_arg_t * a = &cmd_line_args[i]; 
+        if(! Arg_is_batch(a->type))
         {
-            Printf("%s = ",cmd_line_args[i].name);
-            if(cmd_line_args[i].pointer == NULL)
+            Printf("%s = ",a->name);
+            if(a->pointer == NULL)
             {
                 Printf("NULL");
             }
             else
             {
-                switch(cmd_line_args[i].type)
+                switch(a->type)
                 {
                 case ARG_NONE:
                     /* do nothing */
                     break;
                 case ARG_FLOAT:
-                    Printf("%g",*((double*) cmd_line_args[i].pointer));
-                    break;
                 case ARG_INTEGER:
                 case ARG_UNSIGNED_INTEGER:
-                    /* integer argument */
-                    Printf("%d",*((int*)cmd_line_args[i].pointer));
-                    break; 
                 case ARG_LONG_INTEGER:
-                    /* long integer argument */
-                    Printf("%ld",*((long int*)cmd_line_args[i].pointer));
-                    break;
+                case ARG_STRING:
                 case ARG_BOOLEAN:
                 case ARG_NOT_BOOLEAN:
-                    Printf("%s",
-                           (*((Boolean*)cmd_line_args[i].pointer)==TRUE ? "TRUE" : "FALSE"));
-                    break;
-                case ARG_STRING:
-                    /* string argument : NB no bounds checking! */
-                    Printf("%s",(char*)cmd_line_args[i].pointer);
+                    
+                     cc = arg_variable_default_string(a);
+                    Printf("%s",cc);
+                    Safe_free(cc);
                     break;
                 case ARG_SUBROUTINE_RETURN_FLOAT:
                     Arg_value_subroutine(xdouble,double);
@@ -293,18 +387,6 @@ void No_return dumpversion(ARG_SUBROUTINE_DECLARATION)
 }
 
 
-
-double set_metallicity(ARG_SUBROUTINE_DECLARATION)
-{
-    if(*c>=0)
-    {
-        (*c)++;
-        stardata->common.metallicity = atof(argv[*c]);
-    }
-    Clamp(stardata->common.metallicity,1e-4,0.03);
-    return stardata->common.metallicity;
-}
-
 void set_init_abund_mult(ARG_SUBROUTINE_DECLARATION)
 {
     (*c)++;
diff --git a/src/setup/batchmode.c b/src/setup/batchmode.c
index 961edca45e580c7bab8da761e4284b53a09147ee..7b4e14dd98f31fe15b68df350707d9d411359c9a 100644
--- a/src/setup/batchmode.c
+++ b/src/setup/batchmode.c
@@ -105,7 +105,7 @@ void batchmode_reset_prefs(ARG_SUBROUTINE_DECLARATION)
     // reset preferences
     if(stardata->preferences->batchmode==BATCHMODE_ON_AND_ECHO) 
         printf("Reset preferences\n");
-    reset_preferences(stardata->preferences);
+    set_default_preferences(stardata->preferences);
 }
 
 #endif//BATCHMODE
diff --git a/src/setup/cmd_line_args.h b/src/setup/cmd_line_args.h
index c30d76349bd7cbd3057e880e1f01b235859a4df1..01cd4e67c9c4f5cf46bb17c5693d4b5920fbbf68 100644
--- a/src/setup/cmd_line_args.h
+++ b/src/setup/cmd_line_args.h
@@ -37,6 +37,10 @@
  * ARG_SUBROUTINE_WITH_RETURN_(INT|FLOAT) is a variant on
  * the above whereby the function returns a value.
  * This is useful for determining default values.
+ *
+ * The ARG*SCANF functions take an integer as a suffix, 
+ * this is converted to an index to be added to the pointer
+ * provided.
  */
 
 #define ARG_FLOAT 0
@@ -55,31 +59,7 @@
 #define ARG_INTEGER_SCANF 13
 #define ARG_FLOAT_SCANF 14
 #define ARG_UNSIGNED_INTEGER 15
-
-#define Arg_is_function_pointer(N)              \
-    ((N) == ARG_SUBROUTINE ||                   \
-     (N) == ARG_SUBROUTINE_RETURN_INT ||        \
-     (N) == ARGV_SUBROUTINE_RETURN_FLOAT)
-
-#define Argtypestring(A)                                        \
-    (                                                           \
-     (A)==ARG_FLOAT ? "Float" :                                 \
-         (A)==ARG_STRING ? "String" :                           \
-         (A)==ARG_NONE ? "" :                                   \
-         (A)==ARG_INTEGER ? "Integer" :                         \
-         (A)==ARG_SUBROUTINE ? "*" :                            \
-         (A)==ARG_SUBROUTINE_RETURN_FLOAT ? "Float" :           \
-         (A)==ARG_SUBROUTINE_RETURN_INT ? "Int" :               \
-         (A)==ARG_BOOLEAN ? "True|False" :                      \
-         (A)==ARG_LONG_INTEGER ? "Integer" :                    \
-         (A)==ARG_NOT_BOOLEAN ? "" :                            \
-         (A)==BATCH_ARG_SUBROUTINE ? "*" :                      \
-         (A)==BATCH_ARG_BOOLEAN ? "True|False" :                \
-         (A)==ARG_INTEGER_SCANF ? "Int(scanf)" :                \
-         (A)==ARG_FLOAT_SCANF ? "Float(scanf)" :                \
-         (A)==ARG_UNSIGNED_INTEGER ? "Unsigned integer" :       \
-         "*"                                                    \
-         )
+#define ARG_BOOLEAN_SCANF 16
 
 #include "../binary_c_code_options.h"
 #include "../binary_c_debug.h"
@@ -122,6 +102,13 @@
             "Misc"                              \
             }
 
+/*
+ * strings labelled with WTTS_USE_DEFAULT should
+ * output the default value, when available, rather 
+ * than a string specified here
+ */
+#define WTTS_USE_DEFAULT NULL
+
 /*
  * Arguments to automated subroutine calls
  * and equivalent declarations are defined here.
@@ -147,13 +134,13 @@
         argv,                                   \
         argc
 
-#define ARG_SUBROUTINE_DECLARATION              \
+#define ARG_SUBROUTINE_DECLARATION                      \
     struct cmd_line_arg_t * const cmd_line_args,        \
         struct stardata_t * RESTRICT const stardata,    \
         int * const c,                                  \
-        int i,                                  \
-        int arg_count,                          \
-        char ** argv,                           \
+        int i,                                          \
+        int arg_count,                                  \
+        char ** argv,                                   \
         int argc
 
 /*
@@ -174,7 +161,7 @@ struct cmd_line_arg_t
     const char *name;
     const char *help;
     int type;
-    const char *default_value;
+    const char *wtts_string;
     void *pointer;
     double modulate;
     struct arg_pair_t * pairs; 
@@ -202,8 +189,10 @@ struct cmd_line_arg_t
  *
  *              ARG_NONE is a type that is ignored.
  *
- * default_value (string) currently for WTTS only
- *  : a string containing the default value, "Ignore" to be ignored by WTTS,
+ * wtts_string (string) [currently for WTTS only]
+ *        : a string for WTTS
+ *                 WTTS_USE_DEFAULT : uses the default,
+ *                  "Ignore" to be ignored by WTTS,
  *                 "No_Show <default>" to not be shown by WTTS but have its value sent to the
  *                 binary_c command. If this is a macro you can use Stringof(MACRONAME).
  * NB binary_grid ignores this value and uses the code's actual default.
@@ -365,9 +354,9 @@ struct cmd_line_arg_t
         ARG_SECTION_STARS,                                              \
             "metallicity",                                              \
             "This sets the metallicity of the stars, i.e. the amount (by mass) of matter which is not hydrogen or helium. If you are using the BSE algorithm, this must be 1e-4 <= metallicity <= 0.03. See also nucsyn_metallicity and effective_metallicity.", \
-            ARG_SUBROUTINE_RETURN_FLOAT,                                \
-            "0.02",                                                     \
-            &set_metallicity,                                           \
+            ARG_FLOAT,                                                  \
+            WTTS_USE_DEFAULT,                                           \
+            &stardata->preferences->metallicity,                        \
             1.0                                                         \
             } ,                                                         \
 {                                                                       \
@@ -375,8 +364,8 @@ struct cmd_line_arg_t
         "effective_metallicity",                                        \
         "This sets effective metallicity of stars as used in routines like the Schneider wind loss. If not set, or set to DEFAULT_TO_METALLICITY (==-1, the default), this is just the same as metallicity. The main difference between effective_metallicity and metallicity is the range of validity: 0 <= effective_metallicity <= 1, while metallicity's range of validity is limited by the stellar evolution algorithm (so, for BSE, is 1e-4 <= metallicity <= 0.03).", \
         ARG_FLOAT,                                                      \
-        "DEFAULT_TO_METALLICITY",                                       \
-        &(stardata->common.effective_metallicity),                      \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->effective_metallicity),                \
         1.0                                                             \
         },                                                              \
 {                                                                       \
@@ -384,8 +373,8 @@ struct cmd_line_arg_t
         "M_1",                                                          \
         "The mass of star one (in solar units).",                       \
         ARG_FLOAT,                                                      \
-        "15.0",                                                         \
-        &(stardata->star[0].mass) ,                                     \
+        WTTS_USE_DEFAULT,                                               \
+        &stardata->preferences->initial_M1,                             \
         1.0                                                             \
         } ,                                                             \
 {                                                                       \
@@ -393,8 +382,8 @@ struct cmd_line_arg_t
         "M_2",                                                          \
         "The mass of star two (in solar units).",                       \
         ARG_FLOAT,                                                      \
-        "10.0",                                                         \
-        &(stardata->star[1].mass) ,                                     \
+        WTTS_USE_DEFAULT,                                               \
+        &stardata->preferences->initial_M2,                             \
         1.0                                                             \
         } ,                                                             \
 {                                                                       \
@@ -402,8 +391,8 @@ struct cmd_line_arg_t
         "eccentricity",                                                 \
         "Set the eccentricity of the binary orbit (0-1).",              \
         ARG_FLOAT,                                                      \
-        "0.0",                                                          \
-        &(stardata->common.orbit.eccentricity)	,                       \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->initial_orbital_eccentricity)	,       \
         1.0                                                             \
         },                                                              \
 {                                                                       \
@@ -411,8 +400,8 @@ struct cmd_line_arg_t
         "orbital_period",                                               \
         "Set the orbital period in days. See also separation.",         \
         ARG_FLOAT,                                                      \
-        "0.0",                                                          \
-        &(stardata->common.orbit.period) ,                              \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->initial_orbital_period)	,       \
         1.0                                                             \
         },                                                              \
 {                                                                       \
@@ -420,8 +409,8 @@ struct cmd_line_arg_t
         "probability",                                                  \
         "The probability is a weighting applied to the star based on, say, the initial mass function. When running a grid of stars to simulate *all* stars, the summed probability of all the stars should be 1.0.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
-        &(stardata->model.probability),                                 \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->initial_probability)	,               \
         1.0                                                             \
         },                                                              \
 {                                                                       \
@@ -429,7 +418,7 @@ struct cmd_line_arg_t
         "phasevol",                                                     \
         "The system's phase volume, used by binary_grid.",              \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         PHASEVOL_VAR,                                                   \
         1.0                                                             \
         },                                                              \
@@ -438,25 +427,25 @@ struct cmd_line_arg_t
         "stellar_type_2",                                               \
         "Set the stellar type of star 2, usually 1 (main sequence)",    \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
-        &(stardata->star[1].stellar_type),                              \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->initial_stellar_type2)	,               \
         1                                                               \
         },                                                              \
 {                                                                       \
     ARG_SECTION_STARS,                                                  \
         "stellar_structure_algorithm",                                  \
-        "Set the stellar structure algorithm. 0=modified BSE (default), 1=none, 2=external function (must be defined by the calling code), 3=binary_c (not yet implemented).",    \
+        "Set the stellar structure algorithm. 0=modified BSE (default), 1=none, 2=external function (must be defined by the calling code), 3=binary_c (not yet implemented).", \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->stellar_structure_algorithm),          \
         1                                                               \
         },                                                              \
 {                                                                       \
     ARG_SECTION_STARS,                                                  \
         "solver",                                                       \
-        "The type of solver. Default is the Forward-Euler (0), but could be RK2 (1), RK4 (2) or a predictor-corretor (3).",       \
+        "The type of solver. Default is the Forward-Euler (0), but could be RK2 (1), RK4 (2) or a predictor-corretor (3).", \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->solver),                               \
         1                                                               \
         },                                                              \
@@ -465,8 +454,8 @@ struct cmd_line_arg_t
         "max_evolution_time",                                           \
         "Set the maximum age for the stars (Myr).",                     \
         ARG_FLOAT ,                                                     \
-        "13700",                                                        \
-        &(stardata->model.max_evolution_time),                          \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->max_evolution_time),                   \
         1.0                                                             \
         },                                                              \
 {                                                                       \
@@ -474,7 +463,7 @@ struct cmd_line_arg_t
         "max_model_number",                                             \
         "Set the maximum number of models, ignored if 0 (default is 0).", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->max_model_number),                     \
         1.0                                                             \
         },                                                              \
@@ -483,7 +472,7 @@ struct cmd_line_arg_t
         "evolution_algorithm",                                          \
         "Set the evolution algorithm. 0 = BSE, 1 = binary_c.",          \
         ARG_UNSIGNED_INTEGER ,                                          \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->evolution_algorithm),                  \
         1.0                                                             \
         },                                                              \
@@ -492,7 +481,7 @@ struct cmd_line_arg_t
         "monte_carlo_kicks",                                            \
         "Turn on Monte-Carlo SN kicks. On (True) by default, and indeed other algorithms are probably broken.", \
         ARG_BOOLEAN ,                                                   \
-        "True",                                                         \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->monte_carlo_sn_kicks),                 \
         1.0                                                             \
         },                                                              \
@@ -502,7 +491,7 @@ struct cmd_line_arg_t
         "disc_timestep_factor",                                         \
         "Factor that multiplies the natural timestep of a disc.",       \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         DISC_TIMESTEP_FACTOR_VAR,                                       \
         1.0                                                             \
         },                                                              \
@@ -512,7 +501,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_inner_viscous_accretion_method",              \
         "Chooses where the mass that is accreted from the inner edge of a circumbinary disc goes, i.e. to which star. 0 = Young and Clarke 2015, 1 = Gerosa et al 2015, 2 = 50:50 (i.e. not dependence on mass).", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         CBDISC_MASS_LOSS_INNER_VISCOUS_ACCRETION_METHOD_VAR,            \
         1.0                                                             \
         },                                                              \
@@ -522,7 +511,7 @@ struct cmd_line_arg_t
         "cbdisc_inner_edge_stripping",                                  \
         "If True, allow inner edge mass stripping.",                    \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                               \
         CBDISC_INNER_EDGE_STRIPPING_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -532,7 +521,7 @@ struct cmd_line_arg_t
         "cbdisc_outer_edge_stripping",                                  \
         "If True, allow outer edge mass stripping.",                    \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                               \
         CBDISC_OUTER_EDGE_STRIPPING_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -542,7 +531,7 @@ struct cmd_line_arg_t
         "disc_n_monte_carlo_guesses",                                   \
         "Number of monte carlo guesses to try in the disc solver if the normal list of guesses fails (0).", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         DISC_N_MONTE_CARLO_GUESSES_VAR,                                 \
         1.0                                                             \
         },                                                              \
@@ -552,7 +541,7 @@ struct cmd_line_arg_t
         "disc_log",                                                     \
         "If 1, turn on the disc log. Requires DISC_LOG to be defined on build.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         DISC_LOG_VAR,                                                   \
         1.0                                                             \
         },                                                              \
@@ -562,7 +551,7 @@ struct cmd_line_arg_t
         "disc_log2d",                                                     \
         "If 1, turn on the 2d disc log. Requires DISC_LOG to be defined on build.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         DISC_LOG2D_VAR,                                                 \
         1.0                                                             \
         },                                                              \
@@ -572,7 +561,7 @@ struct cmd_line_arg_t
         "disc_log_dt",                                                     \
         "If non-zero, only allows disc log output every disc_log_dt Myr.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         DISC_LOG_DT_VAR,                                                \
         1.0                                                             \
         },                                                              \
@@ -592,7 +581,7 @@ struct cmd_line_arg_t
         "cbdisc_eccentricity_pumping_method",                           \
         "Select from various eccentricity-pumping methods when there is a circumbinary disc. Requires DISCS. 0 = off.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_ECCENTRICITY_PUMPING_METHOD_VAR,                         \
         1.0                                                             \
         },                                                              \
@@ -602,7 +591,7 @@ struct cmd_line_arg_t
         "cbdisc_viscous_photoevaporation_coupling",                     \
         "Set to 1 to turn on viscous-photoevaporation coupling in circumbinary discs. Requires DISCS. 0 = off.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_VISCOUS_PHOTOEVAPORATION_COUPLING_VAR,                   \
         1.0                                                             \
         },                                                              \
@@ -612,7 +601,7 @@ struct cmd_line_arg_t
         "cbdisc_inner_edge_stripping_timescale",                        \
         "Defines the timescale for mass loss from by inner edge stripping. 0 = instant, 1 = very long, 2 = viscous at Revap_in, 3 = orbital at Revap_in.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_INNER_EDGE_TIMESCALE_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -622,7 +611,7 @@ struct cmd_line_arg_t
         "cbdisc_outer_edge_stripping_timescale",                        \
         "Defines the timescale for mass loss from by outer edge stripping. 0 = instant, 1 = very long, 2 = viscous at Revap_in, 3 = orbital at Revap_out.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_OUTER_EDGE_TIMESCALE_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -632,7 +621,7 @@ struct cmd_line_arg_t
         "cbdisc_viscous_L2_coupling",                                   \
         "Set to 1 to turn on viscous-L2-loss coupling in circumbinary discs. Requires DISCS. 0 = off.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_VISCOUS_L2_COUPLING_VAR,                                 \
         1.0                                                             \
         },                                                              \
@@ -642,7 +631,7 @@ struct cmd_line_arg_t
         "gravitational_radiation_model",                                \
         "Model for gravitational radiation from the system. 0=Hurley et al 2002 (Landau and Lifshitz 1951). 1 = as 0 but only when there is no RLOF. 2 = none.", \
         ARG_INTEGER,                                                    \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->gravitational_radiation_model),        \
         1.0                                                             \
         },                                                              \
@@ -652,7 +641,7 @@ struct cmd_line_arg_t
         "nova_irradiation_multiplier",                                  \
         "Multiplier for nova-radiative induced mass loss. (Shara+1986)", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nova_irradiation_multiplier),          \
         1.0                                                             \
         },                                                              \
@@ -662,7 +651,7 @@ struct cmd_line_arg_t
         "gravitational_radiation_modulator_J",                            \
         "Modulator for gravitational wave radiation angular momentum loss rate (1.0).", \
         ARG_FLOAT,                                                      \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->gravitational_radiation_modulator_J),  \
         1.0                                                             \
         },                                                              \
@@ -671,7 +660,7 @@ struct cmd_line_arg_t
         "gravitational_radiation_modulator_e",                          \
         "Modulator for gravitational wave radiation eccentricity pumping rate (1.0).", \
         ARG_FLOAT,                                                      \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->gravitational_radiation_modulator_e),  \
         1.0                                                             \
         },                                                              \
@@ -681,7 +670,7 @@ struct cmd_line_arg_t
         "nova_faml_multiplier",                                         \
         "Nova friction-induced angular momentum loss multiplier. (Shara+1986)", \
         ARG_FLOAT,                                                      \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->nova_faml_multiplier),                 \
         1.0                                                             \
         },                                                              \
@@ -691,7 +680,7 @@ struct cmd_line_arg_t
         "RLOF_angular_momentum_transfer_model",                                     \
         "Choose angular momentum transfer model in RLOF. 0=BSE (with discs), 1=conservative", \
         ARG_INTEGER,                                                    \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->RLOF_angular_momentum_transfer_model),             \
         1.0                                                             \
         },                                                              \
@@ -701,7 +690,7 @@ struct cmd_line_arg_t
         "post_SN_orbit_method",                                         \
         "Method by which the post-SN orbit is calculated. 0=BSE, 1=Tauris&Taken 1998.", \
         ARG_INTEGER,                                                    \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->post_SN_orbit_method),                 \
         1.0                                                             \
         },                                                              \
@@ -711,7 +700,7 @@ struct cmd_line_arg_t
         "evolution_splitting",                                          \
         "If True, turn on splitting of an evolutionary run if splitpoint (e.g. supernova) occurs.", \
         ARG_BOOLEAN,                                                    \
-        "True",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         EVOLUTION_SPLITTING_VAR,                                        \
         1.0                                                             \
         },                                                              \
@@ -721,7 +710,7 @@ struct cmd_line_arg_t
         "disable_events",                                               \
         "Whether to disable the new events code (defaults to False, so we use events by default)\n", \
         ARG_BOOLEAN,                                                    \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->disable_events),                       \
         1.0                                                             \
         },                                                              \
@@ -731,7 +720,7 @@ struct cmd_line_arg_t
         "evolution_splitting_sn_n",                                     \
         "Number of runs to split into when a SN occurs.",               \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         EVOLUTION_SPLITTING_SN_N_VAR,                                   \
         1.0                                                             \
         },                                                              \
@@ -740,7 +729,7 @@ struct cmd_line_arg_t
         "evolution_splitting_maxdepth",                                 \
         "Max number of splits in an evolutionary run.",                 \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         EVOLUTION_SPLITTING_MAXDEPTH_VAR,                               \
         1.0                                                             \
         },                                                              \
@@ -749,7 +738,7 @@ struct cmd_line_arg_t
         "random_seed",                                                  \
         "Random number seed, usually a (possibly negative) integer. Useful for exactly reproducing the evolution of a system which involves a kick (which is a Monte-Carlo, i.e. pseudorandom, process)." , \
         ARG_LONG_INTEGER,                                               \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->cmd_line_random_seed),                 \
         1.0                                                             \
         } ,                                                             \
@@ -758,7 +747,7 @@ struct cmd_line_arg_t
         "random_skip",                                                  \
         "Skip the first <random_seed> random numbers that are generated. Usually this is 0 so they are all used.", \
         ARG_LONG_INTEGER,                                               \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->random_skip),                          \
         1.0                                                             \
         } ,                                                             \
@@ -767,7 +756,7 @@ struct cmd_line_arg_t
         "idum",                                                         \
         "[NB: deprecated, please use 'random_seed' instead.] Random number seed, usually a (possibly negative) integer. Useful for exactly reproducing the evolution of a system which involves a kick (which is a Monte-Carlo, i.e. pseudorandom, process)." , \
         ARG_LONG_INTEGER,                                               \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->cmd_line_random_seed),                 \
         1.0                                                             \
         } ,                                                             \
@@ -776,7 +765,7 @@ struct cmd_line_arg_t
         "repeat",                                                       \
         "If > 1, repeats the system as many times as required. Handy if you're using Monte-Carlo kicks and want to sample the parameter space well. Also, if you are running speed tests this is good to give a statistically more reasonable result. (See e.g. 'tbse pgo')." , \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->repeat),                               \
         1.0                                                             \
         } ,                                                             \
@@ -785,7 +774,7 @@ struct cmd_line_arg_t
         "random_systems",                                               \
         "Experimental. Use this to apply random initial system parameters (masses, separations, etc.). Useful for testing only." , \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         RANDOM_SYSTEMS_VAR,                                             \
         1.0                                                             \
         } ,                                                             \
@@ -794,8 +783,8 @@ struct cmd_line_arg_t
         "stellar_type_1",                                               \
         "Set the stellar type of star 1, usually 1 (main sequence)",    \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
-        &(stardata->star[0].stellar_type),                              \
+        WTTS_USE_DEFAULT,                                                            \
+        &(stardata->preferences->initial_stellar_type1)	,               \
         1                                                               \
         },                                                              \
 {                                                                       \
@@ -803,7 +792,7 @@ struct cmd_line_arg_t
         "equation_of_state_algorithm",                                  \
         "Set the equation of state algorithm. 0 = Paczynski.",          \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         EQUATION_OF_STATE_VAR,                                          \
         1                                                               \
         },                                                              \
@@ -812,7 +801,7 @@ struct cmd_line_arg_t
         "opacity_algorithm",                                            \
         "Set the opacity algorithm. 0 = Paczynski, 1 = Ferguson/Opal.", \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         OPACITY_VAR,                                                    \
         1                                                               \
         },                                                              \
@@ -830,7 +819,7 @@ struct cmd_line_arg_t
         "gbwind",                                                       \
         "Wind prescription for first red giant branch stars.  0=Reimers (Hurley et al 2000/2002; choose gb_reimers_eta=0.5 for their mass loss rate), 1=Schroeder+Cuntz 2005 (set gb_reimers_eta=1.0 for their mass loss rate).", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->gbwind),                               \
         1.0                                                             \
         },                                                              \
@@ -839,7 +828,7 @@ struct cmd_line_arg_t
         "mattsson_Orich_tpagbwind",                                     \
         "Experimental : turns on Mattsson's TPAGB wind when the star is oxygen rich. Requires MATTSSON_MASS_LOSS.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         MATTSSON_ORICH_TPAGBWIND_VAR,                                   \
         1.0                                                             \
         },                                                              \
@@ -849,7 +838,7 @@ struct cmd_line_arg_t
         "magnetic_braking_factor",                                      \
         "Multiplier for the magnetic braking angular momentum loss rate.", \
         ARG_FLOAT ,                                                     \
-        "1.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->magnetic_braking_factor),              \
         1.0                                                             \
         },                                                              \
@@ -858,7 +847,7 @@ struct cmd_line_arg_t
         "magnetic_braking_gamma",                                       \
         "gamma factor in Rappaport style magnetic braking expression.", \
         ARG_FLOAT ,                                                     \
-        "3.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->magnetic_braking_gamma),               \
         1.0                                                             \
         },                                                              \
@@ -867,7 +856,7 @@ struct cmd_line_arg_t
         "magnetic_braking_algorithm",                                      \
         "Algorithm for the magnetic braking angular momentum loss rate. 0 = Hurley et al. 2002, 1 = Andronov, Pinnsonneault and Sills 2003, 2 = Barnes and Kim 2010 ", \
         ARG_INTEGER,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->magnetic_braking_algorithm),           \
         1.0                                                             \
         },                                                              \
@@ -876,7 +865,7 @@ struct cmd_line_arg_t
         "gb_reimers_eta",                                               \
         "First red giant branch wind multiplication factor, cf. eta in Reimers' mass loss formula. (This multiplies the 4e-13 in Reimers' formula, or the 8e-14 in Schroeder and Cuntz.)", \
         ARG_FLOAT ,                                                     \
-        "0.5",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->gb_reimers_eta),                       \
         1.0                                                             \
         },                                                              \
@@ -885,7 +874,7 @@ struct cmd_line_arg_t
         "gbwindfac",                                                    \
         "Multiplier for the giant branch wind mass loss rate",          \
         ARG_FLOAT ,                                                     \
-        "1.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->gbwindfac),                            \
         1.0                                                             \
         },                                                              \
@@ -894,7 +883,7 @@ struct cmd_line_arg_t
         "agbwindfac",                                                   \
         "Multiplier for the AGB wind mass loss rate",                   \
         ARG_FLOAT ,                                                     \
-        "1.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->agbwindfac),                           \
         1.0                                                             \
         },                                                              \
@@ -903,7 +892,7 @@ struct cmd_line_arg_t
         "tpagbwind",                                                    \
         "Wind prescription during the TPAGB. 0=Karakas 2002 (a modified Vassiliadis and Wood 1993), 1=Hurley et al 2000/2002 (Vassiliadis and Wood 1993), 2=Reimers, 3=Bloecker, 4=Van Loon,  5=Rob's C-wind (broken?), 6,7=Vassiliadis and Wood 1993 (Karakas,Hurley variants respectively) when C/O>1, 8=Mattsson", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->tpagbwind),                            \
         1.0                                                             \
         },                                                              \
@@ -913,7 +902,7 @@ struct cmd_line_arg_t
         "vwind_multiplier",                                             \
         "Multiplier for the wind velocity as a function of the star's escape speed. In BSE (Hurley et al 2000/2002) this is 1/8=0.125. Does NOT apply on the AGB, when the Vassiliadis and Wood wind velocity is used instead.", \
         ARG_FLOAT ,                                                     \
-        "0.125",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->vwind_multiplier),                     \
         1.0                                                             \
         },                                                              \
@@ -922,7 +911,7 @@ struct cmd_line_arg_t
         "superwind_mira_switchon",                                      \
         "In the Vassiliadis and Wood (1993) AGB wind prescription, the superwind is turned on at a given Mira period, usually 500 days. You can vary when this switch-on happens with this parameter.", \
         ARG_FLOAT ,                                                     \
-        "500.0",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->tpagb_superwind_mira_switchon),        \
         1.0                                                             \
         },                                                              \
@@ -931,7 +920,7 @@ struct cmd_line_arg_t
         "vw93_mira_shift",                                              \
         "In the Vassiliadis and Wood (1993) AGB wind prescription, the wind loss rate depends on the Mira period plus this offset. Requires VW93_MIRA_SHIFT.", \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         VW93_MIRA_SHIFT_VAR,                                            \
         1.0                                                             \
         },                                                              \
@@ -940,7 +929,7 @@ struct cmd_line_arg_t
         "vw93_multiplier",                                              \
         "In the Vassiliadis and Wood (1993) AGB wind prescription, the wind loss rate is multiplied by this factor. Requires VW93_MULTIPLIER.", \
         ARG_FLOAT ,                                                     \
-        "1.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         VW93_MULTIPLIER_VAR,                                            \
         1.0                                                             \
         },                                                              \
@@ -949,7 +938,7 @@ struct cmd_line_arg_t
         "tpagb_reimers_eta",                                            \
         "TPAGB Reimers wind multiplication factor, cf. eta in Reimers' mass loss formula. (This multiplies the 4e-13 in Reimers' formula, or the 8e-14 in Schroeder and Cuntz.) Note that Reimers is not the default TPAGB wind prescription. See also tpagbwind.", \
         ARG_FLOAT ,                                                     \
-        "0.5",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->tpagb_reimers_eta),                    \
         1.0                                                             \
         },                                                              \
@@ -959,7 +948,7 @@ struct cmd_line_arg_t
         "mass_accretion_rate1",                                         \
         "Constant mass accretion rate on star 1.",                      \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->mass_accretion_rate1),                 \
         1.0                                                             \
         },                                                              \
@@ -969,7 +958,7 @@ struct cmd_line_arg_t
         "mass_accretion_rate2",                                         \
         "Constant mass accretion rate on star 2.",                      \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->mass_accretion_rate2),                 \
         1.0                                                             \
         },                                                              \
@@ -979,7 +968,7 @@ struct cmd_line_arg_t
         "angular_momentum_accretion_rate1",                             \
         "Constant angular momentum accretion rate on star 1.",          \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->angular_momentum_accretion_rate1),     \
         1.0                                                             \
         },                                                              \
@@ -989,7 +978,7 @@ struct cmd_line_arg_t
         "angular_momentum_accretion_rate2",                             \
         "Constant angular momentum accretion rate on star 2.",          \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->angular_momentum_accretion_rate2),     \
         1.0                                                             \
         },                                                              \
@@ -999,7 +988,7 @@ struct cmd_line_arg_t
         "angular_momentum_accretion_rate_orbit",                        \
         "Constant angular momentum accretion rate on the orbit.",       \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->angular_momentum_accretion_rate_orbit), \
         1.0                                                             \
         },                                                              \
@@ -1009,7 +998,7 @@ struct cmd_line_arg_t
         "accretion_start_time",                                         \
         "Time at which artificial accretion stars. Ignored if <0 (default is -1).", \
         ARG_FLOAT ,                                                     \
-        "-1.0",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->accretion_start_time),                 \
         1.0                                                             \
         },                                                              \
@@ -1019,7 +1008,7 @@ struct cmd_line_arg_t
         "accretion_end_time",                                           \
         "Time at which artificial accretion ends. Ignored if <0 (default is -1).", \
         ARG_FLOAT ,                                                     \
-        "-1.0",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->accretion_end_time),                   \
         1.0                                                             \
         },                                                              \
@@ -1029,7 +1018,7 @@ struct cmd_line_arg_t
         "wr_wind",                                                      \
         "Massive-star (WR) wind prescription. 0 = Hurley et al 2000/2002, 1=Maeder and Meynet, 2=Nugis and Lamers, 3=John Eldridge's version of Vink's early-2000s wind (See Lynnette Dray's thesis, or John Eldridge's thesis)", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->wr_wind),                              \
         1.0                                                             \
         },                                                              \
@@ -1039,7 +1028,7 @@ struct cmd_line_arg_t
         "wr_wind_fac",                                                  \
         "Massive-star (WR) wind multiplication factor.",                \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->wr_wind_fac),                          \
         1.0                                                             \
         },                                                              \
@@ -1048,7 +1037,7 @@ struct cmd_line_arg_t
         "wrwindfac",                                                    \
         "Massive-star (WR) wind multiplication factor. Synonymous with wr_wind_fac (which you should use instead).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->wr_wind_fac),                          \
         1.0                                                             \
         },                                                              \
@@ -1057,7 +1046,7 @@ struct cmd_line_arg_t
         "accretion_limit_eddington_multiplier",                         \
         "Accretion is limited by the Eddington instability, with limiting rate given by the accretion_limit_eddington_multiplier * the normal (spherically symmetric) Eddington rate. This is known in the trade as the Eddington factor, and anything greater than 1.0 potentially gives you super-Eddington accretion.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->accretion_limit_eddington_multiplier), \
         1.0                                                             \
         },                                                              \
@@ -1066,7 +1055,7 @@ struct cmd_line_arg_t
         "accretion_limit_thermal_multiplier",                           \
         "Mass transfer onto a MS, HG or CHeB star is limited by the accretor's thermal rate times this multiplier.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->accretion_limit_thermal_multiplier),   \
         1.0                                                             \
         },                                                              \
@@ -1075,7 +1064,7 @@ struct cmd_line_arg_t
         "accretion_limit_dynamical_multiplier",                         \
         "Mass transfer is limited by the accretor's dynamical rate times this multiplier.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->accretion_limit_dynamical_multiplier), \
         1.0                                                             \
         },                                                              \
@@ -1084,7 +1073,7 @@ struct cmd_line_arg_t
         "donor_limit_envelope_multiplier",                              \
         "Mass transfer by RLOF is limited by this fraction of the donor's envelope mass per timestep", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->donor_limit_envelope_multiplier),      \
         1.0                                                             \
         },                                                              \
@@ -1093,7 +1082,7 @@ struct cmd_line_arg_t
         "donor_limit_thermal_multiplier",                               \
         "Mass transfer by RLOF is limited by the accretor's thermal rate times this multiplier.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->donor_limit_thermal_multiplier),       \
         1.0                                                             \
         },                                                              \
@@ -1102,7 +1091,7 @@ struct cmd_line_arg_t
         "donor_limit_dynamical_multiplier",                             \
         "Mass transfer by RLOF is limited by the donor's dynamical rate times this multiplier.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->donor_limit_dynamical_multiplier),     \
         1.0                                                             \
         },                                                              \
@@ -1111,7 +1100,7 @@ struct cmd_line_arg_t
         "Bondi_Hoyle_accretion_factor",                                 \
         "Wind accretion rate, as calculated by the Bondi-Hoyle-Littleton formula, multiplcation factor. (Used to be called 'acc2' which is now deprecated.) Hurley et al 2002 use 1.5, which is the default.", \
         ARG_FLOAT ,                                                     \
-        "1.5",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->Bondi_Hoyle_accretion_factor),         \
         1.0                                                             \
         },                                                              \
@@ -1120,7 +1109,7 @@ struct cmd_line_arg_t
         "BH_prescription",                                              \
         "Black hole mass prescrition: relates the mass of a newly formed black hole to its progenitor's (CO) core mass. 0=Hurley et al 2000/2002, 1=Belczynski (early 2000s).", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->BH_prescription),                      \
         1.0                                                             \
         },                                                              \
@@ -1129,7 +1118,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_II",                                      \
         "Set the distribution of speeds applied to kick type II core collapse supernova systems. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_II]),          \
         1.0                                                             \
         },                                                              \
@@ -1138,7 +1127,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_ECAP",                                    \
         "Set the distribution of speeds applied to the remnants of electron-capture supernovae. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_ECAP]),        \
         1.0                                                             \
         },                                                              \
@@ -1147,7 +1136,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_NS_NS",                                   \
         "Set the distribution of speeds applied to kick neutron stars and black holes that survive a NS-NS merger. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_NS_NS]),       \
         1.0                                                             \
         },                                                              \
@@ -1156,7 +1145,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_IBC",                                     \
         "Set the distribution of speeds applied to kick newly-born neutron stars and black holes after a type Ib/c core-collapse supernova. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_IBC]),         \
         1.0                                                             \
         },                                                              \
@@ -1165,7 +1154,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_GRB_COLLAPSAR",                           \
         "Set the distribution of speeds applied to kick newly-born neutron stars and black holes after a type Ib/c core-collapse supernova which is also a collapsar. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_GRB_COLLAPSAR]), \
         1.0                                                             \
         },                                                              \
@@ -1174,7 +1163,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_TZ",                                      \
         "Set the distribution of speeds applied to kick newly-born neutron stars and black holes at the death of a Thorne-Zytkow object. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_TZ]),          \
         1.0                                                             \
         },                                                              \
@@ -1183,7 +1172,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_AIC_BH",                                  \
         "Set the distribution of speeds applied to kick newly-born neutron stars black holes after accretion induced collapse of a neutron star. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_AIC_BH]),      \
         1.0                                                             \
         },                                                              \
@@ -1192,7 +1181,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_BH_BH",                                   \
         "Set the distribution of speeds applied to black holes formed by the merger of two black holes. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_BH_BH]),       \
         1.0                                                             \
         },                                                              \
@@ -1201,7 +1190,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_BH_NS",                                   \
         "Set the distribution of speeds applied to black holes formed by the merger of a neutron star and a black holes. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_BH_NS]),       \
         1.0                                                             \
         },                                                              \
@@ -1210,7 +1199,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_IA_Hybrid_HeCOWD",                        \
         "Set the distribution of speeds applied to any survivor of a hybrid He-COWD SNIa explosion. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_IA_Hybrid_HeCOWD]), \
         1.0                                                             \
         },                                                              \
@@ -1219,7 +1208,7 @@ struct cmd_line_arg_t
         "sn_kick_distribution_IA_Hybrid_HeCOWD_subluminous",            \
         "Set the distribution of speeds applied to any survivor of a subluminous hybrid He-COWD SNIa explosion. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_distribution[SN_IA_Hybrid_HeCOWD_subluminous]), \
         1.0                                                             \
         },                                                              \
@@ -1228,7 +1217,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_II",                                        \
         "Set the dispersion of speeds applied to kick type II core collapse supernova systems. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_II]),            \
         1.0                                                             \
         },                                                              \
@@ -1237,7 +1226,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_ECAP",                                      \
         "Set the dispersion of speeds applied to the remnants of electron-capture supernovae. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_ECAP]),          \
         1.0                                                             \
         },                                                              \
@@ -1246,7 +1235,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_NS_NS",                                     \
         "Set the dispersion of speeds applied to kick neutron stars and black holes that survive a NS-NS merger. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_NS_NS]),         \
         1.0                                                             \
         },                                                              \
@@ -1255,7 +1244,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_IBC",                                       \
         "Set the dispersion of speeds applied to kick newly-born neutron stars and black holes after a type Ib/c core-collapse supernova. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_IBC]),           \
         1.0                                                             \
         },                                                              \
@@ -1264,7 +1253,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_GRB_COLLAPSAR",                             \
         "Set the dispersion of speeds applied to kick newly-born neutron stars and black holes after a type Ib/c core-collapse supernova which is also a collapsar. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_GRB_COLLAPSAR]), \
         1.0                                                             \
         },                                                              \
@@ -1273,7 +1262,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_TZ",                                        \
         "Set the dispersion of speeds applied to kick newly-born neutron stars and black holes at the death of a Thorne-Zytkow object. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_TZ]),            \
         1.0                                                             \
         },                                                              \
@@ -1282,7 +1271,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_AIC_BH",                                    \
         "Set the dispersion of speeds applied to kick newly-born neutron stars black holes after accretion induced collapse of a neutron star. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_AIC_BH]),        \
         1.0                                                             \
         },                                                              \
@@ -1291,7 +1280,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_BH_BH",                                     \
         "Set the dispersion of speeds applied to black holes formed by the merger of two black holes. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_BH_BH]),         \
         1.0                                                             \
         },                                                              \
@@ -1300,7 +1289,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_BH_NS",                                     \
         "Set the dispersion of speeds applied to black holes formed by the merger of a neutron star and a black holes. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_BH_NS]),         \
         1.0                                                             \
         },                                                              \
@@ -1309,7 +1298,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_IA_Hybrid_HeCOWD",                          \
         "Set the dispersion of speeds applied to the survivor of a SNIa explosion of a hybrid He-COWD. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_IA_Hybrid_HeCOWD]), \
         1.0                                                             \
         },                                                              \
@@ -1318,7 +1307,7 @@ struct cmd_line_arg_t
         "sn_kick_dispersion_IA_Hybrid_HeCOWD_subluminous",              \
         "Set the dispersion of speeds applied to the survivor of a subluminous SNIa explosion of a hybrid He-COWD. 0=fixed, 1=maxwellian (hurley/BSE), 2=custom function (see monte_carlo_kicks.c).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_dispersion[SN_IA_Hybrid_HeCOWD_subluminous]), \
         1.0                                                             \
         },                                                              \
@@ -1327,7 +1316,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_He",                                      \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a Ia He supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_He]),          \
         1.0                                                             \
         },                                                              \
@@ -1336,7 +1325,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_ELD",                                     \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a Ia ELD (sub-Mch) supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_ELD]),         \
         1.0                                                             \
         },                                                              \
@@ -1345,7 +1334,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_CHAND",                                   \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a Ia Mch supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_CHAND]),       \
         1.0                                                             \
         },                                                              \
@@ -1354,7 +1343,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_AIC",                                        \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when an accretion induced collapse (supernova) occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_AIC]),            \
         1.0                                                             \
         },                                                              \
@@ -1363,7 +1352,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_ECAP",                                       \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when an electron capture supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_ECAP]),           \
         1.0                                                             \
         },                                                              \
@@ -1372,7 +1361,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_He_Coal",                                 \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a Ia helium merger supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_He_Coal]),     \
         1.0                                                             \
         },                                                              \
@@ -1381,7 +1370,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_CHAND_Coal",                              \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a Ia Mch merger supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_CHAND_Coal]),  \
         1.0                                                             \
         },                                                              \
@@ -1390,7 +1379,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_NS_NS",                                      \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a neutron-star neutron-star merger. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_NS_NS]),          \
         1.0                                                             \
         },                                                              \
@@ -1399,7 +1388,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_GRB_COLLAPSAR",                              \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a GRB Collapsar (rapidly rotating SN Ibc) supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_GRB_COLLAPSAR]),  \
         1.0                                                             \
         },                                                              \
@@ -1408,7 +1397,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_HeStarIa",                                   \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a He-star Ia supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_HeStarIa]),       \
         1.0                                                             \
         },                                                              \
@@ -1417,7 +1406,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IBC",                                        \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a type Ib/c supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IBC]),            \
         1.0                                                             \
         },                                                              \
@@ -1426,7 +1415,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_II",                                         \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a type II supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_II]),             \
         1.0                                                             \
         },                                                              \
@@ -1435,7 +1424,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IIa",                                        \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a type IIa supernova occurs. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IIa]),            \
         1.0                                                             \
         },                                                              \
@@ -1444,7 +1433,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_WDKICK",                                     \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a WD is kicked. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_WDKICK]),         \
         1.0                                                             \
         },                                                              \
@@ -1453,7 +1442,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_TZ",                                         \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a Thorne-Zytkow object is formed. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_TZ]),             \
         1.0                                                             \
         },                                                              \
@@ -1462,7 +1451,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_AIC_BH",                                     \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a neutron star collapses to a black hole. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_AIC_BH]),         \
         1.0                                                             \
         },                                                              \
@@ -1471,7 +1460,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_BH_BH",                                      \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when two black holes merge. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_BH_BH]),          \
         1.0                                                             \
         },                                                              \
@@ -1480,7 +1469,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_BH_NS",                                      \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the, kick on the companion when a black hole merges with a neutron star. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_BH_NS]),          \
         1.0                                                             \
         },                                                              \
@@ -1489,7 +1478,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_Hybrid_HeCOWD",                           \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the kick on the companion, if it survives, in a hybrid He-COWD type Ia explosion. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_Hybrid_HeCOWD]), \
         1.0                                                             \
         },                                                              \
@@ -1498,7 +1487,7 @@ struct cmd_line_arg_t
         "sn_kick_companion_IA_Hybrid_HeCOWD_subluminous",               \
         "Set the speed (if >=0) of, or the algothim (if <0) used to calculate the kick on the companion, if it survives, in a subluminous hybrid He-COWD type Ia explosion. 0 = none, 1 = Liu+2015, 2 = Wheeler+ 1975.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->sn_kick_companion[SN_IA_Hybrid_HeCOWD_subluminous]), \
         1.0                                                             \
         },                                                              \
@@ -1507,7 +1496,7 @@ struct cmd_line_arg_t
         "wd_sigma",                                                     \
         "Set the speed at which white dwarfs are kicked when they form, in km/s. Default is zero (i.e. no kick). Requires WD_KICKS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         WD_SIGMA_VAR,                                                   \
         1.0                                                             \
         },                                                              \
@@ -1516,7 +1505,7 @@ struct cmd_line_arg_t
         "wd_kick_direction",                                            \
         "Set the direction of white dwarf kicks. 0 = random, 1 = up, 2 = forward, 3 = backward, 4 = inward, 5 = outward. Requires WD_KICKS.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         WD_KICK_DIRECTION_VAR,                                          \
         1.0                                                             \
         },                                                              \
@@ -1525,7 +1514,7 @@ struct cmd_line_arg_t
         "wd_kick_when",                                                 \
         "Decide when to kick a white dwarf. 0=at birth, 1=at first RLOF, 2=at given pulse number (see wd_kick_pulse_number), 3 at every pulse Requires WD_KICKS.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         WD_KICK_WHEN_VAR,                                               \
         1.0                                                             \
         },                                                              \
@@ -1534,7 +1523,7 @@ struct cmd_line_arg_t
         "wd_kick_pulse_number",                                         \
         "Apply a kick to a star at a desired pulse number on the TPAGB (i.e. pre-WD). Requires WD_KICKS.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         WD_KICK_PULSE_NUMBER_VAR,                                       \
         1.0                                                             \
         },                                                              \
@@ -1543,7 +1532,7 @@ struct cmd_line_arg_t
         "max_tpagb_core_mass",                                          \
         "Maximum mass of the core during the TPAGB. Typically around 1.38Msun.", \
         ARG_FLOAT ,                                                     \
-        "1.38",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->max_tpagb_core_mass),                  \
         1.0                                                             \
         },                                                              \
@@ -1552,7 +1541,7 @@ struct cmd_line_arg_t
         "minimum_helium_ignition_core_mass",                            \
         "Minimum helium core mass required to ignite helium in the case that the hydrogen envelope is stripped on the giant branch, e.g. to make an sdB or sdO star. Typically 0.4, if 0.0 then the BSE algorithm (based on the total mass) is used.", \
         ARG_FLOAT ,                                                     \
-        "0.4",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->minimum_helium_ignition_core_mass),    \
         1.0                                                             \
         },                                                              \
@@ -1561,7 +1550,7 @@ struct cmd_line_arg_t
         "minimum_mass_for_carbon_ignition",                             \
         "Minimum core mass for carbon ignition. Typically around 1.6Msun.", \
         ARG_FLOAT ,                                                     \
-        "1.6",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->minimum_mass_for_carbon_ignition),     \
         1.0                                                             \
         },                                                              \
@@ -1570,7 +1559,7 @@ struct cmd_line_arg_t
         "minimum_mass_for_neon_ignition",                               \
         "Minimum core mass for neon ignition. Typically around 2.85Msun.", \
         ARG_FLOAT ,                                                     \
-        "2.85",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->minimum_mass_for_neon_ignition),       \
         1.0                                                             \
         },                                                              \
@@ -1579,7 +1568,7 @@ struct cmd_line_arg_t
         "max_neutron_star_mass",                                        \
         "Maximum mass of a neutron star before it collapses to a black hole. Typically around 1.8Msun.", \
         ARG_FLOAT ,                                                     \
-        "1.8",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->max_neutron_star_mass),                \
         1.0                                                             \
         },                                                              \
@@ -1588,7 +1577,7 @@ struct cmd_line_arg_t
         "chandrasekhar_mass",                                           \
         "The Chandrasekhar mass, usually 1.44Msun",                     \
         ARG_FLOAT ,                                                     \
-        "1.44",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->chandrasekhar_mass),                   \
         1.0                                                             \
         },                                                              \
@@ -1597,7 +1586,7 @@ struct cmd_line_arg_t
         "delta_mcmin",                                                  \
         "A parameter to reduce the minimum core mass for third dredge up to occur on the TPAGB. As used by Izzard and Tout (2004) to increase the amount of dredge up, hence carbon, in Magellanic cloud stars.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_DELTA_MCMIN_VAR,                                         \
         1.0                                                             \
         },                                                              \
@@ -1606,7 +1595,7 @@ struct cmd_line_arg_t
         "lambda_min",                                                   \
         "A parameter to increase the efficiency of third dredge up on the TPAGB. The efficiency is lambda * lambda_mult, and setting lambda_min>0 implies that, once Mc>Mcmin (see delta_mcmin) lambda=Max(lambda(fit to Karakas), lambda_min). As used by Izzard and Tout (2004) to increase the amount of dredge up, hence carbon, in Magellanic cloud stars. See also lambda_multiplier.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_LAMBDA_MIN_VAR,                                          \
         1.0                                                             \
         },                                                              \
@@ -1615,7 +1604,7 @@ struct cmd_line_arg_t
         "lambda_multiplier",                                            \
         "A parameter to increase the efficiency of third dredge up on the TPAGB. The efficiency is lambda * lambda_mult, and setting lambda_min>0 implies that, once Mc>Mcmin (see delta_mcmin) lambda=Max(lambda(fit to Karakas), lambda_min). As used by Izzard and Tout (2004) to increase the amount of dredge up, hence carbon, in Magellanic cloud stars.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_LAMBDA_MULTIPLIER_VAR,                                   \
         1.0                                                             \
         },                                                              \
@@ -1624,7 +1613,7 @@ struct cmd_line_arg_t
         "minimum_envelope_mass_for_third_dredgeup",                     \
         "The minimum envelope mass for third dredge up on the TPAGB. Early, solar metallicity models by Straniero et al suggested 0.5Msun is typical. However, circumstantial evidence (Izzard et al 2009) as well as newer models by Stancliffe and Karakas suggest that at low metallicity a value nearer zero is more appropriate.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_MINIMUM_ENVELOPE_MASS_FOR_THIRD_DREDGE_UP_VAR,           \
         1.0,                                                            \
         },                                                              \
@@ -1633,7 +1622,7 @@ struct cmd_line_arg_t
         "mass_of_pmz",                                                  \
         "The mass in the partial mixing zone of a TPAGB star, using the Karakas 2012 tables. Ask Carlo Abate for more details, or see the series of papers Abate et al 2012, 2013, 2014. Requires NUCSYN and USE_TABULAR_INTERSHELL_ABUNDANCES_KARAKAS_2012.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_MASS_OF_PMZ_VAR,                                         \
         1.0,                                                            \
         },                                                              \
@@ -1642,7 +1631,7 @@ struct cmd_line_arg_t
         "c13_eff",                                                      \
         "The \"efficiency\" of partial mixing in a TPAGB star intershell region, when using the s-process tables of Gallino, Busso, Lugaro et al. as provided by Maria Lugaro for the Izzard et al. 2009 paper. Requires NUCSYN and NUCSYN_S_PROCESS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_C13_EFF_VAR,                                             \
         1.0,                                                            \
         },                                                              \
@@ -1651,7 +1640,7 @@ struct cmd_line_arg_t
         "mc13_pocket_multiplier",                                       \
         "Multiplies the mass in the partial mixing zone of a TPAGB star, when using the s-process tables of Gallino, Busso, Lugaro et al. as provided by Maria Lugaro for the Izzard et al. 2009 paper. Requires NUCSYN and NUCSYN_S_PROCESS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_MC13_POCKET_MULTIPLIER_VAR,                              \
         1.0,                                                            \
         },                                                              \
@@ -1660,7 +1649,7 @@ struct cmd_line_arg_t
         "E2_prescription",                                              \
         "Choose how to calculate the E2 structural parameter (used in tidal timescale calculations). 0=Hurley 1=Izzard (see Siess et al 2013)", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->E2_prescription),                      \
         1.0,                                                            \
         },                                                              \
@@ -1669,7 +1658,7 @@ struct cmd_line_arg_t
         "dtfac",                                                        \
         "A parameter to decrease the timestep ONLY during the TPAGB phase.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_DTFAC_VAR,                                               \
         1.0                                                             \
         },                                                              \
@@ -1678,7 +1667,7 @@ struct cmd_line_arg_t
         "hbbtfac",                                                      \
         "A parameter to modulate the temperature at the base of the hot-bottom burning zone in TPAGB stars. (Works only if NUCSYN is defined)", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_HBBTFAC_VAR,                                             \
         1.0,                                                            \
         },                                                              \
@@ -1687,7 +1676,7 @@ struct cmd_line_arg_t
         "tidal_strength_factor",                                        \
         "A modulator for the tidal strength. If this factor > 1 then tides are stronger, i.e. tidal timescales are reduced." , \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->tidal_strength_factor),                \
         1.0,                                                            \
         },                                                              \
@@ -1696,7 +1685,7 @@ struct cmd_line_arg_t
         "hachisu_qcrit",                                                \
         "Critical q=Maccretor/Mdonor above which Hachisu's disk wind turns on.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->hachisu_qcrit),                        \
         1.0,                                                            \
         },                                                              \
@@ -1705,7 +1694,7 @@ struct cmd_line_arg_t
         "hachisu_disk_wind",                                            \
         "Set to True to turn on Hachisu's disk wind when material accretes too fast onto a white dwarf. This helps to make more SNeIa. See also hachisu_qcrit.", \
         ARG_BOOLEAN ,                                                   \
-        "True",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->hachisu_disk_wind),                    \
         1.0,                                                            \
         },                                                              \
@@ -1714,7 +1703,7 @@ struct cmd_line_arg_t
         "mass_accretion_for_eld",                                       \
         "The mass that must be accreted onto a COWD for it to ignite as an edge-lit detonation SNIa.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->mass_accretion_for_eld),               \
         1.0,                                                            \
         },                                                              \
@@ -1723,7 +1712,7 @@ struct cmd_line_arg_t
         "WDWD_merger_algorithm",                                        \
         "Algorithm to be used when merging two white dwarfs. 0 = Hurley et al. (2002), 1 = Perets+ (2019), 2 = Chen+ (2016, todo) ", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->WDWD_merger_algorithm),                \
         1.0,                                                            \
         },                                                              \
@@ -1732,7 +1721,7 @@ struct cmd_line_arg_t
         "type_Ia_MCh_supernova_algorithm",                              \
         "Algorithm to be used when calculating type Ia yields from Chandrasekhar-mass exploders. 0 = DD7 (Iwamoto 1999), 1 = Seitenzahl 2013 3D hydro yields (you must also set Seitenzahl2013_model) ", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_TYPE_IA_MCH_SUPERNOVA_ALGORITHM_VAR,                     \
         1.0,                                                            \
         },                                                              \
@@ -1750,7 +1739,7 @@ struct cmd_line_arg_t
         "type_Ia_sub_MCh_supernova_algorithm",                          \
         "Algorithm to be used when calculating type Ia yields from sub-Chandrasekhar-mass exploders. (Currently unused.)", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_TYPE_IA_SUB_MCH_SUPERNOVA_ALGORITHM_VAR,                 \
         1.0,                                                            \
         },                                                              \
@@ -1759,7 +1748,7 @@ struct cmd_line_arg_t
         "max_HeWD_mass",                                                \
         "The maximum mass a HeWD can have before it ignites helium (0.7).", \
         ARG_FLOAT ,                                                     \
-        "0.7",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->max_HeWD_mass),                        \
         1.0,                                                            \
         },                                                              \
@@ -1768,7 +1757,7 @@ struct cmd_line_arg_t
         "merger_angular_momentum_factor",                               \
         "When two stars merge the resulting single star retains a fraction of the total system angular momentum (or the critical spin angular momentum, if it is smaller) multiplied by this factor.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->merger_angular_momentum_factor),       \
         1.0,                                                            \
         },                                                              \
@@ -1777,7 +1766,7 @@ struct cmd_line_arg_t
         "wind_angular_momentum_loss",                                                    \
         "Prescription for losing angular momentum in a stellar wind. 0=Hurley et al 2002 ('Tout') prescription, 1=lw i.e. a factor multiplying the specific orbital angular momentum, 2=lw hybrid for fast winds. Set wind_djorb_fac to the desired factor..", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->wind_angular_momentum_loss),                            \
         1.0,                                                            \
         },                                                              \
@@ -1786,7 +1775,7 @@ struct cmd_line_arg_t
         "wind_djorb_fac",                                               \
         "Factor multiplying angular momentum loss in a stellar wind when wind_angular_momentum_loss=0 (the Tout/Hurley et al 2002 prescription). See wind_angular_momentum_loss.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->wind_djorb_fac),                       \
         1.0,                                                            \
         },                                                              \
@@ -1795,7 +1784,7 @@ struct cmd_line_arg_t
         "lw",                                                           \
         "Factor multiplying angular momentum loss in a stellar wind when wind_angular_momentum_loss=1,2 (the 'lw' prescription). See wind_angular_momentum_loss.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->lw),                                   \
         1.0,                                                            \
         },                                                              \
@@ -1804,7 +1793,7 @@ struct cmd_line_arg_t
         "yields_dt",                                                    \
         "When doing yield calculations, yields are output every yields_dt Myr. Requires NUCSYN and NUCSYN_SPARSE_YIELDS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_YIELDS_DT_VAR,                                           \
         1.0,                                                            \
         },                                                              \
@@ -1813,7 +1802,7 @@ struct cmd_line_arg_t
         "yields_logdt",                                                    \
         "When doing yield calculations, and when logyieldtimes is set, yields are output every yields_logdt Myr. Requires NUCSYN and NUCSYN_SPARSE_YIELDS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_YIELDS_LOGDT_VAR,                                        \
         1.0,                                                            \
         },                                                              \
@@ -1822,7 +1811,7 @@ struct cmd_line_arg_t
         "yields_startlogtime",                                          \
         "Start log yields at yields_startlogtime.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_YIELDS_STARTLOGTIME_VAR,                                 \
         1.0,                                                            \
         },                                                              \
@@ -1831,7 +1820,7 @@ struct cmd_line_arg_t
         "yields_logtimes",                                              \
         "When doing yield calculations, set this to output at log times rather than linear times.", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         NUCSYN_YIELDS_LOGTIMES_VAR,                                     \
         1.0,                                                            \
         },                                                              \
@@ -1840,7 +1829,7 @@ struct cmd_line_arg_t
         "reverse_time",                                                 \
         "Make time go backwards. To be considered very experimental!",  \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         REVERSE_TIME_VAR,                                               \
         1.0,                                                            \
         },                                                              \
@@ -1849,7 +1838,7 @@ struct cmd_line_arg_t
         "start_time",                                                   \
         "Start time for the simulation.",                               \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->start_time),                           \
         1.0,                                                            \
         },                                                              \
@@ -1858,7 +1847,7 @@ struct cmd_line_arg_t
         "CEMP_logg_maximum",                                            \
         "Maximum logg that CEMP stars are allowed to have. See Izzard et al 2009. See also CEMP_cfe_minimum, CEMP_minimum_age.", \
         ARG_FLOAT ,                                                     \
-        "1e9",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         NUCSYN_CEMP_LOGG_MAXIMUM_VAR,                                   \
         1.0,                                                            \
         },                                                              \
@@ -1867,7 +1856,7 @@ struct cmd_line_arg_t
         "CEMP_cfe_minimum",                                             \
         "Minimum [C/Fe] that CEMP stars are required to have. See Izzard et al 2009. See also CEMP_logg_maximum, CEMP_minimum_age.", \
         ARG_FLOAT ,                                                     \
-        "1e9",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         NUCSYN_CEMP_CFE_MINIMUM_VAR,                                    \
         1.0,                                                            \
         },                                                              \
@@ -1876,7 +1865,7 @@ struct cmd_line_arg_t
         "thick_disc_start_age",                                         \
         "Lookback time for the start of the thick disc star formation, e.g. 13e3 Myr. Units = Myr.", \
         ARG_FLOAT ,                                                     \
-        "10e3",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         THICK_DISC_START_AGE,                                           \
         1.0,                                                            \
         },                                                              \
@@ -1885,7 +1874,7 @@ struct cmd_line_arg_t
         "thick_disc_end_age",                                           \
         "Lookback time for the end of the thick disc star formation, e.g. 4e3 Myr. Units = Myr.", \
         ARG_FLOAT ,                                                     \
-        "4e3",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         THICK_DISC_END_AGE,                                             \
         1.0,                                                            \
         },                                                              \
@@ -1894,7 +1883,7 @@ struct cmd_line_arg_t
         "thick_disc_logg_min",                                          \
         "Minimum logg for thick disc giants to be logged.",             \
         ARG_FLOAT ,                                                     \
-        "-100.0",                                                       \
+        WTTS_USE_DEFAULT,                                                       \
         THICK_DISC_LOGG_MIN,                                            \
         1.0,                                                            \
         },                                                              \
@@ -1903,7 +1892,7 @@ struct cmd_line_arg_t
         "thick_disc_logg_max",                                          \
         "Maximum logg for thick disc giants to be logged.",             \
         ARG_FLOAT ,                                                     \
-        "100.0",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         THICK_DISC_LOGG_MAX,                                            \
         1.0,                                                            \
         },                                                              \
@@ -1912,7 +1901,7 @@ struct cmd_line_arg_t
         "CEMP_minimum_age",                                             \
         "Minimum age that CEMP stars are required to have. See Izzard et al 2009. See also CEMP_cfe_minimum, CEMP_logg_maximum.", \
         ARG_FLOAT ,                                                     \
-        "1e9",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         NUCSYN_CEMP_MINIMUM_AGE_VAR,                                    \
         1.0,                                                            \
         },                                                              \
@@ -1921,7 +1910,7 @@ struct cmd_line_arg_t
         "escape_velocity",                                              \
         "A parameter used in constructing galactic chemical evolution (GCE) models. If the stellar wind velocity exceeds this value, any chemical yield from the wind is ignored, i.e. assumed lost. (km/s) Requires NUCSYN_GCE_OUTFLOW_CHECKS. Default 1e9 km/s. See also escape_fraction.", \
         ARG_FLOAT ,                                                     \
-        "1e9",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         NUCSYN_ESCAPE_VELOCITY_VAR,                                     \
         1.0,                                                            \
         },                                                              \
@@ -1930,7 +1919,7 @@ struct cmd_line_arg_t
         "escape_fraction",                                              \
         "A parameter used in constructing galactic chemical evolution (GCE) models. If the stellar wind velocity exceeds this value, any chemical yield from the wind is ignored, i.e. assumed lost. (km/s) Requires NUCSYN_GCE_OUTFLOW_CHECKS. Default 0.0. See also escape_velocity.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NUCSYN_ESCAPE_FRACTION_VAR,                                     \
         1.0,                                                            \
         },                                                              \
@@ -1939,7 +1928,7 @@ struct cmd_line_arg_t
         "pre_main_sequence",                                            \
         "Set to True to turn on pre-main sequence evolution. Currently this is not a special stellar type, rather the first (small) fraction of the main sequence has increased radii to match the Railton et al 2014 fits to Tout's pre-main sequence stars. Requires PRE_MAIN_SEQUENCE. See also pre_main_sequence_fit_lobes.", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         PRE_MAIN_SEQUENCE_VAR,                                          \
         1.0,                                                            \
         },                                                              \
@@ -1948,7 +1937,7 @@ struct cmd_line_arg_t
         "pre_main_sequence_fit_lobes",                                  \
         "Set to True force a pre-main sequence star into its Roche lobe. This is done by artificially aging it. Requires PRE_MAIN_SEQUENCE", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         PRE_MAIN_SEQUENCE_FIT_LOBES_VAR,                                \
         1.0,                                                            \
         },                                                              \
@@ -1957,7 +1946,7 @@ struct cmd_line_arg_t
         "rlperi",                                                       \
         "Set this to True to use the Roche lobe radius at periastron, rather than (the default to) assume a circular orbit. This will be useful one day when we treat RLOF in eccentric orbits properly, hopefully.", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->rlperi),                               \
         1.0                                                             \
         },                                                              \
@@ -1966,7 +1955,7 @@ struct cmd_line_arg_t
         "qcrit_LMMS",                                                   \
         "Apply critical q=Mdonor/Maccretor value for low-mass main sequence stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[LOW_MASS_MAIN_SEQUENCE]),        \
         1.0                                                             \
         },                                                              \
@@ -1975,7 +1964,7 @@ struct cmd_line_arg_t
         "qcrit_MS",                                                     \
         "Apply critical q=Mdonor/Maccretor value for (non-low mass) main sequence stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[MAIN_SEQUENCE]),                 \
         1.0                                                             \
         },                                                              \
@@ -1984,7 +1973,7 @@ struct cmd_line_arg_t
         "qcrit_HG",                                                     \
         "Apply critical q=Mdonor/Maccretor value for Hertzsprung gap stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[HERTZSPRUNG_GAP]),               \
         1.0                                                             \
         },                                                              \
@@ -1993,7 +1982,7 @@ struct cmd_line_arg_t
         "qcrit_GB",                                                     \
         "Apply critical q=Mdonor/Maccretor value for first red giant branch stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[GIANT_BRANCH]),                  \
         1.0                                                             \
         },                                                              \
@@ -2002,7 +1991,7 @@ struct cmd_line_arg_t
         "qcrit_CHeB",                                                   \
         "Apply critical q=Mdonor/Maccretor value for core helium burning stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[CHeB]),                          \
         1.0                                                             \
         },                                                              \
@@ -2011,7 +2000,7 @@ struct cmd_line_arg_t
         "qcrit_EAGB",                                                   \
         "Apply critical q=Mdonor/Maccretor value for early-AGB stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[EAGB]),                          \
         1.0                                                             \
         },                                                              \
@@ -2020,7 +2009,7 @@ struct cmd_line_arg_t
         "qcrit_TPAGB",                                                  \
         "Apply critical q=Mdonor/Maccretor value for TP-AGB stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[TPAGB]),                         \
         1.0                                                             \
         },                                                              \
@@ -2029,7 +2018,7 @@ struct cmd_line_arg_t
         "qcrit_HeMS",                                                   \
         "Apply critical q=Mdonor/Maccretor value for helium main sequence stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[HeMS]),                          \
         1.0                                                             \
         },                                                              \
@@ -2038,7 +2027,7 @@ struct cmd_line_arg_t
         "qcrit_HeHG",                                                   \
         "Apply critical q=Mdonor/Maccretor value for helium Hertzsprung gap stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[HeHG]),                          \
         1.0                                                             \
         },                                                              \
@@ -2047,7 +2036,7 @@ struct cmd_line_arg_t
         "qcrit_HeGB",                                                   \
         "Apply critical q=Mdonor/Maccretor value for helium red giant stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[HeGB]),                          \
         1.0                                                             \
         },                                                              \
@@ -2056,7 +2045,7 @@ struct cmd_line_arg_t
         "qcrit_HeWD",                                                   \
         "Apply critical q=Mdonor/Maccretor value for helium white dwarf stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[HeWD]),                          \
         1.0                                                             \
         },                                                              \
@@ -2065,7 +2054,7 @@ struct cmd_line_arg_t
         "qcrit_COWD",                                                   \
         "Apply critical q=Mdonor/Maccretor value for carbon-oxygen white dwarf stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[COWD]),                          \
         1.0                                                             \
         },                                                              \
@@ -2074,7 +2063,7 @@ struct cmd_line_arg_t
         "qcrit_ONeWD",                                                  \
         "Apply critical q=Mdonor/Maccretor value for oxygen-neon white dwarf stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[ONeWD]),                         \
         1.0                                                             \
         },                                                              \
@@ -2083,7 +2072,7 @@ struct cmd_line_arg_t
         "qcrit_NS",                                                     \
         "Apply critical q=Mdonor/Maccretor value for neutron stars to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[NEUTRON_STAR]),                  \
         1.0                                                             \
         },                                                              \
@@ -2092,7 +2081,7 @@ struct cmd_line_arg_t
         "qcrit_BH",                                                     \
         "Apply critical q=Mdonor/Maccretor value for black holes to determine the stability of Roche-lobe overflow for non-degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit[BLACK_HOLE]),                    \
         1.0                                                             \
         },                                                              \
@@ -2101,7 +2090,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_LMMS",                                        \
         "Apply critical q=Mdonor/Maccretor value for (low mass) main sequence stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[MAIN_SEQUENCE]),      \
         1.0                                                             \
         },                                                              \
@@ -2110,7 +2099,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_MS",                                          \
         "Apply critical q=Mdonor/Maccretor value for (non-low mass) main sequence stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[MAIN_SEQUENCE]),      \
         1.0                                                             \
         },                                                              \
@@ -2119,7 +2108,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_HG",                                          \
         "Apply critical q=Mdonor/Maccretor value for Hertzsprung gap stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[HERTZSPRUNG_GAP]),    \
         1.0                                                             \
         },                                                              \
@@ -2128,7 +2117,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_GB",                                          \
         "Apply critical q=Mdonor/Maccretor value for first red giant branch stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[GIANT_BRANCH]),       \
         1.0                                                             \
         },                                                              \
@@ -2137,7 +2126,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_CHeB",                                        \
         "Apply critical q=Mdonor/Maccretor value for core helium burning stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[CHeB]),               \
         1.0                                                             \
         },                                                              \
@@ -2146,7 +2135,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_EAGB",                                        \
         "Apply critical q=Mdonor/Maccretor value for early-AGB stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[EAGB]),               \
         1.0                                                             \
         },                                                              \
@@ -2155,7 +2144,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_TPAGB",                                       \
         "Apply critical q=Mdonor/Maccretor value for TP-AGB stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[TPAGB]),              \
         1.0                                                             \
         },                                                              \
@@ -2164,7 +2153,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_HeMS",                                        \
         "Apply critical q=Mdonor/Maccretor value for helium main sequence stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[HeMS]),               \
         1.0                                                             \
         },                                                              \
@@ -2173,7 +2162,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_HeHG",                                        \
         "Apply critical q=Mdonor/Maccretor value for helium Hertzsprung gap stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[HeHG]),               \
         1.0                                                             \
         },                                                              \
@@ -2182,7 +2171,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_HeGB",                                        \
         "Apply critical q=Mdonor/Maccretor value for helium red giant stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[HeGB]),               \
         1.0                                                             \
         },                                                              \
@@ -2191,7 +2180,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_HeWD",                                        \
         "Apply critical q=Mdonor/Maccretor value for helium white dwarf stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[HeWD]),               \
         1.0                                                             \
         },                                                              \
@@ -2200,7 +2189,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_COWD",                                        \
         "Apply critical q=Mdonor/Maccretor value for carbon-oxygen white dwarf stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[COWD]),               \
         1.0                                                             \
         },                                                              \
@@ -2209,7 +2198,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_ONeWD",                                       \
         "Apply critical q=Mdonor/Maccretor value for oxygen-neon white dwarf stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[ONeWD]),              \
         1.0                                                             \
         },                                                              \
@@ -2218,7 +2207,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_NS",                                          \
         "Apply critical q=Mdonor/Maccretor value for neutron stars to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[NEUTRON_STAR]),       \
         1.0                                                             \
         },                                                              \
@@ -2227,7 +2216,7 @@ struct cmd_line_arg_t
         "qcrit_degenerate_BH",                                          \
         "Apply critical q=Mdonor/Maccretor value for black holes to determine the stability of Roche-lobe overflow for degenerate accretors. See also qcrits_*, qcrits_degenerate_*.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->qcrit_degenerate[BLACK_HOLE]),         \
         1.0                                                             \
         },                                                              \
@@ -2236,7 +2225,7 @@ struct cmd_line_arg_t
         "mass_for_Hestar_Ia_upper",                                     \
         "Only helium stars below this mass can explode as SNIa. Default is zero, i.e. it never happens. See also mass_for_Hestar_Ia_lower.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->mass_for_Hestar_Ia_upper),             \
         1.0,                                                            \
         },                                                              \
@@ -2245,7 +2234,7 @@ struct cmd_line_arg_t
         "mass_for_Hestar_Ia_lower",                                     \
         "Only helium stars above this mass can explode as SNIa. Default is zero, i.e. it never happens. See also mass_for_Hestar_Ia_upper.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->mass_for_Hestar_Ia_lower),             \
         1.0,                                                            \
         },                                                              \
@@ -2255,7 +2244,7 @@ struct cmd_line_arg_t
         "alphaCB",                                                      \
         "Circumbinary disk viscosity parameter, alpha." ,               \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ALPHACB_VAR,                                                    \
         1.0,                                                            \
         },                                                              \
@@ -2264,7 +2253,7 @@ struct cmd_line_arg_t
         "minimum_donor_menv_for_comenv",                                \
         "Minimum donor envelope mass for common envelope evolution to be triggered (Msun). Default 0." , \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->minimum_donor_menv_for_comenv),        \
         1.0,                                                            \
         },                                                              \
@@ -2273,7 +2262,7 @@ struct cmd_line_arg_t
         "comenv_prescription",                                          \
         "Use this to choose which common envelope prescription you should use. 0=Hurley et al 2002 (based on the Paczyński energy model) or 1=Nelemans and Tout (angular momentum model). See also alpha_ce, comenv_ms_accretion_mass, comenv_ms_accretion_fraction, comenv_ns_accretion_fraction, comenv_ns_accretion_mass, nelemans_gamma, nelemans_minq, nelemans_max_frac_j_change, nelemans_n_comenvs, lambda_ce, lambda_ionisation.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->comenv_prescription),                  \
         1.0                                                             \
         },                                                              \
@@ -2282,7 +2271,7 @@ struct cmd_line_arg_t
         "comenv_ejection_spin_method",                                  \
         "When a common envelope is ejected, we need to decide how fast the stars are left spinning. COMENV_EJECTION_SPIN_METHOD_DO_NOTHING (0) is the default, this just leaves the stars/stellar cores spinning with the same spin rate (omega = angular velocity) with which they entered the common envelope phase. COMENV_EJECTION_SPIN_METHOD_SYCHRONIZE instead tidally synchronizes the stars with their new orbital angular velocity.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->comenv_ejection_spin_method),          \
         1.0                                                             \
         },                                                              \
@@ -2291,7 +2280,7 @@ struct cmd_line_arg_t
         "comenv_merger_spin_method",                                    \
         "When a common envelope binary merges, we need to decide how fast the resulting single star is left spinning. COMENV_MERGER_SPIN_METHOD_SPECIFIC (0) is the default, this preserves angular momentum but limits the specific angular momentum of the merged star to the specific angular momentum of the system at the onset of common envelope evolution. COMENV_MERGER_SPIN_METHOD_CONSERVE_ANGMOM (1) sets the merger's angular momentum to be that of the system at the onset of common envelope evolution (which means the star may be rotating supercritically). COMENV_MERGER_SPIN_METHOD_CONSERVE_OMEGA (2) sets the spin rate (angular frequency = omega) of the merged star to be that of the orbit just at the onset of common envelope evolution.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->comenv_merger_spin_method),            \
         1.0                                                             \
         },                                                              \
@@ -2300,7 +2289,7 @@ struct cmd_line_arg_t
         "comenv_ms_accretion_mass",                                     \
         "Experimental. During common envelope evolution, a main sequence star may accrete some of the envelope's mass. Requires COMENV_MS_ACCRETION. See also comenv_ms_accretion_fraction.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CE_MS_ACCRETION_MASS_VAR,                                       \
         1.0                                                             \
         },                                                              \
@@ -2309,7 +2298,7 @@ struct cmd_line_arg_t
         "comenv_ms_accretion_fraction",                                 \
         "Experimental. During common envelope evolution, a main sequence may accrete a fraction of the envelope's mass. Requires COMENV_MS_ACCRETION. See also comenv_ms_accretion_mass.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CE_MS_ACCRETION_FRACTION_VAR,                                   \
         1.0                                                             \
         },                                                              \
@@ -2318,7 +2307,7 @@ struct cmd_line_arg_t
         "comenv_ns_accretion_mass",                                     \
         "Experimental. During common envelope evolution, a neutron star may accrete some of the envelope's mass. Requires COMENV_NS_ACCRETION. See also comenv_ns_accretion_fraction.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CE_NS_ACCRETION_MASS_VAR,                                       \
         1.0                                                             \
         },                                                              \
@@ -2327,7 +2316,7 @@ struct cmd_line_arg_t
         "comenv_ns_accretion_fraction",                                 \
         "Experimental. During common envelope evolution, a neutron star may accrete a fraction of the envelope's mass. Requires COMENV_NS_ACCRETION. See also comenv_ns_accretion_mass.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CE_NS_ACCRETION_FRACTION_VAR,                                   \
         1.0                                                             \
         },                                                              \
@@ -2336,7 +2325,7 @@ struct cmd_line_arg_t
         "alpha_ce",                                                     \
         "Common envelope energy formalism parameter. A fraction alpha of the orbital energy is used to eject the envelope. See Hurley et al 2002 for details." , \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->alpha_ce),                             \
         1.0,                                                            \
         },                                                              \
@@ -2345,7 +2334,7 @@ struct cmd_line_arg_t
         "lambda_ce",                                                    \
         "Common envelope parameter. The binding energy of the common envelope is G*M*Menv/(lambda*R). Typically this is taken to be 0.5, but if set to -1 binary_c uses the Dewi and Tauris fits instead, -2 uses the formalism of Wang, Jia and Li (2016) and if -3 then a polytropic formalism is used (see also comenv_splitmass).", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->lambda_ce),                            \
         1.0,                                                            \
         },                                                              \
@@ -2354,7 +2343,7 @@ struct cmd_line_arg_t
         "comenv_splitmass",                                             \
         "When lambda_ce=-2, the envelope binding energy, lambda, is calculated using a polytropic formalism. The comenv_splitmass defines the point, in the units of the core mass, above which material is ejected.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         COMENV_SPLITMASS_VAR,                                           \
         1.0,                                                            \
         },                                                              \
@@ -2363,7 +2352,7 @@ struct cmd_line_arg_t
         "nelemans_recalc_eccentricity",                                 \
         "If True, recalculate the eccentricity after angular momentum is removed. " , \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->nelemans_recalc_eccentricity),         \
         1.0,                                                            \
         },                                                              \
@@ -2372,7 +2361,7 @@ struct cmd_line_arg_t
         "comenv_post_eccentricity",                                     \
         "Eccentricity remaining after common envelope ejection." ,      \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->comenv_post_eccentricity),             \
         1.0,                                                            \
         },                                                              \
@@ -2381,7 +2370,7 @@ struct cmd_line_arg_t
         "nelemans_gamma",                                               \
         "Set the fraction of the orbital specific angular momentum that is used to eject the common envelope according to the Nelemans and Tout prescription. See also nelemans_minq, nelemans_max_frac_j_change, nelemans_n_comenvs." , \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nelemans_gamma),                       \
         1.0,                                                            \
         },                                                              \
@@ -2390,7 +2379,7 @@ struct cmd_line_arg_t
         "nelemans_minq",                                                \
         "Only activate the Nelemans and Tout common envelope prescription for q>nelemans_minq. See also nelemans_gamma, nelemans_max_frac_j_change, nelemans_n_comenvs." , \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nelemans_minq),                        \
         1.0,                                                            \
         },                                                              \
@@ -2399,7 +2388,7 @@ struct cmd_line_arg_t
         "nelemans_max_frac_j_change",                                   \
         "Maximum fractional angular momentum change in the Nelemans and Tout common envelope prescription. See also nelemans_gamma, nelemans_minq, nelemans_n_comenvs." , \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nelemans_max_frac_j_change),           \
         1.0,                                                            \
         },                                                              \
@@ -2408,7 +2397,7 @@ struct cmd_line_arg_t
         "nelemans_n_comenvs",                                           \
         "Set the maximum number of common envelope ejections allowed to follow the Nelemans and Tout prescription, after which the standard alpha prescription is used." , \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nelemans_n_comenvs),                   \
         1.0,                                                            \
         },                                                              \
@@ -2417,7 +2406,7 @@ struct cmd_line_arg_t
         "lambda_ionisation",                                            \
         "A fraction lambda_ionisation of the recombination energy in the common envelope goes into ejecting the envelope. This is usually 0.0, but a positive value can make a big difference to the outcome of common envelope evolution.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                           \
+        WTTS_USE_DEFAULT,                                                           \
         &(stardata->preferences->lambda_ionisation),                    \
         1.0,                                                            \
         },                                                              \
@@ -2426,7 +2415,7 @@ struct cmd_line_arg_t
         "lambda_enthalpy",                                              \
         "A fraction of the enthalpy to be included in the common envelope evolution binding energy. Only used for the Wang 2016 prescription (so far).", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->lambda_enthalpy),                      \
         1.0,                                                            \
         },                                                              \
@@ -2435,7 +2424,7 @@ struct cmd_line_arg_t
         "cbdisc_gamma",                                                 \
         "Circumbinary disc gamma (equation of state) parameter. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_GAMMA_VAR,                                               \
         1.0,                                                            \
         },                                                              \
@@ -2444,7 +2433,7 @@ struct cmd_line_arg_t
         "cbdisc_alpha",                                                 \
         "Circumbinary disc alpha (viscosity) parameter. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_ALPHA_VAR,                                               \
         1.0,                                                            \
         },                                                              \
@@ -2453,7 +2442,7 @@ struct cmd_line_arg_t
         "cbdisc_kappa",                                                 \
         "Circumbinary disc kappa (opacity) parameter. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_KAPPA_VAR,                                               \
         1.0,                                                            \
         },                                                              \
@@ -2462,7 +2451,7 @@ struct cmd_line_arg_t
         "cbdisc_minimum_evaporation_timescale",                         \
         "Circumbinary disc minimum evaporation timescale (years). If (slow, not edge stripped) mass loss would evaporate the disc on a timescale less than this, simply evaporate the disc immediated. Usually set to 1y, ignore if zero. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MINIMUM_EVAPORATION_TIMESCALE_VAR,                       \
         1.0,                                                            \
         },                                                              \
@@ -2471,7 +2460,7 @@ struct cmd_line_arg_t
         "cbdisc_torquef",                                               \
         "Circumbinary disc binary torque multiplier. Requires DISCS.",  \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_TORQUEF_VAR,                                             \
         1.0,                                                            \
         },                                                              \
@@ -2480,7 +2469,7 @@ struct cmd_line_arg_t
         "cbdisc_max_lifetime",                                          \
         "Circumbinary disc maximum lifetime (years, ignored if 0). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MAX_LIFETIME_VAR,                                             \
         1.0,                                                            \
         },                                                              \
@@ -2489,7 +2478,7 @@ struct cmd_line_arg_t
         "cbdisc_init_dM",                                              \
         "On cbdisc start, reduce mass by a fraction dM if it won't converge. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0.1",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         CBDISC_START_DM_VAR,                                            \
         1.0,                                                            \
         },                                                              \
@@ -2498,7 +2487,7 @@ struct cmd_line_arg_t
         "cbdisc_init_dJdM",                                            \
         "On cbdisc start, reduce angular momentum by a fraction dJ/dM*dM if it won't converge. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0.1",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         CBDISC_START_DJDM_VAR,                                          \
         1.0,                                                            \
         },                                                              \
@@ -2507,7 +2496,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_constant_rate",                               \
         "Circumbinary disc constant mass loss rate (Msun/year). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_RATE_VAR,                                      \
         1.0,                                                            \
         },                                                              \
@@ -2516,7 +2505,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_FUV_multiplier",                              \
         "Circumbinary disc FUV mass loss rate multiplier (no units). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_FUV_MULTIPLIER_VAR,                            \
         1.0,                                                            \
         },                                                              \
@@ -2525,7 +2514,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_Xray_multiplier",                             \
         "Circumbinary disc X-ray mass loss rate multiplier (no units). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_XRAY_MULTIPLIER_VAR,                           \
         1.0,                                                            \
         },                                                              \
@@ -2534,7 +2523,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_ISM_ram_pressure_multiplier",                 \
         "Circumbinary disc interstellar medium ram pressure stripping mass loss rate multiplier (no units). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_ISM_RAM_PRESSURE_MULTIPLIER_VAR,               \
         1.0,                                                            \
         },                                                              \
@@ -2543,7 +2532,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_ISM_pressure",                                \
         "Circumbinary disc interstellar medium ram pressure in units of Boltzmann constant per Kelvin (I think...). Requires DISCS. Typically 3000.0. See e.g. http://www.astronomy.ohio-state.edu/~pogge/Ast871/Notes/Intro.pdf page 15 or https://arxiv.org/pdf/0902.0820.pdf Fig. 1 (left panel).", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_ISM_PRESSURE_VAR,                              \
         1.0,                                                            \
         },                                                              \
@@ -2552,7 +2541,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_inner_viscous_multiplier",                    \
         "Circumbinary disc inner edge viscous mass loss rate multiplier (no units). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_INNER_VISCOUS_MULTIPLIER_VAR,                  \
         1.0,                                                            \
         },                                                              \
@@ -2561,7 +2550,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_inner_viscous_angular_momentum_multiplier",   \
         "Circumbinary disc inner edge viscous angular momentum multiplier (no units). The inner edge angular momentum Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_INNER_VISCOUS_ANGULAR_MOMENTUM_MULTIPLIER_VAR, \
         1.0,                                                            \
         },                                                              \
@@ -2570,7 +2559,7 @@ struct cmd_line_arg_t
         "cbdisc_resonance_multiplier",                                  \
         "Circumbinary disc resonant interaction multiplier, affects eccentricity pumping and angular momentum rates. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_RESONANCE_MULTIPLIER_VAR,                                \
         1.0,                                                            \
         },                                                              \
@@ -2579,7 +2568,7 @@ struct cmd_line_arg_t
         "cbdisc_resonance_damping",                                     \
         "Circumbinary disc resonant interaction damping: should be on (True) to damp the l=1, m=2 resonance when the disc inner edge lies outside the resonance location. Requires DISCS.", \
         ARG_BOOLEAN,                                                    \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         CBDISC_RESONANCE_DAMPING_VAR,                                   \
         1.0,                                                            \
         },                                                              \
@@ -2588,7 +2577,7 @@ struct cmd_line_arg_t
         "cbdisc_fail_ring_inside_separation",                           \
         "If True, while converging on a structure, circumbinary discs with Rring < the binary separation are immediately failed.", \
         ARG_BOOLEAN,                                                    \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         CBDISC_FAIL_RING_INSIDE_SEPARATION,                             \
         1.0,                                                            \
         },                                                              \
@@ -2597,7 +2586,7 @@ struct cmd_line_arg_t
         "cbdisc_mass_loss_inner_L2_cross_multiplier",                   \
         "Circumbinary disc inner edge L2-crossing mass loss rate multiplier (no units). Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MASS_LOSS_INNER_L2_CROSS_MULTIPLIER_VAR,                 \
         1.0,                                                            \
         },                                                              \
@@ -2606,7 +2595,7 @@ struct cmd_line_arg_t
         "cbdisc_minimum_luminosity",                                    \
         "Circumbinary disc minimum luminosity. If the disc becomes dimmer than this, the disc is evaporated instantly. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MINIMUM_LUMINOSITY_VAR,                                  \
         1.0,                                                            \
         },                                                              \
@@ -2615,7 +2604,7 @@ struct cmd_line_arg_t
         "cbdisc_minimum_mass",                                          \
         "Circumbinary disc minimum mass. If the disc becomes less massive than this, the disc is evaporated instantly. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MINIMUM_MASS_VAR,                                        \
         1.0,                                                            \
         },                                                              \
@@ -2624,7 +2613,7 @@ struct cmd_line_arg_t
         "cbdisc_minimum_fRing",                                         \
         "Circumbinary disc minimum fRing. If the disc becomes a ring, and fRing = |Rout/Rin-1| < this value (and this value is non-zero), the disc is evaporated instantly. Requires DISCS.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CBDISC_MINIMUM_FRING_VAR,                                       \
         1.0,                                                            \
         },                                                              \
@@ -2633,7 +2622,7 @@ struct cmd_line_arg_t
         "comenv_disc_angmom_fraction",                                  \
         "If >0 Fraction of the common envelope's angular momentum that goes into the circumbinary disc. If -1 then uses the moments of inertia to calculate (deprecated), if -2 use the common envelope's specific angular momentum, if -3 uses the L2 point at the end of the common envelope to set the angular momentum. Requires DISCS and DISCS_CIRCUMBINARY_FROM_COMENV.", \
         ARG_FLOAT ,                                                     \
-        "-1",                                                           \
+        WTTS_USE_DEFAULT,                                                           \
         COMENV_DISC_ANGMOM_FRACTION_VAR,                                \
         1.0,                                                            \
         },                                                              \
@@ -2642,7 +2631,7 @@ struct cmd_line_arg_t
         "comenv_disc_mass_fraction",                                    \
         "Fraction of the common envelope's mass that goes into the circumbinary disc. Requires DISCS and DISCS_CIRCUMBINARY_FROM_COMENV.", \
         ARG_FLOAT ,                                                     \
-        "0.01",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         COMENV_DISC_MASS_FRACTION_VAR,                                  \
         1.0,                                                            \
         },                                                              \
@@ -2651,7 +2640,7 @@ struct cmd_line_arg_t
         "wind_disc_angmom_fraction",                                  \
         "If >0 Fraction of the wind envelope's angular momentum that goes into the circumbinary disc. If -1 then uses the L2 point's specific angular momentum. Requires DISCS and DISCS_CIRCUMBINARY_FROM_WIND.", \
         ARG_FLOAT ,                                                     \
-        "-1",                                                           \
+        WTTS_USE_DEFAULT,                                                           \
         WIND_DISC_ANGMOM_FRACTION_VAR,                                \
         1.0,                                                            \
         },                                                              \
@@ -2660,7 +2649,7 @@ struct cmd_line_arg_t
         "wind_disc_mass_fraction",                                    \
         "Fraction of the stellar wind's mass that goes into the circumbinary disc. Requires DISCS and DISCS_CIRCUMBINARY_FROM_WIND.", \
         ARG_FLOAT ,                                                     \
-        "0.01",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         WIND_DISC_MASS_FRACTION_VAR,                                  \
         1.0,                                                            \
         },                                                              \
@@ -2669,7 +2658,7 @@ struct cmd_line_arg_t
         "WRLOF_method",                                                 \
         "Choose whether and how to apply wind-Roche-lobe-overflow. 0=none, 1=q-dependent, 2=quadratic See Abate et al 2013/14 for details. Requires WRLOF_MASS_TRANSFER.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         WRLOF_METHOD_VAR,                                               \
         1.0                                                             \
         },                                                              \
@@ -2678,7 +2667,7 @@ struct cmd_line_arg_t
         "minimum_timestep",                                             \
         "The minimum timestep (Myr).",                                  \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->minimum_timestep),                     \
         1.0                                                             \
         },                                                              \
@@ -2688,7 +2677,7 @@ struct cmd_line_arg_t
         "timestep_solver_factor",                                       \
         "Factor applied in timestep_limits, e.g. to prevent X changing too fast by comparing to X/dX/dt, which is usually 1 but can be higher to lengthen timesteps when using an alternative solver.", \
         ARG_FLOAT ,                                                     \
-        "1.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->timestep_solver_factor),               \
         1.0                                                             \
         },                                                              \
@@ -2697,7 +2686,7 @@ struct cmd_line_arg_t
         "RLOF_timestep_modulator",                                      \
         "Multiplier applied to the timestep during Roche-lobe overflow. Requires RLOF_TIMESTEP_MODULATION.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         RLOF_TIMESTEP_MODULATOR_VAR,                                    \
         1.0                                                             \
         },                                                              \
@@ -2706,7 +2695,7 @@ struct cmd_line_arg_t
         "RLOF_mdot_factor",                                             \
         "Multiplier applied to the mass transfer rate during Roche-lobe overflow. Requires RLOF_MDOT_MODULATION.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         RLOF_MDOT_MODULATOR_VAR,                                        \
         1.0                                                             \
         },                                                              \
@@ -2715,7 +2704,7 @@ struct cmd_line_arg_t
         "RLOF_f",                                                       \
         "Factor to enlarge a Roche lobe, nominally because of radiation pressure (see Dermine et al paper). Requires RLOF_RADIATION_CORRECTION.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         RLOF_F_VAR,                                                     \
         1.0                                                             \
         },                                                              \
@@ -2724,7 +2713,7 @@ struct cmd_line_arg_t
         "minimum_separation_for_instant_RLOF",                          \
         "If True, instead of evolving the system just report the minimum separation (on the zero-age main sequence) that would lead to instant RLOF. Used by binary_grid. See also minimum_orbital_period_for_instant_RLOF.", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->show_minimum_separation_for_instant_RLOF), \
         1.0                                                             \
         },                                                              \
@@ -2733,8 +2722,8 @@ struct cmd_line_arg_t
         "separation",                                                   \
         "Set the orbital separation in solar radii. Note that if the orbital period is given, it is used to calculate the separation. So if you want to set the separation instead, either do not set the orbital period or set the orbital period to zero (0.0).", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
-        &(stardata->common.orbit.separation),                                 \
+        WTTS_USE_DEFAULT,                                                            \
+        &(stardata->preferences->initial_orbital_separation),                                 \
         1.0                                                             \
         },                                                              \
 {                                                                       \
@@ -2742,7 +2731,7 @@ struct cmd_line_arg_t
         "minimum_orbital_period_for_instant_RLOF",                      \
         "If True, instead of evolving the system just report the minimum orbital period (on the zero-age main sequence) that would lead to instant RLOF. Used by binary_grid. See also minimum_separeation_for_instant_RLOF.", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         &(stardata->preferences->show_minimum_orbital_period_for_instant_RLOF), \
         1.0                                                             \
         },                                                              \
@@ -2751,7 +2740,7 @@ struct cmd_line_arg_t
         "RLOF_method",                                                  \
         "Use RLOF_method to choose the algorithm you use for Roche-lobe overflow mass loss rate calculations. 0=Hurley et al 2002, 1=Adaptive (for radiative stars) R=RL method, 2=Ritter (probably broken), 3=Claeys etal 2014 variant on Hurley et al 2002.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->RLOF_method),                          \
         1.0                                                             \
         },                                                              \
@@ -2760,7 +2749,7 @@ struct cmd_line_arg_t
         "small_envelope_method",                                                  \
         "Choose the method used to determine the stellar radius when the envelope mass is very thin. 0 = Hurley et al. (2002), 1 = Miller Bertolami et al. (2016+) for GB and AGB stars only.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->small_envelope_method),                \
         1.0                                                             \
         },                                                              \
@@ -2769,7 +2758,7 @@ struct cmd_line_arg_t
         "RLOF_interpolation_method",                                    \
         "When a star overflows its Roche lobe, it always has R>RL because of the limited time resolution of the simulation. Binary_c then uses an algorithm to get back to when R~RL (within a desired tolerance, set in RLOF_ENTRY_THRESHOLD which is usually 1.02, i.e. overflow of 2%). You can choose algorithm 0, the Hurley et al 2002 method which reverses time (i.e. uses a Newton-like scheme), or 1 to use the binary_c method which rejects a timestep (and hence does no logging on that timestep) and repeats with half the timestep until R~RL. The latter is now the default, because this means there are no negative timesteps which break various other algorithms (e.g. nucleosynthesis).", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->RLOF_interpolation_method),            \
         1.0                                                             \
         },                                                              \
@@ -2778,7 +2767,7 @@ struct cmd_line_arg_t
         "vrot1",                                                        \
         "Equatorial rotational speed of star 1 (km/s). If 0.0, the Hurley et al 2000/2002 prescription is used to set the main-sequence velocity, so for a truly non-rotating star, set to something small (e.g. 0.001). Requires MANUAL_VROT. See also vrot2.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         VROT_1_VAR,                                                     \
         1.0                                                             \
         },                                                              \
@@ -2787,7 +2776,7 @@ struct cmd_line_arg_t
         "vrot2",                                                        \
         "Equatorial rotational speed of star 2 (km/s). If 0.0, the Hurley et al 2000/2002 prescription is used to set the main-sequence velocity, so for a truly non-rotating star, set to something small (e.g. 0.001). Requires MANUAL_VROT. See also vrot1.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         VROT_2_VAR,                                                     \
         1.0                                                             \
         },                                                              \
@@ -2796,7 +2785,7 @@ struct cmd_line_arg_t
         "timestep_modulator",                                           \
         "Multiplier applied to the global timestep. Requires TIMESTEP_MODULATION.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         TIMESTEP_MODULATOR_VAR,                                         \
         1.0                                                             \
         },                                                              \
@@ -2805,7 +2794,7 @@ struct cmd_line_arg_t
         "timestep_multiplier%d",                                        \
         "Multiplier applied to timestep limit <n>.",                    \
         ARG_FLOAT_SCANF,                                                \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->timestep_multipliers),                 \
         1.0                                                             \
         },                                                              \
@@ -2814,7 +2803,7 @@ struct cmd_line_arg_t
         "maximum_timestep",                                             \
         "The maximum timestep (MYr).",                                  \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->maximum_timestep),                     \
         1.0                                                             \
         },                                                              \
@@ -2823,7 +2812,7 @@ struct cmd_line_arg_t
         "zoomfac_multiplier_decrease",                                  \
         "When a timestep is rejected, decrease the timestep by this factor (0.5).", \
         ARG_FLOAT ,                                                     \
-        "0.5",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->zoomfac_multiplier_decrease),          \
         1.0,                                                            \
         },                                                              \
@@ -2832,7 +2821,7 @@ struct cmd_line_arg_t
         "zoomfac_multiplier_increase",                                  \
         "When a timestep is rejected, zooms, then succeeds, increase the timestep by this factor (1.2).", \
         ARG_FLOAT ,                                                     \
-        "1.2",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->zoomfac_multiplier_increase),          \
         1.0,                                                            \
         },                                                              \
@@ -2841,7 +2830,7 @@ struct cmd_line_arg_t
         "maximum_timestep_factor",                                      \
         "The maximum factor between two subsequent timesteps (1.2).",   \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->maximum_timestep_factor),              \
         1.0                                                             \
         },                                                              \
@@ -2850,7 +2839,7 @@ struct cmd_line_arg_t
         "maximum_nuclear_burning_timestep",                             \
         "The maximum timestep (MYr) in any nuclear burning phase.",     \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->maximum_nuclear_burning_timestep),     \
         1.0                                                             \
         },                                                              \
@@ -2859,7 +2848,7 @@ struct cmd_line_arg_t
         "nova_retention_method",                                        \
         "Algorithm used to calculate the amount of mass retained during a nova explosion. 0=use nova_retention_fraction. (other methods pending)", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nova_retention_method),                \
         1.0                                                             \
         },                                                              \
@@ -2869,7 +2858,7 @@ struct cmd_line_arg_t
         "nova_retention_fraction",                                      \
         "The mass accreted during a nova as fraction of mass transferred", \
         ARG_FLOAT ,                                                     \
-        "1e-3",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->nova_retention_fraction),              \
         1.0                                                             \
         },                                                              \
@@ -2878,7 +2867,7 @@ struct cmd_line_arg_t
         "beta_reverse_nova",                                            \
         "The fraction of mass ejected in a nova explosion which is accreted back onto the companion star. Set to -1 to automatically calculate based on a geometric argument, or 0 or positive to set the value.", \
         ARG_FLOAT ,                                                     \
-        "0.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         &(stardata->preferences->beta_reverse_nova),                    \
         1.0                                                             \
         },                                                              \
@@ -2887,7 +2876,7 @@ struct cmd_line_arg_t
         "WD_accretion_rate_novae_upper_limit_hydrogen_donor",              \
         "Upper limit of the stable mass transfer rate onto a white dwarf that leads to novae when the donor is hydrogen rich : above this rate the mass transfer leads to stable burning.", \
         ARG_FLOAT ,                                                     \
-        "1.03e-7",                                                      \
+        WTTS_USE_DEFAULT,                                                      \
         &(stardata->preferences->WD_accretion_rate_novae_upper_limit_hydrogen_donor), \
         1.0                                                             \
         },                                                              \
@@ -2896,7 +2885,7 @@ struct cmd_line_arg_t
         "WD_accretion_rate_novae_upper_limit_helium_donor",                \
         "Upper limit of the stable mass transfer rate onto a white dwarf that leads to novae when the donor is helium rich : above this rate the mass transfer leads to stable burning.", \
         ARG_FLOAT ,                                                     \
-        "1.03e-7",                                                      \
+        WTTS_USE_DEFAULT,                                                      \
         &(stardata->preferences->WD_accretion_rate_novae_upper_limit_helium_donor), \
         1.0                                                             \
         },                                                              \
@@ -2905,7 +2894,7 @@ struct cmd_line_arg_t
         "WD_accretion_rate_novae_upper_limit_other_donor",                 \
         "Upper limit of the stable mass transfer rate onto a white dwarf that leads to novae when the donor is neither hydrogen nor helium rich : above this rate the mass transfer leads to stable burning.", \
         ARG_FLOAT ,                                                     \
-        "1.03e-7",                                                      \
+        WTTS_USE_DEFAULT,                                                      \
         &(stardata->preferences->WD_accretion_rate_novae_upper_limit_other_donor), \
         1.0                                                             \
         },                                                              \
@@ -2914,7 +2903,7 @@ struct cmd_line_arg_t
         "WD_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor", \
         "Lower limit of the mass transfer rate onto a white dwarf that leads to a the formation of a new giant envelope with a hydrogen-rich donor. Below this mass transfer leads to stable burning.", \
         ARG_FLOAT ,                                                     \
-        "2.71e-7",                                                      \
+        WTTS_USE_DEFAULT,                                                      \
         &(stardata->preferences->WD_accretion_rate_new_giant_envelope_lower_limit_hydrogen_donor), \
         1.0                                                             \
         },                                                              \
@@ -2923,7 +2912,7 @@ struct cmd_line_arg_t
         "WD_accretion_rate_new_giant_envelope_lower_limit_helium_donor",   \
         "Lower limit of the mass transfer rate onto a white dwarf that leads to a the formation of a new giant envelope with a helium-rich donor. Below this mass transfer leads to stable burning.", \
         ARG_FLOAT ,                                                     \
-        "2.71e-7",                                                      \
+        WTTS_USE_DEFAULT,                                                      \
         &(stardata->preferences->WD_accretion_rate_new_giant_envelope_lower_limit_helium_donor), \
         1.0                                                             \
         },                                                              \
@@ -2932,7 +2921,7 @@ struct cmd_line_arg_t
         "WD_accretion_rate_new_giant_envelope_lower_limit_other_donor",    \
         "Lower limit of the mass transfer rate onto a white dwarf that leads to a the formation of a new giant envelope when the donor is neither hydrogen nor helium rich. Below this mass transfer leads to stable burning.", \
         ARG_FLOAT ,                                                     \
-        "2.71e-7",                                                      \
+        WTTS_USE_DEFAULT,                                                      \
         &(stardata->preferences->WD_accretion_rate_new_giant_envelope_lower_limit_other_donor), \
         1.0                                                             \
         },                                                              \
@@ -2941,7 +2930,7 @@ struct cmd_line_arg_t
         "CRAP_parameter",                                               \
         "Tidally enhanced mass loss parameter. See Tout and Eggleton's paper on the subject. (Was the parameter bb).", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->CRAP_parameter),                       \
         1.0                                                             \
         },                                                              \
@@ -2990,7 +2979,7 @@ struct cmd_line_arg_t
         "hrdiag_output",                                                \
         "Set to True to output high time-resolution Hertzstrpung-Russell diagram information. Requires HRDIAG.", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         HRDIAG_OUTPUT_VAR,                                              \
         1.0                                                             \
         },                                                              \
@@ -2999,7 +2988,7 @@ struct cmd_line_arg_t
         "internal_buffering",                                           \
         "Experimental. Set to non-zero values to implement internal buffering prior to output. For use with binary_grid, you shouldn't really be playing with this.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->internal_buffering),                   \
         1.0                                                             \
         },                                                              \
@@ -3009,7 +2998,7 @@ struct cmd_line_arg_t
         "internal_buffering_compression",                               \
         "Experimental. Set the internal_buffering compression level (0=none, otherwise 1-9). See internal_buffering.", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->internal_buffering_compression),       \
         1.0                                                             \
         },                                                              \
@@ -3019,7 +3008,7 @@ struct cmd_line_arg_t
         "individual_novae",                                             \
         "If individual_novae is True, novae are resolved such that each explosion is performed separtaely.", \
         ARG_BOOLEAN,                                                    \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         INDIVIDUAL_NOVAE_VAR,                                           \
         1.0                                                             \
         },                                                              \
@@ -3029,7 +3018,7 @@ struct cmd_line_arg_t
         "force_corotation_on_RLOF",                                     \
         "If True forces co-rotation of stars and orbit when RLOF starts, this is as in the BSE algorithm. (True)", \
         ARG_BOOLEAN ,                                                   \
-        "True",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->force_corotation_on_RLOF),             \
         1.0                                                             \
         },                                                              \
@@ -3039,7 +3028,7 @@ struct cmd_line_arg_t
         "nonconservative_angmom_gamma",                                 \
         "Mass lost from the system (but NOT from a stellar wind) takes a fraction gamma of the orbital angular momentum with it. Set to -1 to take the specific angular momentum of the donor star. Set to -2 to take super-Eddington, nova and disk-wind angular momenta as if a wind from the accretor.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->nonconservative_angmom_gamma),         \
         1.0                                                             \
         },                                                              \
@@ -3048,7 +3037,7 @@ struct cmd_line_arg_t
         "max_stellar_angmom_change",                                    \
         "Maxmimum fractional change in stellar angular momentum allowed before a timestep is rejected (0.05).", \
         ARG_FLOAT ,                                                     \
-        "0.05",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->max_stellar_angmom_change),            \
         1.0                                                             \
         },                                                              \
@@ -3057,7 +3046,7 @@ struct cmd_line_arg_t
         "comenv_ms_accretion_mass",                                     \
         "Experimental. During common envelope evolution, a main sequence star may accrete some of the envelope's mass. Requires COMENV_MS_ACCRETION. See also comenv_ms_accretion_fraction.", \
         ARG_FLOAT ,                                                     \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         CE_MS_ACCRETION_MASS_VAR,                                       \
         1.0                                                             \
         },                                                              \
@@ -3066,7 +3055,7 @@ struct cmd_line_arg_t
         "third_dup",                                                    \
         "If True, enables third dredge up. Requires NUCSYN and NUCSYN_THIRD_DREDGE_UP.", \
         ARG_BOOLEAN,                                                    \
-        "True",                                                         \
+        WTTS_USE_DEFAULT,                                                         \
         &(stardata->preferences->third_dup),                            \
         1.0                                                             \
         } ,                                                             \
@@ -3093,7 +3082,7 @@ struct cmd_line_arg_t
         "nucreacmult%d",                                                \
         "Usage: --nucreacmult%d <f>. Multiply nuclear reaction given by the integer %d (integer) by f (float). ", \
         ARG_FLOAT_SCANF,                                                \
-        "1.0",                                                          \
+        WTTS_USE_DEFAULT,                                                          \
         NUCSYN_REACTION_RATE_MULTIPLIERS_VAR, \
         1.0                                                             \
         } ,                                                             \
@@ -3102,7 +3091,7 @@ struct cmd_line_arg_t
         "nucsyn_metallicity",                                           \
         "This sets the metallicity of the nucleosynthesis algorithms, i.e. the amount (by mass) of matter which is not hydrogen or helium. Usually you'd just set this with the metallicity parameter, but if you want the nucleosynthesis to be outside the range of the stellar evolution algorithm (e.g. Z=0 or Z=0.04) then you need to use nucsyn_metallicity. That said, it's also outside the range of some of the nucleosynthesis algorithms as well, so you have been warned!", \
         ARG_FLOAT,                                                      \
-        "DEFAULT_TO_METALLICITY",                                       \
+        WTTS_USE_DEFAULT,                                       \
         NUCSYN_METALLICITY_VAR,                                         \
         1.0                                                             \
         },                                                              \
@@ -3150,7 +3139,7 @@ struct cmd_line_arg_t
         "init_abunds_only",                                             \
         "If True, outputs only the initial abundances, then exits.",    \
         ARG_BOOLEAN,                                                    \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         INIT_ABUNDS_VAR,                                                \
         1.0                                                             \
         } ,                                                             \
@@ -3160,7 +3149,7 @@ struct cmd_line_arg_t
         "initial_abunds_only",                                          \
         "If True, outputs only the initial abundances, then exits.",    \
         ARG_BOOLEAN,                                                    \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                                        \
         INIT_ABUNDS_VAR,                                                \
         1.0                                                             \
         } ,                                                             \
@@ -3170,7 +3159,7 @@ struct cmd_line_arg_t
         "no_thermohaline_mixing",                                       \
         "If True, disables thermohaline mixing.",                       \
         ARG_BOOLEAN,                                                    \
-        "False",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         NO_THERMOHALINE_MIXING_VAR,                                     \
         1.0                                                             \
         } ,                                                             \
@@ -3179,7 +3168,7 @@ struct cmd_line_arg_t
         "lithium_GB_post_Heflash",                                      \
         "Sets the lithium abundances after the helium flash. Requires NUCSYN and LITHIUM_TABLES.", \
         ARG_FLOAT,                                                      \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         LITHIUM_GB_POST_HEFLASH_VAR,                                    \
         1.0                                                             \
         } ,                                                             \
@@ -3188,7 +3177,7 @@ struct cmd_line_arg_t
         "lithium_GB_post_1DUP",                                         \
         "Sets the lithium abundance after first dredge up. Requires NUCSYN and LITHIUM_TABLES.", \
         ARG_FLOAT,                                                      \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         LITHIUM_GB_POST_1DUP_VAR,                                       \
         1.0                                                             \
         },                                                              \
@@ -3197,7 +3186,7 @@ struct cmd_line_arg_t
         "lithium_hbb_multiplier",                                       \
         "Multiplies the lithium abundances on the AGB during HBB (based on Karakas/Fishlock et al models).Requires NUCSYN and LITHIUM_TABLES.", \
         ARG_FLOAT,                                                      \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         LITHIUM_GB_HBB_MULTIPLIER_VAR,                                  \
         1.0                                                             \
         },                                                              \
@@ -3206,7 +3195,7 @@ struct cmd_line_arg_t
         "angelou_lithium_decay_function",                                       \
         "Functional form which describes Li7 decay. Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Choices are : 0 expoential (see angelou_lithium_decay_time).", \
         ARG_INTEGER,                                                    \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_DECAY_FUNCTION_VAR,                             \
         1.0                                                             \
         },                                                              \
@@ -3215,7 +3204,7 @@ struct cmd_line_arg_t
         "angelou_lithium_LMMS_time",                                    \
         "Time at which lithium manufacture is triggered in a low-mass (convective) main sequence (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_LMMS_TIME_VAR,                                  \
         1.0                                                             \
         },                                                              \
@@ -3224,7 +3213,7 @@ struct cmd_line_arg_t
         "angelou_lithium_MS_time",                                      \
         "Time at which lithium manufacture is triggered on the main sequence (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_MS_TIME_VAR,                                    \
         1.0                                                             \
         },                                                              \
@@ -3233,7 +3222,7 @@ struct cmd_line_arg_t
         "angelou_lithium_HG_time",                                      \
         "Time at which lithium manufacture is triggered on the Hertzsprung gap (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_HG_TIME_VAR,                                    \
         1.0                                                             \
         },                                                              \
@@ -3242,7 +3231,7 @@ struct cmd_line_arg_t
         "angelou_lithium_GB_time",                                      \
         "Time at which lithium manufacture is triggered on the giant branch (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_GB_TIME_VAR,                                    \
         1.0                                                             \
         },                                                              \
@@ -3251,7 +3240,7 @@ struct cmd_line_arg_t
         "angelou_lithium_CHeB_time",                                    \
         "Time at which lithium manufacture is triggered during core helium burning (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_CHeB_TIME_VAR,                                  \
         1.0                                                             \
         },                                                              \
@@ -3260,7 +3249,7 @@ struct cmd_line_arg_t
         "angelou_lithium_EAGB_time",                                    \
         "Time at which lithium manufacture is triggered on the early AGB (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_EAGB_TIME_VAR,                                  \
         1.0                                                             \
         },                                                              \
@@ -3269,7 +3258,7 @@ struct cmd_line_arg_t
         "angelou_lithium_TPAGB_time",                                   \
         "Time at which lithium manufacture is triggered on the thermally pulsing AGB (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_TPAGB_TIME_VAR,                                 \
         1.0                                                             \
         },                                                              \
@@ -3278,7 +3267,7 @@ struct cmd_line_arg_t
         "angelou_lithium_LMMS_decay_time",                              \
         "Decay time for surface lithium abundance during the low-mass (convective) main sequence (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_LMMS_DECAY_TIME_VAR,                            \
         1.0                                                             \
         },                                                              \
@@ -3287,7 +3276,7 @@ struct cmd_line_arg_t
         "angelou_lithium_MS_decay_time",                                \
         "Decay time for surface lithium abundance on the main sequence (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_MS_DECAY_TIME_VAR,                              \
         1.0                                                             \
         },                                                              \
@@ -3296,7 +3285,7 @@ struct cmd_line_arg_t
         "angelou_lithium_HG_decay_time",                                \
         "Decay time for surface lithium abundance on the Hertzsprung gap (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_HG_DECAY_TIME_VAR,                              \
         1.0                                                             \
         },                                                              \
@@ -3305,7 +3294,7 @@ struct cmd_line_arg_t
         "angelou_lithium_GB_decay_time",                                \
         "Decay time for surface lithium abundance on the giant branch (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_GB_DECAY_TIME_VAR,                              \
         1.0                                                             \
         },                                                              \
@@ -3314,7 +3303,7 @@ struct cmd_line_arg_t
         "angelou_lithium_CHeB_decay_time",                              \
         "Decay time for surface lithium abundance during core helium burning (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_CHeB_DECAY_TIME_VAR,                            \
         1.0                                                             \
         },                                                              \
@@ -3323,7 +3312,7 @@ struct cmd_line_arg_t
         "angelou_lithium_EAGB_decay_time",                              \
         "Decay time for surface lithium abundance on the early AGB (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_EAGB_DECAY_TIME_VAR,                            \
         1.0                                                             \
         },                                                              \
@@ -3332,7 +3321,7 @@ struct cmd_line_arg_t
         "angelou_lithium_TPAGB_decay_time",                             \
         "Decay time for surface lithium abundance on the thermally pulsing AGB (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_TPAGB_DECAY_TIME_VAR,                           \
         1.0                                                             \
         },                                                              \
@@ -3341,7 +3330,7 @@ struct cmd_line_arg_t
         "angelou_lithium_LMMS_massfrac",                                  \
         "Lithium mass fraction when its manufacture is triggered during the low-mass (convective) main sequence (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_LMMS_MASSFRAC_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -3350,7 +3339,7 @@ struct cmd_line_arg_t
         "angelou_lithium_MS_massfrac",                                  \
         "Lithium mass fraction when its manufacture is triggered on the main sequence (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_MS_MASSFRAC_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -3359,7 +3348,7 @@ struct cmd_line_arg_t
         "angelou_lithium_HG_massfrac",                                  \
         "Lithium mass fraction when its manufacture is triggered on the Hertzsprung gap (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_HG_MASSFRAC_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -3368,7 +3357,7 @@ struct cmd_line_arg_t
         "angelou_lithium_GB_massfrac",                                  \
         "Lithium mass fraction when its manufacture is triggered on the giant branch (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_GB_MASSFRAC_VAR,                                \
         1.0                                                             \
         },                                                              \
@@ -3377,7 +3366,7 @@ struct cmd_line_arg_t
         "angelou_lithium_CHeB_massfrac",                                \
         "Lithium mass fraction when its manufacture is triggered during core helium burning (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_CHeB_MASSFRAC_VAR,                              \
         1.0                                                             \
         },                                                              \
@@ -3386,7 +3375,7 @@ struct cmd_line_arg_t
         "angelou_lithium_EAGB_massfrac",                                \
         "Lithium mass fraction when its manufacture is triggered on the early AGB (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_EAGB_MASSFRAC_VAR,                              \
         1.0                                                             \
         },                                                              \
@@ -3395,7 +3384,7 @@ struct cmd_line_arg_t
         "angelou_lithium_TPAGB_massfrac",                               \
         "Lithium mass fraction when its manufacture is triggered on the thermally pulsing AGB (Myr). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0 (for the start, use 1e-6).\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_TPAGB_MASSFRAC_VAR,                             \
         1.0                                                             \
         },                                                              \
@@ -3404,7 +3393,7 @@ struct cmd_line_arg_t
         "angelou_lithium_vrot_trigger",                                 \
         "Equatorial rotational velocity at which lithium manufacture is triggered (km/s). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0.\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_VROT_TRIGGER_VAR,                               \
         1.0                                                             \
         },                                                              \
@@ -3413,7 +3402,7 @@ struct cmd_line_arg_t
         "angelou_lithium_vrotfrac_trigger",                             \
         "Fraction of Keplerian (breakup) equatorial rotational velocity at which lithium manufacture is triggered (must be <1, ignored if 0). Requires NUCSYN and NUCSYN_ANGELOU_LITHIUM. Ignored if 0.\n", \
         ARG_FLOAT,                                                      \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ANGELOU_LITHIUM_VROTFRAC_TRIGGER_VAR,                           \
         1.0                                                             \
         },                                                              \
@@ -3440,7 +3429,7 @@ struct cmd_line_arg_t
         "rotationally_enhanced_mass_loss",                              \
         "Set to 1 to enable rotationally enhanced mass loss rate algorithms: 0= none, 1=formula cf. Langer models (=ROTATIONALLY_ENHNACED_MASSLOSS_LANGER_FORMULA), 2=limit accretion rate before wind loss is applied, 3 = both 1 and 2. Requires ROTATIONALLY_ENHANCED_MASS_LOSS. See also rotationally_enhanced_exponent", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ROTATIONALLY_ENHANCED_MASS_LOSS_VAR,                            \
         1.0                                                             \
         },                                                              \
@@ -3450,7 +3439,7 @@ struct cmd_line_arg_t
         "AGB_core_algorithm",                                           \
         "Algorithm to use for calculating AGB core masses. 0=Hurley et al. 2002 if no NUCSYN, Karakas 2002 if NUCSYN is defined; 1=Hurley et al. 2002 (overshooting models); 1=Karakas 2002 (non-overshooting models).", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->AGB_core_algorithm),                   \
         1.0                                                             \
         },                                                              \
@@ -3460,7 +3449,7 @@ struct cmd_line_arg_t
         "AGB_radius_algorithm",                                         \
         "Algorithm to use for calculating radii on the TPAGB.",         \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->AGB_radius_algorithm),                 \
         1.0                                                             \
         },                                                              \
@@ -3470,7 +3459,7 @@ struct cmd_line_arg_t
         "AGB_luminosity_algorithm",                                     \
         "Algorithm to use for calculating luminosities on the TPAGB.",  \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->AGB_luminosity_algorithm),             \
         1.0                                                             \
         },                                                              \
@@ -3480,7 +3469,7 @@ struct cmd_line_arg_t
         "AGB_3dup_algorithm",                                           \
         "Algorithm to use for calculating third dredge up efficiency on the TPAGB.", \
         ARG_INTEGER ,                                                   \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->AGB_3dup_algorithm),                   \
         1.0                                                             \
         },                                                              \
@@ -3490,7 +3479,7 @@ struct cmd_line_arg_t
         "rotationally_enhanced_exponent",                               \
         "The exponent (power) by which rotationally enhanced mass loss is raised. Requires ROTATIONALLY_ENHANCED_MASS_LOSS. See also rotationally_enhanced_mass_loss.", \
         ARG_FLOAT ,                                                     \
-        "1",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         ROTATIONALLY_ENHANCED_EXPONENT_VAR,                             \
         1.0                                                             \
         },                                                              \
@@ -3563,7 +3552,7 @@ struct cmd_line_arg_t
         "batchmode",                                                    \
         "Set the batchmode control variable. Use only if you know what you are doing!", \
         ARG_INTEGER ,                                                   \
-        "0",                                                            \
+        WTTS_USE_DEFAULT,                                                            \
         &(stardata->preferences->batchmode),                            \
         1.0                                                             \
         },                                                              \
@@ -3573,12 +3562,22 @@ struct cmd_line_arg_t
         "speedtests",                                                   \
         "If True, turns on speedtests during version information (off by default).", \
         ARG_BOOLEAN ,                                                   \
-        "False",                                                        \
+        WTTS_USE_DEFAULT,                                               \
         &(stardata->preferences->speedtests),                           \
         1.0                                                             \
+        },                                                              \
+{                                                                       \
+    ARG_SECTION_STARS,                                                  \
+        "use_fixed_timestep_%d",                                        \
+        "Set to True to use fixed timestep <n>, False to turn off. Fixed timesteps are on (this is True) by default.", \
+        ARG_BOOLEAN_SCANF,                                              \
+        WTTS_USE_DEFAULT,                                               \
+        &(stardata->preferences->use_fixed_timestep),                   \
+        1.0                                                             \
         }                                                               \
                                                                         \
-
+    
+    
 
 
 
diff --git a/src/setup/cmd_line_function_macros.h b/src/setup/cmd_line_function_macros.h
index 4366d7888692ad42ead7aa5e562cd637165be98f..8b0d719721354ac955f67360877ae86ec60bec5c 100644
--- a/src/setup/cmd_line_function_macros.h
+++ b/src/setup/cmd_line_function_macros.h
@@ -2,11 +2,16 @@
 #ifndef CMD_LINE_FUNCTION_MACROS_H
 #define CMD_LINE_FUNCTION_MACROS_H
 
+/*
+ * Function macros used in the command line
+ * argument parsing code of binary_c
+ */
+
 #define Arg_set_double                                                  \
     {                                                                   \
-        errno=0;                                                        \
+        errno = 0;                                                      \
         Boolean __match = FALSE;                                        \
-        struct cmd_line_arg_t * a = cmd_line_args + i;                  \
+        const struct cmd_line_arg_t * const a = cmd_line_args + i;      \
         c++;                                                            \
         if(isdigit((unsigned char)argv[c][0]) ||                        \
            argv[c][0] == '.' ||                                         \
@@ -14,8 +19,8 @@
            argv[c][0] == '+')                                           \
         {                                                               \
             /* numeric argument */                                      \
-            double test = strtod(argv[c],NULL);                         \
-            int errnum = errno;                                         \
+            const double test = strtod(argv[c],NULL);                   \
+            const int errnum = errno;                                   \
             if(errno)                                                   \
             {                                                           \
                 char errstring[100];                                    \
@@ -40,7 +45,7 @@
             unsigned int __i;                                           \
             for(__i=0;__i<a->npairs;__i++)                              \
             {                                                           \
-                struct arg_pair_t * p = a->pairs + __i;                 \
+                const struct arg_pair_t * const p = a->pairs + __i;     \
                 if(Strings_equal(p->string,argv[c]))                    \
                 {                                                       \
                     Cprint("Matched double %s -> set %s to %g\n",       \
@@ -65,13 +70,13 @@
     }
 
 #define Arg_test_int_under_or_overflow                                  \
-        if(test==LONG_MIN || test==LONG_MAX)                            \
-        {                                                               \
-            Exit_binary_c(                                              \
-                BINARY_C_UNDER_OR_OVERFLOW,                                      \
-                "Argument %d (string %s after %s) has caused a (long) integer %sflow\n", \
-                c,argv[c],argv[c-1],((test==LONG_MIN)?"under":"over"));          \
-        }
+    if(test==LONG_MIN || test==LONG_MAX)                                \
+    {                                                                   \
+        Exit_binary_c(                                                  \
+            BINARY_C_UNDER_OR_OVERFLOW,                                 \
+            "Argument %d (string %s after %s) has caused a (long) integer %sflow\n", \
+            c,argv[c],argv[c-1],((test==LONG_MIN)?"under":"over"));     \
+    }
 
 
 /*
@@ -80,13 +85,13 @@
  */
 #define Arg_set_int_of_type(__TYPE)                                     \
     {                                                                   \
-        errno=0;                                                        \
+        errno = 0;                                                      \
         c++;                                                            \
         Boolean __match = FALSE;                                        \
-        struct cmd_line_arg_t * a = cmd_line_args + i;                  \
+        const struct cmd_line_arg_t * const a = cmd_line_args + i;      \
         if(isdigit((unsigned char)argv[c][0]))                          \
         {                                                               \
-            long int test = strtol(argv[c],NULL,10);                    \
+            const long int test = strtol(argv[c],NULL,10);              \
             Arg_test_int_under_or_overflow;                             \
             *((__TYPE*)a->pointer) = (__TYPE)test;                      \
             __match = TRUE;                                             \
@@ -107,7 +112,7 @@
             unsigned int __i;                                           \
             for(__i=0;__i<a->npairs;__i++)                              \
             {                                                           \
-                struct arg_pair_t * p = a->pairs + __i;                 \
+                const struct arg_pair_t * const p = a->pairs + __i;     \
                 if(Strings_equal(p->string,argv[c]))                    \
                 {                                                       \
                     Cprint("Matched %s -> set %s to %ld\n",             \
@@ -143,16 +148,34 @@
  * Match a format statement containing a single %d to represent 
  * an integer. 
  */
-#define Arg_scanf_set_int                                               \
+#define Arg_scanf_set_int                                       \
+    {                                                           \
+        errno = 0;                                              \
+        const long int test = strtol(argv[++c],NULL,10);        \
+        Arg_test_int_under_or_overflow;                         \
+        *((int*)cmd_line_args[i].pointer + offset) =            \
+            (int)test;                                          \
+        Cprint("Set %s to %d\n",                                \
+               cmd_line_args[i].name,                           \
+               *((int*) cmd_line_args[i].pointer + offset));    \
+    }
+
+/*
+ * Match a format statement containing a single %d to represent 
+ * an integer, and put it in a Boolean. Note that if the argument
+ * fails to match a boolean type, we set it to FALSE. 
+ */
+#define Arg_scanf_set_Boolean                                           \
     {                                                                   \
-        errno=0;                                                        \
-        long int test = strtol(argv[++c],NULL,10);                      \
-        Arg_test_int_under_or_overflow;                                 \
-        *((int*)cmd_line_args[i].pointer + offset) = (int)test;         \
-        Cprint("Set %s to %d\n",                                        \
+        errno = 0;                                                      \
+        c++;                                                            \
+        const Boolean test = Arg_is_true(argv[c]) ? TRUE : FALSE;       \
+        *((Boolean*)cmd_line_args[i].pointer + offset) =                \
+            test;                                                       \
+        Cprint("Set %s to %s\n",                                        \
                cmd_line_args[i].name,                                   \
-               *((int*) cmd_line_args[i].pointer + offset));            \
-                                                                        \
+               Truefalse(*((Boolean*) cmd_line_args[i].pointer +        \
+                           offset)));                                   \
     }
 
 /*
@@ -161,8 +184,8 @@
  */
 #define Arg_scanf_set_double                                            \
     {                                                                   \
-        errno=0;                                                        \
-        double test = strtod(argv[++c],NULL);                           \
+        errno = 0;                                                      \
+        const double test = strtod(argv[++c],NULL);                     \
         int errnum = errno;                                             \
         if(errno)                                                       \
         {                                                               \
@@ -179,77 +202,49 @@
                 errstring,                                              \
                 x);                                                     \
         }                                                               \
-        *((double*)cmd_line_args[i].pointer + offset) = (double)test;   \
+        *((double*)cmd_line_args[i].pointer + offset) =                 \
+            (double)test;                                               \
         Cprint("Set %s to %g\n",                                        \
                cmd_line_args[i].name,                                   \
                *((double*) cmd_line_args[i].pointer + offset));         \
-                                                                        \
     }
 
 
 /* Boolean tests */
-#define Arg_is_true(X)                          \
-    (                                           \
-        Strings_equal((X),"1") ||               \
-        Strings_equal((X),"TRUE") ||            \
-        Strings_equal((X),"True") ||            \
-        Strings_equal((X),"true") ||            \
-        Strings_equal((X),"YES") ||             \
-        Strings_equal((X),"yes") ||             \
-        Strings_equal((X),"T") ||               \
-        Strings_equal((X),"t") ||               \
-        Strings_equal((X),"Y") ||               \
-        Strings_equal((X),"y")                  \
-        )
-
-#define Arg_is_false(X)                         \
-    (                                           \
-        Strings_equal((X),"0") ||               \
-        Strings_equal((X),"FALSE") ||           \
-        Strings_equal((X),"False") ||           \
-        Strings_equal((X),"false") ||           \
-        Strings_equal((X),"NO") ||              \
-        Strings_equal((X),"no") ||              \
-        Strings_equal((X),"F") ||               \
-        Strings_equal((X),"f") ||               \
-        Strings_equal((X),"N") ||               \
-        Strings_equal((X),"n")                  \
-        )
-
-#define Arg_is_boolean(X)                       \
-    (                                           \
-        Arg_is_true(X) || Arg_is_false(X)       \
-        )
-
+#define Arg_is_true(X) String_is_true(X)
+#define Arg_is_false(X) String_is_false(X)
+#define Arg_is_boolean(X) String_is_boolean(X)
 
 /*
  * generic boolean setter. X is the default, either TRUE or FALSE.
  * Only sets the boolean if the next argument matches Arg_is_boolean above.
  */
-#define Arg_set_boolean(X)                                              \
-    {                                                                   \
-        Boolean test = (X);                                             \
-        if(c+1<argc && Arg_is_boolean(argv[c+1]))                       \
-        {                                                               \
-            c++;                                                        \
-            test =                                                      \
-                Arg_is_true(argv[c]) ? TRUE :                           \
-                Arg_is_false(argv[c]) ? FALSE :                         \
-                (Boolean)strtol(argv[++c],NULL,10);                     \
-            Cprint("test %d (c=%d vs argc=%d arg is %s)\n",             \
-                   test,c,argc,argv[c]);                                \
-        }                                                               \
-        *((Boolean*)cmd_line_args[i].pointer) = test;                   \
-        Cprint("Set %s to %s\n",                                        \
-               cmd_line_args[i].name,                                   \
-               *((Boolean*)cmd_line_args[i].pointer)?                   \
-               "TRUE":"FALSE"                                           \
-            );                                                          \
+#define Arg_set_boolean(X)                                      \
+    {                                                           \
+        Boolean test = (X);                                     \
+        if(c+1<argc && Arg_is_boolean(argv[c+1]))               \
+        {                                                       \
+            c++;                                                \
+            test =                                              \
+                Arg_is_true(argv[c]) ? TRUE :                   \
+                Arg_is_false(argv[c]) ? FALSE :                 \
+                (Boolean)strtol(argv[++c],NULL,10);             \
+            Cprint("test %d (c=%d vs argc=%d arg is %s)\n",     \
+                   test,c,argc,argv[c]);                        \
+        }                                                       \
+        *((Boolean*)cmd_line_args[i].pointer) = test;           \
+        Cprint("Set %s to %s\n",                                \
+               cmd_line_args[i].name,                           \
+               Truefalse(*((Boolean*)cmd_line_args[i].pointer)) \
+            );                                                  \
     }
 
 /* hence some that default to TRUE and FALSE */
-#define Arg_set_boolean_true Arg_set_boolean(TRUE)
-#define Arg_set_boolean_false Arg_set_boolean(FALSE)
+#define Arg_set_boolean_true                    \
+    Arg_set_boolean(TRUE)
+
+#define Arg_set_boolean_false                   \
+    Arg_set_boolean(FALSE)
 
 #define Arg_set_string                                          \
     {                                                           \
@@ -275,11 +270,81 @@
     {                                                   \
         TYPE (*func)(ARG_SUBROUTINE_DECLARATION);       \
         func = cmd_line_args[i].pointer;                \
-        (VALUE)=func(ARG_SUBROUTINE_ARGS2);             \
+        (VALUE) = func(ARG_SUBROUTINE_ARGS2);           \
     }
 
-#define Arg_is_batch(A)                         \
-    ((A)==BATCH_ARG_SUBROUTINE ||               \
-     (A)==BATCH_ARG_BOOLEAN)
+#define Arg_is_batch(TYPE)                      \
+    (                                           \
+        (TYPE)==BATCH_ARG_SUBROUTINE ||         \
+        (TYPE)==BATCH_ARG_BOOLEAN               \
+        )
+
+#define Arg_is_variable(TYPE)                   \
+    (                                           \
+        (TYPE) == ARG_FLOAT ||                  \
+        (TYPE) == ARG_INTEGER ||                \
+        (TYPE) == ARG_UNSIGNED_INTEGER ||       \
+        (TYPE) == ARG_LONG_INTEGER ||           \
+        (TYPE) == ARG_STRING ||                 \
+        (TYPE) == ARG_BOOLEAN ||                \
+        (TYPE) == ARG_NOT_BOOLEAN               \
+        )
+
+#define Arg_is_subroutine(TYPE)                 \
+    (                                           \
+        (TYPE) == BATCH_ARG_SUBROUTINE ||       \
+        (TYPE) == ARG_SUBROUTINE ||             \
+        (TYPE) == ARG_SUBROUTINE_RETURN_INT ||  \
+        (TYPE) == ARG_SUBROUTINE_RETURN_FLOAT   \
+        )
+
+#define Arg_is_function_pointer(TYPE)           \
+    (                                           \
+        (TYPE) == ARG_SUBROUTINE ||             \
+        (TYPE) == ARG_SUBROUTINE_RETURN_INT ||  \
+        (TYPE) == ARGV_SUBROUTINE_RETURN_FLOAT  \
+        )
+
+#define Arg_is_scanf(TYPE)                      \
+    (                                           \
+        (TYPE) == ARG_INTEGER_SCANF ||          \
+        (TYPE) == ARG_BOOLEAN_SCANF ||          \
+        (TYPE) == ARG_FLOAT_SCANF               \
+        )
+
+#define Argtypestring(TYPE)                                     \
+    (                                                           \
+        (TYPE)==ARG_FLOAT ? "Float" :                           \
+        (TYPE)==ARG_STRING ? "String" :                         \
+        (TYPE)==ARG_NONE ? "" :                                 \
+        (TYPE)==ARG_INTEGER ? "Integer" :                       \
+        (TYPE)==ARG_SUBROUTINE ? "*" :                          \
+        (TYPE)==ARG_SUBROUTINE_RETURN_FLOAT ? "Float" :         \
+        (TYPE)==ARG_SUBROUTINE_RETURN_INT ? "Int" :             \
+        (TYPE)==ARG_BOOLEAN ? "True|False" :                    \
+        (TYPE)==ARG_LONG_INTEGER ? "Integer" :                  \
+        (TYPE)==ARG_NOT_BOOLEAN ? "" :                          \
+        (TYPE)==BATCH_ARG_SUBROUTINE ? "*" :                    \
+        (TYPE)==BATCH_ARG_BOOLEAN ? "True|False" :              \
+        (TYPE)==ARG_INTEGER_SCANF ? "Int(scanf)" :              \
+        (TYPE)==ARG_BOOLEAN_SCANF ? "Boolean(scanf)" :          \
+        (TYPE)==ARG_FLOAT_SCANF ? "Float(scanf)" :              \
+        (TYPE)==ARG_UNSIGNED_INTEGER ? "Unsigned integer" :     \
+        "*"                                                     \
+        )
+
+#define Arg_format(TYPE)                        \
+    (                                           \
+        (TYPE)==ARG_FLOAT ? "%g" :              \
+        (TYPE)==ARG_STRING ? "%s" :             \
+        (TYPE)==ARG_INTEGER ? "%d" :            \
+        (TYPE)==ARG_BOOLEAN ? "%s" :            \
+        (TYPE)==ARG_LONG_INTEGER ? "%ld" :      \
+        (TYPE)==ARG_NOT_BOOLEAN ? "%s" :        \
+        (TYPE)==BATCH_ARG_BOOLEAN ? "%s" :      \
+        (TYPE)==ARG_UNSIGNED_INTEGER ? "%u" :   \
+        NULL                                    \
+        )
+
 
 #endif // CMD_LINE_FUNCTION_MACROS_H
diff --git a/src/setup/cmd_line_macro_pairs.h b/src/setup/cmd_line_macro_pairs.h
index 4785b39a5f34b29ded516761a72f875f0d42387c..c7e000027ecb7d8c97d8ada3dfd2642509ca4f13 100644
--- a/src/setup/cmd_line_macro_pairs.h
+++ b/src/setup/cmd_line_macro_pairs.h
@@ -13,11 +13,12 @@
  */
 #define Add_value_macro_pair(VARNAME,MACRO)                             \
     {                                                                   \
-        struct cmd_line_arg_t * a = match_a(VARNAME,                    \
-                                            &__prevarg,                 \
-                                            &__prevstring,              \
-                                            cmd_line_args2,             \
-                                            arg_count);                 \
+        struct cmd_line_arg_t * const a =                               \
+            match_a(VARNAME,                                            \
+                    &__prevarg,                                         \
+                    &__prevstring,                                      \
+                    cmd_line_args2,                                     \
+                    arg_count);                                         \
                                                                         \
         /* found a match : process */                                   \
         if(a != NULL)                                                   \
@@ -51,9 +52,17 @@
             a->argpairs = Realloc(a->argpairs,                          \
                                   sizeof(struct arg_pair_t)*            \
                                   a->nargpairs);                        \
+            Cprint("matched arg %s %s : nargpairs upped to %u : argpairs = %p\n", \
+                   (VARNAME),                                           \
+                   a->name,                                             \
+                   a->nargpairs,                                        \
+                   a->argpairs);                                        \
             struct arg_pair_t * p = a->argpairs+a->nargpairs-1;         \
             size_t len = strlen(a->name);                               \
-            Cprint("Target string %s :: len %ld\n",a->name,len);        \
+            Cprint("Target string %s :: len %zu :: a = %p\n",           \
+                   a->name,                                             \
+                   len,                                                 \
+                   a);                                                  \
             char * format = Malloc(sizeof(char)*(len+1));               \
             strlcpy(format,a->name,len+1);                              \
             Cprint("format %s\n",format);                               \
@@ -63,12 +72,12 @@
                 if(format[__j] == '%'&&                                 \
                    format[__j+1] == 'd')                                \
                 {                                                       \
-                    Cprint("found %%d at %ld\n",__j);                   \
+                    Cprint("found %%d at %zu\n",__j);                   \
                     format[__j+1] = 's';                                \
                     __j = len + 1;                                      \
                 }                                                       \
             }                                                           \
-            Cprint("hence new format \"%s\", len %ld\n",format,len);    \
+            Cprint("hence new format \"%s\", len %zu\n",format,len);    \
             Cprint("Set string %s\n",(#MACRO));                         \
             len += sizeof(#MACRO);                                      \
             p->string = Malloc(len + 1);                                \
@@ -82,7 +91,7 @@
                               "snprintf failed in cmd_line_macros_pairs.h"); \
             }                                                           \
             p->value = (PREFIX##MACRO);                                 \
-            Cprint("p string \"%s\", value %g, x = %ld\n",              \
+            Cprint("p string \"%s\", value %g, x = %zu\n",              \
                    p->string,                                           \
                    p->value,                                            \
                    x);                                                  \
diff --git a/src/setup/cmd_line_macros.h b/src/setup/cmd_line_macros.h
index 39fdbcaee895d0a39371b679550eebe0f5349081..44ac11683cb82ff554995c73a895fffd6d804648 100644
--- a/src/setup/cmd_line_macros.h
+++ b/src/setup/cmd_line_macros.h
@@ -5,6 +5,8 @@
 /* 
  * Define macros that depend on code build options
  */ 
+
+
 #ifdef RANDOM_SYSTEMS
 #define RANDOM_SYSTEMS_VAR &(stardata->preferences->random_systems)
 #else
diff --git a/src/setup/new_system.c b/src/setup/new_system.c
index 7e9785eacde2a7f54db885ce7b1804fe77dc49c7..5b3690bbdc7cb098f6faffb477ba4834d3833c83 100644
--- a/src/setup/new_system.c
+++ b/src/setup/new_system.c
@@ -48,19 +48,10 @@ void new_system(struct stardata_t ** new_stardata,
                      preferences,
                      store);
 
-    Star_number k;
-    Starloop(k)
-    {
-        dprint(*new_stardata,"Call init star for star %d\n",k);
-        init_star(*new_stardata,&((*new_stardata)->star[k]));
-        (*new_stardata)->star[k].starnum = k;
-    }
-
-    dprint(*new_stardata,"call init model\n");    
-    init_model(&(*new_stardata)->model);
-
-    dprint(*new_stardata,"call init common\n");
-    init_common(*new_stardata);
+    /*
+     * Set defaults into stardata
+     */
+    set_defaults(*new_stardata);
     
     /*
      * Load in options from command-line arguments
diff --git a/src/setup/parse_arguments.c b/src/setup/parse_arguments.c
index 40c32771fe04084ab801d31d3f800614fb6c2b4a..a86a523c457463a52ea642b27e00b37d30b3bf6d 100644
--- a/src/setup/parse_arguments.c
+++ b/src/setup/parse_arguments.c
@@ -13,6 +13,7 @@
 static Boolean match_scanf(const char * const arg,
                            const struct cmd_line_arg_t * const cmd_line_arg,
                            size_t * const offset_p);
+
 static void derived_arguments(struct stardata_t * const stardata);
 /**************/
 
@@ -46,7 +47,7 @@ void parse_arguments(const int start,
            (long int)sizeof(struct store_t),
            stardata->tmpstore,
            stardata->tmpstore->cmd_line_args);
-
+            
     if(argv == NULL)
     {        
         /* 
@@ -197,7 +198,7 @@ void parse_arguments(const int start,
 #endif // ALPHA_ARGS
         
 #undef ALPHA_ARGS
-        Dprint("Arg table built : we have %d args (argc=%d)\n",
+        Dprint("Arg table built : we have %u args (argc=%d)\n",
                tmpstore->arg_count,argc);
     }
     else
@@ -281,25 +282,24 @@ void parse_arguments(const int start,
              * check this argument against all those in the list
              */
 	    unsigned int i;
-            size_t offset;
+            size_t offset = 0;
 	    Boolean success = FALSE;
 
             for(i=0; i<arg_count; i++)
             {
-                Dprint("compare \"%s\" and \"%s\"\n",arg,cmd_line_args[i].name);
                 if(
                     Strings_equal(arg,
                                   cmd_line_args[i].name)
                     ||
-                    ((cmd_line_args[i].type == ARG_INTEGER_SCANF ||
-                      cmd_line_args[i].type == ARG_FLOAT_SCANF) && 
-                     match_scanf(arg,
-                                 &cmd_line_args[i],
-                                 &offset) == TRUE)
+                    (
+                        Arg_is_scanf(cmd_line_args[i].type) && 
+                        match_scanf(arg,
+                                    &cmd_line_args[i],
+                                    &offset) == TRUE)
                     )
                     
                 {
-                    Dprint("match \"%s\" (at arg table %d, type %d, pointer %p : cf log_filename at %p) repeat = %d\n",
+                    Dprint("match \"%s\" (at arg table %u, type %d, pointer %p : cf log_filename at %p) repeat = %d\n",
                            arg,
                            i,
                            cmd_line_args[i].type,
@@ -307,7 +307,7 @@ void parse_arguments(const int start,
                            &(stardata->preferences->log_filename),
                            stardata->preferences->repeat
                         );
-
+                    
                     success = TRUE;
 
                     if(cmd_line_args[i].pointer == NULL)
@@ -319,10 +319,7 @@ void parse_arguments(const int start,
                          * the appropriate subroutine, or 
                          * simply incrementing the counter (i.e. c++).
                          */
-                        if(cmd_line_args[i].type == ARG_SUBROUTINE ||
-                           cmd_line_args[i].type == ARG_SUBROUTINE_RETURN_FLOAT ||
-                           cmd_line_args[i].type == ARG_SUBROUTINE_RETURN_INT ||
-                           cmd_line_args[i].type == BATCH_ARG_SUBROUTINE)
+                        if(Arg_is_subroutine(cmd_line_args[i].type))
                         {
                             void (*func)(ARG_SUBROUTINE_DECLARATION);
                             func = cmd_line_args[i].pointer;
@@ -377,6 +374,11 @@ void parse_arguments(const int start,
                             Next_arg_check;
                             Arg_scanf_set_int;
                             break;
+                        case ARG_BOOLEAN_SCANF:
+                            /* integer argument with a scanf for the index */
+                            Next_arg_check;
+                            Arg_scanf_set_Boolean;
+                            break;
                         case ARG_FLOAT_SCANF:
                             /* integer argument with a scanf for the index */
                             Next_arg_check;
@@ -412,12 +414,12 @@ void parse_arguments(const int start,
                         default:
                             /* Matched argument but no idea what to do with it */
                             Dprint(
-                                "Exit because argument type %d is unknown (check cmd_line_args.h at position %d)",
+                                "Exit because argument type %d is unknown (check cmd_line_args.h at position %u)",
                                 cmd_line_args[i].type,
                                 i);
                             Exit_binary_c(
                                 BINARY_C_SETUP_UNKNOWN_ARGUMENT,
-                                "Exit because argument type %d is unknown (check cmd_line_args.h at position %d)",
+                                "Exit because argument type %d is unknown (check cmd_line_args.h at position %u)",
                                 cmd_line_args[i].type,
                                 i);
                         }
@@ -470,11 +472,24 @@ static Boolean match_scanf(const char * const arg,
                            const struct cmd_line_arg_t * const cmd_line_arg,
                            size_t * const offset_p)
 {
-    if(sscanf(arg,cmd_line_arg->name,offset_p))
+    /*
+     * Use sscanf to test the argument, return TRUE if it matches
+     * and set *offset_p.
+     *
+     * Note: offset_p is an int pointer so it matches the %d
+     *       pattern that is commonly used. The integer should
+     *       always be positive, however,   
+     */
+    const int matching_int;
+    const int scantest = sscanf(arg,
+                                cmd_line_arg->name,
+                                &matching_int); 
+    if(scantest > 0)
     {
         /*
-         * Normal sscanf
+         * Normal sscanf succeeded
          */
+        *offset_p = (size_t) matching_int;
         return TRUE;
     }
     else if(cmd_line_arg->nargpairs > 0)
@@ -492,7 +507,7 @@ static Boolean match_scanf(const char * const arg,
                  * Matched : set the appropriate offset
                  * to be the offset
                  */
-                *offset_p = cmd_line_arg->argpairs[i].value;
+                *offset_p = (size_t) (cmd_line_arg->argpairs[i].value + TINY);
                 return TRUE;
             }
         }
@@ -506,6 +521,27 @@ static Boolean match_scanf(const char * const arg,
 
 static void derived_arguments(struct stardata_t * const stardata)
 {
+
+    /*
+     * Set stellar parameters 
+     */
+    stardata->star[0].mass = stardata->preferences->initial_M1;
+    stardata->star[1].mass = stardata->preferences->initial_M2;
+    stardata->common.orbit.period = stardata->preferences->initial_orbital_period;
+    stardata->common.orbit.separation = stardata->preferences->initial_orbital_separation;
+    stardata->common.orbit.eccentricity = stardata->preferences->initial_orbital_eccentricity;
+    stardata->model.probability = stardata->preferences->initial_probability;
+    stardata->common.metallicity = stardata->preferences->metallicity;
+    Clamp(stardata->common.metallicity,1e-4,0.03);
+    stardata->common.effective_metallicity = stardata->preferences->effective_metallicity;
+#ifdef NUCSYN
+    stardata->common.nucsyn_metallicity = stardata->preferences->nucsyn_metallicity;
+#endif//NUCSYN
+    stardata->model.max_evolution_time = stardata->preferences->max_evolution_time;
+    stardata->star[0].stellar_type = stardata->preferences->initial_stellar_type1;
+    stardata->star[1].stellar_type = stardata->preferences->initial_stellar_type2;
+    
+    
     if(Is_not_zero(stardata->star[0].mass) &&
        Is_not_zero(stardata->star[1].mass))
     {
diff --git a/src/setup/set_cmd_line_macro_pairs.c b/src/setup/set_cmd_line_macro_pairs.c
index ed9440adfe036a82c5f951912571c6f64aaa770d..7088ceee3c7b852728fd0843a4486f6d4abe7549 100644
--- a/src/setup/set_cmd_line_macro_pairs.c
+++ b/src/setup/set_cmd_line_macro_pairs.c
@@ -1,9 +1,9 @@
 #include "../binary_c.h"
 #include "cmd_line_macro_pairs.h"
 
-static struct cmd_line_arg_t * match_a(char * VARNAME,
-                                       struct cmd_line_arg_t ** __prevarg,
-                                       char ** __prevstring,
+static struct cmd_line_arg_t * match_a(char * const VARNAME,
+                                       struct cmd_line_arg_t ** const __prevarg,
+                                       char ** const __prevstring,
                                        struct cmd_line_arg_t * const cmd_line_args2,
                                        unsigned int arg_count);
 
@@ -929,11 +929,17 @@ void set_cmd_line_macro_pairs(struct stardata_t * RESTRICT const stardata,
     Add_argument_macro_pair("timestep_multiplier%d",
                             ZOOMFAC,
                             DT_LIMIT_);
+    Add_argument_macro_pair("use_fixed_timestep_%d",
+                            YIELDS,
+                            FIXED_TIMESTEP_);
+    Add_argument_macro_pair("use_fixed_timestep_%d",
+                            TEST,
+                            FIXED_TIMESTEP_);
 }
 
-static struct cmd_line_arg_t * match_a(char * var_name,
-                                       struct cmd_line_arg_t ** __prevarg,
-                                       char ** __prevstring,
+static struct cmd_line_arg_t * match_a(char * const var_name,
+                                       struct cmd_line_arg_t ** const __prevarg,
+                                       char ** const __prevstring,
                                        struct cmd_line_arg_t * const cmd_line_args2,
                                        unsigned int arg_count)
 {   
@@ -941,7 +947,8 @@ static struct cmd_line_arg_t * match_a(char * var_name,
     
     if(__prevarg != NULL &&
        *__prevarg != NULL &&                                     
-       Strings_equal((var_name),*__prevstring))                          
+       Strings_equal(var_name,
+                     *__prevstring))                          
     {                                                           
         /* cache match previous */                              
         a = *__prevarg;                                          
@@ -952,7 +959,7 @@ static struct cmd_line_arg_t * match_a(char * var_name,
         unsigned int __i;
         for(__i=0; __i<arg_count; __i++)                     
         {
-            if(Strings_equal((var_name),
+            if(Strings_equal(var_name,
                              cmd_line_args2[__i].name))
             {
                 a = &cmd_line_args2[__i];
diff --git a/src/setup/reset_preferences.c b/src/setup/set_default_preferences.c
similarity index 94%
rename from src/setup/reset_preferences.c
rename to src/setup/set_default_preferences.c
index 942826b2d84dd7b80bdf0d335636dea4dcb75e32..ebcbca71a0f08d7253541ae70d4326c709b00e79 100644
--- a/src/setup/reset_preferences.c
+++ b/src/setup/set_default_preferences.c
@@ -1,10 +1,9 @@
 #include "../binary_c.h"
 
-void reset_preferences(struct preferences_t * RESTRICT const preferences)
+void set_default_preferences(struct preferences_t * RESTRICT const preferences)
 {
     /* 
-     * Reset the preferences struct with 
-     * some reasonable defaults.
+     * Reset the preferences struct to its default values
      */
     timestep_set_default_multipliers(preferences);
 #ifdef TIMESTEP_MODULATION
@@ -19,7 +18,7 @@ void reset_preferences(struct preferences_t * RESTRICT const preferences)
     preferences->RLOF_interpolation_method=RLOF_INTERPOLATION_BINARY_C;
     preferences->monte_carlo_sn_kicks=TRUE;
     {
-        int i;
+        Supernova i;
         for(i=0;i<NUM_SN_TYPES;i++)
         {
             preferences->sn_kick_distribution[i] = KICK_VELOCITY_FIXED;
@@ -382,4 +381,27 @@ preferences->WD_accretion_rate_novae_upper_limit_other_donor = ACCRETION_RATE_NO
 #ifdef BINT
     preferences->BINT_dir = getenv("BINT_DIR");
 #endif//BINT
+
+    preferences->initial_M1 = 1.0;
+    preferences->initial_M2 = 0.5;
+    preferences->initial_orbital_period = 0.0;
+    preferences->initial_orbital_separation = 0.0;
+    preferences->initial_orbital_eccentricity = 0.0;
+    preferences->initial_probability = 1.0;
+    preferences->metallicity = 0.02;
+    preferences->effective_metallicity = DEFAULT_TO_METALLICITY;
+#ifdef NUCSYN
+    preferences->nucsyn_metallicity = DEFAULT_TO_METALLICITY;
+#endif//NUCSYN
+    preferences->max_evolution_time = 15000.0;
+    preferences->initial_stellar_type1 = MAIN_SEQUENCE;
+    preferences->initial_stellar_type2 = MAIN_SEQUENCE;
+
+    {
+        unsigned int i;
+        for(i=0;i<NUMBER_OF_FIXED_TIMESTEPS;i++)
+        {
+            preferences->use_fixed_timestep[i] = TRUE;
+        }
+    }
 }
diff --git a/src/setup/set_defaults.c b/src/setup/set_defaults.c
new file mode 100644
index 0000000000000000000000000000000000000000..f1b2fd57c37f8faafd9fb01a4df243ce4d49ed1c
--- /dev/null
+++ b/src/setup/set_defaults.c
@@ -0,0 +1,26 @@
+
+#include "../binary_c.h"
+
+#define dprint(P,...) Dprint_to_pointer((P),TRUE,__VA_ARGS__);
+
+void set_defaults(struct stardata_t * RESTRICT const stardata)
+{
+    /*
+     * Set defaults into stardata
+     */
+    Star_number k;
+    Starloop(k)
+    {
+        dprint(stardata,"Call init star for star %d\n",k);
+        init_star(stardata,&((stardata)->star[k]));
+        (stardata)->star[k].starnum = k;
+    }
+
+    dprint(stardata,"call init model\n");    
+    init_model(&(stardata)->model);
+
+    dprint(stardata,"call init common\n");
+    init_common(stardata);
+
+    set_default_preferences(stardata->preferences);
+}
diff --git a/src/setup/set_metallicities.c b/src/setup/set_metallicities.c
index a749ae1bc4d5939089e764ebed17a69f81ca478c..a40f79c57baae2a2604efb4658cd3e538a3b3ee2 100644
--- a/src/setup/set_metallicities.c
+++ b/src/setup/set_metallicities.c
@@ -14,12 +14,16 @@ void set_metallicities(struct stardata_t * RESTRICT const stardata)
     {
         stardata->common.effective_metallicity =
             stardata->common.metallicity;
+        Dprint("Set effective metallicity %g\n",
+               stardata->common.effective_metallicity);
     }
 #ifdef NUCSYN
     if(Negative_nonzero(stardata->common.nucsyn_metallicity))
     {
         stardata->common.nucsyn_metallicity =
             stardata->common.metallicity;
+        Dprint("Set nucsyn metallicity %g\n",
+               stardata->common.nucsyn_metallicity);
     }
 #endif // NUCSYN
 }
diff --git a/src/setup/set_up_variables.c b/src/setup/set_up_variables.c
index f76548cefd1d7fe14db85ca351c4baf5e19b91d6..611c5480cea73ccb4e00bd79a517fbb9edc29c0d 100644
--- a/src/setup/set_up_variables.c
+++ b/src/setup/set_up_variables.c
@@ -34,20 +34,13 @@ void set_up_variables(const int argc,
 
         Dprint("Set up variables : first call! Reset stars...\n");
 
-        Star_number k;
-        Starloop(k)
-        {
-            init_star(stardata,&stardata->star[k]);
-            stardata->star[k].starnum=k;
-        }
-        stardata->star[1].starnum=1;
-        init_model(&stardata->model);
-        init_common(stardata);
+        set_defaults(stardata);
+    }
+    else
+    {
+        set_default_preferences(stardata->preferences);
     }
 
-
-    /* set preferences to defaults */
-    reset_preferences(stardata->preferences);
     Dprint("done\nargc: %d\n",argc);
 
 #ifndef MAKE_BSE_TABLES    
diff --git a/src/setup/setup_prototypes.h b/src/setup/setup_prototypes.h
index 456678705f7030fa889e837b27eba5b339e3a130..1a0941eb7bb46d9a9b98520aacb978e2d87a493f 100644
--- a/src/setup/setup_prototypes.h
+++ b/src/setup/setup_prototypes.h
@@ -15,7 +15,7 @@ void set_up_variables(const int argc,
 void set_metallicity_parameters(struct stardata_t * RESTRICT const stardata);
 void set_metallicity_parameters2(struct stardata_t * RESTRICT const stardata);
 #endif
-
+void set_defaults(struct stardata_t * RESTRICT const stardata);
 void set_up_memmap(struct stardata_t * RESTRICT const stardata);
 
 void parse_arguments(const int start,
@@ -28,7 +28,7 @@ void stardata_status(struct stardata_t * RESTRICT const stardata,
 
 void version(struct stardata_t * RESTRICT const stardata);
 
-void reset_preferences(struct preferences_t * RESTRICT const preferences);
+void set_default_preferences(struct preferences_t * RESTRICT const preferences);
     
 void default_stardata(struct stardata_t * RESTRICT const stardata);
 
@@ -45,7 +45,6 @@ void dummyfunc(ARG_SUBROUTINE_DECLARATION);
 void binary_c_version_internal(ARG_SUBROUTINE_DECLARATION);
 void version_only(ARG_SUBROUTINE_DECLARATION);
 void dumpversion(ARG_SUBROUTINE_DECLARATION) No_return;
-double set_metallicity(ARG_SUBROUTINE_DECLARATION);
 double set_effective_metallicity(ARG_SUBROUTINE_DECLARATION);
 void set_init_abund(ARG_SUBROUTINE_DECLARATION);
 void set_init_abund_mult(ARG_SUBROUTINE_DECLARATION);
diff --git a/src/setup/version.c b/src/setup/version.c
index aaf08408f450d0eb5f27ae42431d7882fa618f53..624d9956443e091d515f937633cf8c1ac3a52bf2 100644
--- a/src/setup/version.c
+++ b/src/setup/version.c
@@ -26,6 +26,20 @@ void version(struct stardata_t * RESTRICT const stardata)
            __DATE__,
            __TIME__);
 
+    /* binary_c version strings */
+#ifdef BINARY_C_MAJOR_VERSION
+    Show_string_macro(BINARY_C_MAJOR_VERSION);
+#endif//BINARY_C_MAJOR_VERSION
+#ifdef BINARY_C_MINOR_VERSION
+    Show_string_macro(BINARY_C_MINOR_VERSION);
+#endif//BINARY_C_MINOR_VERSION
+#ifdef BINARY_C_PATCH_VERSION
+    Show_string_macro(BINARY_C_PATCH_VERSION);
+#endif//BINARY_C_PATCH_VERSION
+#ifdef BINARY_C_PRE_VERSION
+    Show_string_macro(BINARY_C_PRE_VERSION);
+#endif//BINARY_C_PRE_VERSION
+    
     /* SVN : deprecated from early 2018 but will do no harm if left in */
 #if (SVN_REVISION+0)
     Printf("SVN revision %d\n",SVN_REVISION+0);
@@ -42,7 +56,7 @@ void version(struct stardata_t * RESTRICT const stardata)
 #ifdef GIT_REVISION
     Printf_deslash("git revision \"%s\"\n",Stringof(GIT_REVISION));
 #else
-    Printf("git revision unknown\n",Stringof(GIT_REVISION));
+    Printf("git revision unknown\n");
 #endif
 
 #ifdef GIT_URL
@@ -220,12 +234,16 @@ void version(struct stardata_t * RESTRICT const stardata)
     Show_string_macro(__const__);
     Show_string_macro(__static__);
 
-    Printf("Size of : unsigned int %zu, short int %zu, int %zu, long int %zu, long long int %zu, float %zu, double %zu, long double %zu, char %zu, Boolean %zu, stardata_t %zu, preferences_t %zu, star_t %zu, common_t %zu, model_t %zu, diffstats_t %zu, probability_distribution_t %zu, RLOF_orbit_t %zu, store_t %zu, tmpstore_t %zu, data_table_t %zu, Random_seed %zu, Random_buffer %zu, FILE %zu, void* %zu, unsigned int* %zu, int* %zu, long int* %zu, long long int* %zu, float* %zu, double* %zu, long double* %zu, char* %zu, Boolean* %zu, stardata_t* %zu, star_t* %zu, FILE* %zu, __int__ %zu, __double__ %zu, __unsigned__ __int__ %zu, __short__ __int__ %zu, __long__ __int__ %zu\n",
-           sizeof(unsigned int),
+    Printf("Size of : short int %zu, unsigned short int %zu, int %zu, unsigned int %zu, long int %zu, unsigned long int %zu, long long int %zu, unsigned long long int %zu, size_t %zu, float %zu, double %zu, long double %zu, char %zu, Boolean %zu, stardata_t %zu, preferences_t %zu, star_t %zu, common_t %zu, model_t %zu, diffstats_t %zu, probability_distribution_t %zu, RLOF_orbit_t %zu, store_t %zu, tmpstore_t %zu, data_table_t %zu, stardata_dump_t %zu, GSL_args_t %zu, envelope_t %zu, envelope_shell_t %zu, equation_of_state_t %zu, opacity_t %zu, kick_system_t %zu, coordinate_t %zu, binary_system_t %zu, power_law_t %zu, disc_thermal_zone_t %zu, disc_loss_t %zu, disc_t %zu, mersenne_twister_t %zu, binary_c_random_buffer_t %zu, binary_c_file_t %zu, difflogitem_t %zu, difflogstack_t %zu, binary_c_fixed_timestep_t %zu, new_supernova_t %zu, splitinfo_t %zu, derivative_t %zu, bint_t %zu, orbit_t %zu, Random_seed %zu, Random_buffer %zu, FILE %zu, void* %zu, short int* %zu, unsigned short int* %zu, int* %zu, unsigned int* %zu, long int* %zu, unsigned long int* %zu, long long int* %zu, unsigned long long int* %zu, float* %zu, double* %zu, long double* %zu, char* %zu, Boolean* %zu, stardata_t* %zu, star_t* %zu, FILE* %zu, __int__ %zu, __double__ %zu, __unsigned__ __int__ %zu, __short__ __int__ %zu, __long__ __int__ %zu\n",
            sizeof(short int),
+           sizeof(unsigned short int),
            sizeof(int),
+           sizeof(unsigned int),
            sizeof(long int),
+           sizeof(unsigned long int),
            sizeof(long long int),
+           sizeof(unsigned long long int),
+           sizeof(size_t),
            sizeof(float),
            sizeof(double),
            sizeof(long double),
@@ -242,14 +260,62 @@ void version(struct stardata_t * RESTRICT const stardata)
            sizeof(struct store_t),
            sizeof(struct tmpstore_t),
            sizeof(struct data_table_t),
+           sizeof(struct stardata_dump_t),
+           sizeof(struct GSL_args_t),
+           sizeof(struct envelope_t),
+           sizeof(struct envelope_shell_t),
+           sizeof(struct equation_of_state_t),
+           sizeof(struct opacity_t),
+           sizeof(struct kick_system_t),
+           sizeof(struct coordinate_t),
+#ifdef DISCS
+           sizeof(struct binary_system_t),
+           sizeof(struct power_law_t),
+           sizeof(struct disc_thermal_zone_t),
+           sizeof(struct disc_loss_t),
+           sizeof(struct disc_t),
+#else
+           (size_t)0,
+           (size_t)0,
+           (size_t)0,
+           (size_t)0,
+           (size_t)0,
+#endif//DISCS
+#ifdef USE_MERSENNE_TWISTER
+           sizeof(struct mersenne_twister_t),
+#else
+           (size_t)0,
+#endif//USE_MERSENNE_TWISTER
+           sizeof(struct binary_c_random_buffer_t),
+           sizeof(struct binary_c_file_t),
+           sizeof(struct difflogitem_t),
+           sizeof(struct difflogstack_t), 
+           sizeof(struct binary_c_fixed_timestep_t),
+           sizeof(struct new_supernova_t),
+#ifdef EVOLUTION_SPLITTING
+           sizeof(struct splitinfo_t),
+#else
+           (size_t)0,
+#endif//EVOLUTION_SPLITTING
+           sizeof(struct derivative_t),
+#ifdef BINT
+           sizeof(struct bint_t),
+#else
+           (size_t)0,
+#endif//BINT
+           sizeof(struct orbit_t),
            sizeof(Random_seed),
            sizeof(Random_buffer),
            sizeof(FILE),
            sizeof(void *),
-           sizeof(unsigned int *),
+           sizeof(short int *),
+           sizeof(unsigned short int *),
            sizeof(int *),
+           sizeof(unsigned int *),
            sizeof(long int *),
+           sizeof(unsigned long int *),
            sizeof(long long int *),
+           sizeof(unsigned long long int *),
            sizeof(float *),
            sizeof(double *),
            sizeof(long double *),
@@ -1113,12 +1179,12 @@ void version(struct stardata_t * RESTRICT const stardata)
 #ifndef ALL_ISOTOPES
                 if(!all && i>=Xelse)
                 {
-                    Printf("Isotope %d is else\n",i);
+                    Printf("Isotope %u is else\n",i);
                 }
                 else
                 {
 #endif
-                    Printf("Isotope %d is %s%d (mass=%20.12e g (/amu=%20.12e, /MeV=%20.12e), Z=%d, A=%d)\n",
+                    Printf("Isotope %u is %s%d (mass=%20.12e g (/amu=%20.12e, /MeV=%20.12e), Z=%d, A=%d)\n",
                            i,
                            stardata->store->nucleon_number[i]==0 ? "e" : 
                            s[stardata->store->atomic_number[i]],
@@ -1370,7 +1436,7 @@ void version(struct stardata_t * RESTRICT const stardata)
         Source_number i;
         Sourceloop(i)
         {
-            Printf("Nucleosynthesis source %d is %s\n",
+            Printf("Nucleosynthesis source %u is %s\n",
                    i,
                    Nucsyn_source_string(i));
         }
@@ -1422,7 +1488,7 @@ void version(struct stardata_t * RESTRICT const stardata)
            CEMP_VERSION,BINARY_C_VERSION);
 #endif
 #endif //NUCSYN
-
+    
     Macrotest(BUFFERED_STACK);
     Show_long_int_macro(BUFFERED_PRINTF_MAX_BUFFER_SIZE);
     Show_long_int_macro(BUFFERED_PRINTF_ERROR_BUFFER_SIZE);
@@ -1450,6 +1516,7 @@ void version(struct stardata_t * RESTRICT const stardata)
     Macrotestif(LOG_SUPERNOVAE,
                 "default filename %s",
                 DEFAULT_SN_DAT_FILENAME);
+    Macrotest(ZW2019_SNIA_LOG);
     Macrotest(CGI_EXTENSIONS);
     Macrotest(SDB_CHECKS);
     Macrotest(BI_LYN);
diff --git a/src/stellar_colours/eldridge2015_colours.c b/src/stellar_colours/eldridge2015_colours.c
index e3b5f3335de0d59ce2d340cb1133f86a3306d892..a27cea616d16c9eaff0ff3738f047a488e47dee1 100644
--- a/src/stellar_colours/eldridge2015_colours.c
+++ b/src/stellar_colours/eldridge2015_colours.c
@@ -84,7 +84,7 @@ void eldridge2015_colours(struct stardata_t * const stardata,
             
     /* adjust for the star's luminosity (colours assume L=1) */
     {
-        int i;
+        Stellar_magnitude_index i;
         double ll = magnitude_from_luminosity(star->luminosity);
         for(i=0;i<=STELLAR_MAGNITUDE_f814w;i++)
         {
diff --git a/src/stellar_colours/stellar_colour_tests.c b/src/stellar_colours/stellar_colour_tests.c
index b501aec0d2f7b52f82d2daee124a71caf62321e2..95aee14f4cf03f7064c21c3d5f6058619d8a6018 100644
--- a/src/stellar_colours/stellar_colour_tests.c
+++ b/src/stellar_colours/stellar_colour_tests.c
@@ -15,16 +15,15 @@ void stellar_colour_tests(struct stardata_t * const stardata,
      */
     double magnitudes[NUMBER_OF_STELLAR_MAGNITUDES];
     double magnitudes2[NUMBER_OF_STELLAR_MAGNITUDES];
-    int i;
-    char * colour_strings[NUMBER_OF_STELLAR_MAGNITUDES]=STELLAR_COLOUR_STRINGS;
+    const char * const colour_strings[NUMBER_OF_STELLAR_MAGNITUDES] = STELLAR_COLOUR_STRINGS;
     stardata->common.metallicity=0.02;
     star->luminosity=1.0;
 
     {
-        FILE * Fig11a = fopen("/tmp/Fig11a.dat","w");
-        FILE * Fig11b = fopen("/tmp/Fig11b.dat","w");
-        FILE * Fig13a = fopen("/tmp/Fig13a.dat","w");
-        FILE * Fig13b = fopen("/tmp/Fig13b.dat","w");
+        FILE * const Fig11a = fopen("/tmp/Fig11a.dat","w");
+        FILE * const Fig11b = fopen("/tmp/Fig11b.dat","w");
+        FILE * const Fig13a = fopen("/tmp/Fig13a.dat","w");
+        FILE * const Fig13b = fopen("/tmp/Fig13b.dat","w");
         
         double m;
         for(m=0.5; m<20; m+=1.0)
@@ -52,6 +51,7 @@ void stellar_colour_tests(struct stardata_t * const stardata,
                 stellar_colours(stardata,star,magnitudes2);
             
                 printf("MAGS ");
+                Stellar_magntiude_index i;
                 for(i=0;i<NUMBER_OF_STELLAR_MAGNITUDES;i++)
                 {
                     printf("%d = %s = %g; ",i,colour_strings[i],magnitudes[i]);
@@ -143,12 +143,8 @@ void stellar_colour_tests(struct stardata_t * const stardata,
                        magnitudes[STELLAR_MAGNITUDE_GAIA_GBP] - magnitudes[STELLAR_MAGNITUDE_GAIA_GRP],
                        magnitudes[STELLAR_MAGNITUDE_GAIA_G] - magnitudes[STELLAR_MAGNITUDE_GAIA_GBP],
                        magnitudes[STELLAR_MAGNITUDE_GAIA_G] - magnitudes[STELLAR_MAGNITUDE_GAIA_GRP]);
-
                 printf("\n");
-            
             }
-
-
         }
         fclose(Fig11a);
         fclose(Fig11b);
diff --git a/src/stellar_structure/stellar_structure_HeStar.c b/src/stellar_structure/stellar_structure_HeStar.c
index 3d712c2ea3593a17641880c9e77fc062850d3330..8f6e6c66eedab612e8cfc669e9430ce34ba49c26 100644
--- a/src/stellar_structure/stellar_structure_HeStar.c
+++ b/src/stellar_structure/stellar_structure_HeStar.c
@@ -42,16 +42,19 @@ void stellar_structure_HeStar(struct star_t * newstar,
     }
 #endif
 
-    Dprint("Compare age=%g to tm=%g (menv = %g)\n",
+    Dprint("Compare age=%20.12g to tm=%20.12g (menv = %g) really less? %s diff = %g\n",
            newstar->age,
            newstar->tm,
-           newstar->mass - newstar->core_mass
+           newstar->mass - newstar->core_mass,
+           Yesno(Really_less_than(newstar->age,newstar->tm)),
+           Signed_diff(newstar->age , newstar->tm)
         );
 
     /* core mass above which He burning continues */
     double mc_Heburn = mc_heburn(newstar->mass);
 
-    if(Really_less_than(newstar->age,newstar->tm))
+    if(Signed_diff(newstar->age,
+                   newstar->tm) < -1e-10)
     {
         /*
          * Main Sequence
diff --git a/src/stellar_structure/stellar_structure_prototypes.h b/src/stellar_structure/stellar_structure_prototypes.h
index a598ed1cd19ffa463a6b8d1e4c3839c7cb914deb..28efdee304f55ec21af80eeb91780b8bfd937b6d 100644
--- a/src/stellar_structure/stellar_structure_prototypes.h
+++ b/src/stellar_structure/stellar_structure_prototypes.h
@@ -64,7 +64,7 @@ Stellar_type stellar_structure_HG(struct star_t * RESTRICT const newstar,
                                   struct stardata_t * RESTRICT stardata,
                                   const Caller_id caller_id);
 
-Stellar_type stellar_structure_RG(struct star_t *newstar,
+Stellar_type stellar_structure_RG(struct star_t * const newstar,
                                   double * const rg,
                                   struct stardata_t * RESTRICT const stardata,
                                   const Caller_id caller_id);
diff --git a/src/supernovae/set_kick_velocity.c b/src/supernovae/set_kick_velocity.c
index ff8aee43408fe283411b364bb3a49f04c6b44899..e1053d14cf57efbb6a490c2ac2b9ae8d1322bce4 100644
--- a/src/supernovae/set_kick_velocity.c
+++ b/src/supernovae/set_kick_velocity.c
@@ -52,7 +52,7 @@ void set_kick_velocity(struct stardata_t * const stardata,
                 omega = TWOPI*u2;
                 v[2*k-1] = s*cos(omega);
                 v[2*k] = s*sin(omega);
-                Dprint("v[%d]=%g, v[%d]=%g\n",2*k-1,v[2*k-1],2*k,v[2*k]);
+                Dprint("v[%u]=%g, v[%u]=%g\n",2*k-1,v[2*k-1],2*k,v[2*k]);
             }
             vk2 = Pythag3_squared(v[1],v[2],v[3]);
             vk = sqrt(vk2);
diff --git a/src/timestep/modulate_zoomfac.c b/src/timestep/modulate_zoomfac.c
index e14aa5b32c14368edbab8e528df72f5d0e7bd896..0138f7fd91adab8f8efed9706aaea40a2eeffb81 100644
--- a/src/timestep/modulate_zoomfac.c
+++ b/src/timestep/modulate_zoomfac.c
@@ -69,7 +69,7 @@ Boolean modulate_zoomfac(struct stardata_t * stardata,
     {
         retval = FALSE;
         Exit_binary_c(BINARY_C_ALGORITHM_OUT_OF_RANGE,
-                      "Unknown action = %d in modulate_zoomfac\n",
+                      "Unknown action = %u in modulate_zoomfac\n",
                       action);
                       
     }
diff --git a/src/timestep/setup_fixed_timesteps.c b/src/timestep/setup_fixed_timesteps.c
index 5b1842f16c438f4070a97d781d40fdb0e5da0ba8..102ce228084d7b68e41605a3d81bf2b7923ab03c 100644
--- a/src/timestep/setup_fixed_timesteps.c
+++ b/src/timestep/setup_fixed_timesteps.c
@@ -3,34 +3,66 @@
 void setup_fixed_timesteps(struct stardata_t * RESTRICT const stardata)
 {
     struct binary_c_fixed_timestep_t * t =
-        &stardata->model.fixed_timesteps[FIXED_TIMESTEP_YIELDS]; 
+        &stardata->model.fixed_timesteps[FIXED_TIMESTEP_YIELDS];
+
+    
 #if defined NUCSYN && defined NUCSYN_GCE
     /*
-     * Yields/ensemble fixed timesteps
+     * Yields/ensemble fixed timesteps : 
+     * when NUCSYN and NUCSYN_GCE are enabled, 
+     * use this by default, although allow it 
+     * to be turned off on the command line.
      */
-    t->enabled = TRUE;
-    t->begin =
-        stardata->preferences->yields_logtimes == TRUE ?
-        log10(stardata->preferences->yields_startlogtime) :
-        0.0;
-    t->end =
-        stardata->preferences->yields_logtimes == TRUE ?        
-        log10(stardata->model.max_evolution_time) :
-        stardata->model.max_evolution_time;
-    t->step =
-        stardata->preferences->yields_logtimes == TRUE ?
-        stardata->preferences->yields_logdt :
-        stardata->preferences->yields_dt;
-    t->next = t->begin + t->step;
-    t->logarithmic = stardata->preferences->yields_logtimes;
-    t->final = TRUE;
-    t->previous_trigger = t->previous_test = t->begin;
+    if(stardata->preferences->use_fixed_timestep[FIXED_TIMESTEP_YIELDS])
+    {
+        t->enabled = TRUE;
+        t->begin =
+            stardata->preferences->yields_logtimes == TRUE ?
+            log10(stardata->preferences->yields_startlogtime) :
+            0.0;
+        t->end =
+            stardata->preferences->yields_logtimes == TRUE ?        
+            log10(stardata->model.max_evolution_time) :
+            stardata->model.max_evolution_time;
+        t->step =
+            stardata->preferences->yields_logtimes == TRUE ?
+            stardata->preferences->yields_logdt :
+            stardata->preferences->yields_dt;
+        t->next = t->begin + t->step;
+        t->logarithmic = stardata->preferences->yields_logtimes;
+        t->final = TRUE;
+        t->previous_trigger = t->previous_test = t->begin;
+    }
+    else
+    {
+        t->enabled = FALSE;
+    }
 #else
     /* disable */
     t->enabled = FALSE;
 #endif
 
 
+    /*
+     * The test timestep outputs every 1Myr. It is disabled by default.
+     */
+    t = &stardata->model.fixed_timesteps[FIXED_TIMESTEP_TEST];
+    if(stardata->preferences->use_fixed_timestep[FIXED_TIMESTEP_TEST])
+    {
+        t->enabled = FALSE;
+        t->begin = 0.0;
+        t->end = stardata->model.max_evolution_time;
+        t->step = 1.0;
+        t->next = t->begin + t->step;
+        t->logarithmic = FALSE;
+        t->final = TRUE;
+        t->previous_trigger = t->previous_test = t->begin;
+    }
+    else
+    {
+        t->enabled = FALSE;
+    }
+
     /*
      * Others should be put here...
      *
diff --git a/src/timestep/stellar_timestep.c b/src/timestep/stellar_timestep.c
index 6300b61f8fd344939dae663dbceab0572a3b626e..aa904100eed5800d5a1ef2bdaccd26e63cbde0a3 100644
--- a/src/timestep/stellar_timestep.c
+++ b/src/timestep/stellar_timestep.c
@@ -99,10 +99,11 @@ void stellar_timestep(Timestep_prototype_args)
 //#define ___LOGGING
 #ifdef ___LOGGING
     fprintf(stdout,
-            "%sstellar_timestep at t=%23.15g model %d out star %d stellar_type %d (m=%g mc=%g L=%g R=%g minit=%g menv=%g SN=%d J*=%g; a=%g e=%g Jorb=%g, ω*=%g ωorb=%g tcirc=%g y), age=%g, tm=%20.12g, tn=%20.12g    >>> %sdt=%20.12g Myr%s <<<    time_remaining=%g : set by %s (%d) : logtnow=%g logtnext=%g (Fequal? %s Times_are_equal? %s : diff %g) triggerd? %d %s\n",
+            "%sstellar_timestep at t=%23.15g model %d reject %u out star %d stellar_type %d (m=%g mc=%g L=%g R=%g minit=%g menv=%g SN=%d J*=%g; a=%g e=%g Jorb=%g, ω*=%g ωorb=%g tcirc=%g y), age=%20.12g, tm=%20.12g, tn=%20.12g    >>> %sdt=%20.12g Myr%s <<<    time_remaining=%g : set by %s (%d) : logtnow=%g logtnext=%g (Fequal? %s Times_are_equal? %s : diff %g) triggerd? %d %s\n",
             YELLOW,
             stardata->model.time,
             stardata->model.model_number,
+            stardata->model.reject,
             star->starnum,
             star->stellar_type,
             star->mass,
diff --git a/src/timestep/timestep.h b/src/timestep/timestep.h
index 55c49369844c59da5d93ee0bcd09ab557c0a7879..3705409726bd26d7917a18c4f5754e23e486022a 100644
--- a/src/timestep/timestep.h
+++ b/src/timestep/timestep.h
@@ -8,8 +8,9 @@
  * and are handled in timestep_fixed_timesteps.c
  */
 #define FIXED_TIMESTEP_YIELDS 0
+#define FIXED_TIMESTEP_TEST 1
 
-#define NUMBER_OF_FIXED_TIMESTEPS 1
+#define NUMBER_OF_FIXED_TIMESTEPS 2
 
 /********************************************************************/
 
diff --git a/src/timestep/timestep_RLOF.c b/src/timestep/timestep_RLOF.c
index 5c67f501c2794f5f5bda15280cc5e3513d8c4710..e37d4d812b0bf3955a9357009e626b4295ee9347 100644
--- a/src/timestep/timestep_RLOF.c
+++ b/src/timestep/timestep_RLOF.c
@@ -99,7 +99,7 @@ void timestep_RLOF(Timestep_prototype_args)
     /*
      * Use the RLOF recommended timestep if it's non-zero
      */
-    Dprint("RLOF limiter %g (reject %d)\n",
+    Dprint("RLOF limiter %g (reject %u)\n",
            stardata->model.RLOF_recommended_timestep,
            stardata->model.reject
         );
diff --git a/src/timestep/timestep_fixed_trigger.c b/src/timestep/timestep_fixed_trigger.c
index 50fde29f4ded402a6dc77bdd7b6952351249705d..fc95838c8de7f4ac70271545db425867eaf5785c 100644
--- a/src/timestep/timestep_fixed_trigger.c
+++ b/src/timestep/timestep_fixed_trigger.c
@@ -27,7 +27,6 @@ Boolean timestep_fixed_trigger(struct stardata_t * RESTRICT const stardata,
     }
     else
     {
-
         const double T = t->logarithmic ? log10(stardata->model.time) : stardata->model.time;
     
         if(!In_range(T,t->begin,t->end))
diff --git a/src/wind/wind_mass_loss_rate.c b/src/wind/wind_mass_loss_rate.c
index d0e146311d5fbde78c568d6b4d6d9092e6b3dafb..edff563d2c1f410b4107a2362f9bda082a0c8007 100644
--- a/src/wind/wind_mass_loss_rate.c
+++ b/src/wind/wind_mass_loss_rate.c
@@ -37,11 +37,11 @@ double wind_mass_loss_rate(WIND_PROTOTYPE_ARGS)
         
     default:
         Exit_binary_c(BINARY_C_ALGORITHM_OUT_OF_RANGE,
-                      "Wind mass loss prescription %d is unknown.\n",
+                      "Wind mass loss prescription %u is unknown.\n",
                       stardata->preferences->wind_mass_loss);
     }
     
-    Dprint("mdot_wind = %g from prescription %d\n",
+    Dprint("mdot_wind = %g from prescription %u\n",
            mdot_wind,
            stardata->preferences->wind_mass_loss);
 
diff --git a/tbse b/tbse
index 54e4f8554c510eeaf0bc810ef6cf85560add7b49..346b8e9a87ee8ec920198f09a1ca0d4aa91284f8 100755
--- a/tbse
+++ b/tbse
@@ -94,15 +94,15 @@ STELLAR_TYPE1=MAIN_SEQUENCE
 STELLAR_TYPE2=MAIN_SEQUENCE
 
 # stellar masses (solar units)
-M1=2
-M2=0.9
+M1=3
+M2=1.5
 
 # orbit: 
 # If the period (days) is given, use it. 
 # If the period is zero, use the separation (in Rsun) to calculate the period.
 # (this requires that the masses are already set)
 ORBITAL_PERIOD=0.0
-ORBITAL_SEPARATION=3000
+ORBITAL_SEPARATION=300
 
 # Orbital eccentricity should be in the range 0.0-1.0.
 ECCENTRICITY=0.0
@@ -115,7 +115,7 @@ MAX_MODEL_NUMBER=0
 
 # metallicity for stellar evolution, must be in the range 1e-4<=Z<=0.03
 # (mass fraction)
-METALLICITY=0.0002
+METALLICITY=0.02
 
 # effective metallicity can be outside the
 # range reqired by the stellar evolution
@@ -124,7 +124,7 @@ METALLICITY=0.0002
 #
 # By default it's the same as the actual metallicity,
 # which is the what happens when you set it to -1.
-EFFECTIVE_METALLICITY=-1
+EFFECTIVE_METALLICITY=DEFAULT_TO_METALLICITY
 
 # Stellar structure algorithm
 # 0 = STELLAR_STRUCTURE_ALGORITHM_MODIFIED_BSE = modified BSE (default)
@@ -524,7 +524,7 @@ COMENV_POST_ECCENTRICITY=1e-5
 # Fraction of the ejected common envelope mass that
 
 # goes into the disc (1e-3) set to 0 to disable 
-COMENV_DISC_MASS_FRACTION=0.018
+COMENV_DISC_MASS_FRACTION=0.02
 
 # Fraction of ejected common envelope's angular momentum
 # that goes into the disc.
@@ -535,7 +535,7 @@ COMENV_DISC_MASS_FRACTION=0.018
 # -2 : use comenv specific angular momentum (minimum?)
 # -3 : use post-CE L2 specific angular momentum
 # -4 : use pre-CE comenv radius specific angular momentum
-COMENV_DISC_ANGMOM_FRACTION=0.15
+COMENV_DISC_ANGMOM_FRACTION=0.5
 
 ############################################################
 
@@ -572,10 +572,10 @@ DISC_TIMESTEP_FACTOR=1.0
 # DISC_LOG_LEVEL_SUBTIMESTEP 2 = on with sub-timestep logging
 # DISC_LOG_LEVEL_NORMAL_FIRST_DISC_ONLY = as 1 for first disc only
 # DISC_LOG_LEVEL_SUBTIMESTEP_FIRST_DISC_ONLY = as 2 for first disc only
-DISC_LOG=DISC_LOG_LEVEL_SUBTIMESTEP_FIRST_DISC_ONLY
+DISC_LOG=DISC_LOG_LEVEL_NONE
 
 # soft 2D disc log switch, same options as DISC_LOG
-DISC_LOG2D=DISC_LOG_LEVEL_SUBTIMESTEP_FIRST_DISC_ONLY
+DISC_LOG2D=DISC_LOG_LEVEL_NONE
 
 # disc log every DISC_LOG_DT Myr only. Ignored if zero.
 # If set to -1, is automatically calculated (1Myr except on the GB/AGB)
@@ -607,7 +607,7 @@ CBDISC_TORQUEF=1e-4 # 1e-3 tends to keep discs outside L2
 # but this requires that the initial angular momentum is
 # sufficient to support the disc (see COMENV_DISC_ANGMOM_FRACTION).
 CBDISC_INIT_DM=0.0 # (0)
-CBDISC_INIT_DJDM=0.1 # (0.1)
+CBDISC_INIT_DJDM=0.0 # (0.1)
 
 ##############################
 # disc failure and stopping conditions
@@ -689,7 +689,7 @@ CBDISC_MASS_LOSS_ISM_RAM_PRESSURE_MULTIPLIER=1.0
 
 # multipliers for X-ray (1.0) and FUV (0.0, not yet implemented) winds
 CBDISC_MASS_LOSS_FUV_MULTIPLIER=0.0
-CBDISC_MASS_LOSS_XRAY_MULTIPLIER=1.0
+CBDISC_MASS_LOSS_XRAY_MULTIPLIER=0.0
 
 # couple photoevaporation and viscous losses at the inner edge (True)
 CBDISC_VISCOUS_PHOTOEVAPORATION_COUPLING=True
@@ -703,8 +703,8 @@ CBDISC_OUTER_EDGE_STRIPPING=False
 # DISC_STRIPPING_TIMESCALE_INFINITE = 1 = very slow
 # DISC_STRIPPING_TIMESCALE_VISCOUS = 2 = viscous at Revap
 # DISC_STRIPPING_TIMESCALE_ORBIT = 3 = orbital at Revap
-CBDISC_INNER_EDGE_STRIPPING_TIMESCALE=DISC_STRIPPING_TIMESCALE_INSTANT
-CBDISC_OUTER_EDGE_STRIPPING_TIMESCALE=DISC_STRIPPING_TIMESCALE_INSTANT
+CBDISC_INNER_EDGE_STRIPPING_TIMESCALE=DISC_STRIPPING_TIMESCALE_VISCOUS
+CBDISC_OUTER_EDGE_STRIPPING_TIMESCALE=DISC_STRIPPING_TIMESCALE_VISCOUS
 
 ##############################
 # Eccentricity pumping
@@ -1239,6 +1239,21 @@ TIMESTEP_MODULATOR=1.0
 
 #TIMESTEP_MULTIPLIERS=" timestep_multiplierTIDES 1e6 timestep_multiplierSTELLAR_MAGNETIC_BRAKING 1e6 "
 
+######################
+# Fixed timesteps
+#
+# Here you can turn on or off fixed timestep
+# schemes. Note that these are on by default,
+# and are usually enabled by code-generation macros.
+#
+# These are of the format use_fixed_timestep_*
+# where * is one of
+#
+# YIELDS = 0 : used in yield calculations
+#
+######################
+#FIXED_TIMESTEP_OPTIONS=" use_fixed_timestep_YIELDS True "
+
 ######################
 # Timestep rejection
 ######################
@@ -1268,7 +1283,7 @@ MAX_STELLAR_ANGMOM_CHANGE=0.05
 # metallicity in nucsyn code 
 #
 # If -1, use the same as the normal metallicity
-NUCSYN_METALLICITY=-1
+NUCSYN_METALLICITY=DEFAULT_TO_METALLICITY
 
 ## new: vary initial abundances individually
 #INIT_ABUNDS="--init_abund 2 0.9"
@@ -1778,6 +1793,8 @@ DEFAULT_ARGS=" \
 --separation $ORBITAL_SEPARATION \
 --max_evolution_time $MAX_EVOLUTION_TIME \
 --metallicity $METALLICITY \
+--nucsyn_metallicity $NUCSYN_METALLICITY \
+--effective_metallicity $EFFECTIVE_METALLICITY \
 --monte_carlo_kicks $MONTE_CARLO_KICKS \
 --wr_wind $WRWIND \
 --wr_wind_fac $WRWINDFAC \
diff --git a/test_random.pl b/test_random.pl
index a501631ea40af266722b4021580de22489eda073..44802000aa321a1bffc2b790a42e45b69944febf 100755
--- a/test_random.pl
+++ b/test_random.pl
@@ -27,7 +27,7 @@ check_ps() unless($args=~/skip_valgrind_check/);
 $SIG{INT} = \&reaper;
 my $valgrind = ($args=~/valgrind/) ? 'valgrind' : ''; # valgrind or ''
 my $nice = ($args=~/nice=(\d+)/) ? "nice -n +$1" : 'nice';
-my $timeout = ($args=~/timeout=(\d+)/) ? "timeout $1" : '';
+my $timeout = ($args=~/timeout=(\d+)/) ? "timeout -s 9 $1" : '';
 my $repeat = ($args=~/repeat=(\d+)/)[0] // 1;
 my $logtimes = ($args=~/logtimes/) ? 1 : 0;
 my $ignore_time = ($args=~/ignore_time=(\S+)/)[0] // 2.0; # do not log time if < this