with for.each function