fixed switchSides()