let rec add_node_and_custom_dpds get_dpds node_list node =
  let node_list, added = add_node_in_list node node_list in
  if added
  then
    let is_block = match N.elem_key node with
      | K.SigKey (PdgIndex.Signature.In PdgIndex.Signature.InCtrl-> true
      | K.Stmt stmt ->
          (match stmt.skind with
               Block _ | UnspecifiedSequence _ -> true
             | _ -> false)
      | _ -> false
    in
    if is_block
    then node_list (* blocks are not relevant to propagate information *)
    else
      List.fold_left
        (add_node_and_custom_dpds get_dpds) node_list (get_dpds node)
  else node_list