important change

new_num_nodes = old_num_nodes + nodes_to_add
because we should add one ，when func return， the pos of
nodes_to_add has to be used