problem 3 solved with clojure