added semaphore implementation