$$A = \begin{pmatrix} 2 & 0 & 1 \\ 0 & 3 & 0 \\ 1 & 0 & 2 \end{pmatrix}$$
I need to diagnolize this matrix, I found that the characeristic polynomial is $x^3-7x^2+15x-9$ and that the eigenvalues are 3,3 and 1.
I also found that the eigen vectors are for $Ker (A-3I) = span\{(0,1,0), (1,0,1)\} $ and $Ker (A-I) = span(1,0,-1)$ So I figured that the inverse matrix P when $P^{-1}AP = D$ is $$P=\begin{pmatrix} 0&1&1 \\ 1 & 0 & 0 \\ 0 & 1 & -1 \end{pmatrix}$$ (the eigen vectors as columns).
so $$P^{-1} = \begin{pmatrix} 0&1&0 \\ \frac{1}{2} & 0 & \frac{1}{2} \\ \frac{1}{2} & 0 & -\frac{1}{2} \end{pmatrix}$$
But when multiplying $P^{-1}AP$ i'm not getting a diagonal form, does the order of the columns in $P$ matter? also what an I doing wrong?