This is my PhD diss project. Go gentle on criticism of my Python coding please.