Corrected error with brackets and loops. Creation of graph with nodes and egdes now working.