More comments and docstrings