added tests for 2nd graph, fixed bug