Added is_prime helper