added clojure implementation