changed filter_XXX functions to use list comprehension for better performance