Cleaned up imports and added docstrings