fix problem 6
problem 7 update
improvements to primality test