nextPrime method done.