working graph1 and graph2