I suspect you also need to keep a list of pending operations, and then only execute when certain operations happen.

For instance, if you press 1, then 2, then plus, then 3, then *, then 4 then +....

Digits would be appended to the current value. When you detect an operand, you just check order of operations, before deciding whether to operate on the output value-- for instance when you encounter a plus, you would execute everything before the plus. But times, you would be operating on the input number, if that makes sense...