Added naive primality test