switched from if to switch for commands