Clojure implementation using ref/STM