Initial commit

Functional, but needs cleaning up.