findMatchedBlocks algorithm changed