modular calculator base code.