made Digit more functional/stateless.