Added lots of docstrings some new functions