adding some primality stuff