switched is_prime() to use naive algorithm
finished Shor's algorithm