Updated the checkPrimes function and updated comments.