added docstrings.