First version

Needs docstrings!