tidied up the code and made pydoc comments a bit nicer.