Rewrite without loop/recur