modernization: range-based for loops ftw!