Added a solution to the prime decomposition algorithm