Full algorithm revision.