reverted _.each in favor of for