implements the filter method and a shorthand string selector functionality