             )
             (pagelifetime)
            )
-          )
-          (delete-page-by-number id)
+        )
+
+        (delete-page-by-number id)
+
+
+        ; (doseq [x outarr] 
+
+        ;    (swap! pages conj 
+
+        ;       ;{:pageid pageid :updated "jhkjh"}
+        ;       {:pageid id :downloaded (now) :updated (:updated x) :introduction (:introduction x) :title (:title x) :reference (:reference x) }
+        ;    )
+        ; )          
     )
 
 
     (
-      if (< (count (filter #(= (compare (% :pageid) id) 0 ) @pages )) 1)
+      if (or
+           ( < (count (filter #(= (compare (% :pageid) id) 0 ) @pages )) 5)
+           (
+            >
+            (t/in-minutes 
+              (t/interval 
+                (f/parse  (f/formatters :date-hour-minute-second-ms) (.format (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS") (:downloaded (first (filter #(= (compare (% :pageid) id) 0 ) @pages ) ))))
+                (f/parse  (f/formatters :date-hour-minute-second-ms) (.format (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS") (now)) )    
+                
+              )
+            )
+            (pagelifetime)
+           )
+        )
         (doseq [x outarr] 
 
            (swap! pages conj 

    
    outarr (into [] 
        (
        if (> (count (filter #(= (compare (% :pageid) id) 0 ) @pages )) 0)
          (
            if (
                <
                (t/in-minutes 
                  (t/interval 
                    (f/parse  (f/formatters :date-hour-minute-second-ms) (.format (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS") (:downloaded (first (filter #(= (compare (% :pageid) id) 0 ) @pages ) ))))

        pageid
    )
    page (
      if (
        or 
          (< (count (filter #(= (compare (% :pageid) id) 0 ) @pages )) 1)
          (
            >
            (t/in-minutes 
              (t/interval 
                (f/parse  (f/formatters :date-hour-minute-second-ms) (.format (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS") (:downloaded (first (filter #(= (compare (% :pageid) id) 0 ) @pages ) ))))
                (f/parse  (f/formatters :date-hour-minute-second-ms) (.format (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS") (now)) )    
                
              )
            )
            (pagelifetime)
          )
        )
        (slurp (str "http://www.zerohedge.com/?page=" id))
        
    )
