Tidied up the code, and created run.py that will allow the reader to easily run through the code.