Code for the thesis.  Hopefully very portable between all my different machines