speedup for MaxPr (using valuation instead of abs tends to be faster when sorting)
use a proper loop in findSolutions() and skip if any log is 0
improved output. toInt should be called toRat