better algorithm for erasing wires