Chage to range-based for