added execute_switch and execute_pipe_command