write and test filter