 
     // stop and start recording based off recording state
     @IBAction func recordVideoButtonPressed(sender _: AnyObject) {
+        // end recording
         if movieFileOutput.isRecording || simulatorRecording {
             // stop recording
-            movieFileOutput.stopRecording()
-            endLoc = currentLoc
+            movieFileOutput.stopRecording() // calls fileOutput() method below
+
             // stop recording the simulator
             if TARGET_OS_SIMULATOR != 0 {
                 // force seque to previousTrips
                 performSegue(withIdentifier: "previousTrips", sender: nil)
                 updateRecordButtonTitle()
             }
-        } else {
+        } else { // start recording
             startLoc = currentLoc
             // not running simulator
             if TARGET_OS_SIMULATOR == 0 {

        // set output file location
        self.outputFileLocation = outputFileURL

        // seque to videoPreview
        self.performSegue(withIdentifier: "videoPreview", sender: nil)
    }

    // MARK: Helpers

    var startLoc: CLLocationCoordinate2D!
    var endLoc: CLLocationCoordinate2D!
    var currentLoc: CLLocationCoordinate2D!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
