anchor.diff:              (if (< 0 offset)
                   (decf offset)
                   (return (list i (- loc i))))))))
  -
  -    ;;End of duplicate functions
   
       (defun clean-string-for-excerpt (the-string)
         (collecting-string
  
positive.code:                               (array-cdr res))
              (array-cdr res))))
  
      (defun filter-opins-score (tree-addresses opinions warstats)
        (let ((res
               (collecting
                   (dolist (ta tree-addresses)
                     (let ((id (list-last ta)))
                       (when (< 2 (getprop warstats id 'effect))
                         (collect id)))))))
          (chain res
                 (sort (lambda (a b) (- (getprop warstats a 'effect)
                                        (getprop warstats b 'effect)))))
          res))
  
      (defun filter-opins-controversial (tree-addresses opinions warstats)
        (let ((res
               (collecting
                   (dolist (ta tree-addresses)
                     (let ((id (list-last ta)))
                       (when (< 2 (getprop warstats id 'controversy))
                         (collect id)))))))
          (chain res
                 (sort (lambda (a b) (- (getprop warstats a 'controversy)
                                        (getprop warstats b 'controversy)))))
          res))
  
      (defun filter-opins-question (tree-addresses opinions warstats)
        (let ((res
               (collecting
                   (dolist (ta tree-addresses)
                     (let* ((id (list-last ta))
                            (opin (getprop opinions id))
                            (stats (getprop warstats id)))
                       (when
                           ;;FIXME: This is a crude definition of a question. Reconsider
                           ;; if/when we implement "Accepted" flag. Also if directives
                           ;; are added.
                           (or (chain (list "needsEvidence" "raiseQuestion")
                                      (includes (@ opin flag 1)))
                               ;; Wrong axis is a stand in for being answered. For now.
                               (< 1 (@ stats x-wrong 0)))
                         (collect id)))))))
          (chain res
                 (sort
                  ;; Have arbitrarily decided to sort by combined controversy and effect
                  (lambda (a b) (- (+ (getprop warstats a 'controversy)
                                      (getprop warstats a 'effect))
                                   (+ (getprop warstats b 'controversy)
                                      (getprop warstats b 'effect))))))
          res))
  
      ;;
      ;;Utilies taken from opinion-form
      ;;
  
      ;;FIXME: Duplicate of lisp functions in excerpt.lisp
      ;;Would be nice to only implement once.
      (defun create-textdata (text)
        (let ((res (create :text text :whitespace (create)))
              (found nil))
  
negative.code:     (defun make-missing-rootid-url (url)
        (strcat "/new-target/?url=" (encode-u-r-i-component url)))
  
      (defun excerpt-reply-link (url excerpt)
        (let ((exstr (when excerpt (strcat "&excerpt=" (encode-u-r-i-component excerpt)))))
          (strcat
           "/opinion/?target="
           (encode-u-r-i-component url)
           exstr)))
  
      ;;; Tree tools
  
      ;;FIXME: is this same/similar to immediate-children-ids?
      (defun opinion-children (tree-address opinions)
        (let ((res (some (lambda (x)
                           (when (eql (getprop tree-address 0) (@ x 0 id)))
  