Use the more idiomatic form of iterating through the list.