implemented switch statement in main