Code now compiles thanks to advice from Dr. Brinkman. Some testing has been done so far, and the primes() has been fixed.