engine - maxDuplicates implementation