Replace filter with list comprehensions for assigamnet1