lots of bug fixing, small improvements, better docs
generate documentation for public functions from docstrings