Working solution. Need to test whether it is accepted by 4clojure.