Added algorithm for finding matching sets. Not in use yet.