diff --git a/TestON/drivers/common/cli/zookeeperclidriver.py b/TestON/drivers/common/cli/zookeeperclidriver.py
index abfcb69..5d9396e 100644
--- a/TestON/drivers/common/cli/zookeeperclidriver.py
+++ b/TestON/drivers/common/cli/zookeeperclidriver.py
@@ -50,6 +50,8 @@
         for key in connectargs:
             vars(self)[key] = connectargs[key]       
         self.home = "~/ONOS"
+        self.zkhome = "~/zookeeper-3.4.6"
+        self.clustername = "sanity-rc-onos"
         #self.home = "~/zookeeper-3.4.5"
         for key in self.options:
             if key == "home":
@@ -129,6 +131,28 @@
             main.log.error(self.name + ": Connection failed to the host")
             response = main.FALSE
         return response 
+    
+    def findMaster(self, switchDPID, ip="localhost"):
+        import json
+        time.sleep(1)
+        command = "curl "+ip+":8080/wm/onos/registry/switches/json > master.txt"
+        response = self.execute(cmd=command,prompt="\$",timeout=10)
+        self.handle.sendline("cat master.txt")
+        response = self.execute(cmd=command,prompt="\$",timeout=10)
+        self.handle.expect(["cat master.txt",pexpect.EOF,pexpect.TIMEOUT])
+        self.handle.expect(["admin",pexpect.EOF,pexpect.TIMEOUT])
+        response = self.handle.before
+        decoded = json.loads(response)
+        for k in decoded.iteritems():
+            k2 = json.dumps(k)
+            if re.search(switchDPID,k2):
+                k3 = k2.split(',')
+                k4 = k3[1].split()
+                k5 = k4[1].split('"')
+                print k5[1]
+                return k5[1]
+            else:
+                return "NO SWITCH WITH THIS DPID!"
 
     def isup(self):
         '''
diff --git a/TestON/tests/JamesTest/JamesTest.py b/TestON/tests/JamesTest/JamesTest.py
index 72f4a44..e4fabda 100644
--- a/TestON/tests/JamesTest/JamesTest.py
+++ b/TestON/tests/JamesTest/JamesTest.py
@@ -769,6 +769,13 @@
             else:
                 break
            
+#*****************************************************************************************
+#*****************************************************************************************
+# CASE101:
+# This case is designed to test the intents framework
+# It will cover Installation, Deletion, Rerouting, and Calling of Intents
+#*****************************************************************************************
+#*****************************************************************************************
 
 
     def CASE101(self,main) :
@@ -896,6 +903,7 @@
             srcDPID= '00:00:00:00:00:00:20:' +str(i+25)
             main.ONOS1.add_intent(intent_id=str(count),src_dpid=srcDPID,dst_dpid=dstDPID,src_mac=srcMac,dst_mac=dstMac,intentIP=intentIP,intentPort=intentPort,intentURL=intentURL)
             count+=1
+        main.ONOS1.show_intent(intentIP=intentIP,intentPort=intentPort,intentURL=intentURL)
         result = main.TRUE
         response = main.Mininet1.check_flows(sw="s1")
         print(response)
@@ -964,7 +972,7 @@
                 main.log.error("Intent was not deleted correctly")
                 result = main.FALSE
             else:
-                main.log.info("So far so good, attempting "+str(4-count) + " more times")
+                main.log.info("So far so good, attempting "+str(2-count) + " more times")
         if result == main.TRUE:
             main.log.report("\tIntent Deleted!")
         else:
@@ -984,8 +992,14 @@
 
         main.step("Installing incorrect intent and checking for deletion")
         main.ONOS1.add_intent(intent_id=str(200),src_dpid="00:00:00:00:00:00:45:67",dst_dpid="00:00:00:00:00:32:21:10",src_mac="00:00:00:01:11:11",dst_mac="00:12:12:12:12:12",intentIP=intentIP,intentPort=intentPort,intentURL=intentURL)
-
-        
+        main.ONOS1.show_intent(intent_id=str(200),intentIP=intentIP,intentPort=intentPort,intentURL=intentURL)
+        main.ONOS1.del_intent(intent_id=str(200),intentIP=intentIP,intentPort=intentPort,intentURL=intentURL)
+        time.sleep(2)
+        response = main.ONOS1.show_intent(intentIP=intentIP,intentPort=intentPort,intentURL=intentURL,intent_id=200)
+        if re.search("INTENT_NOT_FOUND",response):
+            main.log.report("Intent Removed Properly!")
+        else:
+            main.log.report("ERROR REMOVING INTENT")
         
 
 
