Some coding for my MSc project