made prime factorization usable on all bases