all the docstrings and more
Updated to reflect code changes