more work on code gen