- Changed foreach to assign the value to the variable