mock 3 working codes
fix threading issue

used semaphores and time.sleep