reimplement stack to make the calculator programmable