more efficient triangles on spark