Use list comprehension instead of loop