Made factorization more dynamic by letting the factorization function reduce the prime generation limit
Pushed to master