I am reading Pro-$p$groups at the moment and would like some clarification on lemma 2.2.
Let $N$ and $ W$ be normal subgroups of a finite $p$-group $G$ with $N \leq W$. If $N$ is not powerfully embedded in $W$ (i.e $[N,W] \not \leq N^p$), then there exist a normal subgroup $J$ of $G$ such that $$ N^p[N,W,W] \leq J <N^p[N,W]$$
The proof given is as follows. Let $M =N^p[N,W]$, since $G$ is a $p$-group and $M$ and $N^{p}$ are normal in $G$, there exists a subgroup $J \triangleleft G$ such that $N^p \leq J <M$ with $[M:J] =p$. Then $ M/J$ is central in $G/J$ and the result follows.
How does the result follow?
All that I can see is that for all $g \in G$ and $n_1^p [n_2,w] \in M$, we have that $$\left[g, n_1^p [n_2,w] \right] \in J $$
Since $M/J\subset Z(G/J)$, we have $[M,G]\subset J$. Also $[[N,W],W]\subset [M,G]$ since $[N,W]\subset M$ and $W\subset G$. Thus:
$$N^p[[N,W],W]\subset N^p[M,G]\subset J\subset M$$