added a port-renumbering function to connect() so that when
two-ports are connected to n-ports the n-port preserves its
port ordering