Fixed int to BigInt conversion issues in random number generator and moved it to be a member function of the BigInt class