added more docstrings.