conver function add and reprint tree