new version of filter. Now working