apply new remove algorithm in filter method