Replaced list comprehensions with filters in qs.hs