made the prime checker more efficient