Updated isPrime()

Iterates until x <= Math.sqrt(num) instead of x <= num / 2