diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index fc85c55..ba4e74f 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -280,13 +280,11 @@
                     self.stepCache += "\t"+str(testCaseNumber)+"."+str(step)+" "+self.stepName+" - "
                     if self.STEPRESULT == self.TRUE:
                         self.stepCache += "PASS\n"
-                        #self.stepCache += "PASS  <ac:emoticon ac:name=\"tick\" /></li>\n"
                     elif self.STEPRESULT == self.FALSE:
                         self.stepCache += "FAIL\n"
-                        #self.stepCache += "FAIL  <ac:emoticon ac:name=\"cross\" /></li>\n"
+                        # TODO: Print the on-fail statement here
                     else:
                         self.stepCache += "No Result\n"
-                        #self.stepCache += "No Result  <ac:emoticon ac:name=\"warning\" /></li>\n"
                     self.stepResults.append(self.STEPRESULT)
             except StandardError as e:
                 self.log.exception( "\nException in the following section of" +
diff --git a/TestON/core/utilities.py b/TestON/core/utilities.py
index dda43bf..8cb681d 100644
--- a/TestON/core/utilities.py
+++ b/TestON/core/utilities.py
@@ -84,27 +84,27 @@
                 return result
             return assertHandling
 
-    def _assert (self,**assertParam):  
+    def _assert (self,**assertParam):
         '''
         It will take the arguments :
-        expect:'Expected output' 
-        actual:'Actual output' 
+        expect:'Expected output'
+        actual:'Actual output'
         onpass:'Action or string to be triggered or displayed respectively when the assert passed'
         onfail:'Action or string to be triggered or displayed respectively when the assert failed'
         not:'optional argument to specify the negation of the each assertion type'
         operator:'assertion type will be defined by using operator. Like equal , greater, lesser, matches.'
-        
+
         It will return the assertion result.
-                
+
         '''
-              
+
         arguments = self.parse_args(["EXPECT","ACTUAL","ONPASS","ONFAIL","NOT","OPERATOR"],**assertParam)
-        
+
         result = 0
         valuetype = ''
         operation = "not "+ str(arguments["OPERATOR"]) if arguments['NOT'] and arguments['NOT'] == 1 else arguments["OPERATOR"]
         operators = {'equals':{'STR':'==','NUM':'=='}, 'matches' : '=~', 'greater':'>' ,'lesser':'<'}
-           
+
         expectMatch = re.match('^\s*[+-]?0(e0)?\s*$', str(arguments["EXPECT"]), re.I+re.M)
         if not ((not expectMatch) and (arguments["EXPECT"]==0)):
             valuetype = 'NUM'
@@ -112,31 +112,30 @@
             if arguments["OPERATOR"] == 'greater' or arguments["OPERATOR"] == 'lesser':
                 main.log.error("Numeric comparison on strings is not possibele")
                 return main.ERROR
-            
+
         valuetype = 'STR'
         arguments["ACTUAL"] = str(arguments["ACTUAL"])
         if arguments["OPERATOR"] != 'matches':
             arguments["EXPECT"] = str(arguments["EXPECT"])
- 
+
         try :
             opcode = operators[str(arguments["OPERATOR"])][valuetype] if arguments["OPERATOR"] == 'equals' else operators[str(arguments["OPERATOR"])]
-            
+
         except KeyError:
             print "Key Error in assertion"
             return main.FALSE
-        
+
         if opcode == '=~':
             try:
                 assert re.search(str(arguments["EXPECT"]),str(arguments["ACTUAL"]))
                 result = main.TRUE
             except AssertionError:
                 try :
-                    assert re.match(str(arguments["EXPECT"]),str(arguments["ACTUAL"])) 
+                    assert re.match(str(arguments["EXPECT"]),str(arguments["ACTUAL"]))
                     result = main.TRUE
                 except AssertionError:
                     main.log.error("Assertion Failed")
                     result = main.FALSE
-                    
         else :
             try:
                 if str(opcode)=="==":
@@ -145,27 +144,21 @@
                         result = main.TRUE
                     else :
                         result = main.FALSE
-                        
                 elif str(opcode) == ">":
                     main.log.info("Verifying the Expected is Greater than the actual or not using assert_greater")
                     if (ast.literal_eval(arguments["EXPECT"]) > ast.literal_eval(arguments["ACTUAL"])) :
                         result = main.TRUE
                     else :
                         result = main.FALSE
-                        
                 elif str(opcode) == "<":
                     main.log.info("Verifying the Expected is Lesser than the actual or not using assert_lesser")
                     if (ast.literal_eval(arguments["EXPECT"]) < ast.literal_eval(arguments["ACTUAL"])):
                         result = main.TRUE
                     else :
                         result = main.FALSE
-                    
-                    
             except AssertionError:
                 main.log.error("Assertion Failed")
                 result = main.FALSE
-                
-        
         result = result if result else 0
         result = not result if arguments["NOT"] and arguments["NOT"] == 1 else result
         resultString = ""
@@ -179,7 +172,7 @@
             else :
                 main.log.error(arguments["ONFAIL"])
                 main.log.report(arguments["ONFAIL"])
-             
+
         msg = arguments["ON" + str(resultString)]
 
         if not isinstance(msg,str):
@@ -190,8 +183,7 @@
 
         main.last_result = result
         return result
-    
-    
+
     def parse_args(self,args, **kwargs):
         '''
         It will accept the (key,value) pair and will return the (key,value) pairs with keys in uppercase.
