reworking of potential matching

Signed-off-by: shalott <shalott@gmail.com>
fixes to new matching process

Signed-off-by: shalott <shalott@gmail.com>
More fixes to matching and assignments
small tweaks

Signed-off-by: shalott <shalott@gmail.com>