fix bug in matching

Tested on darcy.

optimized fractal algorithm took 15.53 seconds