Some coding relating to my Masters project