finish algorithm checked with filterByAttrVal