rewrite list comprehensions