Added docstrings to functions and classes.