removed some unnecessary regex bloat, added some rudimentary docstrings, improved documentation with a pretty picture