cleaned up code
made it more clojure-y