code from the clojure data analysis cookbook