made code functional

Updated the code to make it functional (since we're using it tomorrow for our beginners' night at our local clojure user group).