Cleanup imports and add comments/docstrings