Some code to reproduce results from my thesis