First commit. Code completely untested.