add list comprehension code and tests