GCD and isPrime functions with Driver updates