         
         stopLocationManager()
         updateLabels()
+        configureGetButton()
     }
     
     func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
         let newLocation = locations.last
         print("didUpdateLocations \(newLocation)")
         
-        lastLocationError = nil
-        location = newLocation
-        updateLabels()
+        if newLocation?.timestamp.timeIntervalSinceNow < -5 {
+            return
+        }
+        
+        if newLocation?.horizontalAccuracy < 0 {
+            return
+        }
+        
+        if location == nil || location?.horizontalAccuracy > newLocation?.horizontalAccuracy {
+            lastLocationError = nil
+            location = newLocation
+            updateLabels()
+            
+            if newLocation?.horizontalAccuracy <= locationManager.desiredAccuracy {
+                print("*** We're done!")
+                stopLocationManager()
+                configureGetButton()
+            }
+        }
+        
     }
     
     // MARK: - helper

            return
        }
        
        startLocationManager()
        updateLabels()
    }
    
    // MARK: - CLLocationManagerDelegate

        // Do any additional setup after loading the view, typically from a nib.
        
        updateLabels()
        configureGetButton()
    }

    // MARK: action
