Added switchState function