replace add_nodes function with add_node and add_nodes_from