edited problem 16 to use BigInteger