                         (assoc-id (if (< 0 (length s1)) s1 nil))
                         (atom-id (if (< 0 (length s2)) s2 nil)))
                         (list assoc-id atom-id))))
-            (list nil nil))))
-
-(defun find-link-weight ()
-    (get-text-property (line-beginning-position) 'link-weight))
-
-(defun find-link-sharability ()
-    (get-text-property (line-beginning-position) 'link-sharability))
-
-(defun find-target-weight ()
-    (get-text-property (line-beginning-position) 'target-weight))
-
-(defun find-target-sharability ()
-    (get-text-property (line-beginning-position) 'target-sharability))
+            (list (get-text-property (line-beginning-position) 'link-key) (get-text-property (line-beginning-position) 'target-key))
+            )))
+
+;;            (list nil nil))))
+
+(defun get-key (atom)
+    (cdr (assoc 'key atom)))
+
+(defun get-value (atom)
+    (cdr (assoc 'value atom)))
+
+(defun get-weight (atom)
+    (cdr (assoc 'weight atom)))
+
+(defun get-sharability (atom)
+    (cdr (assoc 'sharability atom)))
 
 (defun view-name (root-id)
     (if root-id
         (concat "view-" root-id)
         (concat "anonymous-" (number-to-string (random 1000)))))
 
-(defun current-line-target ()
+(defun current-target-key ()
     (car (last (find-id))))
 
-(defun current-line-link ()
+(defun current-link-key ()
     (car (find-id)))
 
-(defun show-info (key)
-    (let ((atom (gethash key view-atoms)))
-        (let (
-            (created (cdr (assoc 'created atom)))
-            (value (cdr (assoc 'value atom)))
-		    (weight (cdr (assoc 'weight atom)))
-	        (sharability (cdr (assoc 'sharability atom))))
-	            (message (concat
-	                 "weight: " (number-to-string weight)
-	                 " sharability: " (number-to-string sharability)
-	                 " created: " (format-time-string "%Y-%m-%dT%H:%M:%S%z" (seconds-to-time (/ created 1000.0)))
-	                 " value: " value)))))
+(defun current-link ()
+    (get-atom (current-link-key)))
+
+(defun current-target ()
+    (get-atom (current-target-key)))
+    
+(defun get-atom (key)
+    (if key
+        (if view-atoms
+            (gethash key view-atoms)
+            nil)
+        nil))
+
+(defun show-info (atom)
+    (let (
+        (created (cdr (assoc 'created atom)))
+        (value (cdr (assoc 'value atom)))
+        (weight (cdr (assoc 'weight atom)))
+        (sharability (cdr (assoc 'sharability atom))))
+            (message (concat
+                 "weight: " (number-to-string weight)
+                 " sharability: " (number-to-string sharability)
+                 " created: " (format-time-string "%Y-%m-%dT%H:%M:%S%z" (seconds-to-time (/ created 1000.0)))
+                 " value: " value))))
 
 (defun link-info ()
     (interactive)
-    (let ((key (current-line-link)))
-        (if key
-            (show-info key))))
+    (let ((link (current-link)))
+        (if link
+            (show-info link)
+            (no-link))))
 
 (defun target-info()
     (interactive)
-    (let ((key (current-line-target)))
-        (if key
-            (show-info key))))
+    (let ((target (current-target)))
+        (if target
+            (show-info target)
+            (no-target))))
 
 
 ;; COMMUNICATION ;;;;;;;;;;;;;;;;;;;;;;;

					                     '(:foreground "grey80" :background "grey97")
					                     '(:foreground "black"))) " ")
					         ;;'invisible t
		                    'target-weight target-weight
		                	'target-sharability target-sharability
		                	'link-weight link-weight
			                'link-sharability link-sharability))
			        (loop for i from 1 to indent do (insert "    "))
                    (insert (concat
		                (colorize link-value link-weight link-sharability t) "  "
			            (colorize target-value target-weight target-sharability nil) "\n"))
                    (write-view children (+ indent 1))
                    ))))



(defun visit-target ()
    (interactive)
    (let ((key (current-target-key)))
        (if key
            (request-view key view-depth view-style view-min-sharability view-max-sharability view-min-weight view-max-weight)
            (no-target))))

(defun visit-link ()
    (interactive)
    (let ((key (current-link-key)))
        (if key
            (request-view key view-depth view-style view-min-sharability view-max-sharability view-min-weight view-max-weight)
            (no-link))))

(defun search ()
    (interactive)
