Replaced filter call with a list comprehension for py3k support