Algorithm finalized