I'm assuming this is evolutionary / brute force of some nature, given OP's comments about it being expensive to run.