         }
     }
     
-    var fetchRequestForSavedArticles: NSFetchRequest<WMFArticle> {
-        get {
-            let savedRequest = WMFArticle.fetchRequest()
-            savedRequest.predicate = NSPredicate(format: "savedDate != NULL")
-            return savedRequest
-        }
-    }
-    
-    var fetchRequestForSavedArticlesWithLocation: NSFetchRequest<WMFArticle> {
-        get {
-            let savedRequest = WMFArticle.fetchRequest()
-            savedRequest.predicate = NSPredicate(format: "savedDate != NULL && signedQuadKey != NULL")
-            return savedRequest
-        }
-    }
-    
-    // Search completions
+    func adjustLayout(ofPopover articleVC: ArticlePopoverViewController, withSize size: CGSize,  withAnnotationView annotationView: MKAnnotationView) {
+        let annotationCenter = view.convert(annotationView.center, from: mapView)
+        let center = CGPoint(x: view.bounds.midX, y:  view.bounds.midY)
+        let deltaX = annotationCenter.x - center.x
+        let deltaY = annotationCenter.y - center.y
+        
+        let thresholdX = 0.5*(abs(view.bounds.width - size.width))
+        let thresholdY = 0.5*(abs(view.bounds.height - size.height))
+        
+        var offsetX: CGFloat
+        var offsetY: CGFloat
+        
+        let distanceFromAnnotationView: CGFloat = 5
+        let distanceX: CGFloat = round(0.5*annotationView.bounds.size.width) + distanceFromAnnotationView
+        let distanceY: CGFloat =  round(0.5*annotationView.bounds.size.height) + distanceFromAnnotationView
+        
+        if abs(deltaX) <= thresholdX {
+            offsetX = -0.5 * size.width
+            offsetY = deltaY > 0 ? 0 - distanceY - size.height : distanceY
+        } else if abs(deltaY) <= thresholdY {
+            offsetX = deltaX > 0 ? 0 - distanceX - size.width : distanceX
+            offsetY = -0.5 * size.height
+        } else {
+            offsetX = deltaX > 0 ? 0 - distanceX - size.width : distanceX
+            offsetY = deltaY > 0 ? 0 - distanceY - size.height : distanceY
+        }
+        
+        articleVC.view.frame = CGRect(origin: CGPoint(x: annotationCenter.x + offsetX, y: annotationCenter.y + offsetY), size: size)
+    }
+    
+    // MARK: Search Suggestions & Completions
     
     func updateSearchSuggestions(withCompletions completions: [PlaceSearch]) {
         guard let currentSearchString = searchBar.text?.trimmingCharacters(in: NSCharacterSet.whitespacesAndNewlines), currentSearchString != "" || completions.count > 0 else {

        
    }
    
    var performDefaultSearchOnNextMapRegionUpdate = false
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        

        }
    }
    
    // MARK: Place Grouping
    
    var groupingTaskGroup: WMFTaskGroup?
    var needsRegroup = false
