add debug_mode option to Sim