making dissertation code public (run for your life!)