I want to draw the process like in the picture using the code below, however, there is some problem, would someone help me?

\usepackage[latin1]{inputenc}
\usetikzlibrary{trees}
\usepackage{verbatim}
\tikzstyle{level 1}=[level distance=1.5cm, sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=1.5cm, sibling distance=2cm]
\tikzstyle{bag} = [text width=20em, text centered]
\tikzstyle{end} = [circle, minimum width=3pt,fill, inner sep=0pt]
\begin{tikzpicture}[grow=down]
\node[bag] { $(B)$}
child {
node[bag] {$(R_{good})$}
child {
node[bag] {$(and)$}
edge from parent
node[right] {$and$}
}
edge from parent
node[right] {$t$}
};
\end{tikzpicture}
