         var tip = billAmount * tipPercentage
         var total = billAmount + tip
         
-//        tipLabel.text = "$\(tip)"
-//        totalLabel.text = "$\(total)"
+        //        tipLabel.text = "$\(tip)"
+        //        totalLabel.text = "$\(total)"
         
         tipLabel.text = String(format: "$%.2f", tip)
         totalLabel.text = String(format: "$%.2f", total)
     }
-    
-    @IBAction func onTap(sender: AnyObject) {
-        view.endEditing(true)
-    }
 }

    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        tipLabel.text = String(format: "$%.2f", 0)
        totalLabel.text = String(format: "$%.2f", 0)
        
        var defaults = NSUserDefaults.standardUserDefaults()
        tipControl.selectedSegmentIndex = defaults.integerForKey("defaultTipPercentageIndex")
    }

    override func didReceiveMemoryWarning() {

    @IBAction func onEditingChanged(sender: AnyObject) {
//        println("User editing bill" + billField.text)
        
        updateTotal()
    }
    
    @IBAction func onTap(sender: AnyObject) {
        view.endEditing(true)
    }
    
    func updateTotal() {
        var tipPercentages = [0.15, 0.2, 0.25]
        var tipPercentage = tipPercentages[tipControl.selectedSegmentIndex]
        
