Replaced BigInteger with System.Numerics.BigInteger.