Changing requirements to list comprehension