debugged version of removeEdges, working testrun vs.