adding switch.cpp