added time.sleep for some function and few comments