new filter with matrix inside function