The _cmp function now returns the number of ports.