bigint: implemented copy-on-write optimization