     @IBOutlet weak var searchBar: UISearchBar!
 
     let locationManager = CLLocationManager()
+    var localSearch: MKLocalSearch?
+    var places: [MKMapItem] = []
+    var boundingRegion: MKCoordinateRegion?
 
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        self.locationManager.delegate = self
-        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
-        self.locationManager.requestWhenInUseAuthorization()
-        self.locationManager.startUpdatingLocation()
-        self.mapView.showsUserLocation = true
     }
 
     override func didReceiveMemoryWarning() {


    // called when keyboard search button pressed
    func searchBarSearchButtonClicked(searchBar: UISearchBar) {

    }
}


        // Dispose of any resources that can be recreated.
    }

    func startSearch(searchString: String, region: MKCoordinateRegion) {
        let request = MKLocalSearchRequest()
        request.naturalLanguageQuery = searchString
        request.region = region

        localSearch = MKLocalSearch(request: request)
        localSearch?.startWithCompletionHandler({ (response, error) -> Void in
            if (error != nil) {

            } else {
                self.places = response!.mapItems
                self.boundingRegion = response!.boundingRegion
            }
        })

        UIApplication.sharedApplication().networkActivityIndicatorVisible = true
    }

    // MARK: CLLocationManagerDelegate
    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        let location = locations.last

        manager.stopUpdatingLocation()
        manager.delegate = nil

        let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude)
        let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 1, longitudeDelta: 1))
        mapView.setRegion(region, animated: true)

        if let searchString = searchBar.text {
            startSearch(searchString, region: region)
        }
    }

    func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
