change fast enumeration to for loop