initialised function for finding prime factors of a number.