adding nodes and edges