Added primeFactors function