Reworked matching, made more intelligent changed Match id to potential