fixed compaction to also work for edges.