save a little space by avoiding BigInteger when possible