Add docstrings and toString method.