fixed list comprehensions and set implementation