more flexible search implemented