added docstrings and ran tests