change _.each to for/of