Solved a problem with list comprehensions