wrote out code and tweaked while loop in primefactors.pl