added utility method for filtering list of words