DRYed out the test initializationy
Removed directive I never use
sieve code, no optimizations
added the optimizations suggested in the posting