added sieve method for generating primes
reduced if-else statement
imporoved efficiency of basic method by only dividing by odd numbers