Working code for the prime factors.