replace for to List comprehensions