implement TaskSet.filter() method