modify tree code.