added loop, should be easier to optimize than fn/recur