Code for my MSc dissertation