Converted to use BigInt
Maintain output buffer to display UTF-8 characters