iterate over each item in the list instead of for-loop