Add pydocs
General tidy up, rename some variables to conform with pep8
Fixed a minor bug in update