Modified the prime lookup to be a hashset lookup.