Implement stable marriage, apparently correct.