Reconfiguration of program

Corrected  return and factorization class logic. Fixed bug with
primality test