code cleanup: replaces tabs with spaces for indentation. fleshed out code docs. various other minor formatting changes.
improved code docs.