Unit testing and some docstrings