mutual matches algorithm complete