clojure implementation