changed post filtering to use list comprehension