now generated program compiles (but does not run correctly)