successful filtering function and output