changed dictionary size to power of two in order to use mask to avoid
bounds checking.