problem 3: filter term