Added "switch" code.