docstrings and minor tweaks