change for loop to list comprehension.