Changed binary converted to flip and use BigInteger