adding mode selection in main class