working on logic for filter