added class to handle primality testing