diff --git a/Makefile b/Makefile
index 709f89f..3c5b584 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+#
 # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
 # SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
 #
@@ -44,19 +45,19 @@
 run:
 	docker run -itu root:root --privileged --network host --name $(IMAGE) --rm $(IMAGE)
 
-run-native-test:
+run-native-test: $(VENV)
 	. ./bin/person_detection.sh -i ./resources/run.mp4
 
-run-native:
+run-native: $(VENV) 
 	. ./bin/person_detection.sh -i gstreamer
 
-run-native-cam:
+run-native-cam: $(VENV)
 	. ./bin/person_detection.sh -i cam
 
-run-native-test-no-show:
+run-native-test-no-show: $(VENV)
 	. ./bin/person_detection.sh -i ./resources/run.mp4 -ns
 
-run-native-no-show:
+run-native-no-show: $(VENV)
 	. ./bin/person_detection.sh -i gstreamer -ns
 
 test:
diff --git a/README.md b/README.md
index 376dcda..5bb476e 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Persion-detection Applicaiton
+# Person-detection Application
 
 person-detection is a demo application that runs in the Aether edge and showcases Aether's support for for low-latency, AI/ML driven IOT applications that make use of Aether's support for end-to-end slicing.
 
diff --git a/person_detection/person_detection.py b/person_detection/person_detection.py
index 037734c..702f9f8 100644
--- a/person_detection/person_detection.py
+++ b/person_detection/person_detection.py
@@ -5,13 +5,12 @@
 
 from __future__ import print_function
 
+import cv2
 import logging as log
 import os
 import sys
 import time
 from argparse import ArgumentParser, SUPPRESS
-
-import cv2
 from imutils import build_montages
 from openvino.inference_engine import IECore
 
@@ -25,9 +24,6 @@
     args.add_argument("-i", "--input",
                       help="Required. Path to video file or image. 'cam' for capturing video stream from camera",
                       required=True, type=str)
-    # args.add_argument("-i2", "--input2",
-    #                   help="Optional. Path to second video file or image. 'cam' for capturing video stream from camera",
-    #                   default=None, type=str)
     args.add_argument("-l", "--cpu_extension",
                       help="Optional. Required for CPU custom layers. Absolute path to a shared library with the "
                            "kernels implementations.", type=str, default=None)
@@ -49,11 +45,7 @@
     args = build_argparser().parse_args()
     model_xml = args.model
     model_bin = os.path.splitext(model_xml)[0] + ".bin"
-    # Plugin initialization for specified device and load extensions library if specified
-    log.info("Initializing plugin for {} device...".format(args.device))
-    # plugin = IEPlugin(device=args.device, plugin_dirs=args.plugin_dir)
-    # if args.cpu_extension and 'CPU' in args.device:
-    #   plugin.add_cpu_extension(args.cpu_extension)
+
     # Read IR
     log.info("Reading IR...")
     net = IECore().read_network(model=model_xml, weights=model_bin)
@@ -63,15 +55,10 @@
     input_blob = next(iter(net.inputs))
     out_blob = next(iter(net.outputs))
 
-    # input_blob2 = next(iter(net.inputs))
-    # out_blob2 = next(iter(net.outputs))
-
     log.info("Loading IR to the plugin...")
-    # exec_net = IECore().load_network(network=net, device_name=args.device, num_requests=2)
-    exec_net = IECore().load_network(network=net, device_name=args.device, num_requests=1)
+    exec_net = IECore().load_network(network=net, device_name=args.device, num_requests=2)
     # Read and pre-process input image
     n, c, h, w = net.inputs[input_blob].shape
-    # n2, c2, h2, w2 = net.inputs[input_blob2].shape
     del net
     if args.input == 'cam':
         input_stream = 0
@@ -88,30 +75,15 @@
     else:
         cap = cv2.VideoCapture(input_stream)
 
-    # if args.input2 == 'cam':
-    #     input_stream2 = 0
-    # elif args.input2 == 'gstreamer':
-    #     input_stream2 = 'udpsrc port=5001 caps = " application/x-rtp, encoding-name=JPEG,payload=26" ! rtpjpegdepay ! decodebin ! videoconvert ! appsink'
-    # else:
-    #     input_stream2 = args.input2
-    #     assert os.path.isfile(args.input2), "Specified input file doesn't exist"
     if args.labels:
         with open(args.labels, 'r') as f:
             labels_map = [x.strip() for x in f]
     else:
         labels_map = None
 
-    # if input_stream2 == 'gstreamer':
-    #     cap2 = cv2.VideoCapture(input_stream2, cv2.CAP_GSTREAMER)
-    # else:
-    #     cap2 = cv2.VideoCapture(input_stream2)
-
     cur_request_id = 0
     next_request_id = 1
 
-    # cur_request_id2 = 1
-    # next_request_id2 = 0
-
     log.info("Starting inference in async mode...")
     log.info("To switch between sync and async modes press Tab button")
     log.info("To stop the demo execution press Esc button")
@@ -119,71 +91,47 @@
     # Async doesn't work if True
     # Request issues = Runtime Error: [REQUEST BUSY]
     is_async_mode = False
+    #is_async_mode = True
     render_time = 0
     ret, frame = cap.read()
-    # ret2, frame2 = cap2.read()
-
-    # Montage width and height
-    # In this case means 2x1 boxes
-    mW = 2
-    mH = 1
 
     frameList = []
 
     print("To close the application, press 'CTRL+C' or any key with focus on the output window")
-    # while cap.isOpened() or cap2.isOpened():
-    while cap.isOpened():
+
+    while True:
         if is_async_mode:
             ret, next_frame = cap.read()
-            # ret2, next_frame2 = cap2.read()
         else:
             ret, frame = cap.read()
-            # ret2, frame2 = cap2.read()
-        #if not (ret and ret2):
         if not ret:
             break
         initial_w = cap.get(3)
         initial_h = cap.get(4)
-        # initial_w2 = cap2.get(3)
-        # initial_h2 = cap2.get(4)
+
         # Main sync point:
         # in the truly Async mode we start the NEXT infer request, while waiting for the CURRENT to complete
         # in the regular mode we start the CURRENT request and immediately wait for it's completion
         inf_start = time.time()
         if is_async_mode:
-            # if ret and ret2:
             if ret:
                 in_frame = cv2.resize(next_frame, (w, h))
                 in_frame = in_frame.transpose((2, 0, 1))  # Change data layout from HWC to CHW
                 in_frame = in_frame.reshape((n, c, h, w))
                 exec_net.start_async(request_id=next_request_id, inputs={input_blob: in_frame})
-
-                # in_frame2 = cv2.resize(next_frame2, (w2, h2))
-                # in_frame2 = in_frame2.transpose((2, 0, 1))  # Change data layout from HWC to CHW
-                # in_frame2 = in_frame2.reshape((n2, c2, h2, w2))
-                # exec_net.start_async(request_id=next_request_id2, inputs={input_blob2: in_frame2})
-
         else:
-            # if (ret and ret2):
             if ret:
                 in_frame = cv2.resize(frame, (w, h))
                 in_frame = in_frame.transpose((2, 0, 1))  # Change data layout from HWC to CHW
                 in_frame = in_frame.reshape((n, c, h, w))
                 exec_net.start_async(request_id=cur_request_id, inputs={input_blob: in_frame})
 
-                # in_frame2 = cv2.resize(frame2, (w2, h2))
-                # in_frame2 = in_frame2.transpose((2, 0, 1))  # Change data layout from HWC to CHW
-                # in_frame2 = in_frame2.reshape((n2, c2, h2, w2))
-                # exec_net.start_async(request_id=cur_request_id2, inputs={input_blob2: in_frame2})
-
-        # if exec_net.requests[cur_request_id].wait(-1) == 0 and exec_net.requests[cur_request_id2].wait(-1) == 0:
         if exec_net.requests[cur_request_id].wait(-1) == 0:
             inf_end = time.time()
             det_time = inf_end - inf_start
 
             # Parse detection results of the current request
             res = exec_net.requests[cur_request_id].outputs[out_blob]
-            # res2 = exec_net.requests[cur_request_id2].outputs[out_blob2]
 
             for obj in res[0][0]:
                 # Draw only objects when probability more than specified threshold
@@ -202,23 +150,6 @@
                     print('Object detected, class_id:', class_id, 'probability:', obj[2], 'xmin:', xmin, 'ymin:', ymin,
                           'xmax:', xmax, 'ymax:', ymax)
 
-            # for obj in res2[0][0]:
-            #     # Draw only objects when probability more than specified threshold
-            #     if obj[2] > args.prob_threshold:
-            #         xmin = int(obj[3] * initial_w2)
-            #         ymin = int(obj[4] * initial_h2)
-            #         xmax = int(obj[5] * initial_w2)
-            #         ymax = int(obj[6] * initial_h2)
-            #         class_id = int(obj[1])
-            #         # Draw box and label\class_id
-            #         color = (min(class_id * 12.5, 255), min(class_id * 7, 255), min(class_id * 5, 255))
-            #         cv2.rectangle(frame2, (xmin, ymin), (xmax, ymax), color, 2)
-            #         det_label = labels_map[class_id] if labels_map else str(class_id)
-            #         cv2.putText(frame2, det_label + ' ' + str(round(obj[2] * 100, 1)) + ' %', (xmin, ymin - 7),
-            #                     cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1)
-            #         print('Object detected, class_id:', class_id, 'probability:', obj[2], 'xmin:', xmin, 'ymin:', ymin,
-            #               'xmax:', xmax, 'ymax:', ymax)
-
             # Draw performance stats
             inf_time_message = "Inference time: Not applicable for async mode" if is_async_mode else \
                 "Inference time: {:.3f} ms".format(det_time * 1000)
@@ -233,21 +164,10 @@
             cv2.putText(frame, async_mode_message, (10, int(initial_h - 20)), cv2.FONT_HERSHEY_COMPLEX, 0.5,
                         (10, 10, 200), 1)
 
-            # cv2.putText(frame2, inf_time_message, (15, 15), cv2.FONT_HERSHEY_COMPLEX, 0.5, (200, 10, 10), 1)
-            # cv2.putText(frame2, render_time_message, (15, 30), cv2.FONT_HERSHEY_COMPLEX, 0.5, (10, 10, 200), 1)
-            # cv2.putText(frame2, async_mode_message, (10, int(initial_h - 20)), cv2.FONT_HERSHEY_COMPLEX, 0.5,
-            #             (10, 10, 200), 1)
-
         render_start = time.time()
 
         if not args.ns:
-            # if ret and ret2:
             if ret:
-            #     frameList.append(frame)
-            #     # frameList.append(frame2)
-            # montages = build_montages(frameList, (640, 480), (mW, mH))
-            # for montage in montages:
-            #     cv2.imshow("Detection results", montage)
                 cv2.imshow("Detection results", frame)
             render_end = time.time()
             render_time = render_end - render_start
@@ -256,7 +176,6 @@
             cur_request_id, next_request_id = next_request_id, cur_request_id
 
             frame = next_frame
-            # frame2 = next_frame2
         key = cv2.waitKey(1)
         if key == 27:
             break
@@ -265,7 +184,6 @@
             log.info("Switched to {} mode".format("async" if is_async_mode else "sync"))
 
     cap.release()
-    # cap2.release()
     cv2.destroyAllWindows()
 
 
