First version, non-interactive, but working.