use list comprehensions instead of for loop