diff --git a/README.md b/README.md
index f6cf57b..4e76140 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,2 @@
 # NDN-HOME
-Bootstrap procedure for NDN home.
+Smart home via NDN.
diff --git a/access_control_manager.py b/access_control_manager.py
new file mode 100644
index 0000000..53ed12d
--- /dev/null
+++ b/access_control_manager.py
@@ -0,0 +1,26 @@
+# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2014 Regents of the University of California.
+# Author: Teng Liang <philoliang2011@gmail.com>
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# A copy of the GNU General Public License is in the file COPYING.
+
+"""
+This module uses access token method to sign, verfy, encrypt and decrypt data/interest. Besides, it generates and updates seed/command access token/access token. 
+
+"""
+
+class AccessControlManager(object):
+    pass
diff --git a/base_node.py b/base_node.py
index 2393eea..b93bc5d 100644
--- a/base_node.py
+++ b/base_node.py
@@ -17,33 +17,32 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # A copy of the GNU General Public License is in the file COPYING.
 
+"""
+This module defines BaseNode class, which contains methods/attributes common to both end device and controller.
+"""
+
 import logging
 import time
 import sys
-
 import random
 
-from pyndn import Name, Face, Interest, Data, ThreadsafeFace
-from pyndn.security.policy import ConfigPolicyManager
+from pyndn import Name, Face, Interest, Data
+from pyndn.threadsafe_face import ThreadsafeFace
 from pyndn.security import KeyChain
 from pyndn.security.identity import IdentityManager, BasicIdentityStorage
+from pyndn.security.policy import NoVerifyPolicyManager, ConfigPolicyManager
 from pyndn.security.security_exception import SecurityException
-    
 
-from collections import namedtuple
+from access_control_manager import AccessControlManager    
 
 try:
     import asyncio
 except ImportError:
     import trollius as asyncio
 
-#Command = namedtuple('Command', ['suffix', 'function', 'keywords', 'isSigned'])
 
 class BaseNode(object):
-    """
-    This class contains methods/attributes common to both end device and controller.
-    
-    """
+
     def __init__(self,configFileName):
         """
         Initialize the network and security classes for the node
@@ -53,9 +52,12 @@
 	
         self._identityStorage = BasicIdentityStorage()
         self._identityManager = IdentityManager(self._identityStorage)
-        self._policyManager = ConfigPolicyManager(configFileName)
 
-        # hopefully there is some private/public key pair available
+        if configFileName:
+            self._policyManager = ConfigPolicyManager(configFileName)
+        else:
+            self._policyManager = NoVerifyPolicyManager()
+
         self._keyChain = KeyChain(self._identityManager,self._policyManager)
 
         self._registrationFailures = 0
@@ -64,10 +66,11 @@
         self._setupComplete = False
         self._instanceSerial = None
 
-        # waiting devices register this prefix and respond to discovery
-        # or configuration interest
         self._bootstrapPrefix = '/home/controller/bootstrap'
-
+        self._serviceProfileList = []
+        self._commmandList = []
+        self._protocolList = []
+ 
     def getSerial(self):
         """
          Since you may wish to run two nodes on a Raspberry Pi, each
@@ -82,9 +85,99 @@
             self._instanceSerial = prefix.encode('hex')
         return self._instanceSerial
 
-##
-# Logging
-##
+    def addServiceProfiles(self,profiles):
+        pass
+
+    def addServices(self,services):
+        pass
+
+    def addProtocols(self,protocols):
+        pass
+
+
+    def beforeLoopStart(self):
+        """
+        Called before the event loop starts.
+        """
+        pass
+    
+
+    def start(self):
+        """
+        Begins the event loop. After this, the node's Face is set up and it can
+        send/receive interests+data
+        """
+        self.log.info("Starting up")
+        self.loop = asyncio.get_event_loop()
+        self.face = ThreadsafeFace(self.loop, 'localhost')
+       
+        self._keyChain.setFace(self.face)
+        self.beforeLoopStart()
+
+        self.face.setCommandSigningInfo(self._keyChain, self._keyChain.getDefaultCertificateName())
+
+        try:
+            self.loop.run_forever()
+        except Exception as e:
+            self.log.exception(e, exc_info=True)
+
+    def createACK(self):
+        pass
+  
+    def createNACK(self):
+        pass
+
+    def signData(self, data):
+        """
+        Sign the data with our network certificate
+        :param pyndn.Data data: The data to sign
+        """
+	pass
+
+    def sendData(self, data, transport, sign=True):
+        """
+        Reply to an interest with a data packet, optionally signing it.
+        :param pyndn.Data data: The response data packet
+        :param pyndn.Transport transport: The transport to send the data through. This is 
+            obtained from an incoming interest handler
+        :param boolean sign: (optional, default=True) Whether the response must be signed. 
+        """
+        if sign:
+            self.signData(data)
+        transport.send(data.wireEncode().buf())
+
+    """
+    Failure
+
+    """
+
+    def onRegisterFailed(self, prefix):
+        """
+        Called when the node cannot register its name with the forwarder
+        :param pyndn.Name prefix: The network name that failed registration
+        """
+        if self._registrationFailures < 5:
+            self._registrationFailures += 1
+            self.log.warn("Could not register {}, retry: {}/{}".format(prefix.toUri(), self._registrationFailures, 5)) 
+            self.face.registerPrefix(self.prefix, self._onCommandReceived, self.onRegisterFailed)
+        else:
+            self.log.critical("Could not register device prefix, ABORTING")
+            self._isStopped = True
+
+    def verificationFailed(self, dataOrInterest):
+        """
+        Called when verification of a data packet or command interest fails.
+        :param pyndn.Data or pyndn.Interest: The packet that could not be verified
+        """
+        self.log.info("Received invalid" + dataOrInterest.getName().toUri())
+
+
+
+
+    """
+    Logging
+    """
+    
     def _prepareLogging(self):
         self.log = logging.getLogger(str(self.__class__))
         self.log.setLevel(logging.DEBUG)
@@ -110,117 +203,7 @@
         """
         return self.log
 
-###
-# Startup and shutdown
-###
-    def beforeLoopStart(self):
-        """
-        Called before the event loop starts.
-        """
-        pass
-    
-    def getKeyChain(self):
-        return self._keyChain
 
-    def getDefaultIdentity(self):
-        try:
-            defaultIdentity = self._identityManager.getDefaultIdentity()
-        except SecurityException:
-            defaultIdentity = ""
-
-        return defaultIdentity
-
-
-    def getDefaultCertificateName(self):
-        #exception - no certficate, return ''
-
-        try:
-            certName = self._identityStorage.getDefaultCertificateNameForIdentity( 
-            self._identityManager.getDefaultIdentity())
-        except SecurityException:
-            certName = ""
-
-        return certName
-
-    def start(self):
-        """
-        Begins the event loop. After this, the node's Face is set up and it can
-        send/receive interests+data
-        """
-        self.log.info("Starting up")
-        self.loop = asyncio.get_event_loop()
-        self.face = ThreadsafeFace(self.loop, '')
-       
-        self._keyChain.setFace(self.face)
-
-        self._isStopped = False
-        self.face.stopWhen(lambda:self._isStopped)
-        
-        self.beforeLoopStart()
-
-        self.face.setCommandSigningInfo(self._keyChain, self.getDefaultCertificateName())
-
-        try:
-            self.loop.run_forever()
-        except KeyboardInterrupt:
-            pass
-        except Exception as e:
-            self.log.exception(e, exc_info=True)
-        finally:
-            self._isStopped = True
-
-    def stop(self):
-        """
-        Stops the node, taking it off the network
-        """
-        self.log.info("Shutting down")
-        self._isStopped = True 
-        
-###
-# Data handling
-###
-    def signData(self, data):
-        """
-        Sign the data with our network certificate
-        :param pyndn.Data data: The data to sign
-        """
-        self._keyChain.sign(data, self.getDefaultCertificateName())
-
-    def sendData(self, data, transport, sign=True):
-        """
-        Reply to an interest with a data packet, optionally signing it.
-        :param pyndn.Data data: The response data packet
-        :param pyndn.Transport transport: The transport to send the data through. This is 
-            obtained from an incoming interest handler
-        :param boolean sign: (optional, default=True) Whether the response must be signed. 
-        """
-        if sign:
-            self.signData(data)
-        transport.send(data.wireEncode().buf())
-
-###
-# 
-# 
-##
-    def onRegisterFailed(self, prefix):
-        """
-        Called when the node cannot register its name with the forwarder
-        :param pyndn.Name prefix: The network name that failed registration
-        """
-        if self._registrationFailures < 5:
-            self._registrationFailures += 1
-            self.log.warn("Could not register {}, retry: {}/{}".format(prefix.toUri(), self._registrationFailures, 5)) 
-            self.face.registerPrefix(self.prefix, self._onCommandReceived, self.onRegisterFailed)
-        else:
-            self.log.critical("Could not register device prefix, ABORTING")
-            self._isStopped = True
-
-    def verificationFailed(self, dataOrInterest):
-        """
-        Called when verification of a data packet or command interest fails.
-        :param pyndn.Data or pyndn.Interest: The packet that could not be verified
-        """
-        self.log.info("Received invalid" + dataOrInterest.getName().toUri())
 
     @staticmethod
     def getDeviceSerial():
@@ -233,6 +216,4 @@
         with open('/proc/cpuinfo') as f:
             for line in f:
                 if line.startswith('Serial'):
-                    return line.split(':')[1].strip()
-
-
+                    return line.split(':')[1].strip()
\ No newline at end of file
diff --git a/controller.py b/controller.py
index 7043466..17e2afb 100644
--- a/controller.py
+++ b/controller.py
@@ -37,7 +37,7 @@
     print(result)
 
 class Controller(BaseNode):
-    def __init__(self,configFileName):
+    def __init__(self,configFileName=None):
         super(Controller, self).__init__(configFileName=configFileName)
         self._responseCount = 0
         self._symmetricKey = "symmetricKeyForBootstrapping"
@@ -166,7 +166,7 @@
             self._keyChain.createIdentityAndCertificate(identityName)
        	    self._identityManager.setDefaultIdentity(identityName)
 
-	self.face.setCommandSigningInfo(self._keyChain, self.getDefaultCertificateName())
+	self.face.setCommandSigningInfo(self._keyChain, self._keyChain.getDefaultCertificateName())
         self.face.registerPrefix(self._prefix, self.onInterest, self.onRegisterFailed)
         
         
diff --git a/device.py b/device.py
new file mode 100644
index 0000000..4fa3540
--- /dev/null
+++ b/device.py
@@ -0,0 +1,177 @@
+# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2014 Regents of the University of California.
+# Author: Teng Liang <philoliang2011@gmail.com>
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# A copy of the GNU General Public License is in the file COPYING.
+
+"""
+This module defines Device class, which contains core modules of end device, including device discovery protocol, syncronization protocol, and access control manager.
+"""
+
+
+import time
+import json
+from pyndn import Name, Face, Interest, Data
+from pyndn.threadsafe_face import ThreadsafeFace
+from pyndn import KeyLocator, KeyLocatorType
+from base_node import BaseNode
+from hmac_helper import HmacHelper 
+from pyndn.security.security_exception import SecurityException
+from pyndn.util import Blob
+try:
+    import asyncio
+except ImportError:
+    import trollius as asyncio
+
+def dump(*list):
+    result = ""
+    for element in list:
+        result += (element if type(element) is str else repr(element)) + " "
+    print(result)
+
+class Device(BaseNode):
+    def __init__(self,configFileName=None):
+        super(Device, self).__init__(configFileName)
+        
+        self._deviceSerial = self.getSerial()
+        self._callbackCount = 0
+        self._symKey = "symmetricKeyForBootstrapping"
+        self._category = "sensors"
+        self._id = "T9273659"
+        self._hmacHelper = HmacHelper(self._symKey)
+
+
+    def expressBootstrapInterest(self):
+        
+        #generate bootstrap name /home/controller/bootstrap/<device-parameters>
+        bootstrapName = Name(self._bootstrapPrefix)
+
+        deviceParameters = {}
+        deviceParameters["category"] = self._category
+        deviceParameters["id"] = self._id
+        bootstrapName.append(json.dumps(deviceParameters))
+
+        bootstrapInterest = Interest(bootstrapName)
+        bootstrapInterest.setInterestLifetimeMilliseconds(3000)
+        self._hmacHelper.signInterest(bootstrapInterest)
+
+        dump("Express bootstrap interest : ",bootstrapInterest.toUri())
+        self.face.expressInterest(bootstrapInterest, self.onBootstrapData, self.onTimeout)
+    
+    def onBootstrapData(self, interest, data):
+        dump("Bootstrap data received.")
+
+        if (self._hmacHelper.verifyData(data)):
+            self.log.info("Bootstrap data is verified")
+            content = json.loads(data.getContent().toRawStr(), encoding="latin-1")
+            deviceNewIdentity = Name(content["deviceNewIdentity"])
+            controllerIdentity = Name(content["controllerIdentity"])
+            controllerPublicKeyInfo = content["controllerPublicKey"]
+
+            self.face.registerPrefix(content["deviceNewIdentity"],self.onInterest,self.onRegisterFailed)
+            #set new identity as default and generate default key-pair with KSK Certificate
+            self._identityStorage.addIdentity(deviceNewIdentity)
+            self._identityManager.setDefaultIdentity(deviceNewIdentity)
+            try:
+                self._identityManager.getDefaultKeyNameForIdentity(deviceNewIdentity)
+            except SecurityException:
+                #generate new key-pair and certificate for new identity
+                dump("Install new identity as default\nGenerate new key-pair and self signed certificate")
+                newKey = self._identityManager.generateRSAKeyPairAsDefault(Name(deviceNewIdentity), isKsk=True)
+                newCert = self._identityManager.selfSign(newKey)
+                self._identityManager.addCertificateAsIdentityDefault(newCert)
+            
+            #add controller's identity and public key
+            keyType = controllerPublicKeyInfo["keyType"]
+            keyName = Name(controllerPublicKeyInfo["keyName"])
+            keyDer = Blob().fromRawStr(controllerPublicKeyInfo["publicKeyDer"])
+            dump("Controller's KeyType: ",keyType)
+            dump("Controller's keyName: ",keyName)
+            dump("Controller public key der : ",keyDer)
+
+            self._identityStorage.addIdentity(controllerIdentity)
+            try:
+                self._identityStorage.addKey(keyName, keyType, keyDer)
+                dump("Controller's identity, key and certificate installled.")
+            except SecurityException:
+                dump("Controller's identity, key, certificate already exists.")
+
+            #express an certificate request interest
+            defaultKeyName = self._identityManager.getDefaultKeyNameForIdentity(self._keyChain.getDefaultIdentity() )
+            self.requestCertificate(defaultKeyName)
+        else:
+            self.log.info("Bootstrap data is not verified")
+        
+        
+
+
+    def beforeLoopStart(self):
+        #self.face.registerPrefix('/home', self.onInterest, self.onRegisterFailed)
+        self.expressBootstrapInterest()
+        
+    def onTimeout(self, interest):
+        self._callbackCount += 1
+        dump("Time out for interest", interest.getName().toUri())
+
+    def onInterest():
+        pass
+    def onRegisterFailed():
+	pass
+
+#    def requestCertificate(self, keyIdentity):
+        """
+        We compose a command interest with our public key info so the controller
+        can sign us a certificate that can be used with other nodes in the network.
+        Name format : /home/<device-category>/KEY/<device-id>/<key-id>/<publickey>/ID-CERT/<version-number>
+        """
+"""        certificateRequestName = self._keyChain.getDefaultIdentity()
+        deviceIdComponent = certificateRequestName.get(-1)
+        keyIdComponent = keyIdentity.get(-1)
+
+        certificateRequestName = certificateRequestName
+        certificateRequestName.append("KEY")
+        #certificateRequestName.append(deviceIdComponent)
+        certificateRequestName.append(keyIdComponent)
+
+        key = self._identityManager.getPublicKey(keyIdentity)
+        keyInfo = {}
+        keyInfo["keyType"] = key.getKeyType()
+        keyInfo["keyDer"] = key.getKeyDer().toRawStr()
+
+        certificateRequestName.append(json.dumps(keyInfo, encoding="latin-1"))
+
+        certificateRequestName.append("ID-CERT")
+
+        certificateRequest = Interest(certificateRequestName)
+        certificateRequest.setInterestLifetimeMilliseconds(5000)
+        self._hmacHelper.signInterest(certificateRequest)
+        
+        dump("Sending certificate request : ",certificateRequestName)
+
+        self.face.expressInterest(certificateRequest, self.onCertificateData, self.onTimeout)
+        #TODO use symmetric key to sign
+        
+    def onCertificateData(self, interest, data):
+        dump("OnCertificateData : ",data)
+"""        
+
+if __name__ == '__main__':
+
+    device = Device()
+    device.start()
+    
+    
+
diff --git a/device_profile.py b/device_profile.py
new file mode 100644
index 0000000..e63f01a
--- /dev/null
+++ b/device_profile.py
@@ -0,0 +1,26 @@
+# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2014 Regents of the University of California.
+# Author: Teng Liang <philoliang2011@gmail.com>
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# A copy of the GNU General Public License is in the file COPYING.
+
+"""
+This module defines the DeviceProfile class with holds descriptors of device
+"""
+
+class DeviceProfile(object):
+    pass    
+	
diff --git a/examples/DHT22.py b/examples/DHT22.py
new file mode 100644
index 0000000..49da4cd
--- /dev/null
+++ b/examples/DHT22.py
@@ -0,0 +1,22 @@
+# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2014 Regents of the University of California.
+# Author: Teng Liang <philoliang2011@gmail.com>
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# A copy of the GNU General Public License is in the file COPYING.
+
+"""
+This module gives an example of DHT22 instance
+"""
diff --git a/examples/LED.py b/examples/LED.py
new file mode 100644
index 0000000..9b7118c
--- /dev/null
+++ b/examples/LED.py
@@ -0,0 +1,22 @@
+# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2014 Regents of the University of California.
+# Author: Teng Liang <philoliang2011@gmail.com>
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# A copy of the GNU General Public License is in the file COPYING.
+
+"""
+This module gives an example of LED instance
+"""
diff --git a/test_get_async_threadsafe.py b/test_get_async_threadsafe.py
deleted file mode 100644
index fd1602e..0000000
--- a/test_get_async_threadsafe.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-#
-# Copyright (C) 2014-2015 Regents of the University of California.
-# Author: Jeff Thompson <jefft0@remap.ucla.edu>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-# A copy of the GNU Lesser General Public License is in the file COPYING.
-
-try:
-    # Use builtin asyncio on Python 3.4+, or Tulip on Python 3.3
-    import asyncio
-except ImportError:
-    # Use Trollius on Python <= 3.2
-    import trollius as asyncio
-from pyndn import Name
-from pyndn import ThreadsafeFace
-
-def dump(*list):
-    result = ""
-    for element in list:
-        result += (element if type(element) is str else repr(element)) + " "
-    print(result)
-
-class Counter(object):
-    def __init__(self):
-        self._callbackCount = 0
-
-    def onData(self, interest, data):
-        self._callbackCount += 1
-        dump("Got data packet with name", data.getName().toUri())
-        # Use join to convert each byte to chr.
-        dump(data.getContent().toRawStr())
-
-    def onTimeout(self, interest):
-        self._callbackCount += 1
-        dump("Time out for interest", interest.getName().toUri())
-    
-    def onInterest(self,prefix,interest,face,interestFilterId,filter):
-        self._callbackCount+=1
-	dump("Receive interest", interest.toUri())
-
-    def onRegisterFailed(self,prefix):
-        dump("Register failed for prefix")
-
-def main():
-    loop = asyncio.get_event_loop()
-    face = ThreadsafeFace(loop, "aleph.ndn.ucla.edu")
-
-    counter = Counter()
-    face.stopWhen(lambda: counter._callbackCount >= 10)
-	
-    face.registerPrefix("/home",counter.onInterest,counter.onRegisterFailed)
-    #name1 = Name("/")
-    #dump("Express name ", name1.toUri())
-    # This call to exressIinterest is thread safe because face is a ThreadsafeFace.
-    #face.expressInterest(name1, counter.onData, counter.onTimeout)
-
-    # Run until stopWhen stops the loop.
-    loop.run_forever()
-    face.shutdown()
-
-main()
diff --git a/tests/test_timer.py b/tests/test_timer.py
new file mode 100644
index 0000000..becb79e
--- /dev/null
+++ b/tests/test_timer.py
@@ -0,0 +1,12 @@
+import threading
+import time
+
+def f():
+    print("HHHHH")
+    # call f() again in 60 seconds
+    threading.Timer(3, f).start()
+
+# start calling f now and every 60 sec thereafter
+
+if __name__ == '__main__':
+    f()
\ No newline at end of file
