increased performance of adding terminalEdges.