Given part of the following algorithm in page 217 probabilistic robotics, this algorithm for EKF localization with unknown correspondences
9. for all observed features $z^{i} = [r^{i} \ \phi^{2} \ s^{i}]^{T} $
10. for all landmarks $k$ in the map $m$ do
11. $q = (m_{x} - \bar{\mu}_{x})^{2} + (m_{y} - \bar{\mu}_{y})^{2}$
12. $\hat{z}^{k} = \begin{bmatrix} \sqrt{q} \\ atan2(m_{y} - \bar{\mu}_{y}, m_{x} - \bar{\mu}_{x} ) - \bar{\mu}_{\theta} \\ m_{s} \\ \end{bmatrix}$
13. $ \hat{H}^{k} = \begin{bmatrix} h_{11} & h_{12} & h_{13} \\ h_{21} & h_{22} & h_{23} \\ h_{31} & h_{32} & h_{33} \\ \end{bmatrix} $
14. $\hat{S}^{k} = H^{k} \bar{\Sigma} [H^{k}]^{T} + Q $
15. endfor
16. $ j(i) = \underset{k}{\operatorname{arg\,max}} \ \ det(2 \pi S^{k})^{-\frac{1}{2}} \exp\{-\frac{1}{2} (z^{i}-\hat{z}^{k})^{T}[S^{k}]^{-1} (z^{i}-\hat{z}^{k})\} $
17. $K^{i} = \bar{\Sigma} [H^{j(i)}]^{T} [S^{j(i)}]^{-1}$
18. $\bar{\mu} = \bar{\mu} + K^{i}(z^{i}-\hat{z}^{j(i)}) $
19. $\bar{\Sigma} = (I - K^{i} H^{j(i)}) \bar{\Sigma} $
20. endfor
My question is why the second loop ends in the line 15. Shouldn't it end after the line 19. I've checked the errata of this book but nothing about this issue.