Replaced some for comprehensions.