Add some docstrings and nits