`\begin{algorithm}[H]
\caption{REINFORCE Algorithm}
Initialise $\theta$ arbitrarily\\
\For{each episode $\{s_1, a_1, r_2, ..., s_{T-1}, a_{T-1}, r_T$\}\sim \pi_\theta}{
\For{$t=1$ to $T-1$}{$\theta \leftarrow \theta + \alpha \nabla_\theta \log \pi_\theta (s_t, a_t )v_t}$}
\Return $\theta$
\label{alg:reinforce}
\end{algorithm}
` How do I get the two ends of the for loops to appear in the right places?