prime_factors removed inner recursive function, and made prime_factors recursive