I am trying to find the chromatic polynomial for the following graph:

I know that the square graph acdba has a chromatic polynomial = $\displaystyle k(k-1)(k^2-3k+3)$

So, I figured I could use that and just include the last two vertices f and g. However, I noticed that I get a different equation depending on which vertex I choose first. If I choose g first I get:

$\displaystyle k(k-1)(k^2-3k+3)(k-2)^2$

but if I choose f first, I get:

$\displaystyle k(k-1)(k^2-3k+3)(k-1)(k-3)$

and $\displaystyle (k-2)^2 \neq (k-1)(k-3)$

The answer I have provided is the same as if I had chosen g first. Why does it matter and how can I know which vertex to choose first with other graphs?