Added a semaphore code