save state before major refactoring to reduce dependence on BigInt
avoid use of BigInt