Ran code through beautifier and split into files etc. as per zackmdavis's suggestions: https://github.com/mcoram/guess-calibration/issues/1