updated to use StringBuffer in cljs