much algorithm