Algorithm cnfirm