Initial version, almost functional.