Adding another place for Pcmd swapping.
Indenting code.