more comments and docstrings