Perfect matching seems to be working but has not been tested exhaustively for correctness or work/span.