 import CoreLocation
 
 
+
 class SurveyViewController: UIViewController,  ORKTaskViewControllerDelegate, CLLocationManagerDelegate {
-
     /**
      When a task is completed, the `ViewController` calls this closure
      with the created task.
      */
     var taskResultFinishedCompletionHandler: (ORKResult -> Void)?
     var locationManager: CLLocationManager!
-    var txtLatitude, txtLongitude
     var locationFixAchieved : Bool = false
-
+    var txtLatitude: Double = 0.0
+    var txtLongitude: Double = 0.0
     
     override func viewDidLoad() {
         super.viewDidLoad()

        
        let task = ORKOrderedTask(identifier: "task", steps: [instructionStep, pamOptionStep, summaryStep])
        
        /*
        Passing `nil` for the `taskRunUUID` lets the task view controller
        generate an identifier for this run of the task.
        */
        let taskViewController = ORKTaskViewController(task: task, taskRunUUID: nil)
        taskViewController.delegate = self
        
        presentViewController(taskViewController, animated: true, completion: nil)
    }

    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        
        if (locationFixAchieved == false) {

        return instructionStep
        
    }
    
    
    /**
     This step demonstrates a survey question for assessing a Photographic Affect Meter (PAM)
