         }
     }
     
-    func clearDisplayAndHistory(){
-        displayValue=0
-        userInMiddleOfTypingNumber=false
-        historyValue = ""
-    }
-    
     @IBAction func clear(sender: UIButton) {
         clearDisplayAndHistory()
         brain.clearOpStack()
     }
     
-    @IBAction func enter() {
-        if(userInMiddleOfTypingNumber){
-            userInMiddleOfTypingNumber=false
-            if let value = displayValue {
-                brain.pushOperand(value)
-            }
-        }
-        if let result=brain.evaluate(){
-            displayValue=result
-            historyValue = (historyValue ?? "") + "="
-        }
-        else{
-            display.text = "Error"
-            brain.clearOpStack()
-        }
+    func clearDisplayAndHistory(){
+        displayValue=0
+        userIsTypingNumber=false
+        historyValue = ""
     }
     
-    @IBAction func posOperation(sender: UIButton) {
-        if let operation=sender.currentTitle{
-            if let value = displayValue {
-                brain.pushOperand(value)
-            }
-            brain.pushOperation(operation)
-            displayValue=0
-        }
-    }
-    
-    @IBAction func preOperation(sender: UIButton) {
-        if let operation=sender.currentTitle{
-            brain.pushOperation(operation)
-        }
-    }
+    // MARK: Computed Properties
     
     var displayValue:Double?{
         get{

                    display.text="\(newValue!)"
                }
            }
            userInMiddleOfTypingNumber=false
        }
    }
    

            return history.text
        }
        set{
            clearHistoryIfNeeded()
            history.text = (newValue ?? "")
        }
    }
    
    func clearHistoryIfNeeded(){
        if history.text?.rangeOfString("=") != nil || history.text==nil{
            history.text = ""
        }
    }
}
