Address comments, notably adding docstrings