More cleaning and adding of docstrings