modified for dynamic dictionary size (so I can try multiple sizes in benchmarks)