modify tim code gen