Doing algebra without the normal commuting rules is super unintuitive for me. Did I do this right?

"If G is a group and $\displaystyle g,h \in G$, write $\displaystyle (gh)^{-1}$ in terms of $\displaystyle g^{-1}$ and $\displaystyle h^{-1}$"

What I did (I'm doing all of my operations on the right hand side):

$\displaystyle (gh)^{-1}(gh)=e$

$\displaystyle (gh)^{-1}(ghh^{-1})=h^{-1}$

$\displaystyle (gh)^{-1}(gg^{-1})=h^{-1}g^{-1}$

$\displaystyle (gh)^{-1}=h^{-1}g^{-1}$

Is that right? It seems weird to me that splitting the h and g would make them switch places.