         cancel.isEnabled = true
         
         if sender.currentTitle == "Start" {
-            sender.setTitle("Pause", for: .normal)
-            sender.setTitleColor(UIColor.orange, for: .normal)
+            changeButton(button: sender, title: "Pause", color: .orange)
             selectTime.removeFromSuperview()
             convertedSeconds = hour*60*60 + minute*60 + second
             timerLabel.text = timerLabelFormat(time: TimeInterval(convertedSeconds))

            
        }
        else if sender.currentTitle == "Pause" {
            sender.setTitle("Resume", for: .normal)
            sender.setTitleColor(UIColor.green, for: .normal)
            timer.invalidate()
        }
        else if sender.currentTitle == "Resume" {
            sender.setTitle("Pause", for: .normal)
            sender.setTitleColor(UIColor.orange, for: .normal)
            runTimer()
        }
    }
    
    @IBAction func cancelButton(_ sender: UIButton) {
        cancel.isEnabled = false
        start.setTitle("Start", for: .normal)
        start.setTitleColor(UIColor.green, for: .normal)
        
        convertedSeconds = 0
        timer.invalidate()

                    action -> Void in
                    self.timerLabel.removeFromSuperview()
                    self.view.insertSubview(self.selectTime, at: 0)
                    self.changeButton(button: self.start, title: "Start", color: .green)
                }
            ))
            present(alert, animated: true, completion: nil)
        }
    }
    
    func changeButton(button: UIButton, title: String, color: UIColor) {
        button.setTitle(title, for: .normal)
        button.setTitleColor(color, for: .normal)
    }
    
    /*
