I am trying to write down the central series of $D_4$. i.e $e$=$Z_0$ $\subset Z_1 \subset Z_2........\subset Z_l=D_4$ , where $Z_1=Z(D_4)$ and $Z_{i+1} $ is defined such that $Z_{i+1}/Z_i=Z(G/Z_i)$, where $Z$ denotes the center.
This is what i did, we know that the centre of $Z$ is ${e, r^2}$. to find $Z_2$, the i found the centre of the factor group $G/Z_i $ which is the modulo class of two elements $(e,r^2), (r,r^3)$ . I am not sure if i am right or my procedure is right . I need some tips . Thanks