work on code gen