testing for primality