Adding a parameter max to Utils.getPrimes().
max is the upper limit for prime numbers to be searched