change iteration to list comprehension