   }
   
   func getUserDefaults() {
-    if (UserDefaults.standard.bool(forKey: "HasLaunchedOnce")) {
-      if UserDefaults.standard.getRadius() != -1 {
-        radius = UserDefaults.standard.getRadius()
-      }
-      if UserDefaults.standard.getNoOfResults() != -1 {
-        results = UserDefaults.standard.getNoOfResults()
-      }
-      if UserDefaults.standard.getUnits() != "" {
-        units = UserDefaults.standard.getUnits()
-      }
+    let launchedBefore = UserDefaults.standard.bool(forKey:"HasLaunchedOnce")
+    if launchedBefore {
+      radius = UserDefaults.standard.getRadius()
+      results = UserDefaults.standard.getNoOfResults()
+      units = UserDefaults.standard.getUnits()
     } else {
       UserDefaults.standard.set(true, forKey: "HasLaunchedOnce")
-      UserDefaults.standard.synchronize()
     }
   }
   

      self.settings.alpha = 0
      self.backgroundButton.alpha = 0
    })
    UserDefaults.standard.setRadius(value: self.radius)
    UserDefaults.standard.setNoOfResults(value: self.results)
  }
  
  @IBAction func radiusSliderMoved(_ sender: UISlider) {

    updateRadiusAndUnitsLabels()
  }
  
  func saveRadiusAndResults() {
    UserDefaults.standard.setRadius(value: radius)
    UserDefaults.standard.setNoOfResults(value: results)
  }
  
  // MARK: Segue Functionality
  
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "toMap" {
      print(radius)
      print(results)
      saveRadiusAndResults()
      let controller = segue.destination as! MapVC
      controller.makeNetworkCall = makeNetworkCall
      controller.searchRadius = Int(radius)
