Made use iterator instead of enumeration