Added comments and mode changing
changed pydoc comments