Added docstrings to functions and the class definition.