fixes and better docstrings