output all edges at end, algorithm is clearly broken