improvements

CHG: replaced foreach with GetEnumerator()