         } else {
             resultLabel.text = currentText.substring(to: currentText.characters.index(before: currentText.endIndex))
         }
+        
+        calculator.currentValue = Double(resultLabel!.text!)
     }
     
     @IBAction func onNegativeTapped(_ sender: CalculatorButton) {

        } else {
            resultLabel.text = calculator.minus + currentText
        }
    }
    
    @IBAction func onOperationTapped(_ sender: CalculatorButton) {
        calculator.previousValue = Double(resultLabel!.text!)
        calculator.currentOperator = sender.titleLabel!.text!
        highlightOperationButton()
    }
    
    @IBAction func onClearTapped(_ sender: CalculatorButton) {
        resultLabel.text = zero
    }
    
    @IBAction func onAllClearTapped(_ sender: CalculatorButton) {

        } else {
            resultLabel.text = currentText.appending(inputText)
        }
        
        calculator.currentValue = Double(resultLabel!.text!)
    }
    
    @IBAction func onPeriodTapped(_ sender: CalculatorButton) {
