     let divide = "÷"
     
     var results = [NSManagedObject]()
-    var previousValue: Double
+    var previousValue: Double?
     var currentValue: Double?
     var currentOperator: String?
     var operationButtons: [CalculatorButton]?
     
     required init?(coder aDecoder: NSCoder) {
-        previousValue = 0
+        previousValue = nil
         super.init(coder: aDecoder)
     }
     

    }
    
    @IBAction func onOperationTapped(sender: CalculatorButton) {
        currentOperator = sender.titleLabel!.text!
        highlightOperationButton()
        previousValue = Double(resultLabel.text!)!

        resultLabel.text = readableString(solution)
        
        if resultLabel.text == NSLocalizedString("Number too large", comment: "Number being too large") {
            previousValue = nil
        } else {
            saveToCoreData()
            previousValue = solution
