created CountTriangles2(), which only takes a graph as a parameter