How can I apply a filter for my program?