Move code around. + support code for primes.