diff --git a/src/main/java/complexityparser/Model.java b/src/main/java/complexityparser/Model.java
index 9be358fd7337ddfa0e4b83e903cb61af314abbfa..aac73034d1a3a74889bb795f5421fe9db9c8dfdf 100644
--- a/src/main/java/complexityparser/Model.java
+++ b/src/main/java/complexityparser/Model.java
@@ -139,7 +139,7 @@ public class Model extends Observable {
         Executes the last pass. Note that this pass call an overload visit method. 
 	This is very important as it will not work otherwise
         first and second pass need to be called with visit()
-        final pass needs to be called with visit(ParseTree)
+        final pass needs to be called with visit(ParseTree).
         */
         FinalPass finalPass = new FinalPass(secondPass, tosBuilder, typingListener, token);
         finalPass.visit(context);
@@ -149,11 +149,8 @@ public class Model extends Observable {
         error = err.toString();
         result = finalPass.getResult();
         System.out.println("---------------------------------------");
-
         //optional: Prints the operators list and the TOS to stdout.
         //usually a good idea for debugging and testing
-        //but showing bot might create a difficult to read output
-
         System.out.println(TypingEnv.getInstance());
         //System.out.println(TOS.getInstance());
         //calls update on the Observer objects
diff --git a/src/main/java/complexityparser/tos/TOS.java b/src/main/java/complexityparser/tos/TOS.java
index 144286a3be6040c404464c26f3beda2057f4ae60..677bb365e1ca70e6a67303f77dcac04caf6dc385 100644
--- a/src/main/java/complexityparser/tos/TOS.java
+++ b/src/main/java/complexityparser/tos/TOS.java
@@ -36,7 +36,7 @@ import java.util.Stack;
 /**
  * Table Of symbols
  *
- * Lists all the program variables and their tier type.
+ * Lists all the program variables and their tier type for each block.
  */
 public class TOS {
 
@@ -191,7 +191,7 @@ public class TOS {
             res = b.get(i);
             if(res == null) {
                 /*
-                if the current block is a class and the tiered type has not been found
+                If the current block is a class and the tiered type has not been found
                 (since classes cannot be declared inside other classes) then the parent block is necessarily
                 <root>  (and will not contain the searched value).
 		Moreover it also means that it is time to start looking
@@ -307,7 +307,7 @@ public class TOS {
 
     /**
      *
-     * @return a string representation of the tos
+     * @return a string representation of the tos.
      */
     public String toString() {
         StringBuilder str = new StringBuilder();
@@ -419,7 +419,7 @@ public class TOS {
     /**
      *
      * @param no - an index.
-     * @return the parent class block number of the block number of index no.
+     * @return the parent class block number of the block number of index #no.
      */
     public int getClassBlockNumber(int no) {
         while (no != -1 && !(array.get(no) instanceof  ClassBlock)) {
@@ -431,7 +431,7 @@ public class TOS {
     /**
      *
      * @param no - an index.
-     * @return the number of the parent class for the block number no.
+     * @return the number of the parent class for the block number #no.
      */
     public int getMotherClassNumber(int no) {
         if(no == -1) {
@@ -453,7 +453,7 @@ public class TOS {
      *
      * @param no - an index.
      * @param cl - an index.
-     * @return true if the block no is contained inside the class block cl
+     * @return true if the block of number #no is contained inside the class block #cl.
      */
     public boolean isBlockInClass(int no, int cl) {
         if(no == -1) {
@@ -469,7 +469,7 @@ public class TOS {
     /**
      *
      * @param no - an index.
-     * @return the name of the class identified by the block number no.
+     * @return the name of the class identified by the block number #no.
      */
     public String getClassName(int no) {
         String res = "";
diff --git a/src/main/java/complexityparser/types/FOTier.java b/src/main/java/complexityparser/types/FOTier.java
index 03d19c42d27087f3d2569111f91188d573b0dba7..cdef4ec485803dff0af138fe72d6ab4bc18ab006 100644
--- a/src/main/java/complexityparser/types/FOTier.java
+++ b/src/main/java/complexityparser/types/FOTier.java
@@ -22,7 +22,6 @@ import java.util.Objects;
 
 public class FOTier {
     private Tier[] in;
-//    private Output out;
     private Tier out; 
     private Tier env; 
 
@@ -125,7 +124,7 @@ public class FOTier {
 
     /**
      *
-     * @return the number of input tiers (arity) of the current operator.
+     * @return the number of input tiers (arity) of this FOTier.
      */
     public int size() {
         return in.length;
@@ -136,11 +135,6 @@ public class FOTier {
         return Arrays.toString(in) + " > " + "(" + out + ", " + env + ")";
     }
 
- /* @Override
-    public String toString() {
-        return "(" + out + ", " + env + ")";
-    }*/
-
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
@@ -149,7 +143,7 @@ public class FOTier {
         return out == output.out &&
                 env == output.env;
     }
-//taken directly from former class Output...
+
     @Override
     public int hashCode() {
         return Objects.hash(out, env);
diff --git a/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java b/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java
index 40e36fbe987aa79433c612160459f84a3b006ed4..5f858e05c9897bafaa61d60539e11859bb1fd497 100644
--- a/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java
+++ b/src/main/java/complexityparser/types/env/OperatorTypingEnvBuilder.java
@@ -37,7 +37,7 @@ public class OperatorTypingEnvBuilder extends OperatorsBaseListener {
     }
 
     /**
-     * Creates a new FOTierList, updates the attribute latest, and
+     * Creates a new FOTierList, updates the attribute #latest, and
      * adds the new object with the operator (or method) name to the TypingEnv #te.
      * @param ctx - an operator context.
      */
@@ -54,7 +54,7 @@ public class OperatorTypingEnvBuilder extends OperatorsBaseListener {
     }
 
     /**
-     * Creates a new entry in the operator latest.
+     * Creates a new entry in the FOTierList #latest.
      * @param ctx - a unit context.
      */
     @Override
diff --git a/src/main/java/complexityparser/types/env/TypingEnv.java b/src/main/java/complexityparser/types/env/TypingEnv.java
index 4b502db5b8c9d045900f0acae5618e4a391742b4..b8446f4634c13f87c75aabb0c7344e2d0ad71399 100644
--- a/src/main/java/complexityparser/types/env/TypingEnv.java
+++ b/src/main/java/complexityparser/types/env/TypingEnv.java
@@ -176,7 +176,7 @@ public class TypingEnv {
      */
     public FOTier checkOverrideMethod(String name, FOTier out, Tier... in) {
         TOS tos = TOS.getInstance();
-        //Only the children needs to be verified since no superclass can be used in case of polymorphism.
+        //Only the children need to be verified since no superclass can be used in case of polymorphism.
         return checkOverrideMethod_aux(name, out, in);
     }
 
diff --git a/src/main/java/complexityparser/types/tieredtypes/TieredType.java b/src/main/java/complexityparser/types/tieredtypes/TieredType.java
index 78a104dae862f9aa3170f1d21c763e27ea86dc8b..b9fe3848986897cbdf776711a53f62f4e764ddf4 100644
--- a/src/main/java/complexityparser/types/tieredtypes/TieredType.java
+++ b/src/main/java/complexityparser/types/tieredtypes/TieredType.java
@@ -20,7 +20,7 @@ import complexityparser.tos.TOS;
 import complexityparser.types.Tier;
 
 /**
- * An abstract class to represent a tiered type
+ * An abstract class to represent a tiered type.
  */
 public abstract class TieredType {
 
diff --git a/src/main/java/complexityparser/typingVisitors/base/BaseStatementVisitor.java b/src/main/java/complexityparser/typingVisitors/base/BaseStatementVisitor.java
index e76756260ddbd4e00c00880e370fd40014f1afc5..21c99c393b439953568f61425030cb22ecdc61ca 100644
--- a/src/main/java/complexityparser/typingVisitors/base/BaseStatementVisitor.java
+++ b/src/main/java/complexityparser/typingVisitors/base/BaseStatementVisitor.java
@@ -109,8 +109,8 @@ public abstract class BaseStatementVisitor extends BaseExpressionVisitor {
         visit(ctx.parExpression());
         setLiteralDefaultTier(getTierType(ctx.parExpression().expression()));
         //visitChildren(ctx);
-        //detect recursive calls in each branch and only keep the maximum value
-        //do the same for while counts
+        //Detects recursive calls in each branch and only keep the maximum value.
+        //Does the same for while counts.
         int recursiveCalls = getRecursiveCallsCount();
         int recursiveCallsLocalMax = 0;
         int whileCount = getWhileCount();
@@ -137,7 +137,7 @@ public abstract class BaseStatementVisitor extends BaseExpressionVisitor {
         Tier parExpr = getTierType(ctx.parExpression().expression());
         Tier env = getEnvironmentType(ctx.parExpression().expression());
         Tier res = parExpr;
-        //type the if statement
+        //Types the if statement.
         if(parExpr != Tier.max(parExpr, env)) {
             res = Tier.None;
         }
@@ -169,7 +169,7 @@ public abstract class BaseStatementVisitor extends BaseExpressionVisitor {
         Tier parTier = getTierType(par.expression());
         Tier env = getEnvironmentType(par.expression());
         incrementWhileCount();
-        //if the while statement contains recursive calls, the wile statement types (NONE, NONE)
+        //If the while statement contains recursive calls, the wile statement tier and environment tier are both NONE.
         Tier res;
         if(getRecursiveCallsCount() != 0) {
             res = Tier.None;
@@ -216,8 +216,8 @@ public abstract class BaseStatementVisitor extends BaseExpressionVisitor {
     }
 
     /**
-     * Verifies if a catch clause is valid
-     * because literals are typed with tier 1 an assignment will type 1 and thus not be a valid catch clause
+     * Verifies if a catch clause is valid.
+     * Because literals are typed with tier 1, an assignment will type 1 and thus not be a valid catch clause.
      * @param ctx - a catch clause context.
      * @return the tier None (if the block has tier distinct from 0).
      */
@@ -235,7 +235,7 @@ public abstract class BaseStatementVisitor extends BaseExpressionVisitor {
     }
 
     /**
-     * Verifies if a finally clause is valid
+     * Verifies if a finally clause is valid.
      * @param ctx - a finally block context.
      * @return the tier of the block.
      */
diff --git a/src/main/java/complexityparser/typingVisitors/base/BaseVisitor.java b/src/main/java/complexityparser/typingVisitors/base/BaseVisitor.java
index e4252618a8e20f370f4060ccf47e65c1081fbf49..d84a57cf674de709dbaeeb33816f1c0572c00e35 100644
--- a/src/main/java/complexityparser/typingVisitors/base/BaseVisitor.java
+++ b/src/main/java/complexityparser/typingVisitors/base/BaseVisitor.java
@@ -210,15 +210,15 @@ public abstract class BaseVisitor extends JavaParserBaseVisitor {
 
     /**
      *
-     * @param ctx - a parse tree 
-     * @return the block index associated with the given tree node
+     * @param ctx - a parse tree.
+     * @return the block index associated with the given tree node.
      */
     public Integer getBlockNumber(ParseTree ctx) {
         return blockNumbers.get(ctx);
     }
 
     /**
-     * Sets the value of override result
+     * Sets the value of override result:
      * if true,
      *     the result value will be overriden on call of putTierType(..)
      *     and a string output will be generated
@@ -330,7 +330,7 @@ public abstract class BaseVisitor extends JavaParserBaseVisitor {
 
     /**
      * A helper function to avoid duplicate code and to print the appropriate message
-     * to the appropirate output (error or standard)
+     * to the appropirate output (error or standard).
      * @param rule - the name of the grammar rule.
      * @param txt - the code associated with the grammar rule.
      * @param t - the tier type of the rule.
diff --git a/src/main/java/view/EditorView.java b/src/main/java/view/EditorView.java
index 9661204f8dc16f6bb8b542ae9715187c654f1de5..90aa5adf70cbb70a47b80e66371656c5ebb0c716 100644
--- a/src/main/java/view/EditorView.java
+++ b/src/main/java/view/EditorView.java
@@ -53,8 +53,12 @@ public class EditorView extends JPanel {
         Action action = new AbstractAction() {
             @Override
             public void actionPerformed(ActionEvent actionEvent) {
-                String code = area.getText();
-               	m.setCode(code);
+		try{                
+		    String code = area.getText();
+               	    m.setCode(code);
+		} catch (IndexOutOfBoundsException e){
+		    area.setText(area.getText()+" \n !!! Syntax error !!! ");
+		}
             }
         };
         updateButton.addActionListener(action);
@@ -77,14 +81,12 @@ public class EditorView extends JPanel {
                         String txt = new String(res, StandardCharsets.UTF_8);
                         area.setText(txt);
                         m.setCode(txt);
-
                         parent.setTitle(f.toString());
                     } catch (IOException e) {
                         e.printStackTrace();
                     } catch (IndexOutOfBoundsException e){
-			System.out.println("Syntax error");
-			area.setText("Syntax error");
-		    }
+			area.setText(area.getText()+" \n !!! Syntax error !!! ");
+		   }
                 }
             }
         });
diff --git a/src/main/java/view/MessageView.java b/src/main/java/view/MessageView.java
index a5016c5b89b3d0f2b6e99b600796a66b5c54d1ae..d2a0ee52cafb1fb73239ca465ea72faf3a0ffedc 100644
--- a/src/main/java/view/MessageView.java
+++ b/src/main/java/view/MessageView.java
@@ -29,6 +29,10 @@ public class MessageView extends JScrollPane implements Observer {
     private JTextArea area;
     private Model m;
 
+    public void setArea(JTextArea area){
+	this.area= area;
+    }	
+
     public MessageView(Model m) {
         m.addObserver(this);
         this.m = m;