Initial commit of (possibly?) working code.