corrected placement of else in checkPrimes()

alternative to first if rather than second