Fancy algorithm for match-making