add headings and some docstrings