add comments/docstrings + extra testing