diff --git a/model.ml b/model.ml
index bc17b952770b9104b8e9750464e4cc432da920e6..c31acd34c60b96f0c96a7a41bdb3a9e9295d723a 100644
--- a/model.ml
+++ b/model.ml
@@ -35,10 +35,10 @@ let build ~filename =
        Onnx
       end
     in 
-    print_string "";
-
+    print_newline();
+    Ok { format; filename }
   else
-    Format.printf "The file: %s doesn't exist\n" filename;
+    Error (Format.sprintf "No such file `%s'." filename)
 ;;
 
 let flag = ref 0;;
@@ -157,10 +157,12 @@ let content_file filename =
 ;;
 
 let my_fun filename = 
-        build filename;
-        content_file filename;    
+        build ~filename;;
+let my_fun2 filename =
+        content_file filename;
 ;;
 
+
 (*This command is used to create an interface with the user such that they can insert the name of the file
 to be tested.
 In order to compile the code, use : 
@@ -169,3 +171,4 @@ To run the executable, use :
 ./(name_of_the_executable) (name_of_the_nnet_file.nnet) *)
 
 my_fun Sys.argv.(1);;
+my_fun2 Sys.argv.(1);;
diff --git a/model.mli b/model.mli
index f7294cc28def09fb6800364bfcb09de06edda7f9..26993dab1685d68666ab11e548562188a6cb7edc 100644
--- a/model.mli
+++ b/model.mli
@@ -22,12 +22,14 @@ type record = {
 
     The model is inferred from the [filename] extension.
 *)
-val build: filename:string -> t -> unit
+val build: filename:string -> (t, string) Result.t
 
 (** Verifies the content of the given [filename] and checks 
     if the conditions are satisfied.
 *)
-val content_file: filename:string -> t -> unit
+val content_file:string -> unit
 
 (** The main function of the program *)
-val my_fun: filename:string -> t -> unit
+val my_fun:string -> (t, string) Result.t
+val my_fun2:string -> unit
+