Code relevant to my PhD thesis