use range based for loop