speed up prime_factors