Misc algrithms in clojure