First I measured the length of new wire against the old wire. Then I studied the wire connections at the terminal end. I had marked and color coded each wire as I removed it from the terminal end. The red tape corresponds to number three on the terminal end. On the wire that leads to the plug it is the white wire. I had arbitrarily decided, when wiring the foot pedal, to make the smooth section of new wire the "white" wire. In the case of the plug, the smooth section of new wire will be color coded red. It is just my way of keeping things straight. For someone who understands electricity it may be redundant.
After I tied the knot, I pulled the wire down through, twisted each wire into a braid and wound these around the screws and tightened everything down. I think this looks much neater than the original.