walk through array and use a closure