code gen seemingly works