Improved prime factoring solution!