basic calculator implementation