Changed edge extracting algorithm