using the indexing for adding Nodes
the sfg version with indexing is completed now