updated docstrings and some slight improvements and cleanups