modify tree and link.c