diff --git a/src/sasaMain.ml b/src/sasaMain.ml
index 1edce3abfe989dc6628262a04ad46ac95936b4fd..e70fbdf164e55c8570b7b4204476b18c1ed3181a 100644
--- a/src/sasaMain.ml
+++ b/src/sasaMain.ml
@@ -15,12 +15,12 @@ let (print_step : out_channel -> 'v SimuState.t -> int -> int -> string -> strin
   if st.sasarg.init_search <> No_init_search then (
     (* Printf.fprintf log "\n#step %s\n%!" (string_of_int (n-i)); *)
     (* Printf.fprintf log "%s %s %s %s\n%!" (StringOf.env_rif e pl) enable_val legitimate pot; *)
-  ) else  
+  ) else
   if args.no_data_file then (
     if not args.quiet then Printf.printf "\n#step %s\n%!" (string_of_int (n-i))
   ) else (
     if args.daemon = DaemonType.Custom then (
-      (* in custom mode, to be able to talk with lurette, this should not be 
+      (* in custom mode, to be able to talk with lurette, this should not be
            printed on stdout
       *)
       if not args.rif && not args.quiet then (
@@ -46,28 +46,25 @@ let (print_step : out_channel -> 'v SimuState.t -> int -> int -> string -> strin
     flush stderr;
     flush stdout
   )
-  
 
 open Sasacore.SimuState
-
-
 module StringMap = Map.Make(String)
 
+let injected_fault_nb = ref 0
 let inject_fault ff st =
   let update_nodes e p =
     let nl = StringMap.find p.Process.pid st.neighbors in
     let pid = p.Process.pid in
     let v = Conf.get e pid in
     let v = ff (List.length nl) pid v in
+    incr injected_fault_nb;
     Conf.set e pid v
   in
   let e = List.fold_left update_nodes st.config st.network in
   update_config e st
-   
-let plur i = if i>1 then "s" else ""
 
+let plur i = if i>1 then "s" else ""
 
-       
 let (simustep: out_channel -> int -> int -> string -> 'v SimuState.t -> 'v SimuState.t * string) =
   fun log n i activate_val st ->
   (* 1: Get enable processes *)
@@ -76,38 +73,50 @@ let (simustep: out_channel -> int -> int -> string -> 'v SimuState.t -> 'v SimuS
   let all, enab_ll = Sasacore.SimuState.get_enable_processes st in
   if verb then Printf.fprintf log "==> SasaSimuState.simustep: Get the potential\n%!";
   let pot = if Register.get_potential () = None then "" else
-    string_of_float (SimuState.compute_potentiel st)
-in
+      string_of_float (SimuState.compute_potentiel st)
+  in
   let pl = st.network in
   if verb then Printf.fprintf log "==> SasaSimuState.simustep: is it legitimate?\n%!";
   let silent = List.for_all (fun b -> not b) (List.flatten enab_ll) in
   let leg = legitimate st || silent in
+  let gen_dot_legit () =
+    if st.sasarg.gen_dot_at_legit then (
+      let newdot_fn = (Filename.chop_extension st.sasarg.topo) ^ "_legitimate.dot" in
+      let newdot = open_out newdot_fn in
+      Printf.printf "%s has been generated\n" newdot_fn;
+      Printf.fprintf newdot "%s\n" (SimuState.to_dot st);
+      close_out newdot;
+    );
+  in
   let st, all, enab_ll =
     if
       (* not (args.rif) && *)
-        silent
+      silent
     then (
-      match Register.get_fault () with
+      match if !injected_fault_nb > 0 then None else Register.get_fault () with
       | None ->
         Round.update leg true enab_ll enab_ll;
         print_step log st n i "t" pot st.sasarg st.config pl (bll2str enab_ll) enab_ll;
+        gen_dot_legit ();
         raise (Silent (n-i))
       | Some ff ->
         print_step log st n i "t" pot st.sasarg st.config pl (bll2str enab_ll) enab_ll;
         let str = if st.sasarg.rif then "#" else "" in
         Printf.fprintf log
           "\n%sThis algo is silent after %i move%s, %i step%s, %i round%s.\n"
-          str Round.s.moves (plur Round.s.moves) (n-i) (plur (n-i)) Round.s.cpt (plur Round.s.cpt);
+          str Round.s.moves (plur Round.s.moves) (n-i) (plur (n-i))
+          Round.s.cpt (plur Round.s.cpt);
         Printf.fprintf log "%s==> Inject a fault\n%!" str;
         let st = inject_fault ff st in
         let all, enab_ll = Sasacore.SimuState.get_enable_processes st in
         st, all, enab_ll
     )
     else if leg then (
-      match Register.get_fault () with
+      match if !injected_fault_nb > 0 then None else Register.get_fault () with
       | None ->
         Round.update leg true enab_ll enab_ll;
         print_step log st n i "t" pot st.sasarg st.config pl activate_val enab_ll;
+        gen_dot_legit ();
         raise (Legitimate (n-i))
       | Some ff ->
         print_step log st n i "t" pot st.sasarg st.config pl activate_val enab_ll;
@@ -159,23 +168,23 @@ let rec (simuloop: out_channel -> int -> int -> string -> 'v SimuState.t -> int)
     Printf.fprintf log
       "\n%sThis algo is silent after %i move%s, %i step%s, %i round%s.\n%!"
       str Round.s.moves (plur Round.s.moves) i (plur i) Round.s.cpt (plur Round.s.cpt);
-    if st.sasarg.rif then 
+    if st.sasarg.rif then
       print_string "\nq\n#quit\n%!"
     else
-      Printf.fprintf log "\n#quit\n"; 
+      Printf.fprintf log "\n#quit\n";
     flush_all();
-    i  
-    
+    i
+
   | Legitimate i ->
     let str = if st.sasarg.rif then "#" else "" in
     Printf.fprintf log
       "\n%s%sThis algo reached a legitimate configuration after %i move%s, %i step%s, %i round%s.\n%!"
       (if st.sasarg.rif then "#" else "#")
       str Round.s.moves (plur Round.s.moves) i (plur i) (Round.s.cpt-1) (plur (Round.s.cpt-1));
-    if st.sasarg.rif then 
+    if st.sasarg.rif then
       print_string "\nq\n#quit\n%!"
     else
-      Printf.fprintf log "\n#quit\n"; 
+      Printf.fprintf log "\n#quit\n";
     flush_all();
     i
 
@@ -184,7 +193,8 @@ let sob = fun b -> if b then "t" else "f"
 let () =
   let st = Sasacore.SimuState.make true Sys.argv in
   let n = st.sasarg.length in
-  let oc_rif = match st.sasarg.output_file_name with None -> stdout | Some fn -> open_out fn in
+  let oc_rif = match st.sasarg.output_file_name with
+      None -> stdout | Some fn -> open_out fn in
   try
     match st.sasarg.init_search, st.sasarg.daemon with
     | No_init_search, (ExhaustSearch|ExhaustCentralSearch) ->
@@ -195,7 +205,8 @@ let () =
            if trig <> [] then
              Round.update leg true trig enab
            else (* Round.update requires list of the same size *)
-             Round.update leg true (List.map (fun l -> List.map (fun _ -> false) l) enab) enab;
+             Round.update leg true
+               (List.map (fun l -> List.map (fun _ -> false) l) enab) enab;
            Printf.fprintf oc_rif "#step %d\n#outs %s %s %s %s %s %s %d\n" (i)
              (StringOf.env_rif conf st.network) (bll2str enab) (bll2str trig)
              (sob leg) (string_of_float pot) (bool2str Round.s.is_round) Round.s.cpt;
@@ -247,7 +258,7 @@ let () =
           close_out log;
           failwith(Printf.sprintf
                      "Maximum simulation length reached. Something went wrong or %d %s"
-                     n "is not long enough (use sasa -l to try longer simulation)" 
+                     n "is not long enough (use sasa -l to try longer simulation)"
           )
         )
         else