Improved update Node and AddLink in graph.java