use switch in main