fixed recursion to be more clojure